aboutsummaryrefslogtreecommitdiffstats
path: root/assets/shaders/glsl330/postprocessing.fs
diff options
context:
space:
mode:
authornathan <nathansmith@disroot.org>2025-10-19 00:13:15 +0000
committernathan <nathansmith@disroot.org>2025-10-19 00:13:15 +0000
commit6b6b37dfed2ae3278c8d2322e48443410b26d87f (patch)
tree2d72345604ed157f17341a0ea113240b49ccf535 /assets/shaders/glsl330/postprocessing.fs
parente3f220ee2003e93b2a1ebc335630fac8444a412e (diff)
downloadFindThings-6b6b37dfed2ae3278c8d2322e48443410b26d87f.tar.gz
FindThings-6b6b37dfed2ae3278c8d2322e48443410b26d87f.tar.bz2
FindThings-6b6b37dfed2ae3278c8d2322e48443410b26d87f.zip
Ye retro colors
Diffstat (limited to 'assets/shaders/glsl330/postprocessing.fs')
-rw-r--r--assets/shaders/glsl330/postprocessing.fs26
1 files changed, 26 insertions, 0 deletions
diff --git a/assets/shaders/glsl330/postprocessing.fs b/assets/shaders/glsl330/postprocessing.fs
new file mode 100644
index 0000000..a2dcb17
--- /dev/null
+++ b/assets/shaders/glsl330/postprocessing.fs
@@ -0,0 +1,26 @@
+#version 330
+
+in vec2 fragTexCoord;
+in vec4 fragColor;
+
+uniform sampler2D texture0;
+uniform vec4 colDiffuse;
+
+out vec4 finalColor;
+
+float gamma = 0.6;
+float numColors = 11.0;
+
+void main()
+{
+ // Texel color fetching from texture sampler
+ vec3 texelColor = texture(texture0, fragTexCoord.xy).rgb;
+
+ texelColor = pow(texelColor, vec3(gamma, gamma, gamma));
+ texelColor = texelColor*numColors;
+ texelColor = floor(texelColor);
+ texelColor = texelColor/numColors;
+ texelColor = pow(texelColor, vec3(1.0/gamma));
+
+ finalColor = vec4(texelColor, 1.0);
+}