Alan Turing (1952) showed that two chemicals — an activator and an inhibitor — reacting and diffusing across a sheet can spontaneously break symmetry to form spots, stripes, and labyrinths. This is thought to underlie coat patterns on animals, fingers, and coral organisation.
F: 0.035
K: 0.065
Pattern: Spots (leopard)
Renderer: -
How it works
This runs the Gray-Scott model (a canonical Turing-type system) entirely on the GPU: two ping-ponged WebGL float render targets hold chemical A (activator) and B (inhibitor), and a GLSL fragment shader advances every cell in parallel each frame with a 9-point Laplacian. A display shader maps chemical B to a biology-flavoured palette.
∂A/∂t = DA∇²A − AB² + F(1−A)
∂B/∂t = DB∇²B + AB² − (F+K)B
The term AB² is autocatalytic: B reacts with A twice to produce more B, while consuming A. The feed rate F replenishes A; the kill rate K removes B. Different (F,K) values give leopard spots, zebra stripes, coral/brain labyrinths or giraffe-style cracked patches.
Why patterns form: Alan Turing's 1952 insight (The Chemical Basis of Morphogenesis) was that an activator–inhibitor pair, where the inhibitor diffuses faster, can break symmetry from a near-uniform state — short-wavelength perturbations grow while long ones die, producing the periodic structures seen on animal coats, coral and even embryonic digit spacing.
🐆 Turing Patterns (Gray-Scott, GPGPU)
About this simulation
Alan Turing showed in 1952 that two chemicals — an activator and a faster-diffusing inhibitor — reacting and diffusing across a sheet can spontaneously break symmetry into spots, stripes and labyrinths. The same maths is thought to set animal coat markings, coral structure and the spacing of fingers in an embryo. This simulation runs the Gray-Scott reaction-diffusion equations on your GPU as a WebGL/GLSL fragment shader.
Turing published this years before computers could draw the patterns. In 2012 biologists confirmed Turing-like chemistry really does control the spacing of digits in mouse paws.
About Turing Patterns
This simulation reproduces the spontaneous biological patterns Alan Turing described in 1952, using the Gray-Scott reaction-diffusion model. Two virtual chemicals — activator A and inhibitor B — spread and react across a 400×400 grid, governed by ∂A/∂t = DA∇²A − AB² + F(1−A) and ∂B/∂t = DB∇²B + AB² − (F+K)B. The autocatalytic AB² term lets B breed while consuming A.
It runs entirely on your GPU as a WebGL fragment shader, advancing every cell each frame with a 9-point Laplacian. The Feed (F) and Kill (K) sliders, plus presets for leopard spots, zebra stripes, coral labyrinths and giraffe patches, tune which pattern emerges; palette and speed controls and click-to-paint let you steer it. The same maths is thought to set animal markings and embryonic digit spacing.
Frequently Asked Questions
What is a Turing pattern?
A Turing pattern is a spontaneous, repeating arrangement such as spots, stripes or maze-like labyrinths that emerges from two interacting chemicals diffusing across a surface. Alan Turing proposed in 1952 that this reaction-diffusion mechanism could explain how uniform tissue self-organises into structured biological markings.
What model does this simulation actually use?
It uses the Gray-Scott model, a well-known reaction-diffusion system of the Turing type. Two chemical fields, an activator A and an inhibitor B, evolve on a 400 by 400 grid according to coupled partial differential equations with the nonlinear reaction term AB squared.
What do the Feed and Kill sliders do?
The Feed rate F controls how quickly chemical A is replenished, and the Kill rate K controls how quickly chemical B is removed. Together these two numbers decide which pattern forms: small changes shift the result between spots, stripes, labyrinths and patchy giraffe-like shapes.
Why do patterns appear at all?
Turing showed that when an inhibitor diffuses faster than an activator, a near-uniform state becomes unstable. Short-wavelength disturbances grow while long ones fade, so the system settles into a periodic structure with a characteristic spacing rather than staying flat.
What are the activator and inhibitor here?
Chemical A acts as the activator and chemical B as the inhibitor. In the Gray-Scott equations B is autocatalytic through the AB² term, meaning it promotes its own production while consuming A, and the displayed colour maps the concentration of B.
How does the simulation compute each step?
It runs on the GPU using two ping-ponged WebGL float textures that store the A and B fields. A GLSL fragment shader updates every cell in parallel each frame, using a weighted 9-point Laplacian to approximate diffusion before applying the reaction terms.
What do the presets correspond to?
Each preset loads a tuned pair of Feed and Kill values. Spots uses about F 0.035 and K 0.065, stripes about 0.022 and 0.051, labyrinth about 0.029 and 0.057, and giraffe about 0.039 and 0.058. Moving a slider switches you to Custom.
Can I draw into the simulation?
Yes. Clicking or dragging on the canvas paints fresh blobs of chemical B under the cursor, which then react and spread according to the current Feed and Kill settings. The Re-seed button scatters new random blobs and Reset restarts from the spots preset.
Is this physically accurate?
It is a faithful numerical solution of the Gray-Scott equations, which are a recognised mathematical model of Turing-type pattern formation. It is a simplified abstraction rather than a literal map of any specific biological reaction, but it captures the essential activator-inhibitor mechanism correctly.
Where do Turing patterns appear in real life?
The same reaction-diffusion mathematics is thought to underlie animal coat markings such as leopard spots and zebra stripes, the ridged surface of coral and brain tissue, and the regular spacing of fingers. In 2012 researchers confirmed Turing-like chemistry helps set digit spacing in mouse paws.