We occasionally run membership recruitment campaigns on social media channels and use cookies to track post-clicks. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services. Use the check boxes below to choose the types of cookies you consent to have stored on your device.
Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies. These cookies do not gather information about you that could be used for marketing purposes and do not remember where you have been on the internet.
__cf_bm [x2]This cookie is used to distinguish between humans and bots. This is beneficial for the website, in order to make valid reports on the use of their website.
Maximum Storage Duration: 1 dayType: HTTP Cookie
_cfuvidThis cookie is a part of the services provided by Cloudflare - Including load-balancing, deliverance of website content and serving DNS connection for website operators.
Maximum Storage Duration: SessionType: HTTP Cookie
cf_chl_rc_niThis cookie is a part of the services provided by Cloudflare - Including load-balancing, deliverance of website content and serving DNS connection for website operators.
Maximum Storage Duration: 1 dayType: HTTP Cookie
JSESSIONIDPreserves users states across page requests.
Maximum Storage Duration: SessionType: HTTP Cookie
__jidUsed to add comments to the website and remember the user's Disqus login credentials across websites that use said service.
Maximum Storage Duration: SessionType: HTTP Cookie
disqusauthRegisters whether the user is logged in. This allows the website owner to make parts of the website inaccessible, based on the user's log-in status.
Maximum Storage Duration: SessionType: HTTP Cookie
Preference cookies enable a website to remember information that changes the way the website behaves or looks, like your preferred language or the region that you are in.
Some of the data collected by this provider is for the purposes of personalization and measuring advertising effectiveness.
_gaRegisters a unique ID that is used to generate statistical data on how the visitor uses the website.
Maximum Storage Duration: 2 yearsType: HTTP Cookie
_ga_#Used by Google Analytics to collect data on the number of times a user has visited the website as well as dates for the first and most recent visit.
Maximum Storage Duration: 2 yearsType: HTTP Cookie
_gatUsed by Google Analytics to throttle request rate
Maximum Storage Duration: 1 dayType: HTTP Cookie
_gidRegisters a unique ID that is used to generate statistical data on how the visitor uses the website.
_hjSession_#Collects statistics on the visitor's visits to the website, such as the number of visits, average time spent on the website and what pages have been read.
Maximum Storage Duration: 1 dayType: HTTP Cookie
_hjSessionUser_#Collects statistics on the visitor's visits to the website, such as the number of visits, average time spent on the website and what pages have been read.
Maximum Storage Duration: 1 yearType: HTTP Cookie
_hjTLDTestRegisters statistical data on users' behaviour on the website. Used for internal analytics by the website operator.
Maximum Storage Duration: SessionType: HTTP Cookie
_hjCookieTestCollects data on the user’s navigation and behavior on the website. This is used to compile statistical reports and heatmaps for the website owner.
Maximum Storage Duration: SessionType: HTTP Cookie
disqus_uniqueCollects statistics related to the user's visits to the website, such as number of visits, average time spent on the website and loaded pages.
Maximum Storage Duration: SessionType: HTTP Cookie
Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.
Cookie declaration last updated on 2025/10/07 by Cookiebot
[#IABV2_TITLE#]
[#IABV2_BODY_INTRO#]
[#IABV2_BODY_LEGITIMATE_INTEREST_INTRO#]
[#IABV2_BODY_PREFERENCE_INTRO#]
[#IABV2_BODY_PURPOSES_INTRO#]
[#IABV2_BODY_PURPOSES#]
[#IABV2_BODY_FEATURES_INTRO#]
[#IABV2_BODY_FEATURES#]
[#IABV2_BODY_PARTNERS_INTRO#]
[#IABV2_BODY_PARTNERS#]
About
Cookies are small text files that can be used by websites to make a user's experience more efficient. Other than those strictly necessary for the operation of the site, we need your permission to store any type of cookies on your device. Learn more about ACM, how you can contact us, and how we process personal data in our Privacy Policy. Also please consult our Cookie Notice.
You can change or withdraw your consent from the Cookie Declaration on our website at any time by visiting the Cookie Declaration page. If contacting us regarding your consent, please state your consent ID and date from that page.
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,9201,080 resolution, our method achieves a mean absolute percentage error (MAPE) of 0.312 in 70ms (with 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 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.
Full path
Light subpath (with vertices)
Camera subpath (with vertices)
Random variable for a path
Random variable for a light subpath
Random variable for a camera subpath
Reconnection vertex
Primary hit
Secondary hit
Light subpath selection probability
Canonical probability density function (PDF)
“Forward” solid-angle PDF of sampling from
“Reverse” solid-angle PDF of sampling from
expressed in area measure
expressed in area measure
RIS target functions
,
BDPT MIS weight for technique or
Resampling candidate count
Resampling MIS weight for candidate
Confidence weight for reservoir
Summary of Notation
2.1 Path Integrals and Notations
In rendering, a pixel’s intensity is computed as an integral over all light paths connecting it to light sources [Veach 1997; Kajiya 1986],
(1)
for a light path with vertices, where is on the camera sensor and is on a light. is the path space with the union of scene surfaces , and is the area product measure. The measurement contribution function turns radiance transported along a path into pixel response:
(2)
where is sensor importance of the pixel, is light emission, 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
(3)
where is the PDF for random path . The estimation noise is smaller when better matches .
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 vertices as for on the camera, and light subpaths with vertices as for on the light (see Figure 2).
Fig. 2.
A path formed by BDPT. is the camera subpath, is the light subpath, and the full path is formed by appending them together: .
By connecting camera and light subpaths at different vertices, we form full paths with vertices. Case gives light tracing, with an explicit connection to the camera () from the light subpath’s end (). Case corresponds to randomly selecting the sensor surface via BSDF sampling. In our implementation, we omit 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 , 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:
(4)
where is the probability density of sampling path with technique , and MIS weights form a partition of unity over the probability densities of all ways to form the same path:
(5)
(6)
Here, is the power used by MIS (e.g., for the balance heuristic, for the power heuristic). Forward PDFs are area-measure probability densities for sampling vertex from vertex during camera tracing. Similarly, reverse PDFs represent densities for sampling vertex from vertex during light tracing. This follows notation in van Antwerpen [2011] and Georgiev et al. [2012]. Notably absent in Equation (5) are the densities and 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 . 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 ( in Equation (5)), van Antwerpen [2011] formulated an efficient recursive relation to incrementally compute and store data at path vertices so computing 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 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: , where is the probability density of sampling path . Without loss of generality, we assume one sample per pixel. Ideally, we want a probability density proportional to the integrand , but directly sampling with such a distribution is often intractable. RIS [Talbot et al. 2005] approximates this by first sampling i.i.d. candidate samples from an easier-to-sample distribution , and chooses one of them as the output proportionally to resampling weights. Following Lin et al. [2022], we have
(7)
where the target function is proportional to the often intractable target density.
The resampling process makes the output ’s probability density computationally intractable, rendering the classical Monte Carlo estimator inadequate. Instead, we can compute an unbiased contribution weight (UCW) [Lin et al. 2022] for ,
(8)
which is an unbiased estimate for the unknown reciprocal probability density . The classical Monte Carlo estimator is replaced with
(9)
As candidate count increases, the (intractable) output probability density approaches the target PDF, and approaches . Ideally, would be itself for asymptotically perfect importance sampling.
RIS allows candidates with different source distributions using MIS [Talbot et al. 2005; Lin et al. 2022]. We simply replace the in Equation (7) with resampling MIS weights:
(10)
where, e.g.,
(11)
for the balance heuristic. If all are identically distributed (meaning all are identical), then the weights reduce to the same . 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:
(12)
Since the PDFs are not known, the resampling MIS weights must be modified. A simple choice is the generalized balance heuristic, using input ’s target function as a proxy for :
(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 from the gradient-domain rendering literature [Lehtinen et al. 2013; Kettunen et al. 2015]. A shift mapping takes a path from domain and slightly modifies it into a similar path in . Not every path needs to be shiftable; a shift mapping bijectively maps paths from a subset of 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 are mapped from the source domains into the current pixel’s domain as , and a Jacobian determinant is added to transform the contribution weights to the current domain, giving
(14)
The MIS weight and target function must be evaluated in the current domain, i.e., at instead of . Multiplying the UCW by the Jacobian determinant technically transforms it into for the shifted path. The output is then resampled from the proportionally to the , and Equations (8) and (9) remain unchanged.
The resampling MIS weights require another change. Mapping a random variable with a shift map modifies its probability density. Lin et al. [2022] account for this in the resampling MIS weights by defining a function , “ from ” that shifts path back to domain for target function evaluation and accounts for density changes using the Jacobian determinant,
(15)
Condition amounts to being defined.2 This gives the generalized balance heuristic
(16)
In practice, the terms are scaled by confidence weights , which effectively weight each domain based on the number of samples each domain has processed, yielding
(17)
Kettunen et al. [2023, supplemental] connect Equation (17) to Veach and Guibas [1995b]’s multi-sample MIS, if is interpreted as ’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 current-frame samples, sensible temporal reuse would weight the prior sample by 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 and ). 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 (), 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 (camera subpath hits an emissive surface) and (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., , 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 (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 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 with the technique indices used to generate them in extended paths. 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:
(18)
where is the technique MIS weight of path under technique . We weight the measurement contribution 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 and shift mapping . We set the target function to be always weighted by the technique MIS weight :
(19)
where and is a user-defined target function. We always set to be the luminance of the measurement contribution . 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:
(20)
where is the shift mapping defined for technique . We will specify in the next section. The Jacobian is simply
(21)
Combining these, we can directly apply GRIS to estimate the extended path space integral (Equation (18)). For the resampling output sampled from the shifted inputs proportionally to resampling weights , we get
(22)
The UCW for the chosen sample at GRIS resampling is
(23)
where is given by Equation (19), and the candidates’ resampling weights are, denoting ,
(24)
Here, is the generalized balance heuristic (Equation (17)), with a substitution of our (Equation (19)) and Jacobian (Equation (21)) into the definition of 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 for a bidirectional sample-technique pair from technique is the reciprocal of the subpath sampling PDFs:
(25)
where and are the camera and light subpaths, respectively, and is the probability of selecting 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 from the initial candidates are, with ,
(26)
where is the number of light subpaths. The number of samples a pixel can receive varies by technique: Light tracing techniques can contribute to any pixel, so each pixel receives light tracing samples, requiring the divide by to normalize. Other techniques 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 (Equation (20)) for . We separately discuss three cases: camera tracing techniques (), light tracing techniques () where the path is non-caustic, and light tracing techniques () where the path is caustic. A path is caustic if the third vertex from the camera, , is classified as non-rough. A key caustic path property is reconnections from the primary hit are not possible as is non-rough, leading us to use random replay instead.
Path tracing, next event estimation, and light subpath connections (). When techniques have a camera subpath, we shift the light subpath (if ) with random replay and the camera subpath (if ) with the hybrid shift mapping of ReSTIR PT [Lin et al. 2022]. Case corresponds to PT from the camera and hitting an emitter; corresponds to next event estimation, and connects to a non-degenerate light subpath.
For techniques with subpath connections ( and ), 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 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 and . We first trace a new camera subpath from the target pixel’s primary hit . 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 and . We shift the base path (solid lines) to a new primary hit . When , 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 . We shift the light subpath with random replay, and reconnect the camera subpath to the shifted light subpath. Note that if (as in this figure) our shift involves two reconnections: once to reconnect to and again for .
Light tracing (), non-caustic. For techniques, light subpaths are connected directly to the camera. As we only perform bidirectional connections between rough vertices, this implies the primary hit is rough. If the secondary hit 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 , then reconnects to the new primary hit (see Figure 4, top). If the new primary hit 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 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 (). We apply random replay from the light until the the secondary hit . If is rough, then we can reconnect to the new primary hit (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 () into another extended path () inside the same layer of the extended path space. Our shift mappings never change the technique index.
Light tracing (), caustic. For caustic paths, the secondary hit 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 and thus the path’s pixel filter contribution ( 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 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 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 reservoirs, the non-caustic reservoir using for caustic paths and the caustic reservoir defining for non-caustic paths. Whether a path is caustic is detected simply from the roughness of secondary hit . 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 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, 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 for caustic reservoirs using a proxy confidence which is the weight of the prior frame’s motion-vector-mapped caustic reservoir (as in standard temporal reuse):
(27)
where pixel with weight is found in the prior frame via (diffuse) motion vectors (e.g., ). This gives unbiased results, as 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 ; 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., 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:
(28)
where is the forward area-measure PDF of sampling from , and is the area-measure PDF of sampling from .
For the “reverse random replay” shift, which is applied to the light subpath, the Jacobians are identical but in the reverse direction:
(29)
where denotes the reverse area-measure PDF of sampling from , and is the area-measure PDF of sampling from .
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., ) at 1 sample per pixel on VeachBidir, comparing copying the MIS weight 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 and . Specifically, we store extra partial MIS quantities per vertex, and compute from these quantities at and . Partials are computed incrementally, i.e., values at some vertex derive from quantities at , allowing efficient computation during sampling.
We aim to compute partial MIS quantities at the end of the camera subpath 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 and (where is the same as Georgiev’s term) at subpath vertices , . These quantities are initialized at the beginning of each subpath as:
(30)
and updated during path sampling as
(31)
(32)
where, following the notation in Section 2, is the area-measure PDF of sampling from , is the solid-angle-measure PDF of sampling from , is the geometry term which converts to the area measure, and is the power used by the MIS heuristic (i.e., for balance heuristic or for power heuristic). and denote the probability densities of the actual technique used to sample , which depends on whether is used to start a new light subpath or connect to a camera subpath (e.g., for NEE). The bracket notation evaluates to 1 if the expression inside the bracket is true (i.e., if a delta BSDF was sampled at ), or 0 otherwise.
The full technique MIS weight is then recovered using
(33)
where and are weights from the light and camera subpaths, computed depending on the technique as
—
Vertex Connection ()
(34)
(35)
—
Camera Tracing ()
(36)
(37)
—
Next Event Estimation ()
(38)
(39)
—
Light Tracing ()
(40)
(41)
For further explanation and derivation, see Georgiev [2012].
6.2 Recursive Reconnection MIS
The quantities and are required to compute the MIS weight for a path. However, during reconnection, we only retrace the path up to the reconnection vertex . A straightforward approach is to visit the rest of the camera subpath after the reconnection vertex just to compute and , however, this makes the algorithm prohibitively expensive.
We instead derive a formulation for computing and using information available at the reconnection vertex (where ), 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:
(42)
(43)
(44)
(45)
In our implementation, we compute these quantities recursively by updating them as the path is traced. This is easily done by adding into at each bounce, then multiplying , , 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
If the reconnection vertex is the last vertex on the camera subpath (i.e., ), 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., ), we use a slightly modified version of Equation (32) which just has the geometry term separated from in the denominator, as it does not change during reconnection:
(46)
In this case, all quantities are computed during reconnection except the ratio which is computed and cached during initial sampling, and updated when the scene changes.
For the general case of we use the additional quantities defined above:
(47)
In our implementation, we also cache all other quantities needed to compute the weights and 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.,
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 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 into a parallel multimap which we refer to as the Light Reservoir Map (LRM), where is the path’s pixel index and 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 ), we sample light primitives according to their emissive power. For subpath connection techniques (where ), we select light subpath vertices from the LVC uniformly, corresponding to 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 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 , and only updating 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 which convert differential areas at to differential projected solid-angles at . Many geometry terms cancel when evaluating (Equation (3)), as 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 ( without dividing by ), 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 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 (PT), (NEE) and (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,9201,080. We compare numerical errors using MAPE.3
We sample 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
where returns roughness of the material (not just the sampled BSDF lobe) at vertex .4 We limit confidence weights 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 () to fail, which makes BSDF sampling () 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 ( techniques), similar to prior methods [Liu and Gan 2023; Nabata et al. 2020]. Importantly, techniques excel at sampling caustic paths, making it the dominant technique on these scenes. Even with only the 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 () 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,9201,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 to the number of pixels (). 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 during temporal reuse, where 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].
cannot rely on camera subpath information (path length, throughput, etc.) since this information is not known during light tracing [van Antwerpen 2011; Georgiev 2012].
The pixel a caustic path hits is determined by its primary hit vertex . 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 . The target function is zero outside of the pixel, e.g., by a pixel filter ,
(48)
where is the target function, is the path of the path-technique pair , and evaluates the pixel filter at the subpixel location of ’s primary hit.
Second, in candidate sampling, all paths are conceptually treated as candidates for each pixel , leading to resampling weights
(49)
where pixel filter automatically discards samples not in pixel , and discards non-caustic paths. The initial sampling’s output , now a caustic path in pixel or a zero-contribution null sample [Wyman et al. 2023], is then chosen proportionally to the .
Third, in temporal reuse, each current pixel conceptually reuses from all prior frame pixels (and pixel ’s initial sampling). Most pixels do not contribute, as the temporal random replay shift to fails. Substituting (Equation (48)) to the generalized balance heuristic function (Equation (17)) with confidence weights yields
(50)
where is the random replay shift to the previous frame, shared with all pixels, runs over all previous-frame pixels and the current pixel’s initial sampling result, and runs over all previous-frame pixels. is the confidence weight given to the initial sample. We immediately see that the pixel a caustic path 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 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 from previous frame’s pixel , and its successful random replay shift in the current pixel, a simple substitution yields
(51)
where is the current frame’s target function, is the previous frame’s target function, is the confidence weight of the source pixel’s reservoir in the previous frame, and is the confidence weight of the initial sample. If the shift does not succeed or does not hit the current pixel when shifting, the resampling MIS weight is zero.
Similarly, the initial sample , which is already in current pixel’s domain, gets a resampling MIS weight
(52)
where is the initial sample shifted to the previous frame with random replay, and is the pixel it hits. If the shift fails or hits no pixel, the term containing 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 to on the original path as , and similarly the normalized direction from to on the shifted path as . For random replay on the camera subpath, we have
(53)
and for random replay on the light subpath, we have
(54)
where and are the forward and reverse solid-angle PDFs of sampling vertex , respectively, ( is simply expressed in the solid-angle measure).
The Jacobian for forward reconnection is the ratio of forward geometry terms along the reconnection edge:
(55)
where is the geometry normal at . Note that we must also apply the reconnection Jacobian to the edge between and for techniques (NEE and vertex connection).
For reconnection along the light subpath (only used for techniques), reverse reconnection Jacobian is the ratio of reverse geometry terms along the reconnection edge:
(56)
where for noncaustic paths, where is reconnected to . For caustic paths where a light subpath is reconnected directly to the camera, the Jacobian is the same equation but with .
References
[1]
Benedikt Bitterli. 2016. Rendering Resources. (2016). Retrieved from https://benedikt-bitterli.me/resources/
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:
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/
Yan RGuo HHuang LXiao NLi SWang YLv YChen G(2025)A Survey on Deep Learning for Monte Carlo Path TracingACM Computing Surveys10.1145/3768618Online publication date: 19-Sep-2025
Recent advancements in spatiotemporal reservoir resampling (ReSTIR) leverage sample
reuse from neighbors to efficiently evaluate the path integral. Like rasterization,
ReSTIR methods implicitly assume a pinhole camera and evaluate the light arriving
at a ...
Subsurface scattering is an important visual cue and in real-time rendering it is
often approximated using screen-space algorithms. Path tracing with the diffusion
approximation can easily overcome the limitations of these algorithms, but increases
image ...
Recent work on generalized resampled importance sampling (GRIS) enables importance-sampled
Monte Carlo integration with random variable weights replacing the usual division
by probability density. This enables very flexible spatiotemporal sample reuse, ...
Yan RGuo HHuang LXiao NLi SWang YLv YChen G(2025)A Survey on Deep Learning for Monte Carlo Path TracingACM Computing Surveys10.1145/3768618Online publication date: 19-Sep-2025
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,9201,080 resolution, our method achieves a mean absolute percentage error (MAPE) of 0.312 in 70ms (with light subpaths), while ReSTIR PT [Lin et al. 2022] achieves a MAPE of 1.368 in 71ms.
Bidirectional shift mapping. Our shift on a path with and . We shift the base path (solid lines) to a new primary hit . When , 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 . We shift the light subpath with random replay, and reconnect the camera subpath to the shifted light subpath. Note that if (as in this figure) our shift involves two reconnections: once to reconnect to and again for .
Light tracing shift mapping. Here we illustrate our temporal shift mapping for light tracing techniques (). We apply random replay from the light until the the secondary hit . If is rough, then we can reconnect to the new primary hit (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.
Relative error offset (i.e., ) at 1 sample per pixel on VeachBidir, comparing copying the MIS weight 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.
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).
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.
Without light tracing () 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.
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.
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.
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 to the number of pixels (). The lamp in Sponza comes from Sketchfab user hectopod, under CC-Attribution.
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.
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:
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/
Tomáš Davidovič, Jaroslav Křivánek, Miloš Hašan, and Philipp Slusallek. 2014. Progressive light transport simulation on the GPU: Survey and improvements. ACM Transactions on Graphics (TOG) 33, 3 (2014), 1–19. DOI:DOI:
Iliyan Georgiev, Jaroslav Křivánek, Tomáš Davidovič, and Philipp Slusallek. 2012. Light transport simulation with vertex connection and merging. ACM Transactions on Graphics (TOG) 31, 6, Article 192 (Nov.2012), 10 pages. DOI:DOI:
Pascal Grittmann, Arsène Pérard-Gayot, Philipp Slusallek, and Jaroslav Křivánek. 2018. Efficient caustic rendering with lightweight photon mapping. Computer Graphics Forum 37, 4 (2018). EGSR ’18.
Binh-Son Hua, Adrien Gruson, Victor Petitjean, Matthias Zwicker, Derek Nowrouzezahrai, Elmar Eisemann, and Toshiya Hachisuka. 2019. A survey on gradient-domain rendering. In Proceedings of the Computer Graphics Forum, Vol. 38. DOI:DOI:
James T. Kajiya. 1986. The rendering equation. In Proceedings of the 13th Annual Conference on Computer Graphics and Interactive Techniques (SIGGRAPH’86). Association for Computing Machinery, New York, NY, USA, 143–150. DOI:DOI:
René Kern, Felix Brüll, and Thorsten Grosch. 2024. ReSTIR FG: Real-time reservoir resampled photon final gathering. In Proceedings of the Eurographics Symposium on Rendering, Eric Haines and Elena Garces (Eds.). The Eurographics Association. DOI:DOI:
Markus Kettunen, Daqi Lin, Ravi Ramamoorthi, Thomas Bashford-Rogers, and Chris Wyman. 2023. Conditional resampled importance sampling and ReSTIR. In Proceedings of the SIGGRAPH Asia 2023 Conference Papers. 1–11.
Daqi Lin, Markus Kettunen, Benedikt Bitterli, Jacopo Pantaleoni, Cem Yuksel, and Chris Wyman. 2022. Generalized resampled importance sampling: Foundations of ReSTIR. ACM Transactions on Graphics 41, 4 (2022), 75:1–75:23. DOI:DOI:
Fuyan Liu and Junwen Gan. 2023. Light subpath reservoir for interactive ray-traced global illumination. Computers and Graphics 111, C (Apr2023), 37–46. DOI:DOI:
Marco Manzi, Markus Kettunen, Miika Aittala, Jaakko Lehtinen, Frédo Durand, and Matthias Zwicker. 2015. Gradient-domain bidirectional path tracing. In Proceedings of the Eurographics Symposium on Rendering - Experimental Ideas & Implementations, Jaakko Lehtinen and Derek Nowrouzezahrai (Eds.). The Eurographics Association. DOI:DOI:
Anthony Pajot, Loïc Barthe, Mathias Paulin, and Pierre Poulin. 2011. Combinatorial bidirectional path-tracing for efficient hybrid CPU/GPU rendering. In Proceedings of the Computer Graphics Forum, Vol. 30. Wiley Online Library, 315–324.
Matt Pharr, Wenzel Jakob, and Greg Humphreys. 2016. Physically Based Rendering: From Theory to Implementation (3rd ed.) (3rd ed.). Morgan Kaufmann Publishers Inc. 1266 pages.
Stefan Popov, Ravi Ramamoorthi, Fredo Durand, and George Drettakis. 2015. Probabilistic connections for bidirectional path tracing. Computer Graphics Forum 34, 4 (Jul2015), 75–86.
Justin Talbot, David Cline, and Parris Egbert. 2005. Importance resampling for global illumination. In Proceedings of the Eurographics Symposium on Rendering. 139–146. DOI:DOI:
Eric Veach and Leonidas J. Guibas. 1995a. Bidirectional estimators for light transport. In Proceedings of the Photorealistic Rendering Techniques. Springer, 145–167. DOI:DOI:
Eric Veach and Leonidas J. Guibas. 1995b. Optimally combining sampling techniques for monte carlo rendering. In Proceedings of the 22nd Annual Conference on Computer Graphics and Interactive Techniques. 419–428. DOI:
Jiří Vorba, Ondřej Karlík, Martin Šik, Tobias Ritschel, and Jaroslav Křivánek. 2014. On-line learning of parametric mixture models for light transport simulation. ACM Transactions on Graphics (Proceedings of SIGGRAPH 2014) 33, 4 (Aug2014).
Chris Wyman, Markus Kettunen, Daqi Lin, Benedikt Bitterli, Cem Yuksel, Wojciech Jarosz, and Pawel Kozlowski. 2023. A gentle introduction to ReSTIR path reuse in real-time. In Proceedings of the ACM SIGGRAPH Courses. 1–38.
Song Zhang, Daqi Lin, Markus Kettunen, Cem Yuksel, and Chris Wyman. 2024. Area ReSTIR: Resampling for real-time defocus and antialiasing. 43, 4 (July2024). DOI:DOI: