频谱柱
左为低频、中为中频、右为高频的均衡器柱。
GLSL 源码
// Band bars — lows on the left, mids in the centre, highs on the right. A 4-beat ripple shakes their height.
vec2 prim(vec2 uv) {
float n = floor(uParams.x);
float i = floor(uv.x * n);
float f = fract(uv.x * n);
float t = i / n;
float b = t < 0.25 ? uBass : (t < 0.6 ? uMid : uHigh);
float h = 0.06 + 0.6 * b * (0.55 + 0.45 * sin(i * 1.7 + uBeat * TAU / 4.0));
float gap = uParams.y * 0.5;
float bar = step(gap, f) * step(f, 1.0 - gap) * step(uv.y, h);
float l = bar * (0.55 + 0.45 * uv.y / max(h, 0.01));
return vec2(l, bar);
}
一个使用通用 uniform 约定(uBeat · uBass · uKick …)的 vec2 prim(vec2 uv) 函数,只输出 luma 与 alpha。