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

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.