]> git.sesse.net Git - movit/blobdiff - overlay_effect.frag
Disable dither explicitly per frame; fixes some weird artifacts I found.
[movit] / overlay_effect.frag
index 36c1a7996cf48e0112908d93aa1b9634698ed2fa..9e5709d1dad6271535701316d4ff1b60c4533d99 100644 (file)
 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
 }