Performance and quality
Reflections cost GPU time, and most of it comes from three places: the rays (screen-space and traced), the denoiser, and everything that scales with the pixel count. This page says where to turn first.
Start with a preset
A preset is a named bundle of settings. There are two:
const { resolutionChanged } = applyReflectionsPreset({ ssr, hybrid }, 'performance');
if (resolutionChanged) {
hybrid.rebuild(); // the resolution changed: build the composite again
// ...and call hybrid.composite() again for your own output node
}
With Reflections.create, pass the Reflections itself: applyReflectionsPreset(reflections, 'performance') rebuilds
its composite when the resolution changes.
At construction, pass preset: 'performance' to both ScreenSpaceReflectionsPass and HybridReflections. Settings
you pass explicitly win over the preset, key by key.
What performance costs you: mirror edges lose resolution, and a thin bright reflection loses most of its peak. In
the measurements in the repository, the reflection passes roughly halve at 1080p. It saves nothing at an upscale ratio
of 2, and a bit over 1 ms at 1.5. If you can choose one, upscale first (the whole frame shrinks) and keep the
reflections at full resolution. See Denoising and upscaling.
What costs what
Measured numbers are in the settings reference. The shape of it:
Reading GPU times
Pass timestamps: true to ScreenSpaceReflectionsPass on a device with timestamp-query, then:
ssr.readTimings().then((t) => console.log(t)) // GPU ms per pass, from a few frames ago
It resolves without blocking the frame. The showcase's panel shows it live. Measure with the render loop stopped
(?manual on the example pages) and compare numbers from the same machine and the same load.
A reasonable order
- Turn on the
performancepreset or lower the render size. - Keep the denoiser on.
- If you use the ray-traced fallback, cap it (
maxTracedRaysPerFrame) before removing it. - Look at the source debug view to see which pixels still cost rays.
- Only then touch the smaller settings.
Live examples
- Presets:
defaultagainstperformance, with GPU time per pass. - Upscaling: render below the display size and upscale after the composite.
- Compare with a path tracer: how close the real-time image gets to a reference.