液态团块
融合又分离的元球,随低频膨胀。
GLSL 源码
// Liquid metaball blobs. Lissajous orbits close in whole turns over 16 beats — seamless. Lows inflate the blobs.
vec2 prim(vec2 uv) {
vec2 p = asp(uv);
float field = 0.0;
float rad = (0.09 + uBass * 0.07) * uParams.y;
for (int i = 0; i < 8; i++) {
if (float(i) >= uParams.x) break;
float fi = float(i);
float t = uBeat * TAU / 16.0;
vec2 c = vec2(sin(t * (1.0 + mod(fi, 2.0)) + fi * 2.1), cos(t * (1.0 + mod(fi, 3.0)) + fi * 1.3)) * vec2(0.55, 0.32);
field += rad * rad / max(dot(p - c, p - c), 1e-4);
}
float l = smoothstep(0.8, 1.25, field) * 0.75 + clamp(field * 0.15, 0.0, 0.25);
return vec2(l, smoothstep(0.3, 1.0, field));
}
一个使用通用 uniform 约定(uBeat · uBass · uKick …)的 vec2 prim(vec2 uv) 函数,只输出 luma 与 alpha。