Prevent gl_FrontColor overflow in model lighting shader manually

Some drivers don't clamp it for some reason.

Fixes overbright model lighting and broken colors when combined with palette rendering on affected drivers.
This commit is contained in:
Hannu Hanhi 2021-09-25 18:10:14 +03:00
parent 386c4a95f3
commit 89af6b10ad

View file

@ -40,7 +40,7 @@
"{\n" \
"#ifdef SRB2_MODEL_LIGHTING\n" \
"float nDotVP = dot(gl_Normal, vec3(0, 1, 0));\n" \
"float light = 0.75 + max(nDotVP, 0.0);\n" \
"float light = min(0.75 + max(nDotVP, 0.0), 1.0);\n" \
"gl_FrontColor = vec4(light, light, light, 1.0);\n" \
"#else\n" \
"gl_FrontColor = gl_Color;\n" \