From 2339b18b0140005d3d5cbac46cc47004764f732d Mon Sep 17 00:00:00 2001 From: raa-eruanna Date: Wed, 21 Sep 2016 15:13:10 -0400 Subject: [PATCH] Quick fix: prevents negative values being passed to pow. --- wadsrc/static/shaders/glsl/present.fp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/shaders/glsl/present.fp b/wadsrc/static/shaders/glsl/present.fp index 4f5c7cffa..31c1217cb 100644 --- a/wadsrc/static/shaders/glsl/present.fp +++ b/wadsrc/static/shaders/glsl/present.fp @@ -11,7 +11,7 @@ vec4 ApplyGamma(vec4 c) { vec3 val = c.rgb * Contrast - (Contrast - 1.0) * 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); }