Quick fix: prevents negative values being passed to pow.

This commit is contained in:
raa-eruanna 2016-09-21 15:13:10 -04:00 committed by Christoph Oelckers
parent 72491049e0
commit 2339b18b01

View file

@ -11,7 +11,7 @@ vec4 ApplyGamma(vec4 c)
{ {
vec3 val = c.rgb * Contrast - (Contrast - 1.0) * 0.5; vec3 val = c.rgb * Contrast - (Contrast - 1.0) * 0.5;
val += Brightness * 0.5; val += Brightness * 0.5;
val = pow(val, vec3(InvGamma)); val = pow(max(val, vec3(0.0)), vec3(InvGamma));
return vec4(val, c.a); return vec4(val, c.a);
} }