aboutsummaryrefslogtreecommitdiff
path: root/.config/hypr/shaders/13_sepia.glsl
diff options
context:
space:
mode:
authorkrolxon <krolyxon@tutanota.com>2026-01-11 19:18:06 +0530
committerkrolxon <krolyxon@tutanota.com>2026-01-11 19:18:06 +0530
commitea8f17368def0b581efcc332d057c0a034d4da9b (patch)
tree5fd0bfd6627d34b93090d79628bdd87793e9f715 /.config/hypr/shaders/13_sepia.glsl
parent4c31a041975718cc2fb933012a303cf457475ce7 (diff)
add shader script and keybinds
Diffstat (limited to '.config/hypr/shaders/13_sepia.glsl')
-rwxr-xr-x.config/hypr/shaders/13_sepia.glsl33
1 files changed, 33 insertions, 0 deletions
diff --git a/.config/hypr/shaders/13_sepia.glsl b/.config/hypr/shaders/13_sepia.glsl
new file mode 100755
index 0000000..fcd451a
--- /dev/null
+++ b/.config/hypr/shaders/13_sepia.glsl
@@ -0,0 +1,33 @@
+#version 300 es
+// Sepia Tone Shader - OPTIMIZED
+// Fixes: Clamping to prevent overflow on bright pixels
+
+precision highp float;
+
+in vec2 v_texcoord;
+uniform sampler2D tex;
+out vec4 fragColor;
+
+// W3C standard Sepia Matrix (column-major for GLSL)
+const mat3 SEPIA_MATRIX = mat3(
+ 0.393, 0.769, 0.189, // Red output weights
+ 0.349, 0.686, 0.168, // Green output weights
+ 0.272, 0.534, 0.131 // Blue output weights
+);
+
+// Sepia intensity (0.0 = no effect, 1.0 = full sepia)
+const float INTENSITY = 1.0;
+
+void main() {
+ vec4 color = texture(tex, v_texcoord);
+
+ vec3 sepia = color.rgb * SEPIA_MATRIX;
+
+ // FIXED: Clamp to prevent overflow artifacts on bright pixels
+ sepia = clamp(sepia, 0.0, 1.0);
+
+ // Optional: blend with original for partial effect
+ vec3 final = mix(color.rgb, sepia, INTENSITY);
+
+ fragColor = vec4(final, color.a);
+}