65 case 0:
return texture(spectrum0, freq).r;
168 vec3 pink = vec3(1.0, 0.15, 0.75);
169 vec3 blue = vec3(0.10, 0.55, 1.0);
170 vec3 green = vec3(0.10, 1.00, 0.45);
171 float ph = fract(t * 0.08);
172 vec3 k1 = mix(pink, blue, smoothstep(0.00, 0.33, ph));
173 vec3 k2 = mix(blue, green, smoothstep(0.33, 0.66, ph));
174 vec3 k3 = mix(green, pink, smoothstep(0.66, 1.00, ph));
175 return normalize(mix(mix(k1, k2, step(0.33, ph)), k3, step(0.66, ph))) * 1.05;
223 vec4 baseTex = texture(samp, tc);
224 vec2 uv = tc * 2.0 - 1.0;
226 vec2 ar = vec2(aspect, 1.0);
230 float distFromCenter = length((tc - m) * ar);
231 float historySelect = clamp(distFromCenter * 15.0, 0.0, 15.0);
232 int hIdx = int(historySelect);
233 float hFrac = fract(historySelect);
236 float fftCurrent =
sample16(hIdx, clamp(distFromCenter * 0.5, 0.0, 1.0));
237 float fftNext =
sample16(min(hIdx + 1, 15), clamp(distFromCenter * 0.5, 0.0, 1.0));
238 float fft = mix(fftCurrent, fftNext, hFrac);
242 float liveFft = texture(
spectrum, clamp(distFromCenter * 0.5, 0.0, 1.0)).r;
251 float spectrumSum = 0.0;
252 for (
int i = 0; i < 16; i++) {
255 spectrumSum *= 0.03125;
259 float histDelta = 0.0;
260 for (
int i = 0; i < 15; i++) {
263 histDelta *= (1.0 / 15.0);
264 float historyValid = smoothstep(0.002, 0.02, histDelta + spectrumSum * 0.2);
275 float audioEnergy = mix(liveFft,
histEnergy, historyValid);
282 float basePhase =
time_f * 0.6;
283 float audioOffset = mix(liveFft, spectrumSum, historyValid) * 1.2;
284 float audioPhase = basePhase + audioOffset;
287 float evo = audioPhase * (0.22 + audioEnergy * 0.6) + spectrumSum * 3.7;
288 float evoIdx = floor(evo);
289 float evoFrac = fract(evo);
290 float evoHash = mix(
hash1(evoIdx + 5.0),
hash1(evoIdx + 6.0), evoFrac);
297 float seg = 4.0 + (2.0 + audioEnergy * 4.0) * (0.35 + 0.65 * evoHash);
298 vec2 kUV =
reflectUV(tc, seg, m, aspect);
302 float foldZoom = 1.25 + 0.9 * audioEnergy + 0.35 * (evoHash - 0.5);
304 kUV =
rotateUV(kUV, audioPhase * (0.18 + audioEnergy * 0.45), m, aspect);
308 vec2 p = (kUV - m) * ar;
309 float rD = max(length(p), 1e-6);
313 float drift = audioPhase * (0.22 + audioEnergy * 0.65 + spectrumSum * 0.15);
316 float dIdx = floor(drift * 0.07);
317 float dFrac = fract(drift * 0.07);
318 vec2 dA = vec2(
hash1(dIdx + 19.0),
hash1(dIdx + 43.0)) - 0.5;
319 vec2 dB = vec2(
hash1(dIdx + 20.0),
hash1(dIdx + 44.0)) - 0.5;
320 vec2 driftBias = mix(dA, dB, dFrac) * (0.35 + audioEnergy * 0.45);
323 float radialGain = 1.2 + audioEnergy * 3.0 + spectrumSum * 1.1;
324 float logTerm = log(1.0 + rD * radialGain);
325 float sqrtTerm = sqrt(rD) * (0.35 + audioEnergy * 0.4);
326 float polyTerm = rD * rD * (0.03 + 0.08 * evoHash);
331 pwrap.x = p.x * (1.0 + 0.55 * audioEnergy) + logTerm + drift * 0.11 + driftBias.x;
332 pwrap.y = p.y * (1.0 + 0.40 * audioEnergy) + sqrtTerm + drift * 0.073 + polyTerm + driftBias.y;
335 float chromaShift = (0.0015 + audioEnergy * 0.005) * mix(0.5, 2.0,
amp_high);
337 vec2 off = normalize(pwrap + 1e-6) * chromaShift;
341 finalRGB.r = texture(samp, u0 + off).r;
342 finalRGB.g = texture(samp, u0).g;
343 finalRGB.b = texture(samp, u0 - off).b;
347 float pulse = 0.5 + 0.5 * clamp(
348 log(1.0 + abs(drift) * 0.08 + rD * (5.0 + audioEnergy * 6.0)) * 0.33
353 finalRGB *= (0.85 + 0.15 * pulse);
355 float vign = 1.0 - smoothstep(0.5, 1.5, distFromCenter);
356 finalRGB *= (vign + audioEnergy * 0.3);
359 finalRGB *= 1.0 + audioEnergy * 0.8;
360 finalRGB = mix(finalRGB, finalRGB.zyx, audioEnergy * 0.4);
362 color = vec4(clamp(finalRGB, 0.0, 1.0), baseTex.a);