41 float glitchStrength = 0.05 + 0.03 * sin(
time_f * 3.0);
42 float glitchLine = step(0.5 + 0.1 * sin(
time_f * 10.0), fract(uv.y * 10.0 +
time_f * 5.0));
43 float displacement = glitchStrength * (
random(uv +
time_f) - 0.5);
45 vec2 distortedUV = uv;
46 distortedUV.x += displacement * glitchLine;
48 vec4 texColor = texture(samp, distortedUV);
50 vec2 offset = vec2(0.01 * sin(
time_f * 15.0), 0.01 * cos(
time_f * 10.0));
51 vec3 glitchRGB = vec3(
52 texture(samp, distortedUV + vec2(offset.x, 0.0)).r,
53 texture(samp, distortedUV + vec2(-offset.x, offset.y)).g,
54 texture(samp, distortedUV + vec2(0.0, -offset.y)).b
57 float strobe = step(0.5, fract(
time_f * 10.0)) * 0.2;
59 color = vec4(mix(texColor.rgb, glitchRGB, glitchLine + strobe), texColor.a);