Growing a crack network

A crack is a path, so it is a chain of segments, so it is a distance field. The hard part is not drawing it. It is that the obvious way to generate the path produces something that does not read as fracture at all.

A crack network growing from an impact point. Straight runs, shallow branches, tapered width.

The rule that makes it read

Cracks propagate roughly straight, away from the impact, because the material is failing along the direction the stress is pulling it. They wander a little, but each step keeps the heading it already had.

// wrong: a fresh direction each step. This is a random walk and it
// reads as scribble, no matter how you tune the magnitude.
dir = randomUnitVector();

// right: keep the heading, perturb it slightly.
dir = normalize(dir + noise() * 0.22);

That is the whole difference between "cracked glass" and "someone drew on it".

Three details that carry most of the realism

  1. Taper. Widest at the impact, hairline at the tip. A constant-width crack reads as a drawn line. Width falling with distance from the origin reads as something that ran out of energy.
  2. Shallow branches. Real cracks fork at a narrow angle and one side usually continues as the dominant path. Perpendicular branches look like a grid.
  3. The bright edge. A fresh fracture surface catches light, so a thin highlight either side of the dark line does more for believability than the line itself. Remove it and the crack looks painted on.

Growth is free

Because the network is generated from a time parameter rather than simulated, the crack can advance, and it can be evaluated at any time in any order. A cutscene can scrub it backwards. Nothing accumulates.

The cost is that it is not responding to anything. It does not know where the pane is thin, does not concentrate stress at an existing flaw, and will happily run past the edge of the material unless you clip it, which is what the pane intersection does here.

Rules of thumb

  1. Perturb the heading, never resample it. That single change is most of the effect.
  2. Taper width from the impact outward, down to a hairline.
  3. Branch at shallow angles, and let one side dominate.
  4. Add a bright edge either side of the dark line. Fresh fracture catches light.
  5. Clip against the material, or cracks run off into empty space.

All 61 notes How to use them Credits