Metaballs

Version 14 of 21

Blinn field, raymarched.

1982 meets 2010 · 1982/2010

This version

Real exp() fields like Blinn's. Fixed steps along the ray, bisection for the edge, normal = gradient.

How this version works

At render scale 0.6, this shader sums five exponential fields of the form exp(-3.2 times squared distance). Rays advance in fixed 0.04-unit steps until the field exceeds 0.45, then six bisections refine the crossing. The outward normal comes from the negative field gradient, and a time-varying cosine palette receives diffuse lighting and a specular highlight.

The trick in this version

An exponential density field is not a distance field, so this code uses fixed steps rather than sphere tracing. Bisection improves intersection accuracy without requiring uniformly tiny steps.

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
1982 meets 2010
Era
GPU
Rendered on
GPU
Tags
3D · exp field
Sources
SDF & smooth minimum (~2008)Numb Res (2011)