Turing Pattern (2D Reaction-Diffusion)

Gray-Scott activator-inhibitor model, solved directly on a 2D grid with a finite-difference Laplacian — the canonical way to render Turing patterns.

Step: 0
Pattern: Spots
F: 0.035 K: 0.065

Click or drag on the field to inject inhibitor (chemical B) by hand.

How it works

Two chemical fields — activator A and inhibitor B — occupy every cell of a grid and evolve under the Gray-Scott reaction-diffusion equations:

∂A/∂t = DA∇²A − AB² + F(1−A)
∂B/∂t = DB∇²B + AB² − (F+K)B

Each frame, a weighted 9-point Laplacian approximates diffusion (∇²) for both fields directly on the 2D grid, then the reaction term AB² (autocatalytic — B feeds on itself while consuming A) is applied, along with the feed rate F (replenishing A) and kill rate K (removing B). Because the inhibitor diffuses faster than the activator, a uniform field is unstable: small random perturbations grow into a periodic pattern whose shape — spots, stripes, or a maze-like labyrinth — depends entirely on F and K.