Metaballs

Version 13 of 21

GPU per-pixel glow.

pixel shaders, 2000s · 2000s

This version

The same field as the CPU version, but as a fragment shader: free at full resolution.

How this version works

A fragment shader adds seven moving inverse-square fields using squared distances in aspect-corrected screen coordinates. A smooth transition between field strengths 0.95 and 1.02 separates the background glow from the fill. The exterior has a blue glow, while the interior blends from pink-red towards yellow as the field strengthens.

The trick in this version

Each fragment independently evaluates the whole field, moving the pixel loop from JavaScript onto the GPU. Squared distances avoid square roots, and this entry requests no reduced render scale.

Historical context · GPU

  1. 2002–07 · GPU vendors · GPU Gems 3

    Programmable GPU

    Pixel shaders evaluate the field per pixel. GPU Gems 3 (2007) shows marching cubes in geometry shaders and point-based metaballs on the GPU.

  2. ~2008 · Iñigo Quilez

    SDF & smooth minimum

    Iñigo Quilez popularises raymarching signed distance fields and smin(): metaball-like blending in a single line of code.

  3. 2011 · CNCD & Fairlight

    Numb Res

    CNCD & Fairlight release Numb Res at The Gathering 2011 (2nd place). A realtime SPH fluid of half a million particles on the GPU: blobs that flow, splash and are viscous, in grainy black and white.

Platform
pixel shaders, 2000s
Era
GPU
Rendered on
GPU
Tags
2D · filled
Sources
SDF & smooth minimum (~2008)Numb Res (2011)