{
 "id": "reflection-probes-parallax-corrected-cubemaps",
 "title": "Reflection probes with parallax-corrected cubemaps",
 "aliases": [
  "box projected cubemaps",
  "local cubemap reflections",
  "box projection",
  "reflection probes"
 ],
 "domain": "gi",
 "subdomain": "specular probes",
 "stage": "lighting",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "mobile-gpu",
  "unity",
  "unreal",
  "godot"
 ],
 "year_introduced": 2012,
 "inputs": [
  "hdr-image",
  "gbuffer"
 ],
 "outputs": [
  "radiance"
 ],
 "style": "photoreal",
 "dynamic": "both",
 "summary": "Local specular probes: a cubemap is captured at a point in a room and its lookup is corrected with a proxy box, so reflections shift with the viewer and sit where the real walls are instead of at infinity.",
 "how_it_works": "A reflection probe is a cubemap rendered or baked at a capture position, with a proxy volume (usually an axis-aligned or oriented box) that approximates the room around it. A plain cubemap lookup uses only the reflection direction, which behaves as if every wall were infinitely far away, so reflections slide with the camera and float on floors.\n\nThe correction intersects the reflected ray, starting at the shaded point, with the proxy box and takes the exit point. The lookup direction becomes `exitPoint - probePosition`, so the cubemap is sampled where that ray would land seen from the capture position. Reflections then stay anchored to the walls, and the floor reflection of a window lands under the window.\n\nProbes carry an influence volume. Pixels blend between overlapping probes by distance or priority, the cubemap is prefiltered by roughness into its mip chain as in [split-sum-ibl](split-sum-ibl), and the result is multiplied by specular occlusion because the cubemap knows nothing about local blockers. Probes can be baked once or re-captured at a low rate for dynamic scenes.",
 "when_to_use": "Choose it as the baseline local specular lighting in interiors and mixed scenes: it costs one box intersection and one cubemap fetch per pixel and works on WebGL2 and mobile.\n\nPrefer [environment-mapping-cubemaps](environment-mapping-cubemaps) for sky and distant HDRI backdrops where parallax does not matter. Prefer [screen-space-reflections](screen-space-reflections) for sharp reflections of on-screen dynamic objects, and fall back to this probe where SSR has no data. Prefer [hybrid-ray-traced-reflections](hybrid-ray-traced-reflections) when hardware ray tracing is available and probes are too coarse. Prefer [planar-reflections-oblique-clipping](planar-reflections-oblique-clipping) for a single flat mirror or water plane that needs exact reflections.",
 "cost": {
  "class": "cheap",
  "notes": "A ray-box intersection and a cubemap sample per pixel; capture and prefilter cost is paid at bake time or amortised over frames."
 },
 "failure_modes": [
  "Proxy box mismatch: where real walls are not on the box, reflected edges bend or doubled corners appear",
  "Objects between the surface and the proxy wall are baked at the probe position, so they reflect with the wrong parallax or appear smeared",
  "Visible pops when blending between overlapping probes if influence volumes do not fade smoothly",
  "Reflection of the probe's own capture position: surfaces near the capture point appear in their own reflections",
  "Light leaks when a probe sees the outdoors through a window and its volume spills into the neighbouring room",
  "Dynamic objects and lights are missing unless the probe is re-captured, which then costs a cubemap render and prefilter"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "url:https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap",
   "type": "web",
   "title": "Image-based Lighting approaches and parallax-corrected cubemap",
   "authors": [
    "Sébastien Lagarde"
   ],
   "year": null,
   "venue": "seblagarde.wordpress.com",
   "url": "https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261117084234/https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap/",
     "timestamp": "20261117084234"
    },
    "page_title": "Image-based Lighting approaches and parallax-corrected cubemap",
    "host": "seblagarde.wordpress.com",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap → 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://seblagarde.wordpress.com/2012/09/29/image-based-lighting-approaches-and-parallax-corrected-cubemap → 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": 1,
   "__bib": "lagardeimage"
  },
  {
   "role": "talk",
   "key": "url:https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf",
   "type": "web",
   "title": "Moving Frostbite to Physically Based Rendering",
   "authors": [
    "Sébastien Lagarde",
    "Charles de Rousiers"
   ],
   "year": null,
   "venue": "SIGGRAPH 2014 course",
   "url": "https://seblagarde.wordpress.com/wp-content/uploads/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": null,
    "page_title": null,
    "host": "seblagarde.wordpress.com",
    "title_confirmed_by_page": false,
    "title_unconfirmed": false
   },
   "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://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf → 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": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "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": null,
   "__bib": "lagardemoving"
  },
  {
   "role": "implementation",
   "key": "gh:mrdoob/three.js",
   "type": "code",
   "title": "mrdoob/three.js",
   "description": "JavaScript 3D Library.",
   "authors": [
    "mrdoob"
   ],
   "year": 2010,
   "venue": "GitHub",
   "url": "https://github.com/mrdoob/three.js",
   "ids": {
    "repo": "mrdoob/three.js"
   },
   "license": "MIT",
   "extra": {
    "stars": 119718,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2026-11-29T11:39:51Z",
    "language": "JavaScript",
    "homepage": "https://threejs.org/",
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/mrdoob/three.js",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "mrdoob2010mrdoob"
  }
 ],
 "presets": [
  {
   "id": "parallax-corrected-reflection-split",
   "title": "Box-projected vs plain cubemap floor reflection",
   "runtime": "glsl-fragment",
   "params": {
    "box_min": [
     -4,
     -1,
     -4
    ],
    "box_max": [
     4,
     3,
     4
    ],
    "probe": [
     0,
     1,
     0
    ]
   },
   "code": "// Parallax-corrected (box-projected) reflection probe: left half uncorrected, right half corrected.\nconst vec3 BMIN = vec3(-4.0, -1.0, -4.0);   // probe proxy volume (room)\nconst vec3 BMAX = vec3( 4.0,  3.0,  4.0);\nconst vec3 PROBE = vec3(0.0, 1.0, 0.0);      // capture position of the cubemap\n\n// Stand-in for a baked cubemap: depends on direction only.\nvec3 cubemap(vec3 d) {\n  vec3 a = abs(d); vec2 uv; vec3 col;\n  if (a.x >= a.y && a.x >= a.z) { uv = d.yz / a.x; col = d.x > 0.0 ? vec3(0.9, 0.3, 0.25) : vec3(0.25, 0.5, 0.9); }\n  else if (a.y >= a.z)          { uv = d.xz / a.y; col = d.y > 0.0 ? vec3(0.9, 0.9, 0.85) : vec3(0.35); }\n  else                          { uv = d.xy / a.z; col = d.z > 0.0 ? vec3(0.3, 0.8, 0.4) : vec3(0.9, 0.8, 0.3); }\n  vec2 g = floor(uv * 3.0 + 3.0);\n  float c = mod(g.x + g.y, 2.0);\n  return col * (0.45 + 0.55 * c);\n}\n// Ray from p inside the box: exit point.\nvec3 boxExit(vec3 p, vec3 d) {\n  vec3 t = max((BMAX - p) / d, (BMIN - p) / d);\n  return p + d * min(t.x, min(t.y, t.z));\n}\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  vec3 ro = vec3(sin(iTime * 0.5) * 1.0, 0.2, -3.2);\n  vec3 rd = normalize(vec3(uv.x, uv.y - 0.3, 1.0));\n  vec3 col;\n  if (rd.y < -0.001) {\n    float t = (BMIN.y - ro.y) / rd.y;\n    vec3 p = ro + rd * t;\n    vec3 r = reflect(rd, vec3(0.0, 1.0, 0.0));\n    vec3 lookup = (uv.x < 0.0) ? r : boxExit(p, r) - PROBE;\n    float fres = 0.04 + 0.96 * pow(1.0 - clamp(-rd.y, 0.0, 1.0), 5.0);\n    col = vec3(0.04, 0.05, 0.06) + cubemap(lookup) * (0.35 + 0.65 * fres);\n  } else {\n    col = cubemap(boxExit(ro, rd) - PROBE);\n  }\n  col *= 1.0 - 0.9 * smoothstep(0.004, 0.0, abs(uv.x));\n  fragColor = vec4(pow(col, vec3(1.0 / 2.2)), 1.0);\n}\n",
   "basis": "original",
   "license_note": "written for this index",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-29",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "reflection-probes-parallax-corrected-cubemaps",
     "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.584,
      "std": 0.1242,
      "unique_colors": 69
     },
     "image": "/specimens/parallax-corrected-reflection-split.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "split-sum-ibl",
  "screen-space-reflections",
  "environment-mapping-cubemaps",
  "spherical-harmonics-lighting",
  "irradiance-volumes",
  "ground-truth-specular-occlusion"
 ],
 "extends": [
  "environment-mapping-cubemaps"
 ],
 "supersedes": [],
 "combines_with": [
  {
   "id": "split-sum-ibl",
   "why": "The probe cubemap is prefiltered by roughness into the mip chain that the split-sum lookup samples; the box projection only changes the lookup direction."
  },
  {
   "id": "ground-truth-specular-occlusion",
   "why": "Supplies the per-pixel occlusion factor that hides probe reflections inside crevices the cubemap cannot know about."
  },
  {
   "id": "screen-space-reflections",
   "why": "SSR overrides the probe where the screen has a hit and the probe fills in misses and off-screen content."
  }
 ],
 "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/reflection-probes-parallax-corrected-cubemaps.json"
 },
 "solves": [
  "reflections on a floor slide when the camera moves",
  "cubemap reflections look pasted on instead of in the room",
  "need cheap local specular reflections for interiors",
  "reflections of walls float at infinity on glossy floors"
 ],
 "authority": "Lagarde",
 "url": "https://texelatlas.vercel.app/t/reflection-probes-parallax-corrected-cubemaps/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 1.84,
  "tier": "feather",
  "p50_ms": 0.0607,
  "p95_ms": 0.0635,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "parallax-corrected-reflection-split",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 1.47,
   "tier": "feather",
   "p50_ms": 0.0234,
   "p95_ms": 0.0238,
   "speedup_x": 2.59,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 1.08,
   "tier": "feather",
   "p50_ms": 0.0311,
   "p95_ms": 0.0312,
   "speedup_x": 1.95,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}