]> git.sesse.net Git - movit/blobdiff - dither_effect.frag
Add an implementation of RPDF dither on the final output.
[movit] / dither_effect.frag
diff --git a/dither_effect.frag b/dither_effect.frag
new file mode 100644 (file)
index 0000000..9b39553
--- /dev/null
@@ -0,0 +1,9 @@
+uniform sampler2D PREFIX(dither_tex);
+
+vec4 FUNCNAME(vec2 tc) {
+       // We also choose to dither alpha, just in case.
+       // Maybe it should in theory have a separate dither,
+       // but I doubt it matters much. We currently don't
+       // really handle alpha in any case.
+       return INPUT(tc) + texture2D(PREFIX(dither_tex), tc).xxxx;
+}