98float tempest(vec2 point,
float bass,
float high) {
99 float first = sin(length(point - vec2(sin(
time_f * 0.41), cos(
time_f * 0.33)) * 0.38) * (25.0 + bass * 18.0) -
time_f * 7.0);
100 float second = sin(length(point + vec2(cos(
time_f * 0.29), sin(
time_f * 0.47)) * 0.42) * (31.0 + high * 15.0) +
time_f * 5.0);
101 float crossing = sin(point.x * 42.0 + sin(point.y * 13.0 -
time_f * 4.0) * 4.0);
102 return (first + second + crossing) / 3.0;
110 vec2 aspect = vec2(resolution.x / resolution.y, 1.0);
111 vec2 point = (tc - 0.5) * aspect;
112 float bass = texture(spectrum0, 0.035).r;
113 float middle = texture(spectrum0, 0.28).r;
114 float high = texture(spectrum0, 0.76).r;
116 vec2 distortion = vec2(
field,
tempest(point.yx + 0.17, middle, bass)) * (0.025 + bass * 0.045);
117 vec3 live = texture(samp,
mirror_repeat(tc + distortion)).rgb;
118 float bolt = pow(1.0 - abs(
field), 14.0);
121 vec3 accumulated = live * 1.25;
122 float total_weight = 1.25;
123 for (
int index = 0; index <
SIZE; ++index) {
124 float generation = float(index + 1);
125 float age = generation / float(max(
SIZE, 1));
127 float angle = generation * (0.018 + old_audio.z * 0.11) * sin(
time_f * 0.23 + age *
TAU);
128 float cosine = cos(angle);
129 float sine = sin(angle);
130 mat2
rotation = mat2(cosine, -sine, sine, cosine);
131 vec2 cache_point =
rotation * point * (1.0 - age * (0.055 + old_audio.x * 0.09));
132 cache_point += distortion * generation * 0.28 + vec2(sine, cosine) * old_audio.y * 0.018;
133 vec2 cache_uv = cache_point / aspect + 0.5;
135 float weight = exp(-age * (1.8 -
amp_smooth * 0.4));
136 accumulated += memory * weight;
137 total_weight += weight;
140 vec3 result = accumulated / total_weight;
142 result = (result - 0.5) * (1.25 +
amp_smooth * 0.3) + 0.5;
143 result = mix(result, 1.0 - result, smoothstep(0.88, 1.0,
amp_peak));
144 color = vec4(clamp(result, 0.0, 1.0), 1.0);