Recently a short video from dark magic programmer Tomasz Stachowiak made the rounds in the graphics programming community, at the sound of jaws hitting the floor in its wake. It shows his recent progress on in his renderer pet project: beautiful real-time global illumination with fast convergence and barely any noise, in a static environment with dynamic lighting.
In a Twitter thread where he discussed some details, one keyword in particular caught my attention: ReSTIR.
ReSTIR stands for “Reservoir-based Spatio-Temporal Importance Resampling” and is a sampling technique published at SIGGRAPH 2020 and getting refined since.
The original publication
Spatiotemporal reservoir resampling for real-time ray tracing with dynamic direct lighting
The publication page includes the recording of the SIGGRAPH presentation, with a well articulated explanation of the technique by main author Benedikt Bitterli.
(same publication hosted on the NVidia website).
Explanations of ReSTIR
- How to add thousands of lights to your renderer and not die in the process
This is a high level explanation of the technique, giving the broad lines with a few diagrams and without touching the mathematical aspects. - Spatiotemporal Reservoir Resampling (ReSTIR) – Theory and Basic Implementation
This reads like a simplified version of the paper: the equations and the various algorithms are presented, the reasoning is explained, but there is no mathematical derivation. Finally, an example implementation is presented. - Reframing light transport for real-time (video, slides)
This keynote given at HPG 2020 by Chris Wyman, who is a co-author of ReSTIR, gives another perspective on the technique, through the prism of using statistics to evaluate an unknown distribution.
Improvements over the original publication
After the initial publication, NVidia published a refined version producing images with less noise at a lower cost, which they call “RTXDI” (for RTX Direct Illumination).
- RTXDI: Details on Achieving Real-Time Performance
- Rearchitecting Spatiotemporal Resampling for Production (video, slides)
Both presentations explain the same thing, but with small differences that sometimes are clearer in one or the other. They explain again the foundations of the technique, then detail where the improvements lie (use fewer more relevant samples, avoid wasting work, and using a more cache friendly approach). - ReSTIR GI: Path Resampling for Real-Time Path Tracing
While both the original technique and RTXDI are limited to direct illumination, this publication applies ReSTIR to global illumination.
Other limitations
When discussing on Twitter some of the limitations of ReSTIR, Chris Wyman made the following remarks:
To be clear, right now, ReSTIR is a box of razor blades without handles (or a box of unlabeled knobs). It’s extremely powerful, but you have to know what you’re doing. It is not intuitive, if your existing perspective is traditional Monte Carlo (or real-time) sampling techniques.
People sometimes think SIGGRAPH paper = solved. Nope. We’ve learned a lot since the first paper, and our direct lighting is a lot more stable with that knowledge. We’re still learning how to do it well on full-length paths.
And there’s a bunch of edge cases, even in direct lighting, that we know how to solve but haven’t had time to write them up, polish, and demo.
We haven’t actually tried to solve the extra noise at disocclusions in (what I think of as) a very principled way. Right now a world-space structure is probably the best way. I’m pretty sure it can be done without a (formal) world-space structure, just “more ReSTIR.”