]> git.sesse.net Git - movit/blobdiff - saturation_effect.glsl
Move saturation out into its own effect, and hook up the control.
[movit] / saturation_effect.glsl
diff --git a/saturation_effect.glsl b/saturation_effect.glsl
new file mode 100644 (file)
index 0000000..a68485a
--- /dev/null
@@ -0,0 +1,10 @@
+// Saturate/desaturate (in linear space).
+
+vec4 FUNCNAME(vec2 tc) {
+       vec4 x = LAST_INPUT(tc);
+
+       float luminance = dot(x.rgb, vec3(0.2126, 0.7152, 0.0722));
+       x.rgb = mix(vec3(luminance), x.rgb, PREFIX(saturation));
+
+       return x;
+}