Domain Warping
Feed the output of one noise function back into the coordinates of another, f(p + w(p)), so the pattern is bent into swirls, folds and marble-like flows that plain fBm cannot make.
Also known as noise warping, warped fBm, flow-distorted noise
In the family Procedural generation, noise composition
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | Built in | FastNoiseLite > domain_warp_enabled = true (Simplex and BasicGrid coordinate warping) docs |
| Unity | None found | |
| Unreal 5.7 | None found | |
| Blender 5.2 | Built in | Noise Texture > Distortion input docs Distortion offsets the lookup coordinates by noise. |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Instead of evaluating a field f at p, you first displace p by a vector field w, built from independent noise samples (typically two offset fBm calls for x and y). Nesting the idea, f(p + ag(p + bh(p))) gives progressively more organic structure; each level multiplies cost by the complexity of the inner evaluation. The displacement amplitude controls how far features travel, and animating one of the offset constants or adding time to the inner noise yields convincing liquid motion. Intermediate values (the warp vectors, the magnitude of the displacement) are free by-products that can be used to colour the pattern, so the result is often both a height and a palette index. The technique is general: any coordinate-based function (noise, Voronoi, SDF) can be warped.
When to choose it
Reach for it when
- noise looks too uniform and blobby
- want swirling marble or smoke patterns
- fractal terrain lacks flowing or folded structure
- need lava or strata looking organic swirls cheaply
Choose it when you need organic swirls, marble, smoke, lava, strata, or want to break the regularity of Fractal Brownian Motion and Multifractals terrain cheaply (for example to fake flow-aligned ridges). Prefer Interactive Hydraulic Erosion on Heightfields or Stream-Power Erosion (Fluvial Terrain Uplift) for physically plausible drainage, and Reaction-Diffusion Textures (Turk) for self-organising stripes and spots.
Field marks
- Large warp amplitude folds the domain over itself, causing discontinuous seams or smeared detail
- Differentiation is hard: finite-difference normals through nested warps are noisy and expensive
- Each nesting level multiplies the cost, so mobile or per-vertex use needs a baked texture
- Using the same noise for warp and base creates visible diagonal correlation instead of independent swirls
Presets
Two-level domain-warped fBm
{
"warp_strength": 4,
"octaves": 5
}Show GLSL (37 lines)
// GLSL ES 3.0, Shadertoy-style. f(p + 4*q + 4*r) with animated warp fields.
const int OCTAVES = 5;
const float WARP = 4.0;
float hash21(vec2 p){
p = fract(p * vec2(123.34, 456.21));
p += dot(p, p + 45.32);
return fract(p.x * p.y);
}
float vnoise(vec2 p){
vec2 i = floor(p), f = fract(p);
vec2 u = f * f * (3.0 - 2.0 * f);
return mix(mix(hash21(i), hash21(i + vec2(1.0, 0.0)), u.x),
mix(hash21(i + vec2(0.0, 1.0)), hash21(i + vec2(1.0, 1.0)), u.x), u.y);
}
float fbm(vec2 p){
float s = 0.0, a = 0.5;
for (int i = 0; i < OCTAVES; i++) {
s += a * vnoise(p);
p = mat2(1.6, 1.2, -1.2, 1.6) * p;
a *= 0.5;
}
return s;
}
void mainImage(out vec4 fragColor, in vec2 fragCoord){
vec2 p = (fragCoord - 0.5 * iResolution.xy) / iResolution.y * 3.0;
float t = iTime * 0.15;
vec2 q = vec2(fbm(p + vec2(0.0, 0.0)), fbm(p + vec2(5.2, 1.3)));
vec2 r = vec2(fbm(p + WARP * q + vec2(1.7, 9.2) + t),
fbm(p + WARP * q + vec2(8.3, 2.8) - t));
float f = fbm(p + WARP * r);
vec3 col = mix(vec3(0.10, 0.12, 0.30), vec3(0.85, 0.35, 0.15), smoothstep(0.2, 0.8, f));
col = mix(col, vec3(0.95, 0.90, 0.75), clamp(length(r) * 0.8, 0.0, 1.0) * f);
col = mix(col, vec3(0.02, 0.05, 0.12), clamp(q.x * q.x * 2.0, 0.0, 1.0) * 0.5);
fragColor = vec4(col * (0.3 + 1.1 * f), 1.0);
}Attribution: written for this index. Technique described by Inigo Quilez; code is original.
Multi-octave FBM domain warping (WGSL)
{
"WARP": 3.2,
"OCTAVES": 5
}Show WGSL (45 lines)
// WebGPU WGSL fragment specimen: iterated f(p + WARP * q + WARP * r) domain warping
const WARP: f32 = 3.2000; // P
const OCTAVES: i32 = 5; // P
fn hash21(p_in: vec2f) -> f32 {
var p = fract(p_in * vec2f(123.34, 456.21));
p = p + dot(p, p + 45.32);
return fract(p.x * p.y);
}
fn vnoise(p: vec2f) -> f32 {
let i = floor(p);
let f = fract(p);
let u = f * f * (3.0 - 2.0 * f);
let a = hash21(i);
let b = hash21(i + vec2f(1.0, 0.0));
let c = hash21(i + vec2f(0.0, 1.0));
let d = hash21(i + vec2f(1.0, 1.0));
return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);
}
fn fbm(p_in: vec2f) -> f32 {
var p = p_in;
var acc: f32 = 0.0;
var amp: f32 = 0.5;
let rot = mat2x2f(vec2f(0.8, 0.6), vec2f(-0.6, 0.8));
for (var i: i32 = 0; i < OCTAVES; i = i + 1) {
acc = acc + amp * vnoise(p);
p = rot * p * 2.02;
amp = amp * 0.5;
}
return acc;
}
@fragment
fn fs_main(@builtin(position) pos: vec4f) -> @location(0) vec4f {
let uv = (pos.xy / u.resolution.y) * 2.6;
let t = u.time * 0.14;
let q = vec2f(fbm(uv + vec2f(0.0, t)), fbm(uv + vec2f(5.2, 1.3 - t)));
let r = vec2f(fbm(uv + WARP * q + vec2f(1.7, 9.2)), fbm(uv + WARP * q + vec2f(8.3, 2.8)));
let f = fbm(uv + WARP * r);
var col = mix(vec3f(0.09, 0.18, 0.24), vec3f(0.68, 0.48, 0.30), clamp(f * 1.4, 0.0, 1.0));
col = mix(col, vec3f(0.94, 0.92, 0.86), smoothstep(0.55, 0.92, length(q) * 0.75 + f * 0.4));
return vec4f(col, 1.0);
}Attribution: written for this index
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| domain-warp-fbm | Tesla T4 1920x1080 | 34.2× baseline (heavy) · 1.12 ms / 1.15 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| domain-warp-fbm | NVIDIA L4 1920x1080 | 29.8× baseline (heavy) · 0.474 ms / 0.488 ms · 2.4× faster on L4 | opengl-timer-query · Cross-architecture validation |
| domain-warp-fbm | NVIDIA A100-SXM4-40GB 1920x1080 | 23.9× baseline (heavy) · 0.690 ms / 0.690 ms · 1.6× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
Sources
- tutorialPatricio Gonzalez Vivo. The Book of Shaders: Fractal Brownian Motion. thebookofshaders.com.Verified via live page · 2026-11-29
- implementationGökay Aydoğan (2026). gokayfem/glsl-studies. 454 procedural graphics studies in GLSL ES 3.00 for WebGL2, from woven cloth and animal fur to glacial terrain and atmospheric optics. Each study includes shader source and a rendered preview.GitHub API · license MIT · 2026-11-30