aboutsummaryrefslogtreecommitdiff
path: root/assets/grayscale.fs
diff options
context:
space:
mode:
authorUneven Prankster <unevenprankster@protonmail.com>2023-07-12 13:22:29 -0300
committerUneven Prankster <unevenprankster@protonmail.com>2023-07-12 13:22:29 -0300
commitfa2bdd711212ba6b7a94a20971e8bfa281e73296 (patch)
tree6713b3c0379507d49558287b71dd360ce188a2f0 /assets/grayscale.fs
lol
Diffstat (limited to 'assets/grayscale.fs')
-rw-r--r--assets/grayscale.fs16
1 files changed, 16 insertions, 0 deletions
diff --git a/assets/grayscale.fs b/assets/grayscale.fs
new file mode 100644
index 0000000..979a81c
--- /dev/null
+++ b/assets/grayscale.fs
@@ -0,0 +1,16 @@
+#version 330
+
+in vec2 fragTexCoord;
+in vec4 fragColor;
+
+uniform sampler2D texture0;
+uniform vec4 colDiffuse;
+
+out vec4 finalColor;
+
+void main()
+{
+ vec4 texelColor = texture(texture0, fragTexCoord) * colDiffuse * fragColor;
+ float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));
+ finalColor = vec4(gray, gray, gray, texelColor.a);
+} \ No newline at end of file