69 vec2 center = vec2(0.5, 0.5);
74 float mouseInfluence = 0.0;
76 mouseInfluence = 1.0 - smoothstep(0.0, 0.5, length(mouse - uv));
81 vec2 tcFromCenter = uv - center;
82 float distance = length(tcFromCenter);
83 float angle = atan(tcFromCenter.y, tcFromCenter.x);
86 float twirl = 10.0 * (1.0 - smoothstep(0.0, 0.8, distance)) + time * 5.0;
87 angle +=
twirl * (0.5 + sin(time * 0.7) * 0.5 + mouseInfluence * 2.0);
90 vec2 displacement = vec2(
93 ) * 0.2 * (0.5 + mouseInfluence * 2.0);
96 float radialWave = sin(distance * 30.0 - time * 10.0) * 0.1;
97 radialWave += sin(angle * 5.0 + time * 5.0) * 0.05;
100 float radius = distance * (1.0 + radialWave * 2.0 + mouseInfluence);
101 vec2 distortedTC = center + vec2(cos(angle), sin(angle)) * radius;
102 distortedTC += displacement * (1.0 + sin(time * 10.0) * 0.5);
105 float glitchIntensity = (sin(time * 3.0) * 0.5 + 0.5) * 0.3 + mouseInfluence * 0.5;
106 if (
random(vec2(time)) > 0.7) {
107 distortedTC.x += (
random(vec2(time)) - 0.5) * glitchIntensity;
108 distortedTC.y += (
random(vec2(time * 0.7)) - 0.5) * glitchIntensity;
112 vec4 color1 = texture(samp, distortedTC + vec2(glitchIntensity * 0.02, 0.0));
113 vec4 color2 = texture(samp, distortedTC - vec2(glitchIntensity * 0.02, 0.0));
114 color = vec4(color1.r, color2.g, color1.b, 1.0);
117 float scanLine = sin(uv.y * 800.0 + time * 10.0) * 0.1;
118 color.rgb += scanLine * glitchIntensity;
121 vec2 chromaOffset = vec2(
125 color.r = texture(samp, distortedTC + chromaOffset).r;
126 color.b = texture(samp, distortedTC - chromaOffset).b;
129 color.rgb = mix(color.rgb, smoothstep(0.0, 1.0, color.rgb * 1.2), 0.5);
132 if (
random(vec2(time * 0.3)) > 0.97) {
137 float vignette = 1.0 - smoothstep(0.4, 0.8, distance);