The Reaction-Diffusion Painter — Wet Ink That Thinks
Click anywhere to seed chemistry. The Gray-Scott reaction-diffusion model runs on the GPU and self-organizes into stripes, spots, mazes, mitosis, or chaos depending on the parameters.
What this is
The Gray-Scott reaction-diffusion equations running on a GPU fragment shader at 1024×1024. Two chemical species, U and V, governed by Karl Sims' classic equations. Click anywhere to seed a perturbation. Pick a preset (Coral, Zebra, Solitons, Mazes, Spots, Mitosis, Chaos) or fiddle with feed/kill rate sliders directly. Save the result as a PNG. Four color palettes. R to reset.
Why this is mind-blowing
You're watching the same equations Alan Turing wrote about in 1952 — the equations that explain why zebras have stripes — running in your browser at 60fps and producing a different pattern each time. Click, watch chemistry emerge. The PNG export means every session can produce a wallpaper.
Build a single-file art tool where the canvas runs the Gray-Scott
reaction-diffusion model on a GPU fragment shader at 1024×1024 with
ping-pong framebuffers. Clicking seeds a chemical perturbation. The
pattern self-organizes into stripes, spots, mazes, mitosis, or chaos
depending on parameters. Sliders for feed/kill rates with named presets
(Coral, Zebra, Solitons, Mazes, Spots, Mitosis, Chaos). Save the current
state as PNG. Multiple color palettes. Make it feel like wet ink that
thinks.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- RG16F float textures give you the precision the simulation needs. EXT_color_buffer_float is widely supported; fall back to RGBA8 if not.
- Run 12 sub-steps per visible frame. The simulation is faster than your monitor — let the patterns form quickly without sacrificing the 60fps display rate.
- Named presets matter. 'Coral, F=0.0545, k=0.062' is more useful than two unlabeled sliders, even though it's the same parameters.