{
 "id": "multiple-scattering-octaves",
 "title": "Multiple-Scattering Approximation by Octaves",
 "aliases": [
  "art-directable multiple scattering",
  "Wrenninge multi-octave scattering"
 ],
 "domain": "volumes",
 "subdomain": "clouds",
 "stage": "volume",
 "realtime": "interactive",
 "platforms": [
  "desktop-gpu",
  "webgpu",
  "cpu",
  "houdini",
  "unreal"
 ],
 "year_introduced": 2013,
 "inputs": [
  "volume-density"
 ],
 "outputs": [
  "radiance"
 ],
 "style": "photoreal",
 "dynamic": "both",
 "summary": "Approximate many scattering orders by summing a few octaves of single scattering with progressively weaker extinction, lower anisotropy and lower contribution, so thick clouds stay bright inside.",
 "how_it_works": "Single scattering lets light die quickly in dense media, making clouds look dark and flat. The approximation re-runs the same single-scatter calculation N times (typically 4 to 8), where octave i uses scaled coefficients: the extinction used for the light path is multiplied by a factor a to the i, the scattering contribution is multiplied by b to the i, and the phase function eccentricity g is scaled by c to the i. The three constants are all below one, and with a few octaves the sum mimics the diffusion of light into deeper regions and the loss of directionality. The results are summed per sample, either re-marching the light ray per octave or reusing one light march with scaled optical depths. The constants are art-directable knobs rather than physically derived, and they can be tuned to match a path-traced reference.",
 "when_to_use": "Choose it to rescue single-scatter clouds, smoke and fog when a path tracer is too expensive: it adds only a few extra exponentials per sample if you reuse the light-ray optical depth.\n\nPrefer `delta-tracking` for ground truth or offline production renders. Use it on top of `nubis-volumetric-clouds` or `volume-ray-marching` rather than as a standalone method. Prefer a precomputed multi-scattering LUT (see `hillaire-sky-atmosphere`) when the medium is a planetary atmosphere.",
 "cost": {
  "class": "medium",
  "notes": "Cost scales linearly in the number of octaves; with a shared light march the extra work per octave is mostly ALU."
 },
 "failure_modes": [
  "Not energy conserving: bad constants can make clouds glow or lose energy",
  "Matched only for the reference look it was tuned on; thin and thick media can need different constants",
  "Interior brightness loses contrast with no sense of cloud thickness when too many octaves are summed",
  "Does not capture view-dependent effects like glories",
  "Octave parameters lack a physical meaning, which makes automated tuning against a reference awkward"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/2775280.2792512",
   "type": "paper",
   "title": "Art-directable multiple volumetric scattering",
   "authors": [
    "Magnus Wrenninge"
   ],
   "year": 2015,
   "venue": "ACM SIGGRAPH 2015 Talks",
   "url": "https://doi.org/10.1145/2775280.2792512",
   "ids": {
    "doi": "10.1145/2775280.2792512"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2775280.2792512",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2775280.2792512",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2775280.2792512",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2775280.2792512",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2775280.2792512",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "wrenninge2015directable"
  },
  {
   "role": "primary",
   "key": "doi:10.1145/3084873.3084907",
   "type": "paper",
   "title": "Production volume rendering",
   "authors": [
    "Julian Fong",
    "Magnus Wrenninge",
    "Christopher Kulla",
    "Ralf Habel"
   ],
   "year": 2017,
   "venue": "ACM SIGGRAPH 2017 Courses",
   "url": "https://doi.org/10.1145/3084873.3084907",
   "ids": {
    "doi": "10.1145/3084873.3084907"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3084873.3084907",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3084873.3084907",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3084873.3084907",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3084873.3084907",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/3084873.3084907",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "fong2017production"
  }
 ],
 "presets": [
  {
   "id": "multiple-scattering-octaves-specimen",
   "title": "Backlit cloud: 1 scattering octave (left) vs 6 octaves (right)",
   "runtime": "glsl-fragment",
   "params": {
    "SIGMA": 6,
    "OCT_A": 0.5,
    "OCT_B": 0.5,
    "OCT_C": 0.5,
    "G_ANISO": 0.6
   },
   "code": "// Backlit cloud with the multiple-scattering octave approximation (Wrenninge):\n// sum_n a^n * exp(-tau_light * b^n) * HG(cos, g * c^n).  Left half: 1 octave (single scattering).\n// Right half: 6 octaves.  Same cloud, same light.\nconst float SIGMA = 6.0;\nconst float OCT_A = 0.5;\nconst float OCT_B = 0.5;\nconst float OCT_C = 0.5;\nconst float G_ANISO = 0.6;\n\nfloat h31(vec3 p) { p = fract(p * 0.1031); p += dot(p, p.zyx + 31.32); return fract((p.x + p.y) * p.z); }\nfloat vn(vec3 x) {\n  vec3 i = floor(x), f = fract(x); f = f * f * (3.0 - 2.0 * f);\n  return mix(mix(mix(h31(i), h31(i + vec3(1, 0, 0)), f.x), mix(h31(i + vec3(0, 1, 0)), h31(i + vec3(1, 1, 0)), f.x), f.y),\n             mix(mix(h31(i + vec3(0, 0, 1)), h31(i + vec3(1, 0, 1)), f.x), mix(h31(i + vec3(0, 1, 1)), h31(i + vec3(1, 1, 1)), f.x), f.y), f.z);\n}\nfloat dens(vec3 p) {\n  float shape = 1.0 - length(p / vec3(1.1, 0.75, 1.1));\n  float n = 0.5 * vn(p * 2.5) + 0.25 * vn(p * 5.0) + 0.125 * vn(p * 10.0);\n  return clamp((shape + (n - 0.4) * 0.9) * 2.5, 0.0, 1.0) * SIGMA;\n}\nfloat hg(float c, float g) { float g2 = g * g; return (1.0 - g2) / (12.566 * pow(1.0 + g2 - 2.0 * g * c, 1.5)); }\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  vec3 ro = vec3(0.0, 0.2, 3.6), rd = normalize(vec3(uv, -1.8));\n  vec3 L = normalize(vec3(0.4, 0.5, -0.7));\n  int octs = fragCoord.x < 0.5 * iResolution.x ? 1 : 6;\n  vec3 bg = vec3(0.3, 0.5, 0.85) * (0.75 + 0.5 * uv.y);\n  float b = dot(ro, rd); float hh = b * b - dot(ro, ro) + 2.25;\n  vec3 col = bg;\n  if (hh > 0.0) {\n    float t0 = -b - sqrt(hh), t1 = -b + sqrt(hh); float ds = (t1 - t0) / 48.0;\n    float T = 1.0; vec3 S = vec3(0.0); float cs = dot(L, rd);\n    for (int i = 0; i < 48; i++) {\n      vec3 p = ro + rd * (t0 + (float(i) + 0.5) * ds); float d = dens(p);\n      if (d < 0.01) continue;\n      float tau = 0.0;\n      for (int k = 1; k <= 6; k++) tau += dens(p + L * float(k) * 0.2) * 0.2;\n      float li = 0.0;\n      for (int n = 0; n < 6; n++) {\n        if (n >= octs) break;\n        float fn = float(n);\n        li += pow(OCT_A, fn) * exp(-tau * pow(OCT_B, fn)) * hg(cs, G_ANISO * pow(OCT_C, fn));\n      }\n      vec3 amb = vec3(0.35, 0.5, 0.8) * 0.06 * (0.6 + 0.4 * p.y);\n      S += T * (vec3(1.0, 0.95, 0.85) * li * 9.0 + amb) * d * ds;\n      T *= exp(-d * ds);\n    }\n    col = bg * T + S;\n  }\n  if (abs(fragCoord.x - 0.5 * iResolution.x) < 1.0) col = vec3(1.0);\n  col = 1.0 - exp(-col * 1.4);\n  fragColor = vec4(pow(col, vec3(1.0 / 2.2)), 1.0);\n}\n",
   "basis": "original",
   "license_note": "written for this index",
   "execution_fidelity": "reduced-sandbox",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "multiple-scattering-octaves",
     "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.6207,
      "std": 0.2485,
      "unique_colors": 219
     },
     "image": "/specimens/multiple-scattering-octaves-specimen.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "nubis-volumetric-clouds",
  "delta-tracking",
  "henyey-greenstein-phase-function",
  "volume-ray-marching"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "nubis-volumetric-clouds",
   "why": "Takes the density and per-sample light march from the cloud marcher and brightens interiors."
  },
  {
   "id": "henyey-greenstein-phase-function",
   "why": "Each octave uses an HG lobe with a reduced asymmetry."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/volumes/multiple-scattering-octaves.json"
 },
 "solves": [
  "clouds look dark and flat inside",
  "thick smoke loses brightness with single scattering",
  "can't afford path-traced multiple scattering for clouds",
  "dense fog lacks soft glowing interior"
 ],
 "authority": "Wrenninge, 2015",
 "url": "https://texelatlas.vercel.app/t/multiple-scattering-octaves/",
 "execution_fidelity": "reduced-sandbox",
 "fidelity_label": "Analytic Sandbox",
 "benchmark_eligible": true,
 "gpu_weight": {
  "weight_x": 1006.05,
  "tier": "extreme",
  "p50_ms": 33.0989,
  "p95_ms": 33.5662,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 20,
  "preset_id": "multiple-scattering-octaves-specimen",
  "execution_fidelity": "reduced-sandbox",
  "fidelity_label": "Analytic Sandbox",
  "benchmark_eligible": true,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 827.86,
   "tier": "extreme",
   "p50_ms": 13.163,
   "p95_ms": 13.2518,
   "speedup_x": 2.51,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 692.25,
   "tier": "extreme",
   "p50_ms": 19.9368,
   "p95_ms": 20.0018,
   "speedup_x": 1.66,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}