← ⚗️ Chemistry

🧫 2D Reaction-Diffusion

Gray-Scott model — plain 2D canvas grid
Presets
Colour palette
Grid128 × 128
Steps/frame10
Mean V—
Click / drag — seed chemical V · Panel — adjust f / k parameters

What It Demonstrates

The same Gray-Scott reaction-diffusion chemistry as the 3D shader version, but solved with a real, inspectable numeric loop on a plain 2D canvas: two chemicals U and V diffuse across a 128×128 grid and react, self-organising into spots, stripes, mazes and self-replicating blobs purely from local rules.

How to Use

Click or drag on the canvas to seed chemical V at the cursor. Drag the feed rate (f) and kill rate (k) sliders to switch pattern families, or jump straight to a preset. The Speed slider sets PDE steps per frame; Pause freezes the grid so you can inspect a frozen pattern.

Did You Know?

Unlike the GPU shader version, this simulation updates every one of its 16,384 grid cells with an explicit JavaScript loop each step — genuinely computing the same nine-point discrete Laplacian a fragment shader would, just on the CPU where you can read the exact arithmetic in the page source.