online multiplayer chess game (note server currently down)
Diffstat (limited to 'ui/chat/grayscale.shader')
-rw-r--r--ui/chat/grayscale.shader10
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/chat/grayscale.shader b/ui/chat/grayscale.shader
new file mode 100644
index 0000000..3188c10
--- /dev/null
+++ b/ui/chat/grayscale.shader
@@ -0,0 +1,10 @@
+shader_type canvas_item;
+uniform float saturation: hint_range(0.0, 1.0) = 0.0;
+uniform float scale: hint_range(0.0, 1.0) = 1.0;
+const float pivot = 0.5;
+
+void fragment() {
+ vec4 tex_color = texture(TEXTURE, (UV - pivot) * (2.0 - scale) + pivot);
+ COLOR.rgb = mix(vec3(dot(tex_color.rgb, vec3(0.299, 0.587, 0.114))), tex_color.rgb, saturation); // magic numbers
+ COLOR.a = tex_color.a;
+} \ No newline at end of file