Skip to main content
The Metaballs shader creates up to 20 colored gooey balls that move around and merge into smooth organic shapes. Perfect for creating liquid effects, blob animations, and organic motion graphics with up to 8 different colors.

Usage

Parameters

string
default:"'#000000'"
Background color in hex format. Visible outside the metaballs.
string[]
Array of base colors for the balls in hex format. Supports up to 8 colors. Colors are assigned cyclically to the balls.
number
default:"10"
Number of balls (1 to 20). More balls create denser, more complex blob patterns.
number
default:"0.83"
Size of the balls (0 to 1). Larger values create bigger balls that merge more easily.
number
default:"1"
Animation speed multiplier. Controls how fast the balls move and merge.

Common Sizing Parameters

'none' | 'contain' | 'cover'
default:"'cover'"
How to fit the shader into the canvas dimensions.
number
default:"1"
Overall zoom level (0.01 to 4).
number
default:"0"
Rotation angle in degrees (0 to 360).
number
default:"0"
Horizontal offset (-1 to 1).
number
default:"0"
Vertical offset (-1 to 1).

Presets

Default

Ink Drops

Solar

Background

Technical Details

  • Max Balls: 20
  • Max Colors: 8
  • Algorithm: Inverse distance field blending
  • Motion: Noise-based procedural movement
  • Blending: Smooth merging using power curves
  • Anti-aliasing: Uses fwidth for smooth edges
  • Texture: Requires noise texture for movement randomization
  • Coordinates: Uses object UV coordinates
The shader creates metaballs by:
  1. Positioning each ball using noise-based procedural motion
  2. Computing inverse distance fields for each ball
  3. Accumulating color contributions weighted by field strength
  4. Applying power curves to create the characteristic gooey merging effect
  5. Smoothing edges with anti-aliasing
Fractional ball counts are supported - the last ball will have reduced size/opacity based on the fractional part.