Title: Tabular Importance Sampling Methods in Global Illumination
1Tabular Importance Sampling Methods in Global
Illumination
- David Cline
- Brigham Young University
2Global Illumination
3The Measurement Equation
Lens
Pixel
Incoming radiance
Image plane
4The Rendering Equation
Participating Medium (smoke)
Lens
Reflection
Radiance
Scatter event
Surface
5Dimensionality
- Dimensionality of the measurement equation
- Time (1D)
- Pixel Sensor (2D)
- Lens (2D)
- Distance to Scatter Event (1D)
- Scattering Direction (2D)
- 8 dimensions, just for single scattering!
6Monte Carlo (MC) Rendering
- For each pixel
- Average samples of the measurement equation (ray
paths).
7MC Sample in World Space (Ray Path)
Point on light
Time
Scatter direction
Point on pixel
Point on lens
Distance to scatter event
8MC Sample in World Space (Ray Path)
Point on light
Time
Scatter direction
Point on pixel
Point on lens
Distance to scatter event
pixel term pixel prob
lens term lens prob
distance term distance prob
scatter term scatter prob
x
x
x
Pixel val
9MC Sample in Preimage Space, 0,1)n
x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10,
x11,
10MC Sample in Preimage Space, 0,1)n
Point on light
Distance in medium
Scatter direction
Time
x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10,
x11,
Point on lens
Point on pixel
Which light
Reflect or transmit
11How many samples?
- 50,000 samples per pixel! What can be done?
12Importance Sampling
- Vary the method that converts from preimage to
world space.
Preimage space
Importance sampling
World space
13Tabular Importance Sampling
- Discrete probability tables to help importance
sampling.
Less samples
More samples
14Existing Tabular Methods
-
- Pixel Area Sampling
- Ernst, Stamminger, Greiner
- Filter Importance Sampling (2006)
- BRDF Sampling (light scattering)
- Lawrence, Rusinkiwicz, Ramamoorthi
- Efficient BRDF importance sampling using a
factored representation (2004)
15Existing Tabular Methods
- Environment Map Sampling (light source)
- Debevec
- A Median Cut Algorithm for Light Probe Sampling
(2005) - Lawrence, Rusinkiwicz, Ramamoorthi
- Adaptive Numerical Cumulative Distribution
Functions for Efficient Importance Sampling
(2005) - Product Sampling (BRDF x Light Source)
- Clarberg, Jarosz, Akenine-Möller, Jensen
- Wavelet Importance Sampling (2005)
16Existing Tabular Methods
- Direction in Space Sampling
- Jensen
- Importance Driven Path Tracing using the photon
map (1995) - Hey, Werner
- Importance sampling with hemispherical particle
footprints (2002) - Steinhurst, Lastra
- Global importance sampling of glossy surfaces
using the photon map (2006)
17Two Stage Importance Sampling
- David Cline, Parris Egbert, Justin Talbot, David
Cardon - Two Stage Importance Sampling for Direct
Lighting. Eurographics Symposium on Rendering,
2006.
18Two Stage Importance Sampling
- Simplifications
- One primary ray per pixel
- Poor anti-aliasing on the image plane
- Pinhole Camera
- Not time dependent
- No participating media
- Direct lighting only
- The light is an environment map
19Two Stage Importance Sampling
- 2D function to integrate for each pixel.
Incident Light
BRDF
20Direct Lighting Function
- Triple product
- Environment Map x BRDF x Visibility
Visibility
Environment Map
Triple Product
BRDF
21Current Solutions
- Comparison of importance functions
Multiple Importance Sampling
Environment Map
Double Product
BRDF
22Two Stage Importance Sampling
- Algorithm
- Create summed area table of environment map
- For each primary ray
- Partition environment map to approximate the
double product - Warp uniform samples based on the partition
- Cast rays to test visibility
23Light Source Partition
- Summed area table (cdf) of the environment map.
24Light Source Partition
- Make a kd-tree partition to approximate the BRDF
over the domain of the environment map.
25Light Source Partition
- Make an initial partition based on the surface
normal and peaks of the BRDF.
26Light Source Partition
- Subdivide regions likely to have high error.
27Approximate Product
Summed Area Table
Approximate Product
Light Source Partition
28Example Products
Actual Product
Actual Product
Partition
Partition
29How Can We Use the Product?
30Sample Warping
31Sample Warping
32Sample Warping
33Two Stage IS Results
Eucalyptus Grove 5 seconds
MIS (4 spp)
2 Stage (2 spp)
34Two Stage IS Results
Eucalyptus Grove 14 seconds
MIS (16 spp)
2 Stage (8 spp)
35Two Stage IS Results
Eucalyptus Grove 50 seconds
MIS (64 spp)
2 Stage (32 spp)
36What about Shadows?
37Triple Product Sampling
- David Cline, Parris Egbert, Kenric White
- Towards Triple Product Sampling in Direct
Lighting. Poster, IEEE Symposium on Interactive
Ray Tracing, 2006.
38Triple Product Sampling
- How can we add a visibility term to the double
product in two stage importance sampling?
Visibility
Environment Map
Triple Product
BRDF
39Visibility Maps
- Create low resolution visibility maps at a sparse
set of locations.
40World Space Visibility Maps
41World Space Visibility Maps
Two Stage
World Space Maps
42World Space Visibility Maps
- Problem
- Work wasted in shadowed areas.
- Observation
- Wouldnt it be better to cull shadowed samples
BEFORE they get warped (in Preimage space)?
43Preimage Space Visibility Maps
44Preimage Space Visibility Maps
Two Stage
Preimage Space
45The Price We Pay
Bump Mapped
No Bump Map
46Preimage Space Visibility Maps
- Problems
- Bumpy surfaces
- Only direct lighting
- Little propagation of info between pixels
47What can we take from this?
- Probability maps can augment importance sampling.
- Preimage space is preferable.
48Sample Swarming
49Sample Swarming
- Probability maps for more things than just
direction - Create maps lazily
- Use Preimage space maps most of the time
- Propagate map info. by map averaging.
50Sample Swarming
- Standard Importance Sampling
Importance Sampling
Samples in World space
Uniform points in 0,1)n
51Sample Swarming
Standard Importance Sampling
Combine probabilities
Non-uniform Samples in World space
Uniform points in 0,1)n
World Space Map
52Sample Swarming
Standard Importance Sampling
Preimage Space Map
Non-uniform Samples in World space
Uniform points in 0,1)n
Non-uniform Points in 0,1)n
53Importance Propagation
- Scan back and forth.
- Create current pixels maps by averaging
neighbors. - Once a pixel is rendered, its maps are updated
based rendered samples.
Active Pixel Maps
Time (1D)
Image
Lens (2D)
Active rows
Participating media (1D)
Bifurcation (discrete)
Current Pixel
Light selection (discrete)
Point on light (2D)
Scatter direction (1D)
54Time Map
Helps select an instant in time
Sample Swarming (16 spp)
Path Tracing (16 spp)
Desired Image
55Lens Map
Helps select points on the lens
(same scene without blur)
Sample Swarming (32 spp)
Path Tracing (32 spp)
Desired Image
56Participating Media Map
Helps find important depths into the
participating media
Sample Swarming (32 spp)
Path Tracing (32 spp)
Desired Image
57Bifurcation Map
Helps decide between reflection and transmission
Sample Swarming (16 spp)
Path Tracing (16 spp)
Desired Image
58Light Selection Map
Helps determine which light to sample
Sample Swarming (6 spp)
Path Tracing (6 spp)
Desired Image
59Point on Light Map
Helps determine which point on a light source to
sample
Sample Swarming (32 spp)
Path Tracing (32 spp)
Desired Image
60Direction Map
Helps determine scatter direction
Sample Swarming (32 spp)
Path Tracing (32 spp)
Desired Image
61More Realistic Example
Path Tracing (256 spp)
62More Realistic Example
Sample Swarming (256 spp)
63Issues
- Each map is a 1 or 2D projection of a high
dimensional space. - The maps dont always cooperate.
- Map resolution and which maps are active is set
manually. - Information propagates down, back and forth, but
not up.
64Thank You.