{
 "id": "fractal-brownian-motion",
 "title": "Fractal Brownian Motion and Multifractals",
 "aliases": [
  "fBm",
  "ridged multifractal",
  "hybrid multifractal",
  "spectral synthesis"
 ],
 "domain": "procgen",
 "subdomain": "noise composition",
 "stage": "procedural",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "cpu",
  "blender",
  "houdini",
  "unity",
  "unreal",
  "godot",
  "python"
 ],
 "year_introduced": 1989,
 "inputs": [],
 "outputs": [
  "heightfield",
  "texture",
  "volume-density"
 ],
 "style": "both",
 "dynamic": "both",
 "summary": "Sum several octaves of a band-limited noise with increasing frequency and decreasing amplitude to get a self-similar field. Multifractal variants modulate each octave by the previous so rough peaks and smooth valleys emerge.",
 "how_it_works": "fBm evaluates noise at p, then repeatedly multiplies frequency by a lacunarity (usually about 2) and amplitude by a gain (about 0.5, i.e. Hurst exponent H with gain = 2^-H), accumulating the sum. The gain controls the spectral slope and hence perceived roughness; lacunarity should be a bit off 2 or the octaves are rotated and offset to hide lattice alignment. Musgrave's multifractals break the statistical uniformity: in a multifractal each octave is scaled by the running value, so high areas receive more small-scale detail than low ones, mimicking eroded mountains over smooth basins. Ridged multifractal takes 1-|n| to create sharp crests, and hybrid versions mix additive and multiplicative behaviour. The octave count caps detail and cost; bandlimiting octaves above the Nyquist for the pixel footprint avoids shimmering.",
 "when_to_use": "Choose it as the base heightfield generator and for clouds, marble or any natural-looking detail. Prefer `domain-warping` on top when you want swirled, flow-like structure, `hydraulic-erosion-stava` or `stream-power-erosion` when plain fBm terrain looks unconvincing because it lacks drainage networks, and `thermal-erosion` for cheap slope relaxation.",
 "cost": {
  "class": "cheap",
  "notes": "Linear in octave count; 4 to 8 octaves is typical for terrain."
 },
 "failure_modes": [
  "Statistically stationary: peaks and valleys look equally rough, the telltale 'blobby' fBm terrain without drainage networks",
  "Lattice alignment accumulates across octaves when frequency is exactly 2 with no rotation or offset",
  "Too many octaves alias at distance and shimmer unless fade-by-pixel-footprint is applied",
  "Domain-wide gain tuned for one height range breaks when the field is later remapped or clamped"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/74334.74337",
   "type": "paper",
   "title": "The synthesis and rendering of eroded fractal terrains",
   "authors": [
    "F. K. Musgrave",
    "C. E. Kolb",
    "R. S. Mace"
   ],
   "year": 1989,
   "venue": "ACM SIGGRAPH Computer Graphics",
   "url": "https://doi.org/10.1145/74334.74337",
   "ids": {
    "doi": "10.1145/74334.74337"
   },
   "license": null,
   "extra": {
    "csl_type": "journal-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/74334.74337",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/74334.74337",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/74334.74337",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/74334.74337",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/74334.74337",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "musgrave1989synthesis"
  },
  {
   "role": "primary",
   "key": "doi:10.1016/b978-155860848-1/50045-0",
   "type": "chapter",
   "title": "Procedural fractal terrains",
   "authors": [
    "F. Kenton Musgrave"
   ],
   "year": 2003,
   "venue": "Texturing and Modeling",
   "url": "https://doi.org/10.1016/b978-155860848-1/50045-0",
   "ids": {
    "doi": "10.1016/b978-155860848-1/50045-0"
   },
   "license": null,
   "extra": {
    "csl_type": "book-chapter"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1016/b978-155860848-1/50045-0",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1016/b978-155860848-1/50045-0",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1016/b978-155860848-1/50045-0",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1016/b978-155860848-1/50045-0",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1016/b978-155860848-1/50045-0",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "musgrave2003procedural"
  },
  {
   "role": "tutorial",
   "key": "url:https://iquilezles.org/articles/fbm",
   "type": "tutorial",
   "title": "fBM",
   "authors": [
    "Inigo Quilez"
   ],
   "year": null,
   "venue": "iquilezles.org",
   "url": "https://iquilezles.org/articles/fbm",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261009043930/https://iquilezles.org/articles/fbm/",
     "timestamp": "20261009043930"
    },
    "page_title": "Inigo Quilez :: computer graphics, maths, shaders, fractals, demoscene",
    "host": "iquilezles.org",
    "title_confirmed_by_page": false,
    "title_unconfirmed": true
   },
   "provenance": {
    "title": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://iquilezles.org/articles/fbm → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "http",
     "endpoint": "GET https://iquilezles.org/articles/fbm → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 0,
   "__bib": "quilezitem"
  },
  {
   "role": "tutorial",
   "key": "url:https://thebookofshaders.com/13",
   "type": "tutorial",
   "title": "The Book of Shaders: Fractal Brownian Motion",
   "authors": [
    "Patricio Gonzalez Vivo"
   ],
   "year": null,
   "venue": "thebookofshaders.com",
   "url": "https://thebookofshaders.com/13",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261114134911/https://thebookofshaders.com/13/",
     "timestamp": "20261114134911"
    },
    "page_title": "The Book of Shaders",
    "host": "thebookofshaders.com",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://thebookofshaders.com/13 → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://thebookofshaders.com/13 → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "http",
     "endpoint": "GET https://thebookofshaders.com/13 → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 0.95,
   "__bib": "vivobookb"
  }
 ],
 "presets": [
  {
   "id": "fbm-terrain-color",
   "title": "fBm heightfield with hypsometric colouring and hillshade",
   "runtime": "glsl-fragment",
   "params": {
    "octaves": 7,
    "lacunarity": 2,
    "gain": 0.5,
    "sea_level": 0.45
   },
   "basis": "original",
   "license_note": "written for this index",
   "code": "// GLSL ES 3.0, Shadertoy-style. fBm terrain: sea, beach, grass, rock, snow + hillshade.\nconst int   OCTAVES = 7;\nconst float LACUNARITY = 2.0;\nconst float GAIN = 0.5;\nconst float SEA = 0.45;\n\nfloat hash21(vec2 p){\n  p = fract(p * vec2(123.34, 456.21));\n  p += dot(p, p + 45.32);\n  return fract(p.x * p.y);\n}\nfloat vnoise(vec2 p){\n  vec2 i = floor(p), f = fract(p);\n  vec2 u = f * f * f * (f * (f * 6.0 - 15.0) + 10.0);\n  float a = hash21(i), b = hash21(i + vec2(1.0, 0.0));\n  float c = hash21(i + vec2(0.0, 1.0)), d = hash21(i + vec2(1.0, 1.0));\n  return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);\n}\nfloat fbm(vec2 p){\n  float s = 0.0, a = 0.5, norm = 0.0;\n  mat2 rot = mat2(0.8, 0.6, -0.6, 0.8);\n  for (int i = 0; i < OCTAVES; i++) {\n    s += a * vnoise(p);\n    norm += a;\n    p = rot * p * LACUNARITY + vec2(17.1, 9.2);\n    a *= GAIN;\n  }\n  return s / norm;\n}\nfloat height(vec2 p){ return fbm(p); }\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord){\n  vec2 uv = fragCoord / iResolution.y;\n  vec2 p = uv * 3.0 + vec2(iTime * 0.02, 0.0);\n  float h = height(p);\n  float e = 0.004;\n  vec3 n = normalize(vec3(height(p - vec2(e, 0.0)) - height(p + vec2(e, 0.0)),\n                          height(p - vec2(0.0, e)) - height(p + vec2(0.0, e)), 2.0 * e * 4.0));\n  float light = clamp(dot(n, normalize(vec3(-0.6, 0.5, 0.65))), 0.0, 1.0);\n  vec3 deep = vec3(0.02, 0.10, 0.25), shallow = vec3(0.10, 0.35, 0.50);\n  vec3 sand = vec3(0.76, 0.70, 0.50), grass = vec3(0.20, 0.42, 0.15);\n  vec3 rock = vec3(0.42, 0.38, 0.34), snow = vec3(0.95, 0.96, 0.98);\n  vec3 col;\n  if (h < SEA) {\n    col = mix(deep, shallow, smoothstep(SEA - 0.2, SEA, h));\n  } else {\n    col = mix(sand, grass, smoothstep(SEA, SEA + 0.04, h));\n    col = mix(col, rock, smoothstep(SEA + 0.12, SEA + 0.22, h));\n    col = mix(col, snow, smoothstep(SEA + 0.28, SEA + 0.34, h));\n    col *= 0.45 + 0.9 * light;\n  }\n  fragColor = vec4(col, 1.0);\n}",
   "execution_fidelity": "faithful-pass",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "fractal-brownian-motion",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-29T15:51:50.471Z",
     "renderer": "Chromium 145.0.7632.6 headless, WebGL2 via ANGLE/SwiftShader, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.3029,
      "std": 0.167,
      "unique_colors": 319
     },
     "image": "/specimens/fbm-terrain-color.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "perlin-noise",
  "improved-perlin-noise",
  "domain-warping",
  "thermal-erosion",
  "hydraulic-erosion-stava"
 ],
 "extends": [
  "perlin-noise"
 ],
 "supersedes": [],
 "combines_with": [
  {
   "id": "domain-warping",
   "why": "fBm provides both the base field and the warp vectors."
  },
  {
   "id": "hydraulic-erosion-stava",
   "why": "fBm heightfield is the typical starting terrain that erosion then carves."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/procgen/fractal-brownian-motion.json"
 },
 "solves": [
  "need a natural-looking base heightfield",
  "single noise layer looks smooth and boring",
  "clouds or marble need detail at many scales",
  "want rough mountains with smoother valleys"
 ],
 "authority": "Musgrave et al., 1989",
 "url": "https://texelatlas.vercel.app/t/fractal-brownian-motion/",
 "execution_fidelity": "faithful-pass",
 "fidelity_label": "Faithful Pass",
 "benchmark_eligible": true,
 "gpu_weight": {
  "weight_x": 52.91,
  "tier": "heavy",
  "p50_ms": 1.7407,
  "p95_ms": 1.7977,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "fbm-terrain-color",
  "execution_fidelity": "faithful-pass",
  "fidelity_label": "Faithful Pass",
  "benchmark_eligible": true,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 45.06,
   "tier": "heavy",
   "p50_ms": 0.7165,
   "p95_ms": 0.724,
   "speedup_x": 2.43,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 36.43,
   "tier": "heavy",
   "p50_ms": 1.0491,
   "p95_ms": 1.0496,
   "speedup_x": 1.66,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}