How Wave Function Collapse Works
Procedural generation from local constraints
Wave Function Collapse (WFC) generates complex patterns from simple rules. Start with a small example and watch the algorithm propagate constraints to fill an entire grid, volume, or sequence.
-
001
Intermediate The 2D Simple Tiled Model
Observe, collapse, propagate -- the canonical Wave Function Collapse loop, running on a 2D grid you can watch.
-
002
Intermediate 3D Isometric WFC
Six neighbours instead of four -- the same algorithm, one dimension up, rendered with an isometric camera.
-
003
Intermediate WFC for Music
A one-dimensional WFC where the tiles are chords, the adjacency rules come from music theory, and everything plays through Web Audio.
-
004
Intermediate WFC for Text
A 1D WFC where the tiles are syllables, words, and sentence fragments -- and adjacency encodes linguistic structure.
-
005
Advanced The Overlapping Model
Instead of hand-authored tiles, learn adjacency rules from a sample image -- then grow a bigger image that is locally similar everywhere.
Going Deeper
Robustness and speed -- making WFC work reliably and efficiently at scale.
-
006
Advanced Constraints & Backtracking
What happens when WFC paints itself into a corner -- failure recovery, constraint propagation strategies, and how to make collapse more robust.
-
007
Advanced Performance & Entropy Heuristics
Making WFC fast -- smarter cell selection, acceleration structures, and techniques for real-time generation.