Clamp the ambient light to a max of 0.75. LA Machine guns seems to use an ambient value of 1, which is full bright for everything. But for some reason the hardware seems to treat this as ~ 0.75. This fixes various missing shading in the game. This doesn't seem to have any negative effects on other games I have tested. Clamping in the shader as we might need the full range of values for fixed shading.

This commit is contained in:
Ian Curtis 2017-06-29 19:05:30 +00:00
parent 9e9a549283
commit 3efb055344

View file

@ -124,7 +124,7 @@ static const char *fragmentShaderR3D =
"sunFactor = max(dot(sunVector, fsViewNormal), 0.0);\n"
// Total light intensity: sum of all components
"lightIntensity = vec3(sunFactor*lighting[1].x + lighting[1].y);\n" // ambient + diffuse
"lightIntensity = vec3(sunFactor*lighting[1].x + min(lighting[1].y,0.75));\n" // diffuse + ambient (clamped to max 0.75)
"lightIntensity = clamp(lightIntensity,0.0,1.0);\n"