Real frost does not spread as a smooth film — water-vapour molecules random-walk through the air above the pane until they happen to land on a growing ice crystal, and they overwhelmingly land near existing branch tips rather than in the concave gaps between them (the tips have the largest "capture cross-section"). This runaway tip-favouring is diffusion-limited aggregation (DLA), the same growth class that produces snowflakes, mineral dendrites and lightning figures.
This engine actually runs that process on a lattice model of the glass: a fixed number of walker molecules per frame perform an independent random walk over a 2D grid; a walker freezes onto the cluster only when adjacent to an occupied cell and a coin-flip against the sticking probability succeeds — otherwise it keeps wandering. Growth starts only at seed defects (scratches/dust), exactly as real frost nucleates preferentially at surface imperfections rather than on pristine glass.
Every few hundred freezes the engine box-counts the occupied lattice at several box sizes and fits a log–log slope to estimate the pattern's fractal dimension live — real DLA clusters in 2D measure D ≈ 1.71, and this simulation should land in the same 1.5–1.7 range once enough cells have frozen.
- Temperature — colder glass means a larger vapour pressure deficit driving faster, more runaway (branchier) deposition at each tip.
- Humidity — sets how many vapour-molecule walkers are released per second (more moisture, faster growth).
- Sticking probability — the classic DLA control parameter: near 1, walkers freeze on first contact and branches stay thin and open; turned down, walkers bounce around the surface first, filling gaps and thickening the arms.