OpenGL2: Add more ambient to lightmapped materials.

This commit is contained in:
SmileTheory 2016-10-27 02:12:32 -07:00
parent 8955752457
commit f7711a8119
1 changed files with 3 additions and 0 deletions

View File

@ -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);