Fix gles2 fogboundary.fp

This commit is contained in:
Emile Belanger 2021-03-08 18:57:57 +00:00
parent 0ca27c18d8
commit f1f446d985

View file

@ -14,14 +14,15 @@ void main()
//
// calculate fog factor
//
if (uFogEnabled == -1)
#if (DEF_FOG_ENABLED == 1) && (DEF_FOG_RADIAL == 0) && (DEF_FOG_COLOURED == 1) // This was uFogEnabled = -1,, TODO check this
{
fogdist = pixelpos.w;
}
else
#else
{
fogdist = max(16.0, distance(pixelpos.xyz, uCameraPos.xyz));
}
#endif
fogfactor = exp2 (uFogDensity * fogdist);
gl_FragColor = vec4(uFogColor.rgb, 1.0 - fogfactor);