Neural Radiance Caching
Trains a small neural network online, every frame, to predict outgoing radiance at any surface point. Short path-traced paths end at a cache query, giving multi-bounce GI with one or two samples per pixel.
Also known as NRC
In the family Light transport & global illumination, learned radiance caches
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | |
| Unity | None found | |
| Unreal 5.7 | None found | |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
The cache is a compact MLP (with a multiresolution hash-encoded input) that maps position, normal, view direction and material parameters to outgoing radiance. It is trained while rendering, with no precomputed data.
Each frame has two kinds of paths. Render paths start at the camera, and after one or two bounces query the cache and stop, so the image is cheap. A tiny fraction of paths are extended into longer training paths: they are traced several bounces and the radiance estimate at each vertex becomes a training target for the network, computed by accumulating the actual downstream path contributions and, for the tail, the cache's own prediction (a self-bootstrapping scheme like value iteration in reinforcement learning).
The network takes a handful of gradient steps per frame on these samples, so it tracks changes in light and geometry within a few frames. Fully-fused GPU kernels make the inference and training fast enough for real time. A lag and a smoothing step in the feature encoding keep the cache stable.
When to choose it
Reach for it when
- want path-traced global illumination in real time with few samples
- multi-bounce lighting too noisy at one sample per pixel
- dynamic scene needs learned indirect light cache
- need predictable per-frame cost for path tracing
Choose it for real-time path-traced GI in dynamic scenes with ray tracing and tensor-core class hardware, when predictable per-frame cost and multi-bounce light matter more than exactness.
Prefer SHaRC: Spatially Hashed Radiance Cache when you want a simple, deterministic hash-grid radiance cache with no network and lower hardware requirements. Prefer ReSTIR PT and Generalized Resampled Importance Sampling when you want unbiased reuse rather than a biased cache. Prefer Dynamic Diffuse Global Illumination (DDGI) for low-frequency diffuse GI without a neural network.
Field marks
- Cache bias: the network is smooth, so sharp indirect detail and caustics are blurred and can lag lighting changes
- Temporal instability or flicker when training samples are sparse in a region, plus a warm-up delay on scene load
- Requires specialized fused GPU kernels; a naive implementation is slow
- Cache feeds back on itself, so a single bad prediction can persist and brighten over frames
Presets
Neural Radiance Caching (NRC) — 1-bounce noisy PT (left) vs real-time MLP multi-bounce cache (right)
{
"P_CACHE_GAIN": 1.15,
"P_LIGHT_SWEEP": 0.75,
"P_TRAIN_VIS": 0.65,
"P_SPLIT": 0.48
}Show GLSL (134 lines)
const float P_CACHE_GAIN = 1.15; // P Multi-Bounce GI [0.2, 2.0, 0.05]
const float P_LIGHT_SWEEP = 0.75; // P Dynamic Light [0.0, 2.2, 0.05]
const float P_TRAIN_VIS = 0.65; // P Cache Query Glow [0.0, 1.4, 0.05]
const float P_SPLIT = 0.48; // P 1-Bounce / NRC [0.0, 1.0, 0.02]
float hash21(vec2 p) {
p = fract(p * vec2(127.1, 311.7));
p += dot(p, p + 34.5);
return fract(p.x * p.y);
}
// Multi-alcove gallery room where dynamic colored bounce light must traverse 3+ bounces into recessed corners!
vec2 mapGallery(vec3 p) {
float dFloor = p.y + 0.85;
float dCeil = 0.85 - p.y;
float dLeft = p.x + 1.15;
float dRight = 1.15 - p.x;
float dBack = p.z + 1.35;
vec2 res = vec2(dFloor, 1.0);
if (dCeil < res.x) res = vec2(dCeil, 1.0);
if (dBack < res.x) res = vec2(dBack, 1.0);
if (dLeft < res.x) res = vec2(dLeft, 2.0); // vivid magenta-red wall
if (dRight < res.x) res = vec2(dRight, 3.0); // vivid cobalt-cyan wall
// Two sculptural gallery pillars creating deep indirect shadow alcoves
vec3 p1 = abs(p - vec3(-0.42, -0.25, -0.35)) - vec3(0.20, 0.60, 0.22);
float dP1 = length(max(p1, 0.0)) + min(max(p1.x, max(p1.y, p1.z)), 0.0);
if (dP1 < res.x) res = vec2(dP1, 4.0);
float dOrb = length(p - vec3(0.38, -0.45, -0.22)) - 0.36;
if (dOrb < res.x) res = vec2(dOrb, 5.0);
return res;
}
vec3 calcNormal(vec3 p) {
vec2 e = vec2(0.0025, 0.0);
return normalize(vec3(
mapGallery(p + e.xyy).x - mapGallery(p - e.xyy).x,
mapGallery(p + e.yxy).x - mapGallery(p - e.yxy).x,
mapGallery(p + e.yyx).x - mapGallery(p - e.yyx).x
));
}
// Smooth online-trained MLP neural radiance field approximation L_cache(x, n) for dynamic light position lPos
vec3 evalNeuralCache(vec3 p, vec3 n, vec3 lPos, float gain) {
// Warm direct-bounce lobe from wall nearest the moving light
float leftHit = smoothstep(0.6, -0.9, lPos.x);
float rightHit = smoothstep(-0.6, 0.9, lPos.x);
vec3 bounceL = vec3(0.96, 0.22, 0.36) * (0.45 + 0.95 * leftHit) * max(dot(n, normalize(vec3(-1.15, 0.0, -0.2) - p)), 0.0);
vec3 bounceR = vec3(0.14, 0.66, 0.98) * (0.45 + 0.95 * rightHit) * max(dot(n, normalize(vec3(1.15, 0.0, -0.2) - p)), 0.0);
// Higher-order infinite-bounce diffuse ambient term queried instantaneously from NRC MLP!
vec3 multiBounce = mix(vec3(0.36, 0.18, 0.24), vec3(0.16, 0.28, 0.42), 0.5 + 0.5 * p.x) * (0.55 + 0.45 * n.y);
return (bounceL * 0.52 + bounceR * 0.52 + multiBounce * 0.55) * gain;
}
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 screenX = fragCoord.x / max(iResolution.x, 1.0);
float split = clamp(P_SPLIT, 0.0, 1.0);
bool isNRC = screenX >= split;
float gain = clamp(P_CACHE_GAIN, 0.15, 2.2);
float sweep = iTime * max(P_LIGHT_SWEEP, 0.0);
float vis = clamp(P_TRAIN_VIS, 0.0, 1.5);
vec3 ro = vec3(0.0, 0.06, 2.18);
vec3 rd = normalize(vec3(uv, -1.36));
float t = 0.05;
vec2 hit = vec2(10.0, 0.0);
for (int i = 0; i < 64; i++) {
vec2 h = mapGallery(ro + rd * t);
if (h.x < 0.0025) { hit = vec2(t, h.y); break; }
t += h.x;
if (t > 7.0) break;
}
vec3 col = vec3(0.02, 0.024, 0.04);
if (hit.y > 0.5) {
vec3 p = ro + rd * hit.x;
vec3 n = calcNormal(p);
vec3 alb = vec3(0.76, 0.76, 0.78);
if (hit.y > 1.5 && hit.y < 2.5) alb = vec3(0.92, 0.18, 0.34);
else if (hit.y > 2.5 && hit.y < 3.5) alb = vec3(0.14, 0.64, 0.94);
else if (hit.y > 3.5 && hit.y < 4.5) alb = vec3(0.84, 0.82, 0.78);
else if (hit.y > 4.5) alb = vec3(0.90, 0.84, 0.74);
// Dynamic moving spotlight sweeping between red and cyan walls
vec3 lPos = vec3(0.78 * sin(sweep * 0.75), 0.62, 0.25 * cos(sweep * 0.75) - 0.15);
vec3 toL = lPos - p;
float dL = length(toL);
vec3 lDir = toL / max(dL, 1e-4);
// Quick shadow march toward dynamic light
float sh = 1.0;
float ts = 0.04;
for (int s = 0; s < 16; s++) {
float ds = mapGallery(p + lDir * ts).x;
if (ds < 0.004) { sh = 0.0; break; }
ts += max(ds, 0.04);
if (ts > dL - 0.08) break;
}
vec3 direct = alb * vec3(1.0, 0.95, 0.88) * max(dot(n, lDir), 0.0) * sh * (1.8 / (0.55 + dL * dL));
vec3 nrcGI = alb * evalNeuralCache(p, n, lPos, gain);
if (isNRC) {
// Right: Full multi-bounce NRC MLP cache terminates short paths with clean infinite-bounce radiance!
col = direct + nrcGI;
// Subtle animated neural-cache training suffix probe rings on floor/walls
float probeWave = exp(-abs(fract(length(p - lPos) * 1.4 - sweep * 0.35) - 0.5) * 32.0);
col += vec3(0.24, 0.94, 0.88) * probeWave * 0.14 * vis;
} else {
// Left: 1-bounce path tracing without NRC loses multi-bounce corner fill & suffers 1-spp shadow-zone noise!
float r1 = hash21(floor(fragCoord * 0.8) + floor(iTime * 11.0) * 0.17);
col = direct + nrcGI * 0.28 * mix(0.2, 1.9, r1);
}
// Glowing floating light sphere marker
float dLightOrb = length(cross(lPos - ro, rd));
col += vec3(1.0, 0.94, 0.80) * exp(-dLightOrb * 24.0) * 0.65;
}
float sep = smoothstep(0.0035, 0.0008, abs(screenX - split));
col = mix(col, vec3(0.95, 0.97, 1.0), sep);
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Attribution: MIT — written for this index.
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| neural-radiance-caching-live | Tesla T4 1920x1080 | 21.9× baseline (heavy) · 0.721 ms / 0.798 ms | opengl-timer-query · 32 frames · GPU Weight Atlas · Colab T4 sweep |
| neural-radiance-caching-live | NVIDIA L4 1920x1080 | 21.7× baseline (heavy) · 0.345 ms / 0.350 ms · 2.1× faster on L4 | opengl-timer-query · Cross-architecture validation |
| neural-radiance-caching-live | NVIDIA A100-SXM4-40GB 1920x1080 | 14.1× baseline (moderate) · 0.406 ms / 0.409 ms · 1.8× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
From the citation graph (Crossref reference lists): its primary source cites Voxel Cone Tracing, Reflective Shadow Maps, Irradiance Volumes and Light Probes, Light Propagation Volumes, Instant Radiosity (Virtual Point Lights), Screen-Space Ambient Occlusion, Practical Path Guiding, Screen-Space Global Illumination, Multiple Importance Sampling, Irradiance Caching; cited by Instant NGP (Multiresolution Hash Encoding), Random-access neural texture compression, Stylized nonlinear Monte Carlo rendering.
Crosses
- Toon-banded bounce light, learned live: Real-time GI whose indirect light is banded or thresholded at every bounce. The cache returns a converged average per surface point, so the artist's nonlinear ramp acts on an expectation instead of on single noisy samples.
- Unidirectional Path Tracing: Short camera paths terminate in a cache query instead of tracing all bounces.
Sources
- primaryThomas Müller, Fabrice Rousselle, Jan Novák, Alexander Keller (2021). Real-time neural radiance caching for path tracing. ACM Transactions on Graphics.Verified via crossref · 2026-11-29doi:10.1145/3450626.3459812
- implementationNVIDIA-RTX (2024). NVIDIA-RTX/NRC. Neural Radiance Cache (NRC) LibraryGitHub API · license NOASSERTION · 2026-11-29