From 0c052ad410ac400b92533e4062d4f8c25cb2c458 Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 1 Dec 2025 10:08:43 +0000 Subject: Add Glitch shade --- config/picom/shaders/shiny.glsl | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 config/picom/shaders/shiny.glsl (limited to 'config/picom/shaders/shiny.glsl') diff --git a/config/picom/shaders/shiny.glsl b/config/picom/shaders/shiny.glsl new file mode 100644 index 0000000..16636ac --- /dev/null +++ b/config/picom/shaders/shiny.glsl @@ -0,0 +1,33 @@ +#version 430 + +// Source: https://github.com/yshui/picom/issues/295#issuecomment-592077997 + +in vec2 texcoord; + +uniform float opacity; +uniform bool invert_color; +uniform sampler2D tex; +uniform float time; + +ivec2 window_size = textureSize(tex, 0); + +float amt = 10000.0; + +vec4 default_post_processing(vec4 c); + +vec4 window_shader() { + float pct = mod(time, amt) / amt * 1000; + float factor = float(max(window_size.x, window_size.y)); + pct *= factor / 150.0; + vec2 pos = texcoord; + vec4 c = texelFetch(tex, ivec2(texcoord), 0); + + if (pos.x + pos.y < pct * 4.0 && pos.x + pos.y > pct * 4.0 - .5 * pct + || pos.x + pos.y < pct * 4.0 - .8 * pct && pos.x + pos.y > pct * 3.0) + c *= vec4(2, 2, 2, 1); + if (invert_color) + c = vec4(vec3(c.a, c.a, c.a) - vec3(c), c.a); + + c *= opacity; + return default_post_processing(c); +} -- cgit v1.2.3