Specular Manifold Sampling for Rendering High-Frequency Caustics and Glints
In Transactions on Graphics (Proceedings of SIGGRAPH 2020)
AbstractScattering from specular surfaces produces complex optical effects that are frequently encountered in realistic scenes: intricate caustics due to focused reflection, multiple refraction, and high-frequency glints from specular microstructure. Yet, despite their importance and considerable research to this end, sampling of light paths that cause these effects remains a formidable challenge.
In this article, we propose a surprisingly simple and general path sampling strategy for specular light paths including the above examples, unifying the previously disjoint areas of caustic and glint rendering into a single framework. Given two path vertices, our algorithm stochastically finds a specular subpath connecting the endpoints. In contrast to prior work, our method supports high-frequency normal- or displacement-mapped geometry, samples specular-diffuse-specular ("SDS") paths, and is compatible with standard Monte Carlo methods including unidirectional path tracing. Both unbiased and biased variants of our approach can be constructed, the latter often significantly reducing variance, which may be appealing in applied settings (e.g. VFX). We demonstrate our method on a range of challenging scenes and evaluate it against state-of-the-art methods for rendering caustics and glints.
Update (June 17, 2021)
We recently fixed a subtle but important bug in our reference implementation of this project. In particular, there was an oversight in the computation of our proposed angle difference constraints. In the following we will briefly revisit the relevant part, but please refer to Section 4.4 in the paper for more context.
At the core of our method lies a Newton solver that attempts to find light paths that correctly follow the laws of specular reflection or refraction. In short, each specular vertex of a path is assigned a constraint function where a valid light path is determined with .
In the paper, we propose a new constraint that performs specular reflection or refraction (function ) of an incident direction and compares it to the outgoing direction :
where and convert the two unit directions into spherical coordinates.
It turns out that one needs to be careful regarding the periodicity of the azimuth angles when subtracting them. For instance, the Newton solver does not realize that a value of roughly is close to a solution and might therefore not converge. The subtracted result must therefore be mapped onto using a floating point modulo operation.
The impact of this depends highly on the actual scene complexity, While the difference is not always noticeable, some scenes can benefit considerably from the fix. One such example is shown below, where a caustic is created by a small area light refracted twice through a dielectric cylinder. Here, the Newton solver convergence rate roughly doubles.
The two insets illustrate the difference on zoomed-in regions of the image. Note how the fixed implementation (right) has reduced variance compared to the original version (left). For the comparison, both images were rendered at equal time and sample count, and the brightness of the insets is scaled to make the noise outside the main caustic more visible.
See also the following full image comparison, where the slider can be dragged to interactively compare both versions:
We are grateful to Héloïse de Dinechin for spotting this bug after carefully investigating some of the light paths where the Newton solver diverged. We updated our author version of the paper and the video below with re-rendered images that reflect the fixed implementation.
- Paper (29.7 MB) -- revision 3 (17 Jun 2021)