Curl Noise

also: curl-noise, divergence-free noise

First appeared 2007 · Robert Bridson — Introduced for procedural fluid flow by Bridson, Hourihan and Nordenstam, "Curl-Noise for Procedural Fluid Flow" (SIGGRAPH 2007). · timeline ↗

inventor-coined Name · coined by Robert Bridson (2007) — Descriptive name coined by its authors: Bridson, Hourihan & Nordenstam titled the 2007 paper "Curl-Noise for Procedural Fluid Flow".

In one line A flow technique that takes the curl of a smooth scalar potential field (typically Perlin/Simplex noise) as the velocity. Because the curl of a potential is divergence-free, the field is incompressible — particles swirl in fluid-like eddies without bunching up or thinning out.

Curl noise — incompressible swirls from the curl of a noise potential · Open in new tab ↗ · Motion begins only when you press Run.

The code

The actual sketch behind the demo above — sandboxed and reproducible. This is the whole thing.

curl-noise/index.html
// Curl noise (Bridson, Hourihan & Nordenstam, 2007): take a scalar potential
// field ψ (here Perlin noise) and use its curl as the velocity. In 2D the curl
// of ψ is (∂ψ/∂y, -∂ψ/∂x), which is divergence-free — particles neither bunch
// up nor thin out, giving incompressible, fluid-like swirls. This is the key
// difference from a plain flow field that maps noise straight to an angle.
const SEED = Math.floor(Math.random() * 1e9);
const PALETTES = [
  ['#0b0e14', '#7dd3fc', '#a78bfa', '#f0abfc'],
  ['#0d0a14', '#fcd34d', '#fb7185', '#f472b6'],
  ['#08110d', '#34d399', '#a3e635', '#fde68a'],
  ['#0b0e14', '#e2e8f0', '#94a3b8', '#cbd5e1'],
];
let pal, parts = [], NS = 0.0016, EPS = 1;

function psi(x, y) { return noise(x * NS, y * NS) * 2 - 1; }
function curl(x, y) {
  // central differences of the potential -> divergence-free velocity
  const dx = (psi(x, y + EPS) - psi(x, y - EPS)) / (2 * EPS);
  const dy = (psi(x + EPS, y) - psi(x - EPS, y)) / (2 * EPS);
  return [dx, -dy];
}

function setup() {
  randomSeed(SEED); noiseSeed(SEED);
  const s = Math.min(windowWidth, windowHeight);
  createCanvas(s, s);
  pal = PALETTES[Math.floor(random(PALETTES.length))];
  background(pal[0]);
  for (let i = 0; i < 2200; i++) {
    parts.push({ x: random(width), y: random(height), c: pal[1 + (i % (pal.length - 1))], life: random(60, 260) });
  }
}

function draw() {
  noStroke();
  fill(pal[0] + '14');
  rect(0, 0, width, height);
  for (const p of parts) {
    const [vx, vy] = curl(p.x, p.y);
    const sp = 12;
    p.x += vx * sp; p.y += vy * sp; p.life--;
    fill(p.c + 'cc');
    circle(p.x, p.y, 1.6);
    if (p.life < 0 || p.x < 0 || p.x > width || p.y < 0 || p.y > height) {
      p.x = random(width); p.y = random(height); p.life = random(60, 260);
    }
  }
}

Open the demo source ↗

How it works

Treat a noise function ψ(x, y) as a scalar potential. The velocity is its curl, which in 2D is (∂ψ/∂y, −∂ψ/∂x), estimated with central differences: sample ψ a small step ε on each side and divide. Advect particles along this velocity each frame. Unlike a plain flow field — which maps noise straight to an angle and can create sources and sinks — the curl construction is divergence-free by definition, so density is preserved and the motion reads as incompressible fluid. Boundaries and obstacles can be added by modulating the potential near them (ramping ψ to a constant) so flow goes around rather than through.

Parameters

Lineage

Precedents
Robert Bridson
Related
Flow Field / Vector Field, Perlin / Simplex Noise, Domain Warping

Works using this algorithm (0)

References

Last updated 2026-07-16