Glowing Metaballs
This effect renders smoothly merging, floating blobs that flow and interact like liquid metal in a lightweight, interactive 3D animation. It also respects the user’s reduced motion preference, showing a static image instead of animating when that accessibility setting is enabled.
Fluid Dynamics for People Who Skipped Physics
Turning Simple Ideas into Shader Nightmares
Organic, Fluid, and Alive
Metaballs on the Landing Page
Glowing Metaballs Generator
To create a new effect, use the generator, then click the Export code button and paste the code into the Supa Code Block element to replace the current effect.

Instructions
speed: 1 — Controls how fast time passes in the animation. It’s a multiplier applied to the frame delta time (time += dt * cfg.speed). At 1, everything moves at normal speed. Set it to 0.5 and the blobs float at half speed; set it to 3 and everything gets frantic. This only affects movement speed — not color cycling (that has its own option). A value of 0 effectively freezes the motion (same as paused).
zoom: 1.7 — Scales the camera view. In the shader, the UV coordinates are divided by uZoom, so a higher value zooms in (blobs appear bigger and closer), while a value below 1 zooms out, revealing more space around the metaball cloud. At 1.7 in this config, the blobs fill more of the frame than they would at the default.
animRadius: 2 — Multiplies the spatial extent of the ball positions. Every motion path (orbit, lissajous, vortex, etc.) computes a base position and then multiplies it by uRadius. Higher values spread the balls out over a larger volume — the whole structure gets bigger and looser. Lower values (like 0.5) compress them together, making them merge into one dense blobby mass more often. In this config it’s 2, so the balls roam a wide area.
balls: 7 — How many metaballs are rendered. Internally it’s rounded and clamped between 1 and 12 (the MAX_BALLS constant). Each ball contributes to the shared “energy field” that gets merged into the blobby surface, so more balls = more complexity and more merging, but also slightly higher GPU cost since the metaball function loops over each ball per ray-marching step.
animation: 2 — Selects the motion style. It’s rounded and clamped between 0 and 5. The styles are:
- 0 — Orbit: layered sine-wave orbits; the classic flowing metaball look.
- 1 — Lissajous: closed figure-eight / knot-style curves, ball positions following overlapping sine frequencies.
- 2 — Pulse: radial breathing — balls expand outward and contract inward rhythmically around a center. ← this config uses this one
- 3 — Vortex: tight helixes spinning around the vertical Y axis, like a tornado.
- 4 — Drift: slow, loose floating as if suspended in a cloud.
- 5 — Chaos: entangled, unpredictable wandering with irregular sine/cos combinations.
ballSizeMin: 1 — The size of the first ball (index 0). Each ball’s influence radius is derived from this. Smaller values make that ball contribute a smaller, tighter lump to the field.
ballSizeMax: 2 — The size of the last ball. The sizes of all balls in between are linearly interpolated (ramped) between ballSizeMin and ballSizeMax, so with 1 → 2 you get a gradient of small-to-large balls. Set both to the same value for uniformly sized balls. In this config the balls grow progressively bigger across the sequence.
hue: 0 — A static hue rotation applied to the final color. It’s converted to radians (hue * 2π), so it’s in units of full color-wheel turns: 0.5 shifts colors by half the wheel (e.g., reds become cyans), 1.0 cycles all the way back to the start. At 0, no shift.
hueSpeed: 2 — Makes the hue animate over time. In the shader, the three light sources’ colors are continuously hue-shifted by time * hueSpeed, so the lighting colors cycle through the spectrum. With 2, the light colors complete about a third of the color wheel per second — the blobs’ lighting constantly flows through rainbow tones. Set to 0 to lock the colors. Note this affects the lighting hue; the final image is also affected by the static hue shift.
saturation: 1 — Color saturation. 1 is fully saturated (normal), 0 is completely grayscale (the shader mixes the color with its luminance), values in between dial it down. Values above 1 would over-saturate beyond the original. At 1 here, colors are as vivid as rendered.
rgbShift: 0 — Chromatic aberration strength. When greater than 0, the renderer uses a two-pass approach: it draws the scene to an offscreen framebuffer, then a post-processing pass re-samples it three times (once each for red, green, and blue channels), offsetting each sample radially outward/inward from the screen center. This creates the classic RGB fringe/glitch effect, stronger toward the edges of the frame. At 0 (as in this config) the post pass is skipped entirely for better performance.
glow: 1 — Brightness multiplier applied before tone mapping (1.0 - exp(-col * 1.25)). Higher values push the colors hotter, making bright areas bloom toward white. Lower values darken the blobs. 1 is the neutral setting.
paused: false — Whether the animation clock advances. When true, time stops increasing but frames are still drawn (so a paused but still-rendering static scene). Also controllable later via the API’s .pause() / .resume() methods. Here it starts unpaused.
pixelRatio: 1.25 — Caps the render resolution. The canvas size is computed as CSS size × min(devicePixelRatio, pixelRatio). On a retina display with devicePixelRatio = 2, this option limits rendering to 1.25× so it doesn’t render at full retina resolution — a performance saver for this fairly expensive ray-marching shader. Set it higher (e.g., 2) for sharper output on hi-DPI screens at the cost of FPS.
respectReducedMotion: true — Accessibility flag. When true, it listens to the CSS media query prefers-reduced-motion: reduce. If the user has requested reduced motion in their OS/browser settings, the animation renders one static frame at a fixed time (STATIC_TIME = 1.5 seconds in) instead of animating, and stops the render loop. If the user changes the setting live, it reacts accordingly. Set to false to always animate regardless of the user’s preference (generally not recommended for accessibility).