- remove shadow acne when dynlights perfectly align with planes

This commit is contained in:
Magnus Norddahl 2018-12-23 15:13:38 +01:00 committed by drfrag
parent 14f7efece7
commit 3a76840f87

View file

@ -313,6 +313,7 @@ float shadowmapAttenuation(vec4 lightpos, float shadowIndex)
return 1.0; // No shadowmap available for this light
vec3 planePoint = pixelpos.xyz - lightpos.xyz;
planePoint += 0.01; // nudge light position slightly as Doom maps tend to have their lights perfectly aligned with planes
if (dot(planePoint.xz, planePoint.xz) < 1.0)
return 1.0; // Light is too close