58 float bass = texture(
spectrum, 0.04).r;
59 float mid = texture(
spectrum, 0.20).r;
60 float hiMid = texture(
spectrum, 0.35).r;
61 float treble = texture(
spectrum, 0.55).r;
62 float air = texture(
spectrum, 0.78).r;
65 vec2 centered = uv - 0.5;
68 centered = abs(centered);
72 vec3 result = vec3(0.0);
73 float totalWeight = 0.0;
75 for (
float i = 0.0; i < 8.0; i++) {
76 float scale = 1.0 + i * (0.15 + bass * 0.1);
77 float rotation = i * 0.1 * (1.0 + mid);
78 vec2 echoUV = (uv - 0.5);
80 echoUV = mat2(c, -s, s, c) * echoUV;
81 echoUV = echoUV * scale + 0.5;
84 float freq = texture(
spectrum, i * 0.08 + 0.02).r;
85 vec3 samp_col = texture(samp, echoUV).rgb;
88 float hueOff = i * 0.12 +
iTime * 0.2;
89 samp_col *=
rainbow(hueOff + freq);
91 float w = 1.0 / (1.0 + i * 0.5);
92 result += samp_col * w;
95 result /= totalWeight;
98 float dist = length(centered);
100 result = mix(result, result * grad, 0.3 + treble * 0.2);
103 float ripple = sin(dist * 30.0 -
iTime * 4.0) * hiMid * 0.02;
105 result = mix(result, rippled, 0.2);
111 result = mix(result, vec3(1.0) - result, smoothstep(0.9, 1.0,
amp_peak));
113 color = vec4(result, 1.0);