레이저 부채
무대 아래에서 부채꼴로 쓸어 올리는 레이저. 킥에 굵어진다.
GLSL 소스
// A laser fan from the bottom centre of the stage. Sweeps left and right once every 8 beats and thickens on each kick.
vec2 prim(vec2 uv) {
vec2 p = vec2((uv.x - 0.5) * uResolution.x / uResolution.y, uv.y);
float beams = floor(uParams.x);
float sweep = sin(uBeat * TAU / 8.0) * uParams.y;
float ang = atan(p.x, p.y);
float dist = length(p);
float l = 0.0;
for (int i = 0; i < 24; i++) {
if (float(i) >= beams) break;
float g = (float(i) - (beams - 1.0) * 0.5) * 0.13 + sweep;
float w = 0.0025 + uKick * 0.006;
l += smoothstep(w, 0.0, abs(ang - g) * dist);
}
l = min(l, 1.0) * smoothstep(0.0, 0.08, dist);
return vec2(l, l);
}
공통 유니폼 계약(uBeat · uBass · uKick …)을 받는 vec2 prim(vec2 uv) 하나입니다. 출력은 luma 와 alpha 뿐입니다.