---
id: "gray-scott-reaction-diffusion"
title: "Gray-Scott reaction-diffusion"
aliases: [Turing patterns, Gray-Scott]
domain: "simulation"
stage: "simulation"
realtime: "interactive"
platforms: [webgl2, webgpu, desktop-gpu, cpu]
year_introduced: 1993
inputs: [texture]
outputs: [texture, heightfield]
style: "both"
dynamic: "dynamic"
cost: "cheap"
authority: "Pearson, 1993"
url: "https://texelatlas.vercel.app/t/gray-scott-reaction-diffusion/"
sources_verified_at: "2026-11-29"
---
# Gray-Scott reaction-diffusion (Pearson, 1993)

> Two chemicals diffusing and reacting on a grid or surface produce spots, stripes, mazes and coral-like patterns that can drive textures, displacement or growth.

## Reach for it when

- want spots, stripes or maze patterns that grow
- need animal-coat or coral textures that evolve
- static noise textures look too artificial
- generate organic self-organising patterns on a grid

## How it works

Two concentration fields A and B update by `A' = A + (Da*lap(A) - A*B*B + f*(1-A))*dt` and `B' = B + (Db*lap(B) + A*B*B - (k+f)*B)*dt`. The feed rate `f` and kill rate `k` pick the regime: spots, worms, mazes, solitons. The Laplacian is a 3x3 stencil on a texture; on GPUs the update is a ping-pong fragment pass or compute pass, run many substeps per frame because the system evolves slowly. On meshes the Laplacian is a cotangent or graph Laplacian, or the pattern is simulated in a UV atlas (Turk, Witkin and Kass). The resulting B field is mapped to colour, bump, or used as a mask for growth and material.

## When to use it

Choose it when you want organic, self-organising patterns (animal coats, coral, cracks of paint, worm textures) that animate or evolve. Prefer [Physarum agent transport networks](https://texelatlas.vercel.app/t/physarum-transport-networks.md) when you want branching network paths, noise-based procedural textures when you need direct per-pixel evaluation without a simulation state, and [Stable Fluids](https://texelatlas.vercel.app/t/stable-fluids.md) when the pattern should advect with flow.

## Cost

cheap — Cheap on a 512^2 grid but needs several substeps per frame.
Measured GPU Weight: 3.11× baseline (light) — 0.1022 ms median / 0.1056 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 2.73× baseline (light) — 0.0434 ms median (2.35× faster on L4).
Ampere A100 scaling: 1.98× baseline (feather) — 0.0569 ms median (1.8× faster on A100).

## Failure modes

- Parameter space is narrow; most (f,k) values give a flat or dead field
- Pattern is resolution dependent: features scale with the grid and Da/Db
- Explicit stencil requires small dt to stay stable
- On meshes with uneven triangles, patterns stretch and have visible seams in UV space

## Dataflow

- Inputs: texture
- Outputs: texture, heightfield
- Platforms: webgl2, webgpu, desktop-gpu, cpu

## Presets

### Analytic reaction-diffusion look (no simulation) (glsl-fragment; rendered 2026-11-29)

```json
{
  "SCALE": 9,
  "WARP": 0.55,
  "EDGE": 0.18
}
```

```glsl
// GLSL ES 3.0 - analytic Turing-pattern look (no buffers); written for this index
const float SCALE = 9.0;     // pattern frequency
const float WARP = 0.55;     // domain-warp strength
const float EDGE = 0.18;     // softness of the spot/stripe edge
const vec3 COL_A = vec3(0.04, 0.07, 0.16);
const vec3 COL_B = vec3(0.95, 0.80, 0.45);

float waves(vec2 p, float t) {
  float s = 0.0;
  for (int i = 0; i < 6; i++) {
    float a = 6.2831853 * float(i) / 6.0 + 0.3 * sin(t * 0.2 + float(i));
    s += cos(dot(p, vec2(cos(a), sin(a))) + 1.7 * float(i));
  }
  return s / 3.0;
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  vec2 p = uv * SCALE;
  float t = iTime;
  p += WARP * vec2(sin(p.y * 0.7 + t * 0.3), cos(p.x * 0.7 - t * 0.25));
  float v = waves(p, t);
  v += 0.35 * waves(p * 2.1 + 3.0, t);
  float m = smoothstep(-EDGE, EDGE, v);
  float rim = exp(-pow(v / 0.35, 2.0));
  vec3 col = mix(COL_A, COL_B, m);
  col += 0.25 * rim * vec3(0.3, 0.5, 0.7);
  fragColor = vec4(col, 1.0);
}

```

Attribution: written for this index; an analytic approximation of the look, not a simulation

## Combination ideas

- [Tiger-bush drylands](https://texelatlas.vercel.app/ideas/patterned-dryland-vegetation/)

## Sources

1. [primary] John E. Pearson (1993) Complex Patterns in a Simple System. Science. https://doi.org/10.1126/science.261.5118.189 (verified via crossref on 2026-11-29)
2. [primary] Greg Turk (1991) Generating textures on arbitrary surfaces using reaction-diffusion. Proceedings of the 18th annual conference on Computer graphics and interactive techniques. https://doi.org/10.1145/122718.122749 (verified via crossref on 2026-11-29)
3. [primary] Andrew Witkin, Michael Kass (1991) Reaction-diffusion textures. Proceedings of the 18th annual conference on Computer graphics and interactive techniques. https://doi.org/10.1145/122718.122750 (verified via crossref on 2026-11-29)
4. [tutorial] Karl Sims Reaction-Diffusion Tutorial. karlsims.com. https://www.karlsims.com/rd.html (verified via http on 2026-11-29)

## Cite this entry

Texel. "Gray-Scott reaction-diffusion." https://texelatlas.vercel.app/t/gray-scott-reaction-diffusion/ (accessed 2026-12-01).
