In overlay matte, use the luminance as a matte instead of each individual color compo...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 5 Oct 2012 22:58:31 +0000 (00:58 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 5 Oct 2012 22:58:31 +0000 (00:58 +0200)
overlay_matte_effect.frag

index f80f0b1..12e9fee 100644 (file)
@@ -1,5 +1,6 @@
 vec4 FUNCNAME(vec2 tc) {
        vec4 orig = INPUT1(tc);
        vec4 blurred = INPUT2(tc);
-       return mix(orig, blurred, orig * vec4(PREFIX(blurred_mix_amount)));
+       float luminance = clamp(dot(orig.rgb, vec3(0.2126, 0.7152, 0.0722)), 0.0, 1.0);
+       return mix(orig, blurred, luminance * vec4(PREFIX(blurred_mix_amount)));
 }