diff --git a/wadsrc/static/shaders/glsl/main.fp b/wadsrc/static/shaders/glsl/main.fp index d778aa240..0c27e8cf0 100644 --- a/wadsrc/static/shaders/glsl/main.fp +++ b/wadsrc/static/shaders/glsl/main.fp @@ -114,13 +114,13 @@ float R_DoomLightingEquation(float light) // z is the depth in view/eye space, positive going into the screen float z; - if ((uPalLightLevels >> 8) == 1) + if ((uPalLightLevels >> 8) == 2) { - z = pixelpos.w; + z = distance(pixelpos.xyz, uCameraPos.xyz); } else { - z = distance(pixelpos.xyz, uCameraPos.xyz); + z = pixelpos.w; } // The zdoom light equation