---
id: "reaction-diffusion-textures"
title: "Reaction-Diffusion Textures (Turk)"
aliases: [Gray-Scott, Turing patterns, reaction-diffusion]
domain: "procgen"
stage: "procedural"
realtime: "interactive"
platforms: [webgl2, webgpu, desktop-gpu, cpu, python, houdini, blender]
year_introduced: 1991
inputs: [mesh, texture]
outputs: [texture, uv-atlas]
style: "both"
dynamic: "dynamic"
cost: "medium"
authority: "Turk, 1991"
url: "https://texelatlas.vercel.app/t/reaction-diffusion-textures/"
sources_verified_at: "2026-11-29"
---
# Reaction-Diffusion Textures (Turk) (Turk, 1991)

> Simulate two interacting chemicals that diffuse at different rates to produce spots, stripes, labyrinths and other organic patterns, either in texture space or directly over a mesh surface.

## Reach for it when

- want organic bump or colour maps like animal skin
- need coral, spots and labyrinth textures on a mesh
- emergent growth patterns rather than noise
- pattern should flow across a surface without uv seams

## How it works

Two scalar fields A and B evolve by dA/dt = Da*laplacian(A) - A*B^2 + f(1-A) and dB/dt = Db*laplacian(B) + A*B^2 - (k+f)B (Gray-Scott), where diffusion rates differ and feed f and kill k select the pattern regime: spots, worms, mazes, solitons. Turk's contribution is running the simulation on arbitrary surfaces: generate a uniform point mesh over the surface, compute Laplacians in that mesh, and render the chemical concentration as a texture, so patterns follow the geometry without UV distortion. Alternatively, the simulation runs on a 2D grid in texture space, as ping-pong render targets in a fragment shader. Anisotropic diffusion or spatially varying f and k create stripes oriented along a direction field or patterns that change across a surface.

## When to use it

Choose it for animal-coat patterns, corals, organic bump or colour maps and growth effects that should feel emergent. Prefer [Domain Warping](https://texelatlas.vercel.app/t/domain-warping.md) for cheaper swirled textures without simulation, [Perlin Noise (gradient lattice noise)](https://texelatlas.vercel.app/t/perlin-noise.md) family for stateless patterns, and [Wang Tiles (Aperiodic Tile Synthesis)](https://texelatlas.vercel.app/t/wang-tiles.md) when you need tileable texture synthesis from a source.

## Cost

medium — A few texture passes per simulation step; thousands of steps required for patterns to emerge, so interactive on GPU but seeded offline for bakes.
Measured GPU Weight: 1.92× baseline (feather) — 0.0631 ms median / 0.065 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 1.42× baseline (feather) — 0.0226 ms median (2.79× faster on L4).
Ampere A100 scaling: 1.08× baseline (feather) — 0.0312 ms median (2.02× faster on A100).

## Failure modes

- Pattern depends on seed and parameters in a narrow regime: slightly off f,k values die out to a flat field or blow up
- Texture-space simulation shows distortion and seams on UV-mapped meshes
- Time step too large makes explicit Euler integration unstable (checkerboard or NaNs)
- Result is not tileable unless the grid wraps
- Mesh-based versions need uniformly sampled vertices; irregular meshes produce directional artifacts

## Dataflow

- Inputs: mesh, texture
- Outputs: texture, uv-atlas
- Platforms: webgl2, webgpu, desktop-gpu, cpu, python, houdini, blender

## Presets

### Toy Turing-pattern look (plane-wave approximation, not a simulation) (glsl-fragment; rendered 2026-11-29)

```json
{
  "WAVES": 6,
  "WAVELENGTH": 0.07,
  "BLEND": 0.6
}
```

```glsl
// Toy: Turing-style spots/stripes/labyrinth via superposed plane waves at one wavelength (the linear-regime look of reaction-diffusion), not a simulation.
const int WAVES = 6;
const float WAVELENGTH = 0.07;
const float BLEND = 0.6;   // 0 = spots-like, 1 = labyrinth-like threshold shift
float h(float n) { return fract(sin(n * 91.345) * 43758.5453); }
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
    vec2 uv = fragCoord / iResolution.xy;
    vec2 p = uv + 0.03 * vec2(sin(uv.y * 9.0 + iTime * 0.2), cos(uv.x * 8.0));
    float s = 0.0;
    for (int i = 0; i < WAVES; i++) {
        float a = 3.14159 * (float(i) + 0.3 * h(float(i))) / float(WAVES);
        vec2 k = vec2(cos(a), sin(a)) * 6.2831 / WAVELENGTH;
        s += cos(dot(k, p) + 6.2831 * h(float(i) + 3.0));
    }
    s /= float(WAVES) * 0.5;
    // regime sweep: top of the image has spots (offset threshold), bottom has stripes/labyrinth
    float thr = mix(0.9, 0.0, smoothstep(0.1, 0.9, uv.y) * BLEND + (1.0 - BLEND) * 0.0 + 0.4 * smoothstep(0.1, 0.9, uv.y));
    float u = smoothstep(thr - 0.12, thr + 0.12, s);
    vec3 col = mix(vec3(0.95, 0.9, 0.75), vec3(0.12, 0.1, 0.3), u);
    col = mix(col, vec3(0.8, 0.3, 0.2), smoothstep(0.15, 0.0, abs(s - thr)) * 0.5);
    fragColor = vec4(pow(col, vec3(0.8)), 1.0);
}

```

Attribution: written for this index

## Sources

1. [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)
2. [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. "Reaction-Diffusion Textures (Turk)." https://texelatlas.vercel.app/t/reaction-diffusion-textures/ (accessed 2026-12-01).
