The hybrid resolve
HybridReflections is the part that turns separate sources into one reflection per pixel.
The order
For each pixel, in this order:
- The screen-space hit, weighted by its confidence.
- The ray-traced hit, for pixels whose screen-space ray missed (only if you set up the fallback).
- The local probes, blended by coverage.
- The environment, where no probe reaches.
A pixel that is too rough to trace skips straight to steps 3 and 4. Where the screen-space confidence fades near the screen edge, the hit blends into the probe term rather than cutting off.
Depth-aware blending
A probe is box-projected, so it assumes the reflected surface is the box's wall. If a screen-space hit lies in front
of that wall, the probe cannot be what the ray sees there. With depthAware on (the default), the probe is kept off
such hits, and only the screen-edge fade blends toward it. Set it to 0 for the plain confidence blend.
What update() does each frame
- Renders the composite's raw specular signal (hit times weight, plus the probe or environment term for the rest) into a texture.
- Runs the denoiser on it, with the tracer's hit distance and the frame's guides.
- Keeps the denoiser's output as
hybrid.denoised.
composite() then builds TSL nodes that read the denoised result while a denoiser runs and the raw signal otherwise.
Without a denoiser, mirrors show the raw trace and rough pixels show the probe term.
Specular occlusion
Pass ao to HybridReflections (a texture, or a function of the uv returning a float where 1 means open) to darken
the probe or environment part with specular occlusion. Screen-space and traced hits carry their own occlusion.
The composite replaces three's specular term
The G-buffer pass records the scene colour without its specular environment reflection. The composite adds the hybrid reflection back, using the same specular weights three used. The result follows each material's roughness, metalness and clearcoat, and switching the sources off shows the scene without image-based reflections.
Debug views
composite() returns more than .final: the raw signal, the denoised signal, the confidence, a source map (which
source filled each pixel), the hit distance and more. The showcase's Debug view control shows them. The source view
is the quickest way to see what is working: green is a screen-space hit, blue a traced hit, orange a probe, magenta
the environment, and grey a rough pixel that was not traced.
Live examples
The hybrid, explained compares each source alone with the hybrid, in seven situations, and shows the source map. The showcase runs it on real models.