]> git.sesse.net Git - movit/blobdiff - lift_gamma_gain_effect.frag
Support negative values for lift in LiftGammaGainEffect.
[movit] / lift_gamma_gain_effect.frag
index 7342d7505eb53da6e66167b4921138ef2f5a68dc..ceb2081c752591e71277b10af64e8e499f2f2cb1 100644 (file)
@@ -14,6 +14,10 @@ vec4 FUNCNAME(vec2 tc) {
 
        x.rgb = pow(x.rgb, vec3(1.0/2.2));
        x.rgb += PREFIX(lift) * (vec3(1) - x.rgb);
+
+       // Clip out-of-gamut values again.
+       x.rgb = max(x.rgb, 0.0);
+
        x.rgb = pow(x.rgb, PREFIX(inv_gamma_22));
        x.rgb *= PREFIX(gain_pow_inv_gamma);
        x.rgb *= x.aaa;