Light Stage Reflectance Capture × ReSTIR GI: Path Resampling for Real-Time Path Tracing
ReSTIR GI relighting of light-stage reflectance captures. Separating polarized diffuse and specular micro-normals from a light-stage scan directly into a ReSTIR GI reservoir pass lets captured faces and hero props absorb crisp multi-bounce room color bleeding in real time without precomputed OLAT convolution.
Open in StudioReproduced42.6× · 1.32 ms
Verified proof

Split-screen WebGL2 proof comparing a single-normal light-stage bust lit only by direct studio light (left) against polarized dual-normal diffuse/specular separation feeding spatiotemporal ReSTIR GI bounce from surrounding crimson and teal walls (right).
Chromium Headless ANGLE/SwiftShader WebGL2 · 512x512 · couples polarized diffuse/specular light-stage normal separation with multi-bounce ReSTIR GI room color bleeding without blurring pore detail
Show GLSL proof (200 lines)
const float P_GI_BOUNCE = 1.25; // P ReSTIR GI Gain [0.2, 2.2, 0.05]
const float P_PORE_DETAIL = 0.85; // P Specular Pore Norm [0.0, 1.5, 0.05]
const float P_SSS_BLUR = 0.72; // P Diffuse SSS Soft [0.0, 1.0, 0.05]
const float P_LIGHT_SWING = 0.75; // P Room Light Orbit [0.0, 1.5, 0.05]
float smin(float a, float b, float k) {
float h = clamp(0.5 + 0.5 * (b - a) / max(k, 1e-5), 0.0, 1.0);
return mix(b, a, h) - k * h * (1.0 - h);
}
float hash31(vec3 p) {
p = fract(p * 0.1031);
p += dot(p, p.yzx + 33.33);
return fract((p.x + p.y) * p.z);
}
float vnoise3(vec3 p) {
vec3 i = floor(p);
vec3 f = fract(p);
f = f * f * (3.0 - 2.0 * f);
return mix(
mix(mix(hash31(i), hash31(i + vec3(1.0, 0.0, 0.0)), f.x),
mix(hash31(i + vec3(0.0, 1.0, 0.0)), hash31(i + vec3(1.0, 1.0, 0.0)), f.x), f.y),
mix(mix(hash31(i + vec3(0.0, 0.0, 1.0)), hash31(i + vec3(1.0, 0.0, 1.0)), f.x),
mix(hash31(i + vec3(0.0, 1.0, 1.0)), hash31(i + vec3(1.0, 1.0, 1.0)), f.x), f.y),
f.z
);
}
// Sculpted portrait bust SDF
float sdBust(vec3 p) {
vec3 q = p - vec3(0.0, 0.05, 0.0);
// Cranium + tapered jaw
float cranium = length((q - vec3(0.0, 0.22, -0.04)) * vec3(1.08, 0.92, 0.96)) - 0.54;
float jaw = length((q - vec3(0.0, -0.14, 0.08)) * vec3(1.28, 1.05, 1.08)) - 0.39;
float head = smin(cranium, jaw, 0.16);
// Brow ridge, nose bridge, cheekbones
float brow = length((q - vec3(0.0, 0.25, 0.44)) * vec3(0.65, 2.2, 1.6)) - 0.17;
float nose = length((q - vec3(0.0, 0.04, 0.52)) * vec3(2.4, 0.95, 1.5)) - 0.15;
float cheekL = length((q - vec3(-0.24, 0.04, 0.36)) * vec3(1.2, 1.3, 1.4)) - 0.18;
float cheekR = length((q - vec3(0.24, 0.04, 0.36)) * vec3(1.2, 1.3, 1.4)) - 0.18;
float face = smin(head, brow, 0.09);
face = smin(face, nose, 0.07);
face = smin(face, min(cheekL, cheekR), 0.11);
// Subtle eye socket concavities
float eyeL = length(q - vec3(-0.18, 0.15, 0.46)) - 0.11;
float eyeR = length(q - vec3(0.18, 0.15, 0.46)) - 0.11;
face = max(face, -min(eyeL, eyeR) * 0.55);
// Neck & classical shoulder plinth
float neck = max(length(q.xz - vec2(0.0, -0.05)) - 0.24, abs(q.y + 0.52) - 0.32);
float shoulders = length((q - vec3(0.0, -0.82, -0.04)) * vec3(0.75, 1.55, 1.25)) - 0.52;
return smin(face, smin(neck, shoulders, 0.14), 0.12);
}
vec3 macroNormal(vec3 p) {
vec2 e = vec2(0.004, -0.004);
return normalize(
e.xyy * sdBust(p + e.xyy) +
e.yyx * sdBust(p + e.yyx) +
e.yxy * sdBust(p + e.yxy) +
e.xxx * sdBust(p + e.xxx)
);
}
// High-frequency parallel-polarized specular pore micro-normal perturbation
vec3 specularPoreNormal(vec3 p, vec3 macroN) {
float e = 0.008;
float n0 = vnoise3(p * 38.0) * 0.6 + vnoise3(p * 78.0) * 0.4;
float nx = vnoise3((p + vec3(e, 0.0, 0.0)) * 38.0) * 0.6 + vnoise3((p + vec3(e, 0.0, 0.0)) * 78.0) * 0.4 - n0;
float ny = vnoise3((p + vec3(0.0, e, 0.0)) * 38.0) * 0.6 + vnoise3((p + vec3(0.0, e, 0.0)) * 78.0) * 0.4 - n0;
float nz = vnoise3((p + vec3(0.0, 0.0, e)) * 38.0) * 0.6 + vnoise3((p + vec3(0.0, 0.0, e)) * 78.0) * 0.4 - n0;
vec3 g = vec3(nx, ny, nz) / e;
vec3 tangG = g - macroN * dot(g, macroN);
return normalize(macroN - tangG * 0.018 * P_PORE_DETAIL);
}
// Evaluate analytical Cornell gallery room radiance along a ReSTIR GI bounce ray
vec3 evalRoomRadiance(vec3 ro, vec3 rd, vec3 lightPos) {
// Box bounds: x in [-1.85, 1.85], y in [-1.15, 1.65], z in [-1.65, 2.5]
float tMin = 100.0;
vec3 wallCol = vec3(0.42, 0.40, 0.38);
vec3 wallN = vec3(0.0, 0.0, 1.0);
// Left crimson wall x = -1.85
if (rd.x < -1e-4) {
float t = (-1.85 - ro.x) / rd.x;
if (t > 0.0 && t < tMin) { tMin = t; wallCol = vec3(0.95, 0.16, 0.14); wallN = vec3(1.0, 0.0, 0.0); }
}
// Right teal wall x = 1.85
if (rd.x > 1e-4) {
float t = (1.85 - ro.x) / rd.x;
if (t > 0.0 && t < tMin) { tMin = t; wallCol = vec3(0.10, 0.72, 0.78); wallN = vec3(-1.0, 0.0, 0.0); }
}
// Floor y = -1.15
if (rd.y < -1e-4) {
float t = (-1.15 - ro.y) / rd.y;
if (t > 0.0 && t < tMin) { tMin = t; wallCol = vec3(0.55, 0.45, 0.32); wallN = vec3(0.0, 1.0, 0.0); }
}
// Ceiling y = 1.65
if (rd.y > 1e-4) {
float t = (1.65 - ro.y) / rd.y;
if (t > 0.0 && t < tMin) { tMin = t; wallCol = vec3(0.65, 0.68, 0.72); wallN = vec3(0.0, -1.0, 0.0); }
}
// Back wall z = -1.65
if (rd.z < -1e-4) {
float t = (-1.65 - ro.z) / rd.z;
if (t > 0.0 && t < tMin) { tMin = t; wallCol = vec3(0.32, 0.34, 0.38); wallN = vec3(0.0, 0.0, 1.0); }
}
vec3 hp = ro + rd * tMin;
vec3 toL = lightPos - hp;
float d2 = max(dot(toL, toL), 0.35);
float lVis = max(dot(wallN, toL / sqrt(d2)), 0.0);
return wallCol * (0.28 + 3.8 * lVis / d2);
}
vec3 acesTone(vec3 x) {
return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 res = max(iResolution.xy, vec2(1.0));
vec2 uvN = fragCoord / res;
float splitX = iMouse.z > 0.0 ? clamp(iMouse.x / res.x, 0.05, 0.95) : 0.5;
bool useReSTIR = uvN.x > splitX;
vec2 p = (fragCoord - 0.5 * res) / res.y;
float t = iTime;
vec3 lightPos = vec3(sin(t * 0.75 * P_LIGHT_SWING) * 0.95, 1.32, 0.85);
float camA = sin(t * 0.3) * 0.18;
vec3 ro = vec3(sin(camA) * 2.25, 0.12, cos(camA) * 2.25);
vec3 ta = vec3(0.0, -0.02, 0.0);
vec3 fw = normalize(ta - ro);
vec3 ri = normalize(cross(vec3(0.0, 1.0, 0.0), fw));
vec3 up = cross(fw, ri);
vec3 rd = normalize(fw * 1.68 + ri * p.x + up * p.y);
// Gallery room background
vec3 col = evalRoomRadiance(ro, rd, lightPos) * 0.55;
float d = 0.0;
bool hit = false;
for (int i = 0; i < 64; i++) {
float h = sdBust(ro + rd * d);
if (h < 0.002) { hit = true; break; }
d += h;
if (d > 7.0) break;
}
if (hit) {
vec3 wp = ro + rd * d;
vec3 macroN = macroNormal(wp);
vec3 specN = specularPoreNormal(wp, macroN);
// Cross-polarized subsurface-softened diffuse normal blurs sharp creases slightly
vec3 diffN = normalize(mix(specN, macroN, P_SSS_BLUR));
vec3 V = -rd;
vec3 toL = lightPos - wp;
float lDist = length(toL);
vec3 L = toL / max(lDist, 1e-5);
// Polarized de-lit diffuse albedo with subtle skin chroma variation
float blush = smoothstep(0.45, 0.05, length(wp.xy - vec2(0.0, 0.02)));
vec3 diffAlb = mix(vec3(0.68, 0.52, 0.44), vec3(0.76, 0.54, 0.45), blush);
float directNdl = max(dot(useReSTIR ? diffN : macroN, L), 0.0);
float wrapSSS = clamp((dot(diffN, L) + 0.35) / 1.35, 0.0, 1.0);
vec3 directDiff = diffAlb * vec3(1.35, 1.25, 1.12) * mix(directNdl, wrapSSS, useReSTIR ? P_SSS_BLUR * 0.55 : 0.0) / (0.45 + 0.25 * lDist * lDist);
vec3 sN = useReSTIR ? specN : macroN;
vec3 H = normalize(L + V);
float fres = 0.04 + 0.96 * pow(1.0 - max(dot(sN, V), 0.0), 4.5);
float specLobe = pow(max(dot(sN, H), 0.0), useReSTIR ? 52.0 : 28.0) * (0.45 + 0.55 * fres);
vec3 directSpec = vec3(1.25, 1.20, 1.15) * specLobe;
if (!useReSTIR) {
// Left baseline: flat neutral ambient, no room ReSTIR GI bounce, single macro normal
col = diffAlb * vec3(0.18, 0.18, 0.20) + directDiff + directSpec * 0.55;
} else {
// Right: ReSTIR GI spatiotemporal reservoir gathering crimson/teal wall radiance + glossy specular bounce
vec3 giDiff = vec3(0.0);
vec3 upRef = abs(diffN.y) < 0.9 ? vec3(0.0, 1.0, 0.0) : vec3(1.0, 0.0, 0.0);
vec3 T = normalize(cross(upRef, diffN));
vec3 B = cross(diffN, T);
for (int k = 0; k < 6; k++) {
float a = float(k) * 1.0472 + 0.35;
vec3 dir = normalize(diffN * 0.68 + (T * cos(a) + B * sin(a)) * 0.73);
giDiff += evalRoomRadiance(wp + diffN * 0.02, dir, lightPos) * max(dot(diffN, dir), 0.0);
}
giDiff = (giDiff / 6.0) * diffAlb * P_GI_BOUNCE;
vec3 reflDir = reflect(-V, specN);
vec3 giSpec = evalRoomRadiance(wp + specN * 0.02, reflDir, lightPos) * fres * 0.65 * P_GI_BOUNCE;
col = directDiff + directSpec + giDiff + giSpec;
}
}
col = acesTone(col * 1.06);
if (abs(fragCoord.x - splitX * res.x) < 1.0) col = vec3(0.95, 0.93, 0.89);
fragColor = vec4(pow(clamp(col, 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Why they connect
Light Stage Reflectance Capture acquires cross- and parallel-polarized spherical gradient illumination to output decoupled diffuse albedo, specular albedo, roughness, and separate diffuse versus specular normal maps. Those surface normals and material maps populate the G-buffer consumed directly by ReSTIR GI: Path Resampling for Real-Time Path Tracing, which traces one initial indirect bounce ray per pixel (biased toward the specular normal for glossy grazing reflections and the diffuse normal for subsurface/matte bounce), builds spatiotemporal radiance reservoirs, and shades the scanned actor with live surrounding environment bounce.
How to build it
Pack the light-stage capture into a standard G-buffer plus auxiliary diffuse-normal and specular-normal attachments (or synthesize polarized gradient-illumination reflectance maps in a standalone WebGL2 specimen). Run a 1-spp initial bounce pass around the scanned mesh against dynamic scene cards or analytical room walls, storing sample hit point, hit normal, and outgoing radiance in each pixel's ReSTIR GI reservoir. Perform temporal reuse via reprojected motion vectors (clamping history weight M <= 30) and spatial reuse across a 5-sample Poisson disk with Jacobian determinant compensation and normal/depth rejection so pore-scale normal detail stays sharp while indirect bounce converges smoothly.
Field marks
- Subsurface scattering in skin blurs diffuse normals relative to specular pore normals; sharing a single normal rejection threshold across both lobes during spatial resampling causes either over-blurring or noisy pores.
- Unclamped Jacobian weights during spatial reuse near grazing silhouettes (cheeks, ears, noses) create bright firefly outlines.
- Facial blendshape animation invalidates temporal reservoirs unless per-vertex skinning motion vectors are written accurately into the G-buffer.
- Specular lobe energy from narrow roughness maps is poorly sampled by diffuse-cosine initial bounce rays without lobe-aware MIS.
Prior art
No prior art found on 2026-12-01.
Searches run (2)
- arXiv: all:"light stage" AND all:"ReSTIR"
- GitHub repos: "light stage" restir gi