From 3b8b312fae669c60e78617ab8dd2f6f5b4bf7ef7 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 23 Sep 2018 17:58:17 +0200 Subject: [PATCH] - clamp the software light to never get brighter than the initial light level --- 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 c4caa785e8..5848058f3c 100644 --- a/wadsrc/static/shaders/glsl/main.fp +++ b/wadsrc/static/shaders/glsl/main.fp @@ -147,7 +147,7 @@ float R_DoomLightingEquation(float light) lightscale = shade - vis; // Result is the normalized colormap index (0 bright .. 1 dark) - return clamp(lightscale, 0.0, 31.0 / 32.0); + return clamp(lightscale, 1.0 - light, 31.0 / 32.0); } //===========================================================================