From: Steinar H. Gunderson Date: Fri, 5 Oct 2012 22:58:31 +0000 (+0200) Subject: In overlay matte, use the luminance as a matte instead of each individual color compo... X-Git-Tag: 1.0~375 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=fe785e6f62ab58ef05972850d9275005794505b7 In overlay matte, use the luminance as a matte instead of each individual color component; it makes more sense to me. Also clamp luminance there to [0,1] to avoid going extrapolating into ugliness, which could happen when we had e.g. lift/gamma/gain before. --- diff --git a/overlay_matte_effect.frag b/overlay_matte_effect.frag index f80f0b1..12e9fee 100644 --- a/overlay_matte_effect.frag +++ b/overlay_matte_effect.frag @@ -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))); }