mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-12-15 14:41:20 +00:00
eb9d2d9917
- reactivate alpha testing per fixed function pipeline - use the 'modern' way to define clip planes (GL_CLIP_DISTANCE). This is far more portable than the old glClipPlane method and a lot more robust than checking this in the fragment shader.
30 lines
554 B
GLSL
30 lines
554 B
GLSL
in vec4 pixelpos;
|
|
in vec2 glowdist;
|
|
out vec4 FragColor;
|
|
|
|
//===========================================================================
|
|
//
|
|
// 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);
|
|
FragColor = vec4(uFogColor.rgb, 1.0 - fogfactor);
|
|
}
|
|
|