From 756e3ceaca8c190a9e7c310272c1c6a0e41c9999 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 14 Jan 2013 18:28:06 +0100 Subject: [PATCH] =?utf8?q?=C2=A0Remove=20the=20code=20for=20postmultiplied?= =?utf8?q?=20alpha=20from=20OverlayEffect.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- overlay_effect.frag | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/overlay_effect.frag b/overlay_effect.frag index 36c1a79..9e5709d 100644 --- a/overlay_effect.frag +++ b/overlay_effect.frag @@ -15,22 +15,5 @@ vec4 FUNCNAME(vec2 tc) { vec4 bottom = INPUT1(tc); vec4 top = INPUT2(tc); -#if 0 - // Postmultiplied version. - float new_alpha = mix(bottom.a, 1.0, top.a); - if (new_alpha < 1e-6) { - // new_alpha = 0 only if top.a = bottom.a = 0, at least as long as - // both alphas are within range. (If they're not, the result is not - // meaningful anyway.) And if new_alpha = 0, we don't really have - // any meaningful output anyway, so just set it to zero instead of - // getting division-by-zero below. - return vec4(0.0); - } else { - vec3 premultiplied_color = mix(bottom.rgb * bottom.aaa, top.rgb, top.a); - vec3 color = premultiplied_color / new_alpha; - return vec4(color.r, color.g, color.b, new_alpha); - } -#else return top + (1.0 - top.a) * bottom; -#endif } -- 2.39.2