mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-24 04:41:53 +00:00
4d005bdfa0
All those special shaders have been merged together. Mostly working but the non-shader lighting seems a bit broken.
29 lines
537 B
GLSL
29 lines
537 B
GLSL
in vec4 pixelpos;
|
|
in vec2 glowdist;
|
|
|
|
//===========================================================================
|
|
//
|
|
// Main shader routine
|
|
//
|
|
//===========================================================================
|
|
|
|
void main()
|
|
{
|
|
float fogdist;
|
|
float fogfactor;
|
|
|
|
//
|
|
// calculate fog factor
|
|
//
|
|
if (uFogEnabled == -1)
|
|
{
|
|
fogdist = pixelpos.w;
|
|
}
|
|
else
|
|
{
|
|
fogdist = max(16.0, distance(pixelpos.xyz, uCameraPos.xyz));
|
|
}
|
|
fogfactor = exp2 (uFogDensity * fogdist);
|
|
gl_FragColor = vec4(uFogColor.rgb, 1.0 - fogfactor);
|
|
}
|
|
|