From 6555a8f02cbaf26e672bea01691827f10212e32a Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sun, 8 May 2022 13:56:21 +0200 Subject: [PATCH] :wrench: Fix straight alpha --- src/TVEffect.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/TVEffect.js b/src/TVEffect.js index df2407b..c544d37 100644 --- a/src/TVEffect.js +++ b/src/TVEffect.js @@ -206,10 +206,9 @@ if (utils.isInShellProcess()) { // Assemble the final alpha value. float mask = tbMask * lrMask * ffMask; - vec4 windowColor = texture2D(uTexture, cogl_tex_coord_in[0].st); - windowColor.rgb = mix(windowColor.rgb, uColor * windowColor.a, smoothstep(0, 1, progress)); - - cogl_color_out = windowColor * mask; + cogl_color_out = texture2D(uTexture, cogl_tex_coord_in[0].st); + cogl_color_out.rgb = mix(cogl_color_out.rgb, uColor * cogl_color_out.a, smoothstep(0, 1, progress)); + cogl_color_out.a *= mask; // These are pretty useful for understanding how this works. // cogl_color_out = vec4(vec3(tbMask), 1);