From 3a76840f87ea7e18b0df45f86eb5d391a1e46d63 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 23 Dec 2018 15:13:38 +0100 Subject: [PATCH] - remove shadow acne when dynlights perfectly align with planes --- wadsrc/static/shaders/glsl/main.fp | 1 + 1 file changed, 1 insertion(+) diff --git a/wadsrc/static/shaders/glsl/main.fp b/wadsrc/static/shaders/glsl/main.fp index b73fcde63..8d623237d 100644 --- a/wadsrc/static/shaders/glsl/main.fp +++ b/wadsrc/static/shaders/glsl/main.fp @@ -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