Hybrid ray-traced reflections
Reflections are traced against the scene only where screen-space reflections or probes would fail, with ray counts adapted to roughness and a denoiser to clean the result. It trades some tracing cost for high-quality, off-screen reflections.
Also known as RT reflections with SSR fallback, hybrid reflections, ray-traced reflections denoised
In the family Light transport & global illumination, specular GI
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 | No hardware ray tracing in the renderer; reflections use SSR, probes, SDFGI/VoxelGI. |
| Unity | Built in | HDRP Volume > Ray-Traced Reflections (layers over Screen Space Reflection) docs HDRP with DXR hardware only. |
| Unreal 5.7 | Built in | Project Settings > Engine > Rendering: Support Hardware Ray Tracing + Use Hardware Ray Tracing when available; Ray Lighting Mode = Hit Lighting for Reflections docs Lumen screen traces/surface cache with hardware RT hit lighting. |
| Blender 5.2 | None found | |
| WebGPU W3C | Not applicable | WebGPU exposes no hardware ray tracing. |
| Metal | Built in | MTLAccelerationStructure + intersector<> in MSL docs API primitive for ray/scene intersection; reflection shader and denoise are yours. |
How it works
A hybrid pipeline mixes sources for the reflected radiance. The cheapest is screen-space marching (Screen-space reflections); when the march leaves the screen or reaches hidden surfaces the pipeline falls back to hardware ray tracing against the BVH, and misses beyond that read a reflection probe (Reflection probes with parallax-corrected cubemaps) or sky.
Rays are generated per pixel from importance-sampled GGX normals (Visible normal distribution sampling (GGX VNDF)), with count and tracing budget scaled by roughness. Very rough surfaces skip tracing entirely and use probes. At hit points the renderer evaluates a simplified material with probe or cached lighting rather than recursive shading, to bound cost.
The traced result is noisy, so a spatial filter guided by roughness and a temporal accumulation stage reconstruct it. Shadow rays at the hit and a reflection-to-reflection depth of one keep it within a frame budget on current GPUs.
When to choose it
Reach for it when
- screen space reflections are missing off screen content
- want high quality glossy reflections on rtx hardware
- reflections need to fall back gracefully when rays miss
- probes reflections are too coarse for mirror like floors
Choose it for mirror-like and glossy reflections of dynamic content on ray-tracing-capable hardware, where SSR leaves holes at screen edges and probes are too coarse.
Prefer Screen-space reflections alone on mid-range hardware or when off-screen reflections are unimportant. Prefer Planar reflections with oblique near-plane clipping for a single flat mirror where re-rendering is cheaper and exact. Prefer Unidirectional Path Tracing or ReSTIR GI: Path Resampling for Real-Time Path Tracing when reflections must include multiple glossy bounces and full global illumination, and Reflection probes with parallax-corrected cubemaps when rays are unavailable.
Field marks
- Visible seam where the pipeline switches between SSR, traced and probe sources, especially in mirrored moving content
- Noisy or smeared rough reflections when the denoiser's history is rejected on moving objects
- Ghosting of dynamic objects because temporal accumulation keeps reflections from previous frames
- Reflections of simplified hit shading look flatter than the directly shaded scene
- Ray budget runs out on very glossy large surfaces such as wet floors, producing tracing bubbles
- Fine detail such as thin grates or foliage gives incoherent rays and slow traversal
Presets
Hybrid Ray-Traced Reflections — screen-space reflection holes & missing off-screen emitters (left) vs world-space RT fallback (right)
{
"P_FLOOR_ROUGH": 0.1,
"P_PANEL_GLOW": 1.4,
"P_CAM_SWAY": 0.45,
"P_SPLIT": 0.48
}Show GLSL (180 lines)
const float P_FLOOR_ROUGH = 0.10; // P Floor Roughness [0.02, 0.35, 0.02]
const float P_PANEL_GLOW = 1.40; // P Neon Intensity [0.4, 2.4, 0.1]
const float P_CAM_SWAY = 0.45; // P Camera Sway [0.0, 1.5, 0.05]
const float P_SPLIT = 0.48; // P SSR / Hybrid RT Split [0.0, 1.0, 0.02]
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);
}
// Gallery hall with glossy floor, pillars, a central sculpture, AND off-screen overhead neon light strips!
vec2 mapGallery(vec3 p) {
float dFloor = p.y + 0.65;
vec2 res = vec2(dFloor, 1.0);
// Back wall
float dBack = p.z + 2.45;
if (dBack < res.x) res = vec2(dBack, 2.0);
// Two dark slate pillars (visible on-screen)
float dP1 = sdBox(p - vec3(-0.92, 0.25, -0.75), vec3(0.22, 0.92, 0.22));
if (dP1 < res.x) res = vec2(dP1, 3.0);
float dP2 = sdBox(p - vec3(0.92, 0.25, -0.95), vec3(0.22, 0.92, 0.22));
if (dP2 < res.x) res = vec2(dP2, 3.0);
// Central floating warm amber neon ring/monolith (partially on screen)
float dCol = length(p - vec3(0.0, -0.05, -0.55)) - 0.34;
if (dCol < res.x) res = vec2(dCol, 4.0);
// OFF-SCREEN overhead magenta-gold ceiling light panel (above camera frustum y = 1.45!)
float dCeilPanel = sdBox(p - vec3(0.0, 1.48, -0.65), vec3(1.15, 0.06, 0.55));
if (dCeilPanel < res.x) res = vec2(dCeilPanel, 5.0);
// OFF-SCREEN behind-pillar cyan vertical beacon strip (occluded from primary camera!)
float dHiddenStrip = sdBox(p - vec3(-0.92, 0.15, -1.28), vec3(0.16, 0.72, 0.06));
if (dHiddenStrip < res.x) res = vec2(dHiddenStrip, 6.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
));
}
vec3 shadeHit(vec3 p, vec3 n, float id, float glow) {
vec3 lDir = normalize(vec3(0.45, 0.85, 0.35));
float ndl = max(dot(n, lDir), 0.0);
if (id < 1.5) return vec3(0.06, 0.07, 0.09) * (0.4 + 0.6 * ndl);
if (id < 2.5) {
float stripe = smoothstep(0.06, 0.01, abs(fract(p.x * 1.4) - 0.5));
return mix(vec3(0.14, 0.16, 0.21), vec3(0.28, 0.32, 0.40), stripe) * (0.35 + 0.65 * ndl);
}
if (id < 3.5) {
// Pillar with thin emissive trim
float trim = smoothstep(0.06, 0.015, abs(p.y + 0.12));
return vec3(0.18, 0.21, 0.28) * (0.3 + 0.7 * ndl) + vec3(0.18, 0.88, 1.0) * trim * glow * 1.4;
}
if (id < 4.5) return vec3(0.95, 0.66, 0.28) * (0.28 + 0.72 * ndl);
if (id < 5.5) {
// Overhead off-screen neon art panel (warm coral + magenta bars)
float bars = 0.5 + 0.5 * sin(p.x * 7.5 + iTime * 1.4);
return mix(vec3(2.4, 0.32, 0.58), vec3(2.8, 1.45, 0.25), bars) * glow;
}
return vec3(0.16, 1.95, 2.35) * glow;
}
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 sx = fragCoord.x / max(iResolution.x, 1.0);
float split = clamp(P_SPLIT, 0.0, 1.0);
bool useHybridRT = sx >= split;
float rough = clamp(P_FLOOR_ROUGH, 0.01, 0.45);
float glow = clamp(P_PANEL_GLOW, 0.3, 2.8);
float sway = sin(iTime * max(P_CAM_SWAY, 0.0) * 0.8) * 0.28;
vec3 ro = vec3(sway, 0.16, 2.15);
vec3 ta = vec3(0.0, -0.22, -0.65);
vec3 fw = normalize(ta - ro);
vec3 ri = normalize(cross(fw, vec3(0.0, 1.0, 0.0)));
vec3 up = cross(ri, fw);
float fl = 1.48;
vec3 rd = normalize(fw * fl + ri * uv.x + up * uv.y);
vec3 envAmb = mix(vec3(0.04, 0.05, 0.08), vec3(0.11, 0.14, 0.22), smoothstep(-0.3, 0.5, rd.y));
vec3 col = envAmb;
float t = 0.05;
float hitId = 0.0;
for (int i = 0; i < 64; i++) {
vec2 h = mapGallery(ro + rd * t);
if (h.x < 0.002) { hitId = h.y; break; }
t += h.x;
if (t > 9.0) break;
}
if (hitId > 0.5) {
vec3 p = ro + rd * t;
vec3 n = calcNormal(p);
col = shadeHit(p, n, hitId, glow);
// Glossy reflection pass on marble floor (id == 1) and chrome sphere (id == 4)
if (hitId < 1.5 || (hitId > 3.5 && hitId < 4.5)) {
vec3 reflN = n;
if (hitId < 1.5) {
// Subtle marble tile normal ripple for floor roughness
vec2 tile = floor(p.xz * 2.0);
float w = sin(p.x * 16.0 + tile.y) * cos(p.z * 16.0 + tile.x) * rough * 0.08;
reflN = normalize(n + vec3(w, 0.0, -w));
}
vec3 rDir = reflect(rd, reflN);
vec3 rOrig = p + n * 0.015;
// Trace world-space reflection ray
float rt = 0.04;
float rId = 0.0;
for (int j = 0; j < 52; j++) {
vec2 rh = mapGallery(rOrig + rDir * rt);
if (rh.x < 0.003) { rId = rh.y; break; }
rt += rh.x;
if (rt > 8.0) break;
}
vec3 reflCol = envAmb;
if (rId > 0.5) {
vec3 rp = rOrig + rDir * rt;
vec3 rn = calcNormal(rp);
vec3 trueRefl = shadeHit(rp, rn, rId, glow);
// Project reflection hit point rp back into primary camera screen space to test SSR visibility!
vec3 camToHit = rp - ro;
float cz = dot(camToHit, fw);
vec2 projUv = vec2(dot(camToHit, ri), dot(camToHit, up)) * (fl / max(cz, 0.05));
float aspect = iResolution.x / max(iResolution.y, 1.0);
bool onScreen = (cz > 0.1) && (abs(projUv.x) < 0.48 * aspect) && (abs(projUv.y) < 0.46);
// Also test if rp is occluded from the primary camera (e.g., back of pillar or hidden beacon)
bool unoccluded = onScreen;
if (onScreen) {
vec3 camDir = normalize(camToHit);
float camDist = length(camToHit);
float ocT = 0.08;
for (int k = 0; k < 24; k++) {
float od = mapGallery(ro + camDir * ocT).x;
if (od < 0.008 && ocT < camDist - 0.08) { unoccluded = false; break; }
ocT += max(od, 0.06);
if (ocT >= camDist - 0.08) break;
}
}
if (useHybridRT) {
// Hybrid RT: seamlessly uses world-space ray hit everywhere, even off-screen or occluded!
reflCol = trueRefl;
} else {
// SSR-only: succeeds for visible on-screen objects, but drops out to dull probe fallback off-screen/occluded!
float edgeFade = smoothstep(0.49 * aspect, 0.36 * aspect, abs(projUv.x)) * smoothstep(0.47, 0.34, abs(projUv.y));
float ssrConf = (unoccluded ? 1.0 : 0.0) * edgeFade;
reflCol = mix(envAmb * 0.8, trueRefl, ssrConf);
}
}
float ndv = max(dot(reflN, -rd), 0.0);
float F = (hitId < 1.5) ? (0.18 + 0.78 * pow(1.0 - ndv, 4.0)) : (0.55 + 0.45 * pow(1.0 - ndv, 4.0));
col = mix(col, reflCol, clamp(F * (1.0 - rough * 0.6), 0.0, 0.94));
}
}
float sep = smoothstep(0.0035, 0.0008, abs(sx - 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 |
|---|---|---|---|
| hybrid-ray-traced-reflections-live | Tesla T4 1920x1080 | 42.1× baseline (heavy) · 1.39 ms / 1.47 ms | opengl-timer-query · 32 frames · GPU Weight Atlas · Colab T4 sweep |
| hybrid-ray-traced-reflections-live | NVIDIA L4 1920x1080 | 46.4× baseline (heavy) · 0.738 ms / 0.745 ms · 1.9× faster on L4 | opengl-timer-query · Cross-architecture validation |
| hybrid-ray-traced-reflections-live | NVIDIA A100-SXM4-40GB 1920x1080 | 27.5× baseline (heavy) · 0.792 ms / 0.797 ms · 1.8× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
Crosses
- Visible normal distribution sampling (GGX VNDF): Visible-normal sampling picks the microfacet normal for each reflection ray so rough lobes are sampled efficiently.
- Blue-noise error distribution sampler: Per-pixel ray directions use the sampler so the noise the denoiser sees is high-frequency.
- Temporal Anti-Aliasing: Reprojection and history rejection logic is shared between the reflection denoiser and TAA.
Sources
- primaryColin Barré-Brisebois, Henrik Halén, Graham Wihlidal, Andrew Lauritzen, Jasper Bekkers, Tomasz Stachowiak et al. (2019). Hybrid Rendering for Real-Time Ray Tracing. Ray Tracing Gems.Verified via crossref · 2026-11-29doi:10.1007/978-1-4842-4427-2_25
- implementationNVIDIAGameWorks (2017). NVIDIAGameWorks/Falcor. Real-Time Rendering FrameworkGitHub API · license NOASSERTION · 2026-11-29