HdRestir: spectral path tracing and ReSTIR in OpenUSD
These notes document the implementation of HdRestir, a spectral path tracer and ReSTIR renderer implemented as an OpenUSD Hydra render delegate. The first three foundation steps define the spectral, Monte Carlo, and Hydra concepts used by the source. The remaining step 0 chapters establish the renderer pipeline, geometry, spectral material transport, and direct-light integrators needed before ReSTIR begins. Steps 1 onward follow the ReSTIR implementation in the order needed to understand its algorithms. A commit receives more than one article only when it introduces several substantial rendering systems. Formatting, build portability, and platform-specific fixes remain available in the repository history but are intentionally outside this series.
Mathematical claims are accompanied by a derivation or a reference containing one. Statements about unbiasedness identify the random variable, sampling density, support condition, and expectation. Implementation chapters link to the exact commit and explain the relevant C++, Slang, or USD changes.
Code blocks quoted from the repository preserve the code at the stated
revision. A // ... line, or the equivalent comment syntax for that language,
marks an omitted contiguous region. Derived code or pseudocode is identified
before the block and is never presented as text from the commit.
Reading order
- Read steps 0.a–0.g first for the mathematical, OpenUSD, and pipeline prerequisites.
- Read steps 1–7 in order to follow the ReSTIR implementation.
- For a specific revision, open its chapter directly; each one lists the files discussed and links to the complete commit diff.
Foundations
- Spectral rendering Wavelength packets, CIE XYZ integration, RGB reconstruction, and the CPU implementation.
- Monte Carlo path tracing Rendering equation, PDF measures, importance sampling, NEE, MIS, throughput, and Russian roulette.
- OpenUSD Hydra render delegates Plugin registration, Hydra primitives, dirty-bit synchronization, render passes, and AOVs.
- Initial plugin entry and render pipeline Plugin registration, render-pass state translation, pass construction, and output-based pruning.
- Camera rays, intersections, and the first BVH Camera-space mapping and implementation-specific choices in traversal and hit reconstruction.
- GGX materials and spectral path transport Material closure resolution, regularized GGX evaluation, direct light, and spectral throughput.
- Direct-light integrators and multiple importance sampling Path/direct-light separation, light-selection probability, PDF measures, and both MIS branches.
Implementation sequence
- Resampled Importance Sampling Candidate generation, scalar targets, categorical selection, normalization, regularization, and cost.
- Weighted reservoirs and temporal reuse Constant-memory weighted sampling, temporal state, validation, and merging.
- Deferred visibility in RIS Estimator conditions, winner visibility, reservoir handling, shadow-ray cost, and variance.
- Renderer performance metrics Samples, rays, variance, RMSE, hierarchical timing, and time-to-quality.
- GPU scene representation and upload Flattened instances, transforms, materials, textures, lights, acceleration structures, and hit identity.
- Spectral path tracing on the GPU Pass lifetime, frame parameters, dispatch, random streams, spectral transport, and parity tests.
- GPU reservoirs and temporal ReSTIR Persistent reservoirs, normalization, history validation, reconnection, Jacobians, and visibility.
- Convergence across scenes Reproducible CPU/GPU Path Tracer and ReSTIR comparisons using internal noise and independent HDR references.
What “complete” means here
The series documents the implementation as it exists at each checkpoint. Later chapters are allowed to correct or qualify earlier decisions. The current renderer reuses the previous reservoir at the same pixel after geometric validation; it does not yet implement spatial neighbor reuse. That distinction matters: reservoir sampling is the data structure, temporal reuse is one ReSTIR operation, and full spatiotemporal ReSTIR is the larger family.
The final article ends with a forward map for spatial reuse, motion vectors, disocclusion handling, wavelength-aware targets, and better light proposals.