Two virtual chemicals (U and V) diffuse across a 2D grid and react with each other according to the Gray-Scott model. U feeds V, V inhibits U, and both diffuse at different rates. The balance between feed rate (F), kill rate (k), and the diffusion ratio determines the pattern. Pearson's classification maps the (F, k) parameter space into distinct morphologies: spots, stripes, mitosis, coral growth, pulsating solitons, and labyrinthine mazes. Small shifts in these two numbers produce radically different worlds.
The reaction-diffusion update applies a discrete Laplacian stencil to approximate spatial diffusion. Each texelsamples its four cardinal neighbors, weights them against the center, and feeds the result into the Gray-Scott rate equations. The Laplacian's kernel size determines how far chemicals spread per timestep. Multiple simulation steps per frame accelerate the dynamics without changing the spatial resolution.
Each frame, a fragment shader runs the Gray-Scott equations on every texel simultaneously. Two framebuffers ping-pong the state: one reads while the other writes, then they swap. The render pass maps V concentration to color. No CPU simulation. Pure GPU.
Clicking seeds a burst of V chemical at that point, nucleating new pattern growth that propagates outward and interacts with existing structures. Moving your mouse locally shifts the feed/kill parameters, warping the dynamics in real time. Watch for areas where two pattern regimes collide. The boundary between them often produces the most visually complex behavior.
Karl Sims · Wikipedia