---
id: "hybrid-ray-traced-reflections"
title: "Hybrid ray-traced reflections"
aliases: [RT reflections with SSR fallback, hybrid reflections, ray-traced reflections denoised]
domain: "gi"
stage: "lighting"
realtime: "realtime"
platforms: [desktop-gpu, unreal, unity]
year_introduced: 2018
inputs: [gbuffer, depth, normals, irradiance-probes]
outputs: [radiance]
style: "photoreal"
dynamic: "dynamic"
cost: "heavy"
authority: "Barré-Brisebois et al., 2019"
url: "https://texelatlas.vercel.app/t/hybrid-ray-traced-reflections/"
sources_verified_at: "2026-11-29"
---
# Hybrid ray-traced reflections (Barré-Brisebois et al., 2019)

> 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.

## 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

## How it works

A hybrid pipeline mixes sources for the reflected radiance. The cheapest is screen-space marching ([screen-space-reflections](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-parallax-corrected-cubemaps](reflection-probes-parallax-corrected-cubemaps)) or sky.

Rays are generated per pixel from importance-sampled GGX normals ([vndf-sampling](vndf-sampling)), 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 use it

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](screen-space-reflections) alone on mid-range hardware or when off-screen reflections are unimportant. Prefer [planar-reflections-oblique-clipping](planar-reflections-oblique-clipping) for a single flat mirror where re-rendering is cheaper and exact. Prefer [path-tracing](path-tracing) or [restir-gi](restir-gi) when reflections must include multiple glossy bounces and full global illumination, and [reflection-probes-parallax-corrected-cubemaps](reflection-probes-parallax-corrected-cubemaps) when rays are unavailable.

## Cost

heavy — Tracing plus denoising typically takes several milliseconds at 1080p on ray-tracing GPUs; cost scales with ray count and hit-shader complexity.
Measured GPU Weight: 42.15× baseline (heavy) — 1.3866 ms median / 1.4713 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 46.43× baseline (heavy) — 0.7383 ms median (1.88× faster on L4).
Ampere A100 scaling: 27.49× baseline (heavy) — 0.7918 ms median (1.75× faster on A100).

## Failure modes

- 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

## Engine support

- metal: builtin — `MTLAccelerationStructure + intersector<> in MSL` (evidence: https://developer.apple.com/tutorials/data/documentation/metal/mtlaccelerationstructure.json, checked 2026-12-01) — API primitive for ray/scene intersection; reflection shader and denoise are yours.
- unity: builtin — `HDRP Volume > Ray-Traced Reflections (layers over Screen Space Reflection)` (evidence: https://github.com/Unity-Technologies/Graphics/blob/557f6ac22b948284f57ffae6a789751fd1f63620/Packages/com.unity.render-pipelines.high-definition/Documentation~/Ray-Traced-Reflections.md, checked 2026-12-01) — HDRP with DXR hardware only.
- unreal: builtin — `Project Settings > Engine > Rendering: Support Hardware Ray Tracing + Use Hardware Ray Tracing when available; Ray Lighting Mode = Hit Lighting for Reflections` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/lumen-technical-details-in-unreal-engine, checked 2026-12-01) — Lumen screen traces/surface cache with hardware RT hit lighting.

## Dataflow

- Inputs: gbuffer, depth, normals, irradiance-probes
- Outputs: radiance
- Platforms: desktop-gpu, unreal, unity

## Presets

### Hybrid Ray-Traced Reflections — screen-space reflection holes & missing off-screen emitters (left) vs world-space RT fallback (right) (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_FLOOR_ROUGH": 0.1,
  "P_PANEL_GLOW": 1.4,
  "P_CAM_SWAY": 0.45,
  "P_SPLIT": 0.48
}
```

```glsl
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.

## Lineage

- extends [Screen-space reflections](https://texelatlas.vercel.app/t/screen-space-reflections.md)

## Combines with

- [Visible normal distribution sampling (GGX VNDF)](https://texelatlas.vercel.app/t/vndf-sampling.md): Visible-normal sampling picks the microfacet normal for each reflection ray so rough lobes are sampled efficiently.
- [Blue-noise error distribution sampler](https://texelatlas.vercel.app/t/blue-noise-screen-space-sampler.md): Per-pixel ray directions use the sampler so the noise the denoiser sees is high-frequency.
- [Temporal Anti-Aliasing](https://texelatlas.vercel.app/t/temporal-anti-aliasing.md): Reprojection and history rejection logic is shared between the reflection denoiser and TAA.

## Sources

1. [primary] Colin Barré-Brisebois, Henrik Halén, Graham Wihlidal, Andrew Lauritzen, Jasper Bekkers, Tomasz Stachowiak, Johan Andersson (2019) Hybrid Rendering for Real-Time Ray Tracing. Ray Tracing Gems. https://doi.org/10.1007/978-1-4842-4427-2_25 (verified via crossref on 2026-11-29)
2. [implementation] NVIDIAGameWorks (2017) NVIDIAGameWorks/Falcor. https://github.com/NVIDIAGameWorks/Falcor License: NOASSERTION. (verified via github on 2026-11-29)

## Cite this entry

Texel. "Hybrid ray-traced reflections." https://texelatlas.vercel.app/t/hybrid-ray-traced-reflections/ (accessed 2026-12-01).
