127 float aspect = resolution.x / resolution.y;
128 vec2 center =
iMouse.z > 0.0 ?
iMouse.xy / resolution : vec2(0.5);
129 vec2 point = (tc - center) * vec2(aspect, 1.0);
130 float bass = max(texture(spectrum0, 0.055).r,
amp_low);
131 float middle = max(texture(spectrum0, 0.38).r,
amp_mid);
132 float treble = max(texture(spectrum0, 0.86).r,
amp_high);
135 vec2 live_uv = tc + flow *
field * (0.012 + bass * 0.04);
137 float threads = pow(1.0 - abs(
field), 9.0);
139 (0.18 + treble * 0.38);
141 vec3 accumulated = live * 1.2;
142 float total_weight = 1.2;
143 for (
int index = 0; index <
SIZE; ++index) {
144 float age = float(index + 1) / float(max(
SIZE, 1));
148 float old_field =
weave_field(point, old_bass, old_middle,
150 vec2 cache_uv = tc - center;
151 cache_uv =
rotate_2d((old_middle - old_treble) * age * 0.7) * cache_uv;
152 cache_uv *= 1.0 - age * (0.07 + old_bass * 0.08);
153 cache_uv += vec2(old_field, -old_field) * age * 0.025;
156 memory *= 0.65 +
palette(old_field * 0.3 + age) * 0.62;
157 float old_threads = pow(1.0 - abs(old_field), 6.0);
159 float weight = exp(-age * 2.5) * (0.7 + old_middle * 0.5);
160 accumulated += memory * weight;
161 total_weight += weight;
164 vec3 result = accumulated / total_weight;
165 result = mix(result, result.rbg, smoothstep(0.88, 1.0,
amp_peak) * 0.65);
166 result = (result - 0.5) * (1.1 +
amp_smooth * 0.28) + 0.5;
167 color = vec4(clamp(result, 0.0, 1.0), texture(samp, tc).a);