Sampling Techniques for Direct Illumination

  A. Ghosh,
W. Heidrich, D. Burke, A. Doucet  




Bidirectional Importance Sampling


Illumination from textured area light source Illumination from environment map

area illumination
area bidirectional
EM illumination
EM bidirectional
Area-light Bidirectional EM Bidirectional
                                                                                                   

Abstract

Image-based representations for illumination can capture complex real-world lighting that is difficult to represent in other forms. Current importance sampling strategies for image-based illumination have difficulties in cases where both the illumination and the surface BRDF contain important high-frequency detail, for example, when a specular surface is illuminated by an environment map containing small light sources. We introduce the notion of bidirectional importance sampling, in which samples are drawn from the product distribution of both the surface reflectance and the light source energy. While this approach makes the sample selection process more expensive, we drastically reduce the number of visibility tests required to obtain good image quality. As a consequence, we achieve significant quality improvements over previous sampling strategies for the same compute time.
 

Bidirectional Sampling

We propose a biirectional sampling approach in which both the energy distribution in the environment map and the reflectance of the BRDF are taken into account. This is a two-step approach: we initially create samples according to either the BRDF alone or the environment map alone, and then adjust these samples to be proportional to the product distribution. The adjusted samples are then used for visibility testing. This approach has the following benefits:

We realize bidirectional sampling using rejection sampling and sampling-importance resampling (SIR).


Sample Generation through Rejection

rejection

 

Our first approach for sampling from the product distribution is through rejection sampling. To create samples wi, j ~ p(wi), we can approximate p(wi) with a PDF q(wi), such that p(wi) < c · q(wi) for some constant c and all directions wi. We then generate random samples wi, j ~ q(wi) and accept them with a probability of p(wi, j)=(c · q(wi, j)). In our particular case, a simple way of bounding p(wi) is to use qL, the energy distribution of the light sources, as the approximation. The bounding constant c in this case is fmax := max(qf (wi)), the largest value of the BRDF distribution over all incident light directions but for a given fixed exitant direction.


Sample Generation through SIR

SIR


SIR first draws a set of M samples X = {x1, ... , xM} from a simple distribution q(x). The actual target distribution p(x) is evaluated at these M samples, and the resulting values are used to approximate p. In a second step, a smaller set of N  samples Y = {y1, ... , yN} is drawn from X with sample probabilities w(xi) proportional to their importance ratio p(xi)/q(xi). As the number of first-round samples M approaches infinity, the sample set Y can be shown to have been drawn directly from p. The closer q approximates p, the faster the method converges.

We can apply SIR to the problem of drawing samples from the bidirectional distribution.We can use either qL (i.e., sampling from the light sources) or qf (i.e., sampling from the BRDF) for the first stage. As in the rejection sampling approach, starting with qL is advantageous if the illumination contains higher frequencies than the BRDF and vice versa, since the higher frequency factor better approximates the shape of the product distribution.


Results


EM
BRDF
MIS (Veach&Guibas)
SIR
EM
BRDF
MIS
SIR
EM
BRDF
MIS
SIR

Top row: Specular Phong BRDF (s=50, ks= 1.0). Bottom row: Phong BRDF with diffuse component (s=50, ks=kd=0.5).


 

Video

  Bidirectional sampling video





Sequential Sampling of Environment Maps


1st frame
5th frame
5th frame comparison
1st frame bidirectional
5th frame SMC
5th frame bidirectional
SIR (8 seconds)
SMC (4 seconds)
SIR (4 seconds)

Abstract

Sampling complex illumination in the form of environment maps has received a lot of attention in computer graphics. Recent work in this area has demonstrated that drawing samples from the product of light and BRDF produces superior results to other sampling strategies. However, existing methods in this area consider only individual frames, and do not take advantage of coherence in animations. We introduce a sequential sampling approach for dynamic environment map illumination. Our algorithm efficiently samples from the product of illumination and BRDF, while exploiting temporal coherence. We demonstrate significant performance benefits over existing methods.


Sequential Sampling

In this work, we aim to efficiently sample from the product distribution of the illumination and the BRDF in a video sequence with dynamic illumination using a Sequential Monte Carlo (SMC) sampling strategy. The basic idea is to generate samples according to the product distribution in the first frame of the sequence, and thereafter to filter these samples (particles) in the subsequent frames according to the dynamic product distribution. This sequential sampling mechanism is more efficient than independently re-regenerating the samples for every time step, especially for scenes with high frequencies in both the dynamic illumination and the BRDF.

