Interactive demo

Domain Warping

Domain warping does not change the noise itself, but where it is read: the position is first moved by another noise. Applied twice, plain fractal noise turns into marble, smoke and flowing liquids.

Set the warp levels to “No warping” to see the plain fractal noise, then add one level after the other. “Warp offsets” shows how far and in which direction every point is moved.

Controls

Display

Noise types compared

NoiseOutputBuilt fromWork per sampleSmooth
Value NoiseScalar fieldRandom values on a grid4 grid pointsYes
Perlin NoiseScalar fieldRandom gradients on a grid4 grid pointsYes
Simplex NoiseScalar fieldGradients on a triangle grid3 cornersYes
Worley NoiseScalar fieldRandom feature points9 to 25 cellsNo
Blue NoisePoint setRandom candidates around existing pointsUp to 30 tries per point–
Fractal NoiseScalar fieldOctaves of a base noise1 base noise per octaveYes
Diamond-SquareHeightmapDisplaced midpoints of a grid4 neighbors per pointNo
Colors of NoiseSignal or imageWhite noise filtered by frequency1 FFT for all samples–
Domain Warping this pageScalar fieldFractal noise at warped positionsUp to 5 fractal noisesYes
Curl NoiseVector fieldDerivatives of a noise field4 noise samplesYes
Noise Terrain GeneratorHeightmapStacked noise layersLayers × octaves–

1. Moving the input

Instead of f(p), the shader computes f(p + s · q(p)): the noise q moves the point p before f is read. q has two components, two fractal noises with different offsets, so the shift has a direction.

2. Warped twice

The second level warps the warp: f(p + s · r) with r = fbm(p + s · q) and q = fbm(p). Five fractal noises per pixel, each with up to eight octaves, are no problem for the graphics card.

3. Coloring by the warp

The intermediate values carry information too: the color mixes the final value with the length of q and the first component of r. Slowly shifting the inner noises over time makes the pattern flow.

Credits

  • Based on the article Domain Warping by Inigo Quilez: the two-level warp and the idea of coloring by the intermediate values come from it. The noise functions, colors and controls were written for this page.