Cap dynamic light intensity / brightness to 3.

Without capping the brightness entity models may fade into pure white
which looks ugly. This can be seen when several flyer fire blaster
bolds onto the player or when multiple barrels are exploding. This
change was suggest by @DanielGibson, I'm just the messenger.
This commit is contained in:
Yamagi Burmeister 2017-04-10 19:07:33 +02:00 committed by Daniel Gibson
parent b124d0cada
commit 0314eafdaa

View file

@ -617,9 +617,7 @@ static const char* fragmentSrcAlias = MULTILINE_STRING(
// apply gamma correction and intensity
texel.rgb *= intensity;
texel.a *= alpha; // is alpha even used here?
// TODO: is this really equivalent to GL_MODULATE's behavior of texture vs glColor()?
texel *= passColor;
texel *= min(vec4(3.0), passColor);
outColor.rgb = pow(texel.rgb, vec3(gamma));
outColor.a = texel.a; // I think alpha shouldn't be modified by gamma and intensity