Files
nixos/scripts/hypr-shaders/rainbow.frag
2026-10-06 22:34:05 +02:00

20 lines
562 B
GLSL

//modified version of [this shader](https://github.com/wessles/GLSL-CRT/blob/master/shader.frag)
#version 300 es
precision mediump float;
in vec2 v_texcoord;
uniform sampler2D tex;
out vec4 FragColor;
const float scaleFactor = 0.7;
// [0,1]
void main() {
vec4 cta = texture(tex, v_texcoord);
// cta += vec4(cos(v_texcoord.x)/4., sin(v_texcoord.y)/4., 0., 1.);
cta += vec4(cos(v_texcoord.x)/4., cos(v_texcoord.y)/8., sin(v_texcoord.y)/4., 1.);
FragColor = vec4(clamp(cta.x, 0., 1.), clamp(cta.y, 0., 1.), clamp(cta.z, 0., 1.), clamp(cta.w, 0., 1.));
}