- 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.
This commit is contained in:
Christoph Oelckers 2021-08-09 18:50:50 +02:00
parent 747c291ae1
commit cd5aa65fda
1 changed files with 1 additions and 1 deletions

View File

@ -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;