From f7711a8119fa5020276f87a9344597b61c564708 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Thu, 27 Oct 2016 02:12:32 -0700 Subject: [PATCH] OpenGL2: Add more ambient to lightmapped materials. --- code/renderergl2/glsl/lightall_fp.glsl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/renderergl2/glsl/lightall_fp.glsl b/code/renderergl2/glsl/lightall_fp.glsl index 531267cb..5cb8233d 100644 --- a/code/renderergl2/glsl/lightall_fp.glsl +++ b/code/renderergl2/glsl/lightall_fp.glsl @@ -274,6 +274,9 @@ void main() ambientColor = lightColor; float surfNL = clamp(dot(var_Normal.xyz, L), 0.0, 1.0); + // reserve 25% ambient to avoid black areas on normalmaps + lightColor *= 0.75; + // Scale the incoming light to compensate for the baked-in light angle // attenuation. lightColor /= max(surfNL, 0.25);