skip to main content
research-article
Open access

ReSTIR BDPT: Bidirectional ReSTIR Path Tracing with Caustics

Authors:
Trevor Hedstrom
University of California San Diego, San Diego, United States
,
Markus Kettunen
NVIDIA Corp, Santa Clara, United States
,
Daqi Lin
NVIDIA Corp, Redmond, United States
,
Chris Wyman
NVIDIA Corp, Santa Clara, United States
,
Tzu-Mao Li
University of California San Diego, San Diego, United States
Authors Info & Claims
Published: 10 September 2025 Publication History

Abstract

Recent spatiotemporal resampling algorithms (ReSTIR) accelerate real-time path tracing by reusing samples between pixels and frames. However, existing methods are limited by the sampling quality of path tracing, making them inefficient for scenes with caustics and hard-to-reach lights. We develop a ReSTIR variant incorporating bidirectional path tracing that significantly improves the sampling quality in these scenes.
Combining bidirectional path tracing and ReSTIR introduces multiple challenges: the generalized resampled importance sampling (GRIS) behind ReSTIR is, by default, not aware of how a path was sampled, which complicates reuse of bidirectional paths. Light tracing is also challenging since light subpaths can contribute to all pixels. To address these challenges, we apply GRIS in a sampling technique-aware extended path space, design a bidirectional hybrid shift mapping, and introduce caustics reservoirs that can accumulate caustics across frames. Our method takes around 50ms per frame across our test scenes, and achieves significantly lower error compared to prior unidirectional ReSTIR variants running in equal time.

1 Introduction

ReSTIR PT [Lin et al. 2022] improves real-time rendering quality by orders of magnitude by reusing path samples between pixels and frames. However, ReSTIR PT inherits weaknesses from unidirectional path tracing (PT) for scenes with caustics or hard-to-reach lights (Figure 1). Our work aims to significantly improve ReSTIR PT in these scenes by incorporating BDPT.
Fig. 1.
We combine bidirectional path tracing (BDPT) with a novel reuse scheme to enable ReSTIR [Wyman et al. 2023] to better find hard-to-reach light sources and even resolve caustics interactively. Only emissive filaments inside the glass blubs light this Bathroom scene. At a 1,920×1,080 resolution, our method achieves a mean absolute percentage error (MAPE) of 0.312 in 70ms (with 1M light subpaths), while ReSTIR PT [Lin et al. 2022] achieves a MAPE of 1.368 in 71ms.
Naïvely applying generalized resampled importance sampling (GRIS), the main engine behind ReSTIR PT, to real-time bidirectional PT is not feasible. When reusing across pixels or frames, GRIS does not directly account for which technique generates a path sample; and in BDPT, many sampling techniques can form each path. This makes parameterizing a path with one random seed infeasible, calling for expensive path storage. Additionally, light tracing poses additional challenges for screen-space reuse as it produces samples contributing to all pixels.
To address these challenges, we apply GRIS theory in an extended path space consisting of path–technique pairs (x¯,τ) joined by technique-specific multiple importance sampling (MIS) weights. These extended paths allow principled reasoning about the sampling technique at path reuse without introducing bias. Our method enables a seemingly infeasible choice, using [Lin et al. 2022] hybrid shift for camera sub-paths and random replay for light sub-paths.
We achieve interactive caustic rendering by implementing a bidirectional hybrid shift, as well as storing an additional caustic reservoir in each pixel. The caustic reservoir enables unbiased temporal accumulation of caustics over multiple frames in dynamic scenes. Scene changes may move caustics between pixels, but they often remain nearly converged. Accumulation is supported by merging new caustic paths into caustic reservoirs each frame. Our caustic reservoirs automatically aggregate and stratify the caustics into the pixels, allowing interactive updates and retaining high caustic quality as the scene evolves.
We further accelerate our ReSTIR BDPT by deriving a novel variant of recursive MIS weights [van Antwerpen 2011] for fast MIS weight evaluation with shift mappings. We also propose two faster alternatives, a biased variant which copies the unshifted MIS weight for cases where full unbiasedness is not required, and an unbiased lightweight (LW) variant which omits vertex connection techniques.
Our method runs interactively, taking around 50ms per frame in most of our test scenes (Figure 11). On difficult scenes at one sample per pixel, we achieve much lower error compared to ReSTIR PT in equal time due to the improved efficiency of bidirectional sampling.

2 Background

We briefly review resampled importance sampling (RIS) [Talbot et al. 2005], its generalization [Lin et al. 2022], and bidirectional PT [Veach and Guibas 1995a]. We refer readers to [Wyman et al. 2023] course notes for a more comprehensive ReSTIR review [Bitterli et al. 2020; Lin et al. 2022], and physically-based rendering textbooks [Pharr et al. 2016] and Veach’s thesis [1997] for an introduction to path space and bidirectional PT.
Our notation and key symbols are summarized in Table 1.
Table 1.
x¯Full path
y¯Light subpath (with s vertices)
z¯Camera subpath (with t vertices)
XRandom variable for a path
YRandom variable for a light subpath
ZRandom variable for a camera subpath
xrReconnection vertex
x1Primary hit
x2Secondary hit
pLLight subpath selection probability
pCanonical probability density function (PDF)
piσ“Forward” solid-angle PDF of sampling xi from xi1
piσ“Reverse” solid-angle PDF of sampling xi from xi+1
pipiσ expressed in area measure
pipiσ expressed in area measure
p^,p^τRIS target functions
ωτ, ωs,tBDPT MIS weight for technique τ or (s,t)
MResampling candidate count
miResampling MIS weight for candidate i
ciConfidence weight for reservoir i
Summary of Notation

2.1 Path Integrals and Notations

In rendering, a pixel’s intensity I is computed as an integral over all light paths connecting it to light sources [Veach 1997; Kajiya 1986],
I=Ωf(x¯)dμ(x¯),
(1)
for a light path x¯=(x0,x1,,xk) with k+1 vertices, where x0 is on the camera sensor and xk is on a light. Ω=k=1Mk+1 is the path space with the union of scene surfaces M, and μ is the area product measure. The measurement contribution function f turns radiance transported along a path into pixel response:
f(x¯)= We(x1x0)G(x0x1)Le(xkxk1)(i=1k1ρ(xi+1xixi1)G(xixi+1)),
(2)
where We is sensor importance of the pixel, Le is light emission, G is the geometry term, and ρ is the bidirectional scattering distribution function (BSDF).
In standard unidirectional PT [Kajiya 1986], the pixel intensity (Equation (1)) is given by the Monte Carlo estimator
IPT=f(X)p(X),
(3)
where p is the PDF for random path X. The estimation noise is smaller when p better matches f.

2.2 Bidirectional Path Tracing

