From cd5aa65fdab569bbc32a05ba9999e48929ec70aa Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 9 Aug 2021 18:50:50 +0200 Subject: [PATCH] - eliminate an unexpected slow path in the fragment shader. Apparently with checking uLightLevel the shader cannot discard the slow software lighting path entirely adding a significant amount of processing time. Changed to check the actual lightmode value, which re-enables the fast path again. --- wadsrc/static/shaders/glsl/main.fp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/shaders/glsl/main.fp b/wadsrc/static/shaders/glsl/main.fp index 009427dd2e..ba6e9190ae 100644 --- a/wadsrc/static/shaders/glsl/main.fp +++ b/wadsrc/static/shaders/glsl/main.fp @@ -595,7 +595,7 @@ vec4 getLightColor(Material material, float fogdist, float fogfactor) { vec4 color = vColor; - if (uLightLevel >= 0.0) + if ((uPalLightLevels >> 16) >= 5) // gl_lightmode >= 5 are software lighting modes. { float newlightlevel = 1.0 - R_DoomLightingEquation(uLightLevel); color.rgb *= newlightlevel;