Introduction
Summary
@pmndrs/reflections adds specular reflections to a WebGPU scene. It has three sources of reflected light and a
resolve that picks the best one for every pixel. It works with three.js WebGPURenderer today, and the core knows
nothing about any engine.
This is an early release. The API can still change.
The three sources
A reflection answers one question: what does this surface see in this direction? No single method answers it well everywhere, so the library uses three and combines them.
The hybrid resolve puts them together. For each pixel it uses the SSR hit where SSR found one. It asks the ray tracer about the misses. It falls back to the probes, then to the environment map. Then it hands the noisy part to a temporal denoiser and composites the result into your frame.
Which one do I need?
- A static room with glossy floors. Probes alone. Bake once, pay almost nothing.
- Moving objects in glossy surfaces. Add SSR. The reflections follow what is on screen.
- Mirrors, wet floors, car paint, where an off-screen object must show. Add the ray-traced fallback.
- You want the best look and have the GPU time. All three, through
HybridReflections, with a denoiser.
You can start with probes and add the others one at a time. Each page in Concepts covers one source.
What is in the package
The adapter comparison shows which feature each one has.
Where to go next
- Installation: peers, WebGPU requirements, and device limits.
- Quick start: reflections in a three.js scene in a few lines.
- First frame, step by step: the same thing with every part explained.
- Live examples: the showcase runs the whole pipeline on real models. Switch each source on and off. The examples page lists all of them.
The library sits next to a few others from the same group, each with one job: a denoiser, an upscaler, a ray tracer and BVH, a path tracer used as a reference, a depth downsampler and motion vectors. You do not need them all. The denoising and upscaling page says how they fit.