{
 "id": "light-propagation-volumes",
 "title": "Light Propagation Volumes",
 "aliases": [
  "LPV",
  "cascaded LPV"
 ],
 "domain": "gi",
 "subdomain": "grid-based GI",
 "stage": "lighting",
 "realtime": "realtime",
 "platforms": [
  "desktop-gpu",
  "webgl2",
  "webgpu"
 ],
 "year_introduced": 2009,
 "inputs": [
  "depth",
  "normals",
  "gbuffer"
 ],
 "outputs": [
  "irradiance-probes",
  "radiance"
 ],
 "style": "photoreal",
 "dynamic": "dynamic",
 "summary": "Injects virtual point lights from reflective shadow maps into a coarse 3D grid of spherical-harmonic radiance, then diffuses the light cell-to-cell for several iterations to approximate multi-bounce indirect lighting.",
 "how_it_works": "A 3D grid (often cascaded around the camera) stores, per cell, the radiance as a low-order spherical-harmonic vector. Each frame has three stages.\n\n**Injection**: the texels of one or more reflective shadow maps become virtual point lights and splat their flux into the cell that contains them as an SH cosine lobe. Geometry from depth buffers is also injected as occluder SH to later block light.\n\n**Propagation**: light flows between neighbouring cells. Each cell sends a fraction of its SH radiance through each of its six faces, using precomputed face-flux coefficients and then re-projecting into the neighbouring cell's SH. Repeating this step (typically 8 to 16 iterations) pushes light farther through empty space. A geometry-volume occupancy term damps flux through solid cells.\n\n**Lookup**: shading points sample the grid trilinearly and evaluate the SH for the surface normal. This is entirely image/grid space and so scene complexity does not matter.",
 "when_to_use": "Choose it as a very inexpensive dynamic GI for a single dominant light on mid-range hardware, a historical choice for 2010-era engines.\n\nPrefer [voxel-cone-tracing](voxel-cone-tracing) when higher quality glossy transport and sharper occlusion are required. Prefer [ddgi](ddgi) or [radiance-cascades](radiance-cascades) when ray tracing or SDF tracing is available. Prefer [reflective-shadow-maps](reflective-shadow-maps) alone if only a one-bounce direct gather is enough.",
 "cost": {
  "class": "medium",
  "notes": "Cost scales with cell count times propagation iterations; typically modest per cascade (32^3 per cascade is a common size)."
 },
 "failure_modes": [
  "Light bleeding through walls thinner than a cell, since occlusion is only approximated",
  "Low spatial resolution (cell size of tens of centimetres) so indirect shadows are very soft",
  "Directional smearing and ringing from low-order SH in the propagation step",
  "Cascade boundaries produce visible lighting discontinuities and flicker as the grid follows the camera"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1145/1730804.1730821",
   "type": "paper",
   "title": "Cascaded light propagation volumes for real-time indirect illumination",
   "authors": [
    "Anton Kaplanyan",
    "Carsten Dachsbacher"
   ],
   "year": 2010,
   "venue": "Proceedings of the 2010 ACM SIGGRAPH symposium on Interactive 3D Graphics and Games",
   "url": "https://doi.org/10.1145/1730804.1730821",
   "ids": {
    "doi": "10.1145/1730804.1730821"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1730804.1730821",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1730804.1730821",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1730804.1730821",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1730804.1730821",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/1730804.1730821",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "kaplanyan2010cascaded"
  }
 ],
 "presets": [
  {
   "id": "light-propagation-volumes-live",
   "title": "Light Propagation Volumes — 3D SH flux lattice injection, multi-step propagation & colored bounce bleed",
   "runtime": "glsl-fragment",
   "params": {
    "P_GRID_RES": 5,
    "P_PROP_SPREAD": 1,
    "P_BOUNCE_GAIN": 1.35,
    "P_SPLIT": 0.36
   },
   "basis": "original",
   "license_note": "Original interactive WebGL2 fragment shader written for Texel Atlas (MIT).",
   "code": "const float P_GRID_RES = 5.0; // P LPV Lattice Res [3.0, 9.0, 1.0]\nconst float P_PROP_SPREAD = 1.0; // P Prop Diffusion [0.35, 2.0, 0.05]\nconst float P_BOUNCE_GAIN = 1.35; // P LPV GI Gain [0.0, 2.5, 0.05]\nconst float P_SPLIT = 0.36; // P Direct / LPV Split [0.0, 1.0, 0.02]\n\nfloat sdBox(vec3 p, vec3 b) {\n  vec3 q = abs(p) - b;\n  return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);\n}\n\n// Cornell chamber with matte pedestal & central arch baffle\nvec2 mapRoom(vec3 p) {\n  vec2 res = vec2(1.0 + p.y, 1.0); // floor\n  float cD = 1.0 - p.y; if (cD < res.x) res = vec2(cD, 1.0);\n  float bD = 1.45 + p.z; if (bD < res.x) res = vec2(bD, 1.0);\n  float lD = 1.45 + p.x; if (lD < res.x) res = vec2(lD, 2.0); // crimson wall\n  float rD = 1.45 - p.x; if (rD < res.x) res = vec2(rD, 3.0); // cobalt-teal wall\n\n  float dP1 = sdBox(p - vec3(-0.32, -0.52, -0.35), vec3(0.28, 0.48, 0.28)) - 0.02;\n  if (dP1 < res.x) res = vec2(dP1, 4.0);\n\n  float dSph = length(p - vec3(0.42, -0.58, -0.15)) - 0.38;\n  if (dSph < res.x) res = vec2(dSph, 4.0);\n  return res;\n}\n\nvec3 calcNormal(vec3 p) {\n  vec2 e = vec2(0.0025, 0.0);\n  return normalize(vec3(\n    mapRoom(p + e.xyy).x - mapRoom(p - e.xyy).x,\n    mapRoom(p + e.yxy).x - mapRoom(p - e.yxy).x,\n    mapRoom(p + e.yyx).x - mapRoom(p - e.yyx).x\n  ));\n}\n\n// Evaluate 2-band SH LPV cell irradiance at quantized voxel center vc for surface normal n\nvec3 evalLpvCell(vec3 vc, vec3 n, vec3 sunPatch, float spread) {\n  // 3 injected directional flux sources propagated through the 3D SH lattice:\n  // 1) Sunlit floor/wall bounce patch (sweeps across the red & teal walls)\n  vec3 dSun = sunPatch - vc;\n  float rSun = length(dSun) + 0.35;\n  vec3 dirSun = dSun / max(length(dSun), 1e-4);\n  vec3 patchCol = mix(vec3(1.1, 0.92, 0.65), vec3(1.45, 0.24, 0.16), smoothstep(-0.3, -1.2, sunPatch.x));\n  patchCol = mix(patchCol, vec3(0.16, 1.15, 0.92), smoothstep(0.3, 1.2, sunPatch.x));\n\n  // SH L0 (isotropic) + L1 (directional cosine lobe) propagation kernel\n  float kSun = exp(-rSun * (0.95 / max(spread, 0.2))) / (0.45 + rSun * rSun * 0.6);\n  float shSun = 0.45 + 0.55 * max(dot(n, dirSun), 0.0);\n\n  // 2) Persistent crimson left wall flux\n  vec3 dLeft = vec3(-1.42, vc.y * 0.5, -0.35) - vc;\n  float rL = length(dLeft) + 0.4;\n  float shL = 0.42 + 0.58 * max(dot(n, normalize(dLeft)), 0.0);\n  vec3 fluxL = vec3(1.05, 0.16, 0.12) * exp(-rL * (0.85 / max(spread, 0.2))) * shL * 0.52;\n\n  // 3) Persistent teal right wall flux\n  vec3 dRight = vec3(1.42, vc.y * 0.5, -0.35) - vc;\n  float rR = length(dRight) + 0.4;\n  float shR = 0.42 + 0.58 * max(dot(n, normalize(dRight)), 0.0);\n  vec3 fluxR = vec3(0.12, 0.88, 0.72) * exp(-rR * (0.85 / max(spread, 0.2))) * shR * 0.52;\n\n  return patchCol * kSun * shSun * 1.45 + fluxL + fluxR;\n}\n\n// Trilinearly interpolated 3D LPV lookup matching hardware 3D texture sampling\nvec3 sampleLPV(vec3 p, vec3 n, vec3 sunPatch, float gridRes, float spread) {\n  vec3 gp = p * gridRes;\n  vec3 base = floor(gp);\n  vec3 f = fract(gp);\n  vec3 c000 = evalLpvCell((base + vec3(0.5, 0.5, 0.5)) / gridRes, n, sunPatch, spread);\n  vec3 c100 = evalLpvCell((base + vec3(1.5, 0.5, 0.5)) / gridRes, n, sunPatch, spread);\n  vec3 c010 = evalLpvCell((base + vec3(0.5, 1.5, 0.5)) / gridRes, n, sunPatch, spread);\n  vec3 c110 = evalLpvCell((base + vec3(1.5, 1.5, 0.5)) / gridRes, n, sunPatch, spread);\n  vec3 c001 = evalLpvCell((base + vec3(0.5, 0.5, 1.5)) / gridRes, n, sunPatch, spread);\n  vec3 c101 = evalLpvCell((base + vec3(1.5, 0.5, 1.5)) / gridRes, n, sunPatch, spread);\n  vec3 c011 = evalLpvCell((base + vec3(0.5, 1.5, 1.5)) / gridRes, n, sunPatch, spread);\n  vec3 c111 = evalLpvCell((base + vec3(1.5, 1.5, 1.5)) / gridRes, n, sunPatch, spread);\n\n  vec3 c00 = mix(c000, c100, f.x);\n  vec3 c10 = mix(c010, c110, f.x);\n  vec3 c01 = mix(c001, c101, f.x);\n  vec3 c11 = mix(c011, c111, f.x);\n  return mix(mix(c00, c10, f.y), mix(c01, c11, f.y), f.z);\n}\n\nvec3 aces(vec3 x) {\n  x = max(x, 0.0);\n  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  float screenX = fragCoord.x / max(iResolution.x, 1.0);\n  float split = clamp(P_SPLIT, 0.0, 1.0);\n  float gridRes = clamp(floor(P_GRID_RES + 0.5), 2.0, 10.0);\n  float spread = clamp(P_PROP_SPREAD, 0.3, 2.2);\n  float giGain = max(P_BOUNCE_GAIN, 0.0);\n\n  vec3 ro = vec3(0.0, 0.04, 2.35);\n  vec3 rd = normalize(vec3(uv, -1.48));\n\n  // Sweeping direct sun spot injecting VPL flux into the LPV lattice\n  vec3 sunPatch = vec3(1.15 * sin(iTime * 0.55), -0.95 + 0.45 * abs(sin(iTime * 0.55)), -0.35 + 0.45 * cos(iTime * 0.42));\n  vec3 lightPos = vec3(0.0, 0.92, 0.25);\n\n  vec3 col = vec3(0.02);\n  float t = 0.0;\n  float matId = 0.0;\n  bool hit = false;\n  for (int i = 0; i < 64; i++) {\n    vec2 h = mapRoom(ro + rd * t);\n    if (h.x < 0.002) { hit = true; matId = h.y; break; }\n    t += h.x;\n    if (t > 10.0) break;\n  }\n\n  if (hit) {\n    vec3 p = ro + rd * t;\n    vec3 n = calcNormal(p);\n\n    vec3 alb = vec3(0.76, 0.76, 0.74);\n    if (matId > 1.5 && matId < 2.5) alb = vec3(0.86, 0.14, 0.12);\n    else if (matId > 2.5 && matId < 3.5) alb = vec3(0.10, 0.74, 0.62);\n    else if (matId > 3.5) alb = vec3(0.84, 0.83, 0.80);\n\n    // Focused direct spotlight beam illuminating sunPatch\n    vec3 toL = lightPos - p;\n    float dL = length(toL);\n    vec3 lDir = toL / max(dL, 1e-4);\n    vec3 spotAxis = normalize(sunPatch - lightPos);\n    float spotCos = dot(-lDir, spotAxis);\n    float spotMask = smoothstep(0.80, 0.94, spotCos);\n\n    // Shadow march toward ceiling spotlight\n    float sh = 1.0;\n    float ts = 0.03;\n    for (int i = 0; i < 24; i++) {\n      float dh = mapRoom(p + lDir * ts).x;\n      if (dh < 0.004) { sh = 0.0; break; }\n      ts += dh;\n      if (ts > dL - 0.08) break;\n    }\n\n    vec3 direct = alb * vec3(2.8, 2.5, 2.1) * max(dot(n, lDir), 0.0) * spotMask * sh / (1.0 + 0.25 * dL * dL);\n\n    // Subtle ambient fill + LPV trilinearly sampled SH indirect bounce\n    vec3 lpvIrr = sampleLPV(p + n * 0.04, n, sunPatch, gridRes, spread);\n    vec3 indirect = alb * lpvIrr * giGain;\n\n    // Show subtle 3D LPV voxel cell boundaries on surfaces so the lattice scale is immediately legible\n    vec3 vf = abs(fract(p * gridRes - 0.5) - 0.5);\n    float vEdge = smoothstep(0.035, 0.008, min(vf.x, min(vf.y, vf.z)));\n\n    vec3 leftCol = direct + alb * vec3(0.03, 0.035, 0.045);\n    vec3 rightCol = direct + indirect + lpvIrr * vEdge * 0.18;\n    col = (screenX < split) ? leftCol : rightCol;\n  }\n\n  float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));\n  col = mix(col, vec3(0.95, 0.97, 1.0), sep);\n\n  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);\n}",
   "execution_fidelity": "reduced-sandbox",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-30",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "light-propagation-volumes",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T19:04:32.000Z",
     "renderer": "Headless EGL Tesla T4/PCIe/SSE2, OpenGL 3.30 Core, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.4274,
      "std": 0.247,
      "min": 0.1255,
      "max": 0.9557
     },
     "image": "/specimens/light-propagation-volumes-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "reflective-shadow-maps",
  "voxel-cone-tracing",
  "ddgi",
  "radiance-cascades"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [
  {
   "id": "reflective-shadow-maps",
   "why": "RSM texels are the virtual lights that get injected into the volume."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/gi/light-propagation-volumes.json"
 },
 "solves": [
  "cheap dynamic indirect lighting for older hardware",
  "one-bounce gi with no baking or ray tracing",
  "diffuse color bleeding in moving scenes",
  "gi that fits in a small frame time budget"
 ],
 "authority": "Kaplanyan & Dachsbacher, 2010",
 "url": "https://texelatlas.vercel.app/t/light-propagation-volumes/",
 "execution_fidelity": "reduced-sandbox",
 "fidelity_label": "Analytic Sandbox",
 "benchmark_eligible": true,
 "gpu_weight": {
  "weight_x": 34,
  "tier": "heavy",
  "p50_ms": 1.0676,
  "p95_ms": 1.1509,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "light-propagation-volumes-live",
  "execution_fidelity": "reduced-sandbox",
  "fidelity_label": "Analytic Sandbox",
  "benchmark_eligible": true,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 33.2,
   "tier": "heavy",
   "p50_ms": 0.5246,
   "p95_ms": 0.5251,
   "speedup_x": 2.04,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 22.17,
   "tier": "heavy",
   "p50_ms": 0.6384,
   "p95_ms": 0.6391,
   "speedup_x": 1.67,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}