BDPT [Lafortune and Willems 1993; Veach and Guibas 1995a] improves sampling efficiency over unidirectional PT in complex scenes. It samples two subpaths: one traced from the camera and one from the light. We denote camera subpaths with t vertices as z¯t=(z0,z1,,zt1) for z0 on the camera, and light subpaths with s vertices as y¯s=(ys1,ys2,,y0) for y0 on the light (see Figure 2).
Fig. 2.
A path formed by BDPT. z¯ is the camera subpath, y¯ is the light subpath, and the full path is formed by appending them together: x¯=z¯y¯.
By connecting camera and light subpaths at different vertices, we form full paths x¯s,t=z¯ty¯s with t+s vertices. Case t=1 gives light tracing, with an explicit connection to the camera (z0) from the light subpath’s end (ys1). Case t=0 corresponds to ys1 randomly selecting the sensor surface via BSDF sampling. In our implementation, we omit t=0 paths, as they have zero probability for pinhole cameras and otherwise contribute very little to the final image [Veach and Guibas 1995a].
Bidirectional sampling can produce the same path by many sampling techniques (s,t), by connecting subpaths of different lengths. This can over-count the same path. To form an unbiased estimator, Veach and Guibas [1995b] combine these sampling techniques using MIS:
IBDPT=t>0,s0ωs,t(Xs,t)f(Xs,t)ps,t(Xs,t),
(4)
where ps,t(X) is the probability density of sampling path X with technique (s,t), and MIS weights ωs,t form a partition of unity over the probability densities of all ways to form the same path:
ps,t(X)=i=1t1pii=ts+t1pi,
(5)
ωs,t(X)=(ps,t(X))βt+s=t+s(ps,t(X))β.
(6)
Here, β is the power used by MIS (e.g., β=1 for the balance heuristic, β>1 for the power heuristic). Forward PDFs pi are area-measure probability densities for sampling vertex xi from vertex xi1 during camera tracing. Similarly, reverse PDFs pi represent densities for sampling vertex xi from vertex xi+1 during light tracing. This follows notation in van Antwerpen [2011] and Georgiev et al. [2012]. Notably absent in Equation (5) are the densities pt and pt1 along the subpath connection; this connection is made deterministically.
By combining techniques with MIS, BDPT excels at rendering intricate light paths, e.g., difficult-to-reach lights or complex caustics; different techniques are efficient in different situations, but due to MIS, BDPT is typically efficient as long as at least one of the techniques is efficient.1
Recursive MIS calculations. Classical BDPT stores forward and reverse densities per vertex [Veach 1997] and loops over all techniques for a path to compute ωs,t. This uses storage proportional to path length and reduces compute efficiency on the GPU. By observing that subpath probabilities of sequential vertices share much of the product prefix (ps in Equation (5)), van Antwerpen [2011] formulated an efficient recursive relation to incrementally compute and store data at path vertices so computing ωs,t only needs data from the two connection vertices. This allows discarding other path vertices after tracing, enabling GPU-efficient algorithms without per-vertex path storage [van Antwerpen 2011; Davidovič et al. 2014].
Light Vertex Cache (LVC). Classical BDPT generates samples for a pixel by creating a pair of camera and light subpaths and evaluating all possible connections along each subpath. Many later variants [Pajot et al. 2011; Davidovič et al. 2014; Popov et al. 2015; Nabata et al. 2020] explore different ways to combine subpaths for more efficient sampling. The Light Vertex Cache (LVC) algorithm [Davidovič et al. 2014] first generates NL light subpaths shared over all pixels, and lets per-pixel camera subpaths connect to random light subpaths. Instead of storing light subpaths, it stores connectable light subpath vertices in an array called the LVC. During camera tracing, camera subpaths connect to random vertices in the LVC. After connecting, efficient computation of BDPT MIS weights is enabled by van Antwerpen’s [2011] recursive MIS formulation. This transforms BDPT into a GPU-friendly streaming algorithm where camera subpaths connect to a stream of random light subpath vertices, instead of a single light subpath.

2.3 Resampled Importance Sampling (RIS)

Estimating the integral in Equation (1) is often done using Monte Carlo integration: IMC=f(X)p(X), where p(X) is the probability density of sampling path X. Without loss of generality, we assume one sample per pixel. Ideally, we want a probability density proportional to the integrand f, but directly sampling with such a distribution is often intractable. RIS [Talbot et al. 2005] approximates this by first sampling M i.i.d. candidate samples X1,X2,,XM from an easier-to-sample distribution p, and chooses one of them as the output Yz proportionally to resampling weights wi. Following Lin et al. [2022], we have
wi=1Mp^(Xi)p(Xi),
(7)
where the target function p^ is proportional to the often intractable target density.
The resampling process makes the output Yz’s probability density pYz computationally intractable, rendering the classical Monte Carlo estimator f/p inadequate. Instead, we can compute an unbiased contribution weight (UCW) [Lin et al. 2022] WYz for Yz,
WYz=1p^(Yz)i=1Mwi,
(8)
which is an unbiased estimate for the unknown reciprocal probability density 1/pYz(Yz). The classical Monte Carlo estimator IMC is replaced with
IRIS=f(Yz)WYZ.
(9)
As candidate count M increases, the (intractable) output probability density approaches the target PDF p¯=p^/p^, and WYz approaches 1/p¯(Yz). Ideally, p^ would be f itself for asymptotically perfect importance sampling.
RIS allows candidates Xi with different source distributions pi using MIS [Talbot et al. 2005; Lin et al. 2022]. We simply replace the 1/M in Equation (7) with resampling MIS weights mi:
wi=mi(Xi)p^(Xi)pi(Xi),
(10)
where, e.g.,
mi(x¯)=pi(x¯)j=1Mpj(x¯),
(11)
for the balance heuristic. If all Xi are identically distributed (meaning all pi are identical), then the weights mi reduce to the same 1/M. Equations (8) and (9) remain unchanged.

2.4 Spatiotemporal Reuse and ReSTIR

