Shattering with a Voronoi field
Built on cellular noise, SIGGRAPH 1996 by Steven Worley. Sources for this reference
Breaking a shape usually means generating geometry: cell polygons, a mesh per shard, a physics body each. None of that is required if the shape is already a field. A Voronoi partition plus one trick gives you the whole effect per pixel.
The trick is evaluating in rest space
The instinct is to move the pieces and then try to cut them out of the field where they now are. That does not work, because the shape is defined where it started, not where the piece has flown to.
So invert it. For the pixel you are shading, work out which cell it belongs to, undo that cell's motion and rotation, and evaluate the original unbroken shape at the result. Every shard is the same function sampled in a different frame, and the fragments fit together perfectly because they were never actually separated.
vec2 local = p - drift; // undo translation
local = rotate(local - c, -spin) + c; // undo rotation about the piece
float body = sdCircle(local, 0.62); // the ORIGINAL shape, in rest space
The cell boundary is the cut
The standard Voronoi edge metric is F2 - F1, the difference between the
distances to the two nearest sites. It is zero exactly on a cell boundary and grows
inward, so it works directly as a distance to the cut. Intersect the body with it and
each pixel keeps only the part of the shape belonging to its own cell.
Widening that seam over time is what makes it read as breaking rather than sliding. A shard that separates without a visible cut looks like the shape simply came apart at a texture, not along a break.
What this costs
Nine site evaluations for the Voronoi lookup, one shape evaluation, and a handful of arithmetic. No buffers, no mesh generation, no per-shard draw calls, and the piece count is a uniform rather than a memory allocation. Going from 40 shards to 400 is a single number.
The limit is honest though: every pixel pays for the partition whether or not it is near a break, and pieces cannot collide with anything, because there are no bodies to collide. This buys a visual break, not a simulation.
Rules of thumb
- Undo the piece's motion and evaluate the original shape. Never carve a moving field.
F2 - F1is your cut distance. It is zero on the boundary by construction.- Widen the seam over time, or it reads as sliding rather than breaking.
- Give the cut interior its own brighter material. A fresh face should not look like the outside surface.
- Derive per-piece motion from a hash of the cell id, so it is stable frame to frame and needs no state.
One email when something new goes up. No newsletter, no schedule, nothing else.
Double opt-in, so watch for a confirmation email. Unsubscribe any time.