89float surge(vec2 point,
float bass,
float middle,
float high) {
90 vec2 source_a = vec2(sin(
time_f * 0.43), cos(
time_f * 0.37)) * 0.31;
91 vec2 source_b = vec2(cos(
time_f * 0.29), -sin(
time_f * 0.53)) * 0.39;
92 vec2 source_c = vec2(-cos(
time_f * 0.61), sin(
time_f * 0.31)) * 0.26;
93 float a = sin(length(point - source_a) * (24.0 + bass * 16.0) -
time_f * 6.0);
94 float b = sin(length(point - source_b) * (29.0 + middle * 14.0) -
time_f * 5.0);
95 float c = sin(length(point - source_c) * (35.0 + high * 12.0) -
time_f * 8.0);
96 return (a + b + c) / 3.0;
104 vec2 aspect = vec2(resolution.x / resolution.y, 1.0);
105 vec2 point = (tc - 0.5) * aspect;
106 float bass = texture(spectrum0, 0.03).r;
107 float middle = texture(spectrum0, 0.23).r;
108 float high = texture(spectrum0, 0.67).r;
109 float wave =
surge(point, bass, middle, high);
110 float crest = pow(max(
wave, 0.0), 6.0) + pow(max(-
wave, 0.0), 9.0) * 0.55;
111 vec2
warp = vec2(
wave,
surge(point.yx * 1.07 + 0.19, high, bass, middle)) * (0.035 + bass * 0.06);
113 float chroma = crest * (0.018 + high * 0.045);
118 live +=
palette(length(point) * 0.5 -
time_f * 0.17) * crest * (0.9 + high * 2.7);
120 vec3 accumulated = live * 1.2;
121 float total_weight = 1.2;
122 for (
int index = 0; index <
SIZE; ++index) {
123 float generation = float(index + 1);
124 float age = generation / float(max(
SIZE, 1));
126 float angle = generation * (0.02 + old_audio.z * 0.1) * sin(
time_f * 0.35 + age *
TAU);
127 float cosine = cos(angle);
128 float sine = sin(angle);
129 vec2 cache_point = mat2(cosine, -sine, sine, cosine) * point;
130 cache_point *= 1.0 - age * (0.09 + old_audio.x * 0.11);
131 cache_point +=
warp * age * (0.8 + old_audio.y);
132 vec3 memory =
sample_cache(index, cache_point / aspect + 0.5);
133 memory *=
palette(age * 0.7 + old_audio.y * 0.5 -
time_f * 0.03);
134 float weight = pow(0.8, generation) * (0.72 + old_audio.x * 0.55);
135 accumulated += memory * weight;
136 total_weight += weight;
138 vec3 result = accumulated / total_weight;
140 result = (result - 0.5) * (1.31 +
amp_smooth * 0.3) + 0.5;
141 result = mix(result, vec3(1.0) - result, smoothstep(0.86, 1.0,
amp_peak));
142 color = vec4(clamp(result, 0.0, 1.0), 1.0);