aboutsummaryrefslogtreecommitdiff
path: root/.config/hypr/shaders/14_vibrance.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/14_vibrance.glsl
parent4c31a041975718cc2fb933012a303cf457475ce7 (diff)
add shader script and keybinds
Diffstat (limited to '.config/hypr/shaders/14_vibrance.glsl')
-rwxr-xr-x.config/hypr/shaders/14_vibrance.glsl37
1 files changed, 37 insertions, 0 deletions
diff --git a/.config/hypr/shaders/14_vibrance.glsl b/.config/hypr/shaders/14_vibrance.glsl
new file mode 100755
index 0000000..e0a8350
--- /dev/null
+++ b/.config/hypr/shaders/14_vibrance.glsl
@@ -0,0 +1,37 @@
+#version 300 es
+// Vignette Shader - OPTIMIZED
+// Fixes: Aspect ratio correction for circular vignette, safe smoothstep bounds
+
+precision highp float;
+
+in vec2 v_texcoord;
+uniform sampler2D tex;
+out vec4 fragColor;
+
+// --- CONFIGURATION ---
+const float RADIUS = 0.65;
+const float SOFTNESS = 0.45;
+const float STRENGTH = 0.5;
+// Set to your monitor's aspect ratio for circular vignette
+const float ASPECT_RATIO = 16.0 / 9.0;
+
+void main() {
+ vec4 color = texture(tex, v_texcoord);
+
+ // FIXED: Aspect-corrected distance for circular (not elliptical) vignette
+ vec2 centered = v_texcoord - 0.5;
+ centered.x *= ASPECT_RATIO;
+ float dist = length(centered);
+ // Normalize so corner distance is ~1.0 regardless of aspect ratio
+ dist /= length(vec2(ASPECT_RATIO * 0.5, 0.5));
+
+ // FIXED: Ensure smoothstep has valid bounds (edge1 > edge0)
+ float innerEdge = RADIUS;
+ float outerEdge = RADIUS + SOFTNESS;
+ float vignette = 1.0 - smoothstep(innerEdge, outerEdge, dist);
+
+ // Apply with strength control
+ color.rgb = mix(color.rgb, color.rgb * vignette, STRENGTH);
+
+ fragColor = color;
+}