Domain Warping

First appeared 2008 · Iñigo Quílez — Formalized as a noise technique by Íñigo Quílez (2008). · timeline ↗

community / folk Name — A descriptive term popularized by Inigo Quilez (c. 2008) for feeding noise into the input coordinates of more noise; not a personal eponym.

In one line Distorting the input coordinates of a noise (or pattern) function with another noise function before sampling it — producing organic, swirling, marbled textures from otherwise plain noise.

Domain Warping · 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.

domain-warping/index.html
const SEED = Math.floor(Math.random()*1e9);

// Inigo Quilez style domain warping:
//   q = fbm(p)
//   r = fbm(p + q)
//   color = fbm(p + r)
// Each fbm input is offset by the previous field, producing organic swirls.
function setup() {
  noiseSeed(SEED); randomSeed(SEED);
  const s = Math.min(windowWidth, windowHeight);
  createCanvas(s, s);
  pixelDensity(1);
  noiseDetail(5, 0.5);

  const fbm = (x, y) => noise(x, y);
  const SC = 2.4;
  const RAMP = [
    [16, 24, 48], [36, 64, 102], [70, 130, 140],
    [150, 190, 170], [232, 222, 190], [250, 244, 230],
  ];
  const lerpC = (a, b, t) => [a[0]+(b[0]-a[0])*t, a[1]+(b[1]-a[1])*t, a[2]+(b[2]-a[2])*t];

  loadPixels();
  for (let py = 0; py < height; py++) {
    for (let px = 0; px < width; px++) {
      const x = (px / width) * SC;
      const y = (py / height) * SC;
      const qx = fbm(x, y);
      const qy = fbm(x + 5.2, y + 1.3);
      const rx = fbm(x + 4 * qx + 1.7, y + 4 * qy + 9.2);
      const ry = fbm(x + 4 * qx + 8.3, y + 4 * qy + 2.8);
      let v = fbm(x + 4 * rx, y + 4 * ry);
      v = Math.max(0, Math.min(1, v * 1.3));
      const f = v * (RAMP.length - 1);
      const i0 = Math.floor(f);
      const i1 = Math.min(RAMP.length - 1, i0 + 1);
      const c = lerpC(RAMP[i0], RAMP[i1], f - i0);
      const idx = 4 * (py * width + px);
      pixels[idx] = c[0]; pixels[idx+1] = c[1]; pixels[idx+2] = c[2]; pixels[idx+3] = 255;
    }
  }
  updatePixels();
}

Open the demo source ↗

How it works

Instead of evaluating f(p) directly, evaluate f at a displaced position: 1. Compute an offset vector from noise at p — e.g. q = (noise(p), noise(p + c)). 2. Sample the field at the warped coordinate: f(p + k·q), where k controls warp strength. Nesting deepens the effect: f(p + k·g(p + k·h(p))) — warping the warp — which is Quílez's classic recipe and the source of fluid, vein- and marble-like flows. Using the same approach on a tiling or SDF (not just noise) bends grids and shapes into wavy, hand-drawn-feeling distortions.

Parameters

Lineage

Precedents
Iñigo Quílez
Related
Perlin / Simplex Noise, Flow Field / Vector Field

Frequently combined with

Works using this algorithm (10)

Augury
lovid
Colorspace
tabor-robak
Galaxiss
xenoliss
Longing
phenomena
Material Violence
jeres
Nära
tengil
Photon's Dream
harvey-rayner
Solve-Un-Solve
ves3l
Thoughts of Meadow
eric-davidson
Total Strangers
artem-verkhovskiy-x-andy-shaw

Last updated 2026-07-16