gzdoom/wadsrc/static/shaders/scene/frag_fogboundary.glsl

22 lines
407 B
Text
Raw Normal View History

2023-03-19 06:18:12 +00:00
void main()
{
//
// calculate fog factor
//
#if defined(FOG_RADIAL)
float fogdist = max(16.0, distance(pixelpos.xyz, uCameraPos.xyz));
#else
float fogdist = max(16.0, pixelpos.w);
#endif
float fogfactor = exp2 (uFogDensity * fogdist);
2023-03-19 06:18:12 +00:00
FragColor = vec4(uFogColor.rgb, 1.0 - fogfactor);
#ifdef GBUFFER_PASS
FragFog = vec4(0.0, 0.0, 0.0, 1.0);
FragNormal = vec4(0.5, 0.5, 0.5, 1.0);
#endif
}