Some color are negative, clamp them in loglum

I have yet to investigate how the pipeline can produce negative values
somewhere.
This commit is contained in:
vlj 2014-04-21 19:29:13 +02:00
parent a0e63dea46
commit 43df357cfb

View File

@ -9,6 +9,7 @@ void main()
{
vec3 weight = vec3(0.2125f, 0.7154f, 0.0721f);
vec3 col = texture(tex, uv).xyz;
float luma = dot(col, weight);
// TODO: Investigate why color buffer has negative value sometimes
float luma = max(dot(col, weight), 0.);
FragColor = vec4(log(luma + delta));
}