From ea8f17368def0b581efcc332d057c0a034d4da9b Mon Sep 17 00:00:00 2001 From: krolxon Date: Sun, 11 Jan 2026 19:18:06 +0530 Subject: add shader script and keybinds --- .config/hypr/shaders/13_sepia.glsl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 .config/hypr/shaders/13_sepia.glsl (limited to '.config/hypr/shaders/13_sepia.glsl') 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); +} -- cgit v1.2.3