Gray-Scott reaction-diffusion. Click to seed new chemical clusters; press space to cycle through five presets (Coral, Mitosis, Spots, Maze, Waves).
In 1952, Alan Turing published a paper called "The Chemical Basis of Morphogenesis." The argument: two chemicals diffusing at different rates through a tissue can spontaneously break symmetry and produce stable spatial patterns. Spots on a leopard, stripes on a zebrafish, ridges on a fingerprint. The math predicts them all from the same pair of coupled partial differential equations. Thirty years later, Peter Gray and Stephen Scott studied a specific autocatalytic reaction scheme that generates exactly this kind of instability. Their model uses two species, U and V. U fills the system at a constant feed rate f. V consumes U through the reaction U + 2V → 3V and decays at kill rate k. Both species diffuse, with U spreading roughly twice as fast as V.
The surprise is how much structure falls out of so little. Tweak f and k by a hundredth and the system jumps between coral-like branching, mitotic spot division, stable polka dots, labyrinthine mazes, and traveling waves. The five presets in this visualization span that range. Pearson's 1993 survey catalogued the parameter space and found at least twelve qualitatively distinct pattern classes, all from the same two equations.
The simulation runs on a 256×180 grid with wraparound boundaries. Each frame advances eight timesteps. The core computation is a discrete Laplacian (the sum of four neighbors minus four times the center) applied to both U and V, then plugged into the Gray-Scott update:
const lapU = u[y*GW+xL] + u[y*GW+xR] + u[yU*GW+x] + u[yD*GW+x] - 4*u[i]; const lapV = v[y*GW+xL] + v[y*GW+xR] + v[yU*GW+x] + v[yD*GW+x] - 4*v[i]; const uvv = ui * vi * vi; u2[i] = ui + Du*lapU - uvv + f*(1 - ui); v2[i] = vi + Dv*lapV + uvv - (f + k)*vi;
That's the entire physics. Five multiplications, a handful of additions, and a clamp. The Laplacian handles diffusion. The uvv term handles the autocatalytic reaction. The feed and kill terms push the system away from equilibrium. Colors map V concentration through a five-band palette: near-black at low concentration, deep purple, teal, bright cyan, then white at saturation. The result looks organic because it is organic, at least in the mathematical sense. The same equations describe the ferrocyanide-iodate-sulfite reaction in a petri dish, where self-replicating spots were first observed experimentally.
What Turing proposed as a thought experiment in 1952 turned out to describe real chemistry and real biology. The Gray-Scott model is one clean instantiation of that idea: proof that complex spatial order doesn't require a blueprint. Two chemicals and a gradient are enough.
← Back to showcase