Coral shader preview: Living reaction–diffusion patterns, grown from seeds and lit like wet enamel.
ittybitty

Coral

Living reaction–diffusion patterns, grown from seeds and lit like wet enamel.

Code

Use as
Code view

Copy embed: paste into Webflow, Framer, Squarespace or any HTML · Copy for agent: paste into Cursor or Claude · Copy code: the files for your own build.

For your own build, add coral.js, ittybitty-shader.js, runtime.js and pointer.js next to this page. Highlighted values follow the controls.

<!-- Quickest: one element. Size it with CSS; it fills its box. -->
<script type="module" src="./ittybitty-shader.js"></script>
<ittybitty-shader effect="coral" style="width: 100%; height: 480px;"></ittybitty-shader>

<!-- Or with JavaScript, for full control: -->
<canvas id="coral" aria-hidden="true" style="width: 100%; height: 480px; display: block"></canvas>

<script type="module">
  import { coral } from './coral.js';

  const canvas = document.getElementById('coral');
  const effect = coral(canvas, {
    pattern: 'coral',
    speed: 1,
    scale: 1,
    colors: [[0, '#0a1f2e'], [0.3, '#145a66'], [0.55, '#d9483a'], [0.8, '#ff8f6b'], [1, '#ffdcc4']],
    lighting: 'glossy',
    relief: 1,
    glow: 0,
    evolve: 0.5,
    variation: 0,
    interactive: true,
    brush: 1,
    // Performance
    dpr: 1.5,
    adaptive: true,
  });

  // Later: effect.set(…), effect.pause(), effect.resume(), effect.destroy()
</script>

Details

Two chemicals spread, feed and decay across the canvas, and from a handful of seeds grow coral, dividing cells, zebra stripes, mazes or worms. It never settles: feed and kill rates drift slowly so different patterns meet, and patches are wiped and reseeded so fresh growth keeps running. The concentration becomes a relief, coloured by a gradient and lit as glossy wet coral, porcelain enamel or embossed foil. The pointer clears a path for the pattern to grow back into, and a press seeds new growth.

Payload
12.6 KB brotli for coral.js, ittybitty-shader.js, runtime.js and pointer.js, measured at build time.
Resolution
Device pixel ratio capped at 1.5. The chemistry runs on a grid of at most 512 cells across, stepped a few times a frame, and is lit at full resolution with bicubic smoothing.
Frame rate
Display rate.
When unseen
Stops rendering when the canvas leaves the viewport or the tab is hidden, and resumes where it left off.
Reduced motion
Shows a single still frame of a fully grown pattern. Controls still update it.
Layers
Up to five effects fuse into one shader and one draw call. Filters such as dithering and halftone process the layers beneath them.
Browsers
Any browser with WebGL2: Chrome and Edge 56+, Firefox 51+, Safari 15+.
Licence
MIT. Copy it, change it, ship it.