Irradiance Volumes and Light Probes
Stores precomputed irradiance at points in space (often as low-order spherical harmonics) and interpolates between them to light moving objects with indirect light consistent with the baked environment.
Also known as light probes, ambient cubes, probe grids
In the family Light transport & global illumination, probe-based GI
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | Official add-on | import { LightProbeGrid } from 'three/addons/lighting/LightProbeGrid.js' docs |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | Built in | Add LightmapProbe nodes under a baked LightmapGI for dynamic objects docs |
| Unity | Built in | GameObject > Light > Adaptive Probe Volume (or Light Probe Group) docs Adaptive Probe Volumes (baked) and Light Probe Groups, URP and HDRP. |
| Unreal 5.7 | Built in | Volumetric Lightmaps built by Lightmass (World Settings > Lightmass > Volume Lighting Sample Placement Scale) docs Precomputed SH volumetric lightmap. |
| Blender 5.2 | Built in | Add > Light Probe > Volume, then Bake Light Caches (EEVEE) docs |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
A light probe records how much light arrives at a point from each direction, compressed into a handful of coefficients, usually L1 or L2 Spherical-Harmonic Lighting (Irradiance Environment Maps) or a six-sided ambient cube. Probes are placed on a regular grid, on an adaptive tetrahedral mesh, or by hand near interesting lighting changes.
Baking computes each probe's radiance from a skyline and scene capture (or an offline Unidirectional Path Tracing of the neighbourhood) and projects it into the basis. At runtime an object finds the probes surrounding it, interpolates their coefficients (trilinearly in a grid, barycentrically in a tetrahedralization), and evaluates the irradiance for its normal in the shader. Because only a few numbers per probe are needed, thousands fit in a small buffer.
Common refinements: visibility-aware interpolation to prevent probes on the wrong side of a wall from contributing, adaptive probe volumes that subdivide where lighting varies, and runtime-updated probes (Dynamic Diffuse Global Illumination (DDGI)) for dynamic GI.
When to choose it
Reach for it when
- dynamic characters look unlit in baked scenes
- moving props don't pick up indirect light
- need bounce light on objects without lightmaps
- fog and particles need indirect lighting in baked levels
Choose it for lighting dynamic characters and props in baked scenes, and for adding indirect light to volumes (fog, particles) where lightmaps cannot go.
Prefer Lightmap Baking for large static surfaces where per-texel detail is needed. Prefer Dynamic Diffuse Global Illumination (DDGI) when the probes must update at runtime. Prefer Precomputed Radiance Transfer when objects need self-shadowing under changing low-frequency light. Prefer Spherical-Harmonic Lighting (Irradiance Environment Maps) alone when a single global environment is enough.
Field marks
- Light leaking when interpolation mixes probes separated by a wall
- Low-order SH gives soft, low-contrast lighting that cannot represent sharp shadows or strong directional light, and can ring (negative lobes)
- Pop or discontinuity when an object switches tetrahedron or crosses a probe-volume boundary
- Probe placement inside geometry produces black or wrong probes unless invalid ones are detected and filled
Presets
Irradiance Volumes & Light Probes — 3D trilinear SH probe lattice & directional probe spheres
{
"P_PROBE_SIZE": 0.11,
"P_GI_STRENGTH": 1.25,
"P_SUN_SWEEP": 1,
"P_SH_CONTRAST": 1
}Show GLSL (157 lines)
const float P_PROBE_SIZE = 0.11; // P Probe Sphere Size [0.0, 0.18, 0.005]
const float P_GI_STRENGTH = 1.25; // P Volume GI Gain [0.2, 2.4, 0.05]
const float P_SUN_SWEEP = 1.0; // P Sun Motion [0.0, 2.5, 0.05]
const float P_SH_CONTRAST = 1.0; // P SH Directionality [0.2, 1.8, 0.05]
float sdBox(vec3 p, vec3 b) {
vec3 q = abs(p) - b;
return length(max(q, 0.0)) + min(max(q.x, max(q.y, q.z)), 0.0);
}
// Architectural gallery + 3x2x2 lattice of floating SH light-probe spheres
vec2 mapScene(vec3 p, float probeR) {
vec2 res = vec2(1.0 + p.y, 1.0); // floor
float cD = 1.0 - p.y; if (cD < res.x) res = vec2(cD, 1.0);
float bD = 1.50 + p.z; if (bD < res.x) res = vec2(bD, 1.0);
float lD = 1.50 + p.x; if (lD < res.x) res = vec2(lD, 2.0); // warm amber-crimson wall
float rD = 1.50 - p.x; if (rD < res.x) res = vec2(rD, 3.0); // cool azure wall
// Central matte sculpture pedestal
float dPed = sdBox(p - vec3(0.0, -0.62, -0.35), vec3(0.42, 0.38, 0.34)) - 0.025;
if (dPed < res.x) res = vec2(dPed, 4.0);
float dStat = length(p - vec3(0.0, -0.02, -0.35)) - 0.26;
if (dStat < res.x) res = vec2(dStat, 4.0);
// Visible 3D irradiance probe lattice (3 in X, 2 in Y, 2 in Z)
if (probeR > 0.005) {
vec3 q = p - vec3(0.0, 0.05, -0.25);
vec3 id = clamp(floor(q / vec3(0.88, 0.78, 0.85) + 0.5), vec3(-1.0, 0.0, -1.0), vec3(1.0, 1.0, 0.0));
vec3 cellC = id * vec3(0.88, 0.78, 0.85) + vec3(0.0, 0.05, -0.25);
float dProbe = length(p - cellC) - probeR;
if (dProbe < res.x) res = vec2(dProbe, 5.0);
}
return res;
}
vec3 calcNormal(vec3 p, float probeR) {
vec2 e = vec2(0.0025, 0.0);
return normalize(vec3(
mapScene(p + e.xyy, probeR).x - mapScene(p - e.xyy, probeR).x,
mapScene(p + e.yxy, probeR).x - mapScene(p - e.yxy, probeR).x,
mapScene(p + e.yyx, probeR).x - mapScene(p - e.yyx, probeR).x
));
}
// Evaluate L0 + L1 Spherical Harmonics irradiance at a single 3D probe location probePos in direction dir
vec3 evalSHProbe(vec3 probePos, vec3 dir, vec3 sunPos, float shContrast) {
// L0 isotropic ambient base
vec3 l0 = vec3(0.14, 0.16, 0.21);
// Directional SH lobes from warm crimson left wall, azure right wall, skylight ceiling, and moving sun bounce
float wLeft = exp(-max(probePos.x + 1.5, 0.0) * 0.75);
float wRight = exp(-max(1.5 - probePos.x, 0.0) * 0.75);
float wCeil = exp(-max(1.0 - probePos.y, 0.0) * 0.85);
vec3 toSun = sunPos - probePos;
float rSun = length(toSun) + 0.45;
vec3 dirSun = toSun / max(length(toSun), 1e-4);
// Cosine-convolved SH basis: 0.5 + 0.5 * dot(dir, sourceDir)
float cL = mix(0.5, max(dot(dir, vec3(-1.0, 0.0, 0.0)), 0.0), clamp(shContrast, 0.1, 1.5));
float cR = mix(0.5, max(dot(dir, vec3(1.0, 0.0, 0.0)), 0.0), clamp(shContrast, 0.1, 1.5));
float cU = mix(0.5, max(dot(dir, vec3(0.0, 1.0, 0.0)), 0.0), clamp(shContrast, 0.1, 1.5));
float cS = mix(0.5, max(dot(dir, dirSun), 0.0), clamp(shContrast, 0.1, 1.5));
vec3 irr = l0;
irr += vec3(1.18, 0.26, 0.14) * wLeft * cL * 1.15;
irr += vec3(0.14, 0.56, 1.18) * wRight * cR * 1.15;
irr += vec3(0.65, 0.78, 0.96) * wCeil * cU * 0.55;
irr += vec3(1.45, 1.12, 0.56) * cS / (rSun * rSun * 0.75 + 0.35);
return irr;
}
// Trilinear interpolation across the 3D irradiance probe volume grid
vec3 sampleIrradianceVolume(vec3 p, vec3 n, vec3 sunPos, float shContrast) {
vec3 stepSz = vec3(0.88, 0.78, 0.85);
vec3 q = (p - vec3(0.0, 0.05, -0.25)) / stepSz;
vec3 b = floor(q);
vec3 f = fract(q);
vec3 o = vec3(0.0, 0.05, -0.25);
vec3 p000 = evalSHProbe((b + vec3(0.0, 0.0, 0.0)) * stepSz + o, n, sunPos, shContrast);
vec3 p100 = evalSHProbe((b + vec3(1.0, 0.0, 0.0)) * stepSz + o, n, sunPos, shContrast);
vec3 p010 = evalSHProbe((b + vec3(0.0, 1.0, 0.0)) * stepSz + o, n, sunPos, shContrast);
vec3 p110 = evalSHProbe((b + vec3(1.0, 1.0, 0.0)) * stepSz + o, n, sunPos, shContrast);
vec3 p001 = evalSHProbe((b + vec3(0.0, 0.0, 1.0)) * stepSz + o, n, sunPos, shContrast);
vec3 p101 = evalSHProbe((b + vec3(1.0, 0.0, 1.0)) * stepSz + o, n, sunPos, shContrast);
vec3 p011 = evalSHProbe((b + vec3(0.0, 1.0, 1.0)) * stepSz + o, n, sunPos, shContrast);
vec3 p111 = evalSHProbe((b + vec3(1.0, 1.0, 1.0)) * stepSz + o, n, sunPos, shContrast);
vec3 x00 = mix(p000, p100, f.x);
vec3 x10 = mix(p010, p110, f.x);
vec3 x01 = mix(p001, p101, f.x);
vec3 x11 = mix(p011, p111, f.x);
return mix(mix(x00, x10, f.y), mix(x01, x11, f.y), f.z);
}
vec3 aces(vec3 x) {
x = max(x, 0.0);
return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
float tAnim = iTime * max(P_SUN_SWEEP, 0.0);
float probeR = clamp(P_PROBE_SIZE, 0.0, 0.20);
float giGain = max(P_GI_STRENGTH, 0.0);
float shCon = clamp(P_SH_CONTRAST, 0.15, 1.8);
vec3 ro = vec3(0.28 * sin(tAnim * 0.35), 0.16, 2.35);
vec3 ta = vec3(0.0, -0.05, -0.45);
vec3 fw = normalize(ta - ro);
vec3 rt = normalize(cross(fw, vec3(0.0, 1.0, 0.0)));
vec3 up = cross(rt, fw);
vec3 rd = normalize(fw * 1.48 + rt * uv.x + up * uv.y);
vec3 sunPos = vec3(0.95 * cos(tAnim * 0.65), 0.72, -0.35 + 0.55 * sin(tAnim * 0.65));
vec3 col = vec3(0.02);
float t = 0.0;
float matId = 0.0;
bool hit = false;
for (int i = 0; i < 68; i++) {
vec2 h = mapScene(ro + rd * t, probeR);
if (h.x < 0.002) { hit = true; matId = h.y; break; }
t += h.x;
if (t > 10.0) break;
}
if (hit) {
vec3 p = ro + rd * t;
vec3 n = calcNormal(p, probeR);
if (matId > 4.5) {
// Light Probe visualization sphere: directly displays its stored directional SH irradiance E(n)!
vec3 shVis = evalSHProbe(p, n, sunPos, shCon) * giGain;
float rim = pow(1.0 - max(dot(n, -rd), 0.0), 3.0);
col = shVis + vec3(0.85, 0.92, 1.0) * rim * 0.35;
} else {
vec3 alb = vec3(0.76, 0.76, 0.74);
if (matId > 1.5 && matId < 2.5) alb = vec3(0.88, 0.22, 0.14);
else if (matId > 2.5 && matId < 3.5) alb = vec3(0.14, 0.46, 0.88);
else if (matId > 3.5) alb = vec3(0.86, 0.85, 0.83);
// Direct light from moving overhead warm lamp
vec3 toL = sunPos - p;
float dL = length(toL);
vec3 lDir = toL / max(dL, 1e-4);
float diff = max(dot(n, lDir), 0.0);
vec3 direct = alb * vec3(1.9, 1.65, 1.25) * diff / (1.0 + 0.55 * dL * dL);
// Trilinearly interpolated 3D Irradiance Volume GI
vec3 irr = sampleIrradianceVolume(p, n, sunPos, shCon);
col = direct + alb * irr * giGain * 0.72;
}
}
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Attribution: Original interactive WebGL2 fragment shader written for Texel Atlas (MIT).
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| irradiance-volumes-live | Tesla T4 1920x1080 | 25.9× baseline (heavy) · 0.814 ms / 0.858 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| irradiance-volumes-live | NVIDIA L4 1920x1080 | 26.6× baseline (heavy) · 0.420 ms / 0.427 ms · 1.9× faster on L4 | opengl-timer-query · Cross-architecture validation |
| irradiance-volumes-live | NVIDIA A100-SXM4-40GB 1920x1080 | 17.2× baseline (moderate) · 0.494 ms / 0.502 ms · 1.6× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): cited by Light Propagation Volumes, Neural Radiance Caching, Spherical-Harmonic Lighting (Irradiance Environment Maps).
Crosses
- Lightmap Baking: Lightmaps cover static surfaces; the same bake feeds probes for moving objects.
Sources
- primaryG. Greger, P. Shirley, P.M. Hubbard, D.P. Greenberg (1998). The irradiance volume. IEEE Computer Graphics and Applications.Verified via crossref · 2026-11-29doi:10.1109/38.656788