Our solution to sampling from the dynamic product dis-tribution is a two-step approach. We assume that we have already obtained a sample set according to the product distribution of the previous frame. For the first frame of the animation, we generate this sample set with bidirectional importance sampling. In the first step of our algorithm, samples distributed according to the product distribution of the previous time step are propagated in time using sequential importance sampling. The product distribution at the new time step is incrementally estimated using the weights of the sequential importance. The second step extends the path of each of these samples using a Markov Chain Monte Carlo (MCMC) kernel whose invariant distribution is the target distribution at the current time step. The MCMC kernel is implemented using the Metropolis-Hastings (MH) algorithm. No visibility tests are performed during either of the two steps. Visibility is finally tested at the end of the second step in order to obtain a Monte Carlo estimate of the direct illumination. This approach has the following benefits:


Results


Dawn
Morning
Noon
Dusk
Bidir dawn
Bidir morning
Bidir noon
Bidir dusk
SMC dawn
SMC morning
SMC noon
SMC dusk
                                                                                                                                                
Specular David in Sky Probe Gallery. Top row: Bidirectional sampling. Bottom row: SMC sampling. All frames rendered in 4 seconds.


Video

  Sequential sampling video





Correlated Visibility Sampling

Complex visibility situation around Buddha's feet in the Grace Cathedral environment

Bidirectional
Correlated
Bidirectional sampling Correlated visibility sampling
                                          
Abstract

State-of-the-art importance sampling strategies for direct illumination take into account the importance of the incident illumination, as well as the surface BRDF. Hence, these techniques achieve low variance in unoccluded regions. However, the resulting images still have noise in partially occluded regions as these techniques do not take visibility into account during the sampling process. We introduce the notion of correlated visibility sampling, which considers visibility in partially occluded regions during the sampling process, thereby improving the quality of the shadowed regions. We aim to draw samples in the partially occluded regions according to the triple product of the incident illumination, BRDF and visibility using Monte Carlo sampling followed by Metropolis sampling.


Correlated Sampling

Our solution to sampling from the triple product distribution is a two-step approach. In the first step, energy estimates for each pixel are created using samples drawn from the bidirectional importance (product distribution) of the incident illumination and the surface BRDF. This estimate is built using the sampling-importance resampling (SIR) algorithm. We create a visibility mask and mark pixels for which one or more of the visibility tests failed, i.e., pixels which are partially occluded. In the second step, Metropolis sampling is started for the partially occluded pixels in order to locally explore the shadowed regions more extensively. If desired, any image-space operation such as dilation can be applied to the visibility mask.  Our approach has the following benefits:


Visbility Masks and Lens Perturbation


mask feet
mask memorial
MCMC transition
                                                                               
Visibility masks generated after first round of bidirectional sampling Energy transition from one pixel to another based on visibility tests.
Green arrow depicts un-occluded sample,  red arrow depicts occluded sample.
                                                                   

After an initial pahse of bdirectional sampling, we create a visibility mask and mark pixels for which one or more visibility tests failed. In the second step, we employ the Metropolis-Hastings algorithm in order to locally explore visibility in the shadowed regions more extensively. We employ lens perturbation as the mutation strategy for our Metropolis algorithm. Since there is correlation in the visibility of points in neighboring pixels, using this strategy to transfer energy of samples w_i,x to neighboring pixels x' can be an effective means of reducing variance. We partition the image plane into 5x5 tiles for lens perturbation and carry out mutations only between the partially occluded pixels within each tile. First a mutation of a valid unoccluded sample (obtained from first round of bidirectional sampling) is proposed. Visibility is then sampled in the same direction (for environment map illumination) for the pixel that the sample gets mutated to. If the visibility test passes, the mutation is accepted with an acceptance probability a, else it is rejected. If the mutation is accepted, energy is transfered from pixel coordinate x to x'.


Results

Quality comparison of various algorithms for glossy buddha in Memorial environment

EM
MIS
Bidirectional
Correlated
EM
MIS (Veach&Guibas)
Bidirectional
Correlated


Video

  Correlated visibility sampling video

                                                                                                                                                  


Publications



Back to the projects page ...