The idea of ReSTIR [Bitterli et al. 2020] is to recursively apply RIS to reuse samples from each pixel’s spatiotemporal neighbors. Lin et al. [2022] formalized this in their generalized RIS (GRIS), defining the UCWs and allowing them in resampling weights in place of the unknown reciprocal PDFs:
wi=mi(Xi)p^(Xi)WXi.
(12)
Since the PDFs pi are not known, the resampling MIS weights mi must be modified. A simple choice is the generalized balance heuristic, using input Xi’s target function p^i as a proxy for pi:
mi(Xi)=p^i(Xi)j=1Mp^j(Xi).
(13)
To deal with the fact that the candidates from a pixel’s spatiotemporal neighbors are from different domains, Lin et al. [2022] transfer paths between domains with shift mappings Ti from the gradient-domain rendering literature [Lehtinen et al. 2013; Kettunen et al. 2015]. A shift mapping Ti takes a path x¯ from domain Ωi and slightly modifies it into a similar path Ti(x¯) in Ω. Not every path needs to be shiftable; a shift mapping bijectively maps paths from a subset of Ωi into a subset of Ω. A shift may be undefined, e.g., due to occlusion or a failure to ensure bijectivity (e.g., due to total internal reflection). See Wyman et al. [2023] for details.
Reusing paths with shift mappings further modifies the resampling weights, but other formulas remain the same. The inputs Xi are mapped from the source domains into the current pixel’s domain as Ti(Xi), and a Jacobian determinant is added to transform the contribution weights to the current domain, giving
wi=mi(Ti(Xi))p^(Ti(Xi))WXi|TiXi|.
(14)
The MIS weight mi and target function p^ must be evaluated in the current domain, i.e., at Ti(Xi) instead of Xi. Multiplying the UCW WXi by the Jacobian determinant technically transforms it into WTi(Xi) for the shifted path. The output Yz is then resampled from the {Ti(Xi)}i proportionally to the wi, and Equations (8) and (9) remain unchanged.
The resampling MIS weights mi require another change. Mapping a random variable Xi with a shift map Ti modifies its probability density. Lin et al. [2022] account for this in the resampling MIS weights by defining a function p^i, “p^ from i” that shifts path x¯ back to domain i for target function evaluation and accounts for density changes using the Jacobian determinant,
p^i(x¯)={p^i(Ti1(x¯))|Ti1x¯|x¯Ti(suppXi)0otherwise.
(15)
Condition x¯Ti(suppXi) amounts to Ti1 being defined.2 This gives the generalized balance heuristic
mi(x¯)=p^i(x¯)j=1Mp^j(x¯).
(16)
In practice, the terms are scaled by confidence weights ci, which effectively weight each domain based on the number of samples each domain has processed, yielding
mi(x¯)=cip^i(x¯)j=1Mcjp^j(x¯).
(17)
Kettunen et al. [2023, supplemental] connect Equation (17) to Veach and Guibas [1995b]’s multi-sample MIS, if Mi is interpreted as Xi’s effective sample count, i.e., how many simple samples it represents. For instance, if ReSTIR has improved a prior frame’s sample to correspond to ci current-frame samples, sensible temporal reuse would weight the prior sample by ci and the current sample by 1. Effective sample counts are hard to compute, so actual sample counts with a fixed confidence cap are often used instead.
A more computationally efficient but less robust alternative to the generalized balance heuristic is the pairwise MIS weight [Bitterli et al. 2020]. We refer readers to the recent ReSTIR course for complete formulas [Wyman et al. 2023].
ReSTIR PT’s [Lin et al. 2022] shift mapping, the hybrid shift, reuses paths by first tracing a new primary ray from the target pixel, and then combining two operations:
Random replay: continue tracing the shifted path by copying the random numbers used in the original path,
Reconnection: connect back to the next path vertex of the original path.
The hybrid shift applies reconnection if the current vertex on the shifted path and the next vertex on the original path are both connectable, i.e., follow a simple vertex roughness and distance based heuristic that guarantees the reconnection is valid (not e.g., on a mirror); random replay postpones reconnection until a connectable vertex is found. Once joined by reconnection, spatial reuse reuses the rest of the path, while temporal reuse requires re-tracing in the new scene: the reconnection vertex is moved with the geometry to follow possible animation, and the later vertices are re-traced with random replay to avoid excess vertex storage on the GPU.
To summarize, ReSTIR is the combination of initial sampling, temporal reuse with GRIS, and spatial reuse between pixels with GRIS. GRIS aggregates multiple samples into one by appropriately weighting each input (e.g., Equation (14)) and choosing which one to output proportionally to these resampling weights. The output aggregates many samples over pixels and frames, and is assigned an UCW by Equation (8). The UCW may be used, for example, to recursively resample or integrate with Equation (9). By combining samples spatiotemporally, ReSTIR improves the sample distribution, greatly reducing noise even with just a single sample per pixel per frame.

2.5 Resampling for BDPT

RIS has previously been used to improve subpath connections within BDPT. Two-stage Resampling Nabata et al. [2020] and SPCBPT Su et al. [2022] apply RIS to sample important light subpaths for subpath connections (techniques with both s>1 and t>1). More recently, Liu and Gan [2023] use grid-based reservoirs to resample light subpaths over time. These methods only use RIS to select light subpaths for bidirectional connections. Since they do not modify subpaths (e.g., with reconnection), they are not applicable to light tracing techniques (t1), which are often most efficient for sampling effects such as caustics. They also operate in world space, requiring more storage for large or highly detailed scenes.
The term caustic reservoir also appears in the concurrent ReSTIR FG [Kern et al. 2024], which applies resampling to vertex merging. ReSTIR FG separates caustic light paths during resampling to reduce caustic blurring from vertex merging. We also separate caustic light paths, however, this is to prevent caustic samples from degrading spatial resampling quality, since they cannot be spatially shifted to other pixels. Our caustic reservoirs are an unbiased estimate of the contribution from caustic light paths, while ReSTIR FG is biased due to the use of vertex merging.

3 Overview

We aim to produce paths with BDPT and apply GRIS to reuse these paths spatiotemporally. BDPT often produces a much better sample distribution, enabling rendering of intricate light paths such as caustics, and improving the sampling quality at low sample counts.
Lin et al. [2022] apply GRIS to unidirectional PT, which corresponds to techniques s=0 (camera subpath hits an emissive surface) and s=1 (next event estimation). A main challenge in applying GRIS to BDPT is handling the large set of sampling techniques. In particular, we often want to apply random replay as part of Lin et al.’s hybrid reconnection shift. However, we cannot use random replay for bidirectional paths unless we know which technique generated the path: a path combining two subpaths can only be reproduced by replaying the random number states for the camera and light subpaths up until the connection vertices.
Another challenge comes from light tracing techniques, i.e., t1, as such paths can contribute to any pixel. We must correctly weight our samples to account for this fact. Furthermore, we need to design a reuse scheme that works well for light tracing and caustics.
Finally, computing the BDPT MIS weight ωs,t (Equation (6)) during spatiotemporal reuse can be quite involved. We cannot directly apply [van Antwerpen 2011] efficient, recursive MIS formulation, since shift mappings may change parts of the paths.
Below, we address the aforementioned challenges:
Section 4: We present an extended path space that includes information about the sampling technique, and derive the corresponding GRIS estimator for BDPT in the extended path space,
Section 5: We identify shift mappings for bidirectional connections and light tracing, and
Section 6: We generalize the recursive MIS formulation to efficiently compute the MIS weight ωs,t during reconnection.
Finally, in Section 7, we discuss our GPU implementation of a ReSTIR-based bidirectional path tracer.

4 Bidirectional ReSTIR With a Path Space Extension

In this section, we derive our bidirectional ReSTIR estimator by applying GRIS in an extended path space. We want to apply GRIS to resample over all bidirectional sampling techniques, using correct MIS weights ωτ to allow unbiased spatiotemporal reuse.
Previous ReSTIR methods directly apply GRIS to the path integral (Equation (1)) by sampling paths and merging them into reservoirs. As mentioned, using random replay shift mappings complicates this case: existing formulations do not allow shift mapping to depend on a path’s sampling technique. Thus, when shifting via random replay, we do not know the camera and light subpath lengths.
Therefore, we apply GRIS in an extended path space. We pair path samples X with the technique indices τ used to generate them in extended paths X^=(X,τ). All extended paths of a given technique τ define the technique’s path space Ωτ and our extended path space Ω^ is the union of all sample-technique pairs, Ω^=τΩτ. Our extended path space integral is then:
I=Ωf(x¯)dx¯=τΩτωτ(x¯)f(x¯)dx¯,=Ω^ωτ(x¯)f(x¯)d(x¯,τ),
(18)
where ωτ(x¯) is the technique MIS weight of path x¯ under technique τ. We weight the measurement contribution f with these MIS weights to avoid counting a path’s contribution multiple times.
Now, our goal is to apply GRIS on the extended path space integral (Equation (18)). To apply GRIS, we first need two items: the target function p^ and shift mapping T. We set the target function to be always weighted by the technique MIS weight ωτ:
p^(x^)=ωτ(x¯)q^(x¯),
(19)
where x^=(x¯,τ) and q^ is a user-defined target function. We always set q^ to be the luminance of the measurement contribution f. We then assume technique-specific shift mappings, i.e., the output path depends on the technique, but the technique is not changed in the shift:
T(x^)=T((x¯,τ))=(Tτ(x¯),τ),
(20)
where Tτ is the shift mapping defined for technique τ. We will specify Tτ in the next section. The Jacobian is simply
|Tx^|=|Tτx¯|.
(21)
Combining these, we can directly apply GRIS to estimate the extended path space integral (Equation (18)). For the resampling output Y^=(Y,τ) sampled from the shifted inputs Ti(X^i) proportionally to resampling weights wi, we get
I=ωτ(Y)f(Y)WY^.
(22)
The UCW for the chosen sample at GRIS resampling is
WY^=1p^(Y^)i=1Mwi,
(23)
where p^ is given by Equation (19), and the candidates’ resampling weights are, denoting Y^i=Ti(X^i),
wi=mi(Y^i) p^(Y^i) WX^i|TiX^i|.
(24)
Here, mi is the generalized balance heuristic (Equation (17)), with a substitution of our p^ (Equation (19)) and Jacobian (Equation (21)) into the definition of p^i in Equation (15).
Like Lin et al. [2022], we use the generalized balance heuristic for temporal reuse and pairwise MIS [Lin et al. 2022; Wyman et al. 2023] for spatial reuse. We use pairwise MIS for spatial reuse to avoid the quadratic cost of the balance heuristic. For temporal reuse, we use the balance heuristic since temporal reuse always has just two candidates (the current and prior frame’s samples).
In initial sampling, the UCW WX^i for a bidirectional sample-technique pair X^i=(Xi,τi) from technique τi=(s,t) is the reciprocal of the subpath sampling PDFs:
WX^i={1p(Zi)1p(Yi)1pL(Yi)s>1,t>11p(Zi)1p(Yi)otherwise,
(25)
where Zi and Yi are the camera and light subpaths, respectively, and pL(Yi) is the probability of selecting Yi for subpath connection.
Initial sampling generates a path for each technique within a pixel, and we use GRIS to select one. The resampling MIS weights for resampling one path-technique pair x^=(x¯,τ) from the initial candidates are, with τ=(s,t),
mi(x^)={1/NLt11otherwise,
(26)
where NL is the number of light subpaths. The number of samples a pixel can receive varies by technique: Light tracing techniques t1 can contribute to any pixel, so each pixel receives NL light tracing samples, requiring the divide by NL to normalize. Other techniques t2 generate samples only for the camera subpath’s pixel. With one camera subpath per pixel and each subpath vertex connected to one light subpath, all the other path-technique spaces receive one sample each per pixel.

5 Shift Mappings for Bidirectional Spatiotemporal Reuse

Now, we define our technique-specific bidirectional hybrid shift mapping Tτ (Equation (20)) for τ=(s,t). We separately discuss three cases: camera tracing techniques (t2), light tracing techniques (t1) where the path is non-caustic, and light tracing techniques (t1) where the path is caustic. A path is caustic if the third vertex from the camera, x2, is classified as non-rough. A key caustic path property is reconnections from the primary hit are not possible as x2 is non-rough, leading us to use random replay instead.
Path tracing, next event estimation, and light subpath connections (t2). When techniques have a camera subpath, we shift the light subpath (if s>0) with random replay and the camera subpath (if t>1) with the hybrid shift mapping of ReSTIR PT [Lin et al. 2022]. Case s=0 corresponds to PT from the camera and hitting an emitter; s=1 corresponds to next event estimation, and s2 connects to a non-degenerate light subpath.
For techniques with subpath connections (t>1 and s>0), we always reconnect (at latest) to the first light subpath vertex. As Manzi et al. [2015], we only allow subpath connections on vertices classified as rough at sampling time. Thus, for BDPT to connect a camera and light subpath, the connected vertices must be classified rough, so a reconnection shift will also succeed. We do not impose a distance constraint for reconnection between the light and camera subpaths, as technique MIS weights wτ naturally lower weights for short connections. Additionally, if a shift changes the classification of either vertex (e.g., a rough vertex becomes non-rough) we then force a shift failure to maintain bijectivity.
Figure 3 illustrates a temporal shift for a path with t=6 and s=4. We first trace a new camera subpath from the target pixel’s primary hit x1. If we sample two consecutive rough vertices, we can reconnect to the second. Otherwise, we reuse the random numbers that generated the original path’s next direction (i.e., apply a random replay shift), and keep tracing the shifted path.
Fig. 3.
Bidirectional shift mapping. Our shift on a path with t=6 and s=4. We shift the base path (solid lines) to a new primary hit x1. When t>1, our bidirectional shift map follows the hybrid shift from Lin et al. [2022], where base path’s random numbers are copied before reconnecting to the reconnection vertex xr. We shift the light subpath with random replay, and reconnect the camera subpath to the shifted light subpath. Note that if xrys1 (as in this figure) our shift involves two reconnections: once to reconnect to xr and again for ys1.
Light tracing (t1), non-caustic. For t=1 techniques, light subpaths are connected directly to the camera. As we only perform bidirectional connections between rough vertices, this implies the primary hit x1 is rough. If the secondary hit x2 is also rough, then the path is non-caustic and a spatial shift is possible. We apply a reverse hybrid shift which shifts the light subpath using random replay until the secondary hit x2, then reconnects to the new primary hit x1 (see Figure 4, top). If the new primary hit x1 is not rough, reconnection is not possible and the shift fails. Just like the forward hybrid shift used for camera subpaths, our reverse hybrid always reconnects the first two consecutively-rough vertices from the camera, which are always the primary and secondary hits x1x2 as we only use this shift for non-caustic paths.
Fig. 4.
Light tracing shift mapping. Here we illustrate our temporal shift mapping for light tracing techniques (t1). We apply random replay from the light until the the secondary hit x2. If x2 is rough, then we can reconnect to the new primary hit x1 (top). Otherwise, we continue with random replay (bottom), and reconnect to the camera directly. In the latter case, the primary hit (and therefore the pixel index) is determined by the random seed, which means we cannot shift to arbitrary primary hits. For this reason, we store these paths in separate caustic reservoirs, which do not interact with standard reservoirs used for all other paths.
Despite replacing the last BSDF direction sampling with a reconnection to the primary hit, the technique index does not change: The shift mapping shifts the extended path (x¯,τ) into another extended path (Tτ(x¯),τ) inside the same layer of the extended path space. Our shift mappings never change the technique index.
Light tracing (t1), caustic. For caustic paths, the secondary hit x2 is non-rough, making reconnection impossible. Prior work defined shifts on such paths (e.g., [Lehtinen et al. 2013] manifold shift), but they are poor fits for real-time, requiring expensive optimization procedures and per-vertex storage. We instead shift caustics temporally via random replay only (see Figure 4, bottom).
Unlike our shifts for other techniques, this changes the primary hit x1 and thus the path’s pixel filter contribution (We in Equation (2)). To best preserve the sample’s contribution, the sample should be shifted to the pixel where the pixel filter contribution is largest. Our shift mapping accomplishes this by projecting the shifted primary hit x1 onto the screen; the shifted sample is stored at this new pixel. This may shift multiple caustic samples to the same pixel, and GRIS automatically selects one of them. This essentially forward-projects caustic paths to the next frame, using random replay instead of motion vectors, and GRIS combines the samples. We justify this mathematically in Appendix A.

5.1 Separating Caustic Reservoirs

As discussed above, we shift caustic t1 paths purely via random replay, which makes spatial shifts to arbitrary vertices impossible. Using spatially shifted reservoirs greatly degrades caustic quality as the non-caustic spatial neighbors are selected more often than low-probability caustic samples. For spatial reuse without this degradation, we store caustic samples in separate per-pixel reservoirs that are not spatially reused. These caustic reservoirs are identical to regular reservoirs except they can only contain caustic samples. The final image simply sums the per-pixel estimates from both reservoirs.
Mathematically, separating caustic reservoirs means having two t1 reservoirs, the non-caustic reservoir using f=p^=0 for caustic paths and the caustic reservoir defining f=p^=0 for non-caustic paths. Whether a t1 path is caustic is detected simply from the roughness of secondary hit x2. Both reservoirs are populated from the same initial candidates but use different shift mappings: caustic paths use random replay only, while non-caustic paths use reconnection.
Confidence weights. ReSTIR reservoirs store confidence weights ci that count how many samples each has processed. These weight the samples from different domains during spatiotemporal reuse (Equation (17)). Importantly, confidence weights must remain independent of actualized samples for GRIS to remain unbiased; they should only count possible samples. Intuitively, ci is unaffected by specific samples (if any) found each frame. For instance, we cannot update confidence weights based on if caustic samples happen to land in the current pixel, as that would correlate the weights with the samples.
We instead update ci for caustic reservoirs using a proxy confidence cv which is the weight of the prior frame’s motion-vector-mapped caustic reservoir (as in standard temporal reuse):
cici+cv,
(27)
where pixel v with weight cv is found in the prior frame via (diffuse) motion vectors (e.g., v=motionVecs[i]). This gives unbiased results, as cv is independent of the samples, and works well for static scenes. Diffuse motion vectors are not ideal, e.g., for animated caustics, and better quality would be achievable if we could define caustic motion vectors. Still, diffuse motion vectors effectively handle new pixels entering the image due to camera rotation. This only affects updates to ci; the resampling MIS weight formulas remain unchanged.

5.2 Shift Jacobians

Below, we give formulas for our shift mapping Jacobians in the area measure. The Jacobian for a path shift is the product of Jacobians at each vertex. We denote quantities on the offset path as prime (e.g., x1 is the shifted primary hit). For full derivations and further discussion, we refer to prior works [Lin et al. 2022; Hua et al. 2019].
For all reconnections, the Jacobian in the area measure is just 1. For random replay bounces on the camera subpath, the Jacobian is the ratio of area-measure sampling PDFs of the vertices:
|xixi|=|pipi|,
(28)
where pi is the forward area-measure PDF of sampling xi from xi1, and pi is the area-measure PDF of sampling xi from xi1.
For the “reverse random replay” shift, which is applied to the light subpath, the Jacobians are identical but in the reverse direction:
|xixi|=|pipi|,
(29)
where pi denotes the reverse area-measure PDF of sampling xi from xi+1, and pi is the area-measure PDF of sampling xi from xi+1.

6 Fast MIS Weight Computation

After shifting a path, we must recompute its MIS weight ωτ in the new domain. This is prohibitively expensive, requiring PDF evaluations at every path vertex. We could simply copy the candidate path’s MIS weight, but this introduces bias (see Figure 5). Instead, we provide an efficient recursive formulation for recomputing ωτ during reconnection. We also provide bounds on the bias associated with copying the MIS weight in Section 6.4.
Fig. 5.
Relative error offset (i.e., 0.5+(II)/I) at 1 sample per pixel on VeachBidir, comparing copying the MIS weight ωs,t during spatial shifts (left) to correctly recomputing it for the shifted path (right) as in Section 6.2. Just copying the MIS weight causes bias; this is fixed by recalculating the shifted sample’s MIS weight.
We build on prior work [van Antwerpen 2011; Georgiev 2012] which optimizes the formulas for ωτ allowing computation using only information at the connected subpath vertices ys1 and zt1. Specifically, we store extra partial MIS quantities per vertex, and compute ωτ from these quantities at ys1 and zt1. Partials are computed incrementally, i.e., values at some vertex zi derive from quantities at zi1, allowing efficient computation during sampling.
We aim to compute partial MIS quantities at the end of the camera subpath zt1 only using information available during reconnection, without visiting the rest of the camera subpath. We store additional information with the subpath and use that to recover the partial MIS quantities needed to compute ωτ during reconnection. Importantly, the size of the additional information is fixed and independent of the subpath length, which is key for performance.
If the scene changes or animates, these quantities must be updated. For temporal reuse, we already retrace the whole path, so we can compute the MIS weight as usual. During spatial reuse, we use our recursive MIS algorithm to recover only the information needed to compute the MIS weight, without traversing the entire path.

6.1 Recursive MIS

Here, we briefly review the recursive MIS algorithm. We adopt the implementation and notation from Georgiev [2012], excluding vertex merging. We store two quantities diVC and dip (where dp is the same as Georgiev’s dVCM term) at subpath vertices yi, zi. These quantities are initialized at the beginning of each subpath as:
y1:d1p=(p0connectp0trace1p1)β,  z1:d1p=(p0connectp0traceNLp1)β,d1VC=(g0p0tracep1)β,  d1VC=0,
(30)
and updated during path sampling as
dip=[xi1nondelta](1pi)β,
(31)
diVC=(gi1pi)β([xi1nondelta]di1p+(pi2σ)βdi1VC).
(32)
where, following the notation in Section 2, pi is the area-measure PDF of sampling xi from xi1, piσ is the solid-angle-measure PDF of sampling xi from xi+1, gi is the geometry term which converts piσ to the area measure, and β is the power used by the MIS heuristic (i.e., β=1 for balance heuristic or β>1 for power heuristic). pconnect and ptrace denote the probability densities of the actual technique used to sample y0, which depends on whether y0 is used to start a new light subpath or connect to a camera subpath (e.g., for NEE). The bracket notation [xinondelta] evaluates to 1 if the expression inside the bracket is true (i.e., if a delta BSDF was sampled at xi), or 0 otherwise.
The full technique MIS weight is then recovered using
ωτ=(w¯s1(y¯)+1+w¯t1(z¯))1,
(33)
where w¯s1 and w¯s1 are weights from the light and camera subpaths, computed depending on the technique as
Vertex Connection (s>1,t>1)
w¯s1(y¯)=(ps1)β(ds1p+(ps2σ)βds1VC),
(34)
w¯t1(z¯)=(pt1)β(dt1p+(pt2σ)βdt1VC),
(35)
Camera Tracing (s=0)
w¯s1(y¯)=0,
(36)
w¯t1(z¯)=(pt1connect)βdt1p+(pt1trace)β(pt2σ)βdt1VC,
(37)
Next Event Estimation (s=1)
w¯0(y¯)=(p0p0connect)β,
(38)
w¯t1(z¯)=(p0trace(y¯)p0connect(y¯))β(pt1)β(dt1p+(pt2σ)βdt1VC),
(39)
Light Tracing (t=1)
w¯s1(y¯)=(p0trace(z¯)p0connect(z¯)ps1NL)β(ds1p+(ps1)βds1VC),
(40)
w¯0(z¯)=0.
(41)
For further explanation and derivation, see Georgiev [2012].

6.2 Recursive Reconnection MIS

The quantities dt1VC and dt1p are required to compute the MIS weight for a path. However, during reconnection, we only retrace the path up to the reconnection vertex xr. A straightforward approach is to visit the rest of the camera subpath after the reconnection vertex just to compute dt1VC and dt1p, however, this makes the algorithm prohibitively expensive.
We instead derive a formulation for computing dt1VC and dt1p using information available at the reconnection vertex xr (where r<t1), without visiting the rest of the camera subpath.
Our algorithm works by computing and storing extra quantities when the camera subpath is first sampled. These quantities are:
γ¯=(gt2pt1)β,
(42)
λ¯VC=(prgr+1)βi=r+1t3(pipi+1)β,
(43)
λ¯P=[xr+1 nondelta]i=r+1t3(pipi+1)β,
(44)
σ¯=i=r+2t2[xi nondelta]dipj=it3(pjpj+1)β.
(45)
In our implementation, we compute these quantities recursively by updating them as the path is traced. This is easily done by adding dip into σ¯ at each bounce, then multiplying λ¯VC, λ¯P, and σ¯ by the ratio of reverse and forward PDFs at each bounce. We provide an implementation of this process in Python as supplemental material.

6.3 Computing dt1VC

If the reconnection vertex is the last vertex on the camera subpath (i.e., r=t1), then Equation (32) can be used without further modification.
If the reconnection vertex is the second-to-last vertex on the camera subpath (i.e., r=t2), we use a slightly modified version of Equation (32) which just has the geometry term separated from pr+1σ in the denominator, as it does not change during reconnection:
dt1VC=(grpr+1σgr+1)β(drp+(pr1σ)βdrVC).
(46)
In this case, all quantities are computed during reconnection except the ratio gr/gr+1 which is computed and cached during initial sampling, and updated when the scene changes.
For the general case of r<t2 we use the additional quantities defined above:
dt1VC=γ¯((1pr+1σ)βλ¯VC(drp+(pr1σ)βdrVC)+(1pr+1σ)β(1gr+1)βλ¯P+σ¯).
(47)
In our implementation, we also cache all other quantities needed to compute the weights w¯t1 and w¯s1 used to compute the final MIS weight (Equation (33)).

6.4 Bias from MIS Weight Reuse

Faster rendering can be achieved by simply copying the MIS weight from the base path instead of recomputing it. This introduces bias, but eliminates the need for our recursive reconnection MIS algorithm. In practice, we observe a small darkening bias near corners and shadow boundaries. In our supplementary document, we show the relative bias is bounded by the MIS weight error, i.e.,
|Bias|Iϵω,
where ϵω bounds the relative error between the correct MIS weight and the copied MIS weight from the original domain.

7 Implementation

We implemented BDPT in the Falcor rendering framework [Kallweit et al. 2022] using the Slang shading language. At a high-level, our initial sampling resembles SmallVCM [Georgiev et al. 2012], but without vertex merging. We first sample a fixed number of light subpaths via Algorithm 1, parallelizing over subpaths. Initial vertices y0 are selected according to each light’s emissive power. After sampling light subpaths, we sample camera subpaths, parallelizing over pixels, connecting them to light subpaths in Algorithm 2. Finally, pixels reuse full paths from spatiotemporal neighbors, using Algorithm 3 to shift paths between pixel domains.

7.1 Initial Sampling

Light subpath sampling. In Algorithm 1, light subpaths are traced and all connectable light subpath vertices are atomically appended to the LVC (line 8). These vertices are also connected to the camera to form full paths (line 9), corresponding to the light tracing technique. These paths must be resampled into the destination pixel, however, reservoir merging is not an atomic operation. To avoid race conditions from merging, we instead insert the key-value pair (k,r) into a parallel multimap which we refer to as the Light Reservoir Map (LRM), where k is the path’s pixel index and r is a new reservoir containing the sampled path (line 10). Afterwards, the LRM is efficiently sorted on the GPU via prefix sum operations, following [Boissé 2021] parallel hash map (line 11).
Camera subpath sampling.After light subpath sampling, Algorithm 2 samples camera subpaths and connects them to random light subpath vertices to form full paths. For NEE (where s=1), we sample light primitives according to their emissive power. For subpath connection techniques (where s>1), we select light subpath vertices from the LVC uniformly, corresponding to pL=NL/|LVC| in Equation (25).
Merging light tracing paths. After camera subpath sampling, Algorithm 2 merges the reservoirs from light tracing in each pixel (lines 15–20). Conceptually, light tracing reservoirs are merged into every pixel’s reservoir, and we only use the LRM as an acceleration structure to skip zero-contribution paths within each pixel. During this step, we separate reservoirs containing caustic paths as mentioned in Section 5.1, corresponding to the check on line 17 in Algorithm 2. The full image is the sum of caustic and noncaustic contributions, which we recover by summing the estimates from our caustic and noncaustic reservoirs.
Confidence weights. The confidence weight ci of the resulting reservoir is always 1, regardless of how many paths Algorithm 2 found. This is because confidence weights cannot depend on the random samples, and must be updated deterministically based on the sampling process. In practice, we implement this by initializing our reservoirs with ci=1, and only updating ci during spatiotemporal reuse.

7.2 Spatiotemporal Sample Reuse

After initial sampling, pixels reuse samples from neighbor pixels and the prior frame. For both spatial and temporal reuse, Algorithm 3 is used to shift paths to new primary hits. For caustic samples, the primary hit is unused, and the shifted path instead contributes to an arbitrary pixel based on the reverse random replay shift. For this reason, we temporally shift caustic paths separately, merging them into the new pixels based on the random replay shift. As in initial sampling, this occurs in two passes using the LRM to efficiently sort the shifted paths into pixels.
Integration measures. Integrating with respect to surface area (as in Equation (1)) introduces geometry terms G(xixi+1) which convert differential areas at xi+1 to differential projected solid-angles at xi. Many geometry terms cancel when evaluating f/p (Equation (3)), as p also has geometry terms after converting sampling probability densities to area measure. Renderers often omit cancelled geometry terms entirely, essentially integrating with respect to solid-angle everywhere. This reduces computation and improves numerical stability where geometric inverse-squared terms go to zero.
For sample reuse, we use the unweighted integrand (f without dividing by p), so we cannot rely on this cancellation. To avoid numerically-unstable geometry terms, we integrate with respect to solid-angle at each vertex; this slightly changes our Jacobians. We give solid-angle parameterizations of shift Jacobians in Appendix B.
Stable but biased temporal reuse of light traced samples. Many ReSTIR implementations [Bitterli et al. 2020; Lin et al. 2022] store primary hits in a visibility buffer [Burns and Hunt 2013]; this works well for unidirectional PT. However, BDPT connects light paths to the camera directly, which makes it possible to sample paths occluded from these primary hits (Figure 6). These samples must be included for an unbiased estimate, but they degrade temporal reuse as shifting them to the next frame’s primary hit immediately fails. To fix this, we add a simple rejection heuristic to reject non-caustic t1 paths that cannot be shifted to the primary hit. This greatly improves temporal stability, albeit with a negligible darkening bias in penumbra regions due to missing samples. A better solution might apply [Zhang et al. 2024] concurrent Area ReSTIR to reuse samples within a pixel.
Fig. 6.
Light tracing hits and V-Buffer hits. It is possible to connect light subpaths to the camera (purple dashed line) which cannot be shifted to the visibility buffer hit for the pixel due to differences in visibility (red dashed line).
Lightweight BDPT. A simple way to improve performance is to omit techniques involving subpath connections. We refer to this version of our algorithm as LW BDPT. Specifically, LW BDPT refers to the combination of s=0 (PT), s=1 (NEE) and t=1 (light tracing) techniques. This is an appealing middle ground as it provides high quality caustic sampling with a lower cost than full BDPT. We show results for this algorithm in Figure 11.

8 Results

In Figure 11, we show several scenes [Bitterli 2016] that are challenging with unidirectional PT. All results use an RTX 4090 GPU, a Ryzen 7 3700x CPU, at a resolution of 1,920×1,080. We compare numerical errors using MAPE.3
We sample NL=192010802M light subpaths, unless otherwise noted. All results use a maximum path length of 20 bounces, or 8 diffuse bounces (whichever is reached first), where a “diffuse bounce” refers to sampling a BSDF lobe with roughness above the connectability threshold. We classify vertices with roughness greater than 0.08 as connectable, which is the minimum roughness our material system supports. See Figure 7 for comparison with other thresholds. We apply Russian roulette by randomly terminating paths inside TraceNewVertex (Algorithm 2, line 5) according to the probability
pterminate(xi)=0.2rgh(xi),
where rgh(xi) returns roughness of the material (not just the sampled BSDF lobe) at vertex xi.4 We limit confidence weights ci to a maximum of 20 in all experiments.
Fig. 7.
The VeachBidir scene with a metallic table with a roughness texture, rendered with different roughness thresholds. Using too large of a threshold disables bidirectional connections (including NEE) on rough surfaces, and leads us to select less efficient shift mappings, which produces more noise.
Our strongest results are on scenes lit primarily by caustics, e.g., the Bathroom and Sponza that only have emissive geometry inside glass light fixtures. The glass fixtures in Sponza and Bathroom cause next event estimation (s=1) to fail, which makes BSDF sampling (s=0) the only viable technique for ReSTIR PT. The glass also causes failed reconnections, forcing ReSTIR PT to use (unidirectional) random replay for most scene lighting; this introduces obvious blotchy correlation artifacts. In contrast, our work efficiently samples light paths through the glass, greatly improving sampling of LSD*E paths and better resolving scene caustics.
In the VeachBidir scene, the caustics on the wall are challenging without bidirectional techniques. Even at high sample counts, unidirectional PT fails to resolve them. Additionally, when the light is animated (Figure 9), our temporal caustic shift enables efficient resampling between frames, greatly improving the result.
For diffuse lighting, as in the WhiteRoom, our improvement over ReSTIR PT is reduced. Reconnection works well on these scenes, enabling spatial reuse to share many light paths between pixels. However, BDPT still improves the candidate distribution, so our method still shows benefits, especially at low sample counts where candidate path distribution especially matters.
In Figure 8, we show a cut-down version of our algorithm without camera connections (t1 techniques), similar to prior methods [Liu and Gan 2023; Nabata et al. 2020]. Importantly, t1 techniques excel at sampling caustic paths, making it the dominant technique on these scenes. Even with only the t=1 technique, most illumination in the scene is well-sampled, except for regions where the primary hits are not rough, which makes connecting to the camera impossible.
Fig. 8.
Without light tracing (t1) techniques (as in Liu and Gan [2023] and Nabata et al. [2020]), scenes lit by caustics are difficult to sample. Light tracing techniques very efficiently sample caustics, while standard path tracing struggles to find such paths.
Fig. 9.
The VeachBidir scene with animated caustics rendered with one sample per pixel. The light moves from right to left during animation, focusing light through the glass egg. With light subpath random replay and separate caustic reservoirs, our work temporal resamples the caustics, even capturing smaller details on the wall. Note: the light around the egg’s shadow captured by ReSTIR PT is direct illumination, not a caustic.
Our algorithm costs roughly twice as much as ReSTIR PT at the same sample count. This is mostly because BDPT traces roughly twice as many rays as regular PT, due to light tracing and subpath connections. Our algorithm also employs additional data structures (the LVC and caustic reservoirs) and a larger path reservoir to store light subpath and recursive reconnection MIS information, increasing register and memory pressures.
Our per-pixel reservoirs have size 244B if using our recursive reconnection MIS, and 160B otherwise. The size of LVC vertices is 112B. We give the full contents of our reservoir and light vertex data structures in the supplementary document. For 1,920×1,080 renders, the total storage cost of our full unbiased algorithm is 8.2 GB. We did not attempt to optimize storage.
Fig. 10.
Results with one sample per pixel in the BistroInterior. In this scene, light tracing struggles to sample high-contribution paths, especially the caustics on the wall, as most scene lights do not contribute to the image. Our method performs similarly to unidirectional ReSTIR in this case.
Fig. 11.
Results on various scenes. All scenes are modified to be more challenging for unidirectional PT (except Veach). Sponza and Bathroom are lit only by filaments inside glass light fixtures. BreakfastRoom has glass dishes, adding caustics on the table and wall. The WhiteRoom is lit from the outside, but the blinds are closed, blocking much of the window. We show results at 1spp, after warming the reservoirs with 200 frames of reuse. We perform equal-time comparisons by increasing initial candidate count for other methods. Unless otherwise specified, we set the number of light subpaths NL to the number of pixels (1,920×1,080). The lamp in Sponza comes from Sketchfab user hectopod, under CC-Attribution.
Figure 12 shows error (MAPE) over time for an offline variant of our algorithm, compared to ReSTIR PT. As Lin et al. [2022] note, temporal resampling is less effective for offline rendering as temporal correlations hurt offline convergence (when averaging multiple frames). Instead, our offline variant uses spatial resampling only. As BDPT has a higher-quality initial candidate distribution, our error is lower than Lin et al. [2022].
Fig. 12.
Convergence graphs comparing standard BDPT to offline ReSTIR variants (three spatial reuse passes with six candidates each, no temporal reuse) on our scenes. Our method has a lower error than ReSTIR PT due to the improved candidate distribution from bidirectional sampling. Standard BDPT is able to accumulate more samples in less time, however, the per-sample error is lower with resampling.
Spatial reuse from pixels with very different target functions can sometimes reduce efficiency [Pan et al. 2024; Tokuyoshi 2023]. While we observe better offline results than standard BDPT in all of our scenes when measured per-sample, in some scenes the reduced efficiency no longer compensates for the added computational cost of resampling, leading to standard BDPT converging faster. This suggests a careful study on how to best benefit from ReSTIR algorithms in the offline context.

9 Conclusion

We presented a method to combine BDPT with ReSTIR. By combining spatiotemporal reuse and path-space sampling, we enable interactive rendering of scenes with caustics and complex occlusion; this was previously limited to offline renderers.

9.1 Limitations and Future Work

Not all scenes benefit from light tracing. In these cases, our method’s efficiency may decrease below ReSTIR PT, due to being more expensive (Figure 10). However, this could potentially be improved with better light subpath sampling strategies leveraging camera information [Vorba et al. 2014; Grittmann et al. 2018].
We did not optimize our light subpath shifts. Our implementation shifts camera and light subpaths in the same GPU dispatch, dealing with caustic and non-caustic cases separately. A more optimal implementation could reduce divergence by shifting camera and light subpaths in separate dispatches.
As discussed in Section 5.1, we use a proxy confidence weight cv during temporal reuse, where v is found via motion vectors. This is suboptimal for animation, as animated caustics do not follow the diffuse motion vectors. We did not explore alternative schemes to update confidence weights. Future work could explore using information from all caustic reservoirs to better update the confidence weights.
Specular-diffuse-specular (SDS) paths such as the bathroom mirror reflections are still challenging with our method. This is a known limitation of bidirectional sampling [Veach 1997]. Future work could apply vertex merging to capture these effects. Manifold shifts could also help reuse in hard situations.

Acknowledgments

We thank Aaron Lefohn for the discussions and support, and the anonymous reviewers for their constructive feedback.

Footnotes

1
Full BDPT can be less efficient than a subset of techniques due to the extra cost from evaluating all techniques, or from sub-optimal MIS weights [Grittmann et al. 2019].
2
The condition also requires that the PDF of Xi is positive at Ti1(x¯), but this is normally guaranteed by p^i(Ti1(x¯))>0.
3
We use MAPE=mean(|IIref|/(Iref+0.01mean(Iref)).
4
pterminate cannot rely on camera subpath information (path length, throughput, etc.) since this information is not known during light tracing [van Antwerpen 2011; Georgiev 2012].

Supplemental Material

PDF File - Supplementary Materials for ReSTIR BDPT: Bidirectional ReSTIR Path Tracing with Caustics
Supplementary Materials
MP4 File - Supplementary Materials for ReSTIR BDPT: Bidirectional ReSTIR Path Tracing with Caustics
Supplementary Materials

A Temporal Caustic Reuse

The pixel a caustic path (t1) hits is determined by its primary hit vertex x1. We shift caustic paths temporally by random replay, i.e., re-tracing the path in the new frame with the same random numbers. This means its pixel may change. This initially seems incompatible with GRIS, which requires pre-selecting the reuse domains, and the selection cannot depend on their samples. To resolve this, we reformulate the reuse process as follows.
First, the domain of current and previous pixels covers the whole image, but their support covers only the current pixel i. The target function q^ is zero outside of the pixel, e.g., by a pixel filter h,
q^i(x^)=hi(x¯)p^(x^),
(48)
where p^ is the target function, x¯ is the path of the path-technique pair x^, and hi(x¯) evaluates the pixel filter at the subpixel location of x¯’s primary hit.
Second, in candidate sampling, all NL t1 paths are conceptually treated as candidates for each pixel i, leading to resampling weights
wi=1NLhi(X^i)p^i(X^i)WX^i,
(49)
where pixel filter hi automatically discards samples not in pixel i, and p^ discards non-caustic paths. The initial sampling’s output X^, now a caustic path in pixel i or a zero-contribution null sample [Wyman et al. 2023], is then chosen proportionally to the wi.
Third, in temporal reuse, each current pixel i conceptually reuses from all prior frame pixels j (and pixel i’s initial sampling). Most pixels do not contribute, as the temporal random replay shift to i fails. Substituting q^ (Equation (48)) to the generalized balance heuristic function (Equation (17)) with confidence weights Mi yields
mi(x^)=Mihi(T1(x¯))p^i(x)jMjhj(T1(x¯))p^j(x^)+Mishi(x^)p^(x^),
(50)
where T1 is the random replay shift to the previous frame, shared with all pixels, i runs over all previous-frame pixels and the current pixel’s initial sampling result, and j runs over all previous-frame pixels. Mis is the confidence weight given to the initial sample. We immediately see that the pixel a caustic path x^ shifts to with random replay is unique, and hence the denominator contains only two active terms, assuming the box filter, and simple sum over multiple pixels for wider filters (the shift mapping, its Jacobian, and p^ do not depend on the pixel).
In the following, we assume a 1-pixel box filter to avoid notation clutter without loss of generality. Given a sample X^i from previous frame’s pixel i, and its successful random replay shift Y^i=T(X^i) in the current pixel, a simple substitution yields
mi(Y^i)=Mip^prev(X^i)|TXi|1Mip^prev(X^i)|TXi|1+Misp^(Y^i),
(51)
where p^ is the current frame’s target function, p^prev is the previous frame’s target function, Mi is the confidence weight of the source pixel’s reservoir in the previous frame, and Mis is the confidence weight of the initial sample. If the shift does not succeed or X^i does not hit the current pixel when shifting, the resampling MIS weight mi(Y^i) is zero.
Similarly, the initial sample Y^is, which is already in current pixel’s domain, gets a resampling MIS weight
mis(Y^is)=Misp^(Y^is)Mip^prev(X^is)|T1Yis|+Misp^(Y^is),
(52)
where X^is=T1(Y^is) is the initial sample shifted to the previous frame with random replay, and i is the pixel it hits. If the shift fails or hits no pixel, the term containing Mi is zero.
This mathematical construction allows temporal reuse of caustics from pixels as defined by the random replay shift. It also allows stratification and unbiased temporal accumulation of caustics in the pixels they land, extending the limits of GRIS theory by seemingly allowing the samples themselves to define the pixels included in the MIS weights. Yet this does not eliminate the requirement to keep confidence weights independent of realized samples. We still cannot increment confidence weights by counting the number of caustics landing on each pixel. We explain our method for updating the caustic reservoirs’ confidence weights in Section 5.1.

B Solid-Angle Jacobians

Here, we give solid-angle Jacobians for our bidirectional hybrid shift. For further discussion on the random replay and reconnection Jacobians, we refer to Lin et al. [2022].
The solid-angle Jacobian for random replay is the ratio of solid-angle sampling PDFs between original and shifted paths. We denote the normalized direction from xi to xj on the original path as ωij, and similarly the normalized direction from xi to xj on the shifted path as ωij. For random replay on the camera subpath, we have
|ωi1iωi1i|=piσpiσ,
(53)
and for random replay on the light subpath, we have
|ωi+1iωi+1i|=piσpiσ,
(54)
where piσ and piσ are the forward and reverse solid-angle PDFs of sampling vertex xi, respectively, (piσ is simply pi expressed in the solid-angle measure).
The Jacobian for forward reconnection is the ratio of forward geometry terms along the reconnection edge:
|ωi1iωi1i|=|niωi1i||niωi1i|xi1xi2xi1xi2,
(55)
where ni is the geometry normal at xi. Note that we must also apply the reconnection Jacobian to the edge between zt1 and ys1 for s1,t2 techniques (NEE and vertex connection).
For reconnection along the light subpath (only used for t1 techniques), reverse reconnection Jacobian is the ratio of reverse geometry terms along the reconnection edge:
|ωi+1iωi+1i|=|niωi+1i||niωi+1i|xi1xi2xi1xi2,
(56)
where i=2 for noncaustic paths, where x2 is reconnected to x1. For caustic paths where a light subpath is reconnected directly to the camera, the Jacobian is the same equation but with i=1.

References

[1]
Benedikt Bitterli. 2016. Rendering Resources. (2016). Retrieved from https://benedikt-bitterli.me/resources/
[2]
Benedikt Bitterli, Chris Wyman, Matt Pharr, Peter Shirley, Aaron Lefohn, and Wojciech Jarosz. 2020. Spatiotemporal reservoir resampling for real-time ray tracing with dynamic direct lighting. ACM Transactions on Graphics 39, 4 (2020), 148:1–148:17. DOI:DOI:
[3]
Guillaume Boissé. 2021. World-space spatiotemporal reservoir reuse for ray-traced global illumination. SIGGRAPH Asia 2021 Technical Communications (2021). DOI:DOI:
[4]
Christopher A. Burns and Warren A. Hunt. 2013. The visibility buffer: A cache-friendly approach to deferred shading. Journal of Computer Graphics Techniques (JCGT) 2, 2 (12 August2013), 55–69. Retrieved from http://jcgt.org/published/0002/02/04/

Cited By

View all
  • (2025)A Survey on Deep Learning for Monte Carlo Path TracingACM Computing Surveys10.1145/3768618Online publication date: 19-Sep-2025

Index Terms

  1. ReSTIR BDPT: Bidirectional ReSTIR Path Tracing with Caustics

    Recommendations

    Comments