95float lattice(vec2 point,
float bass,
float middle,
float high) {
96 vec2 grid = abs(fract(point * (8.0 + middle * 5.0)) - 0.5);
97 float rails = min(grid.x, grid.y);
98 float diagonal = abs(fract((point.x + point.y) * (6.0 + high * 4.0) +
time_f * 0.8) - 0.5);
99 float jitter =
hash_21(floor(point * 18.0) + floor(
time_f * 9.0)) * bass * 0.09;
100 return exp(-min(rails, diagonal) * (65.0 + high * 30.0) + jitter * 18.0);
108 vec2 aspect = vec2(resolution.x / resolution.y, 1.0);
109 vec2 point = (tc - 0.5) * aspect;
110 float bass = texture(spectrum0, 0.04).r;
111 float middle = texture(spectrum0, 0.3).r;
112 float high = texture(spectrum0, 0.8).r;
113 float grid_energy =
lattice(point + vec2(sin(
time_f), cos(
time_f * 0.7)) * 0.02, bass, middle, high);
114 vec2
warp = vec2(sin(point.y * 37.0 -
time_f * 8.0), cos(point.x * 33.0 +
time_f * 7.0)) * grid_energy * (0.02 + bass * 0.055);
116 live *= 0.76 +
palette(point.x * 0.2 - point.y * 0.15 +
time_f * 0.08) * 0.72;
117 live +=
palette(grid_energy +
time_f * 0.14) * grid_energy * (0.8 + high * 3.0);
119 vec3 accumulated = live;
120 float total_weight = 1.0;
121 for (
int index = 0; index <
SIZE; ++index) {
122 float generation = float(index + 1);
123 float age = generation / float(max(
SIZE, 1));
125 vec2 cache_point = point * (1.0 - age * (0.06 + old_audio.x * 0.07));
126 cache_point += vec2(
hash_21(vec2(generation, floor(
time_f * 6.0))),
hash_21(vec2(floor(
time_f * 6.0), generation))) * old_audio.z * 0.07 - old_audio.z * 0.035;
127 vec3 memory =
sample_cache(index, cache_point / aspect + 0.5);
128 float old_grid =
lattice(cache_point, old_audio.x, old_audio.y, old_audio.z);
129 memory *=
palette(age * 0.8 + old_audio.z * 0.3 + old_grid * 0.2);
130 float weight = pow(0.75, generation) * (0.8 + old_grid * 0.7);
131 accumulated += memory * weight;
132 total_weight += weight;
134 vec3 result = accumulated / total_weight;
136 result = (result - 0.5) * (1.32 +
amp_smooth * 0.3) + 0.5;
137 result = mix(result, vec3(1.0) - result, smoothstep(0.9, 1.0,
amp_peak));
138 color = vec4(clamp(result, 0.0, 1.0), 1.0);