]> git.sesse.net Git - movit/blobdiff - alpha_division_effect.frag
Make Movit work in premultiplied alpha.
[movit] / alpha_division_effect.frag
diff --git a/alpha_division_effect.frag b/alpha_division_effect.frag
new file mode 100644 (file)
index 0000000..6b58148
--- /dev/null
@@ -0,0 +1,8 @@
+// Note: Division by zero will give inf or nan, whose conversion to
+// integer types is implementation-defined. However, anything is fine for
+// alpha=0, since that's undefined anyway.
+vec4 FUNCNAME(vec2 tc) {
+       vec4 x = INPUT(tc);
+       x.rgb /= x.aaa; 
+       return x;
+}