Importance Sampling for Production Rendering Mark Colbert

Google (formerly Disney’s ImageMovers Digital)

Simon Premoze Guillaume Francois

Weta Digital (formerly Moving Picture Company)

Problem

Problem • Focus on efficiently evaluating the illumination integral

Problem • Focus on efficiently evaluating the illumination integral

• Looking predominately at direct lighting

Illumination Integral

Illumination Integral

Illumination Integral

Illumination Integral

Illumination Integral

Illumination Integral

Illumination Integral ωo ωi

Lo (ωo , x) =

!



Li (ωi , x)f (ωo , ωi ) cos θi dωi

Illumination Integral •

Li - incoming light

ωo Li ωi

Lo (ωo , x) =

!



Li (ωi , x)f (ωo , ωi ) cos θi dωi

Illumination Integral ωo Li ωi

• •

Li - incoming light f - Bidirectional Reflectance Distribution Function (BRDF)

f

Lo (ωo , x) =

!



Li (ωi , x)f (ωo , ωi ) cos θi dωi

Illumination Integral ωo Li ωi

• •

Li - incoming light



Cosine for projection

f - Bidirectional Reflectance Distribution Function (BRDF)

f

Lo (ωo , x) =

!



Li (ωi , x)f (ωo , ωi ) cos θi dωi

Illumination Integral

Illumination Integral • Evaluate and sum all incoming directions

Illumination Integral • Evaluate and sum all incoming directions

• Computationally Expensive

Importance Sampling • Re-orient the sample directions to point in directions that provide better estimates with fewer samples

Importance Sampling • Re-orient the sample directions to point in directions that provide better estimates with fewer samples

Overview • BRDF Importance Sampling • Filtered Importance Sampling (FIS) • FIS for Area Light • Multiple Importance Sampling Sampling at MPC • Importance Guillaume Francois Simon Premoze

Goal • With the presentation and course notes,

the goal is to provide you with the tools to implement importance sampling in your production pipeline

Integration • Discretize integral into smaller solid angles N ! 2π ≈ Li (ωi , x)f (ωi , ωo ) cos θi N i=1 2

Integration • Deterministic Sampling • Break into even sized pieces (e.g. Trapezoidal Rule)

• Stochastic Sampling • Randomly choose sample directions • Monte Carlo Integration

Importance Sampling •

Sample according to a Probability Density Function (PDF)

• •

Effectively an educated guess



PDF

Map from a uniform sample space to a nonuniform space

• • •

Peaks represent important regions Non-negative Integrates to one

Importance Sampling • Need to adjust for not evenly spacing the samples

Importance Sampling • Need to adjust for not evenly spacing the samples

Importance Sampling • Need to adjust for not evenly spacing the samples

Importance Sampling • Need to adjust for not evenly spacing the samples

Importance Sampling • Need to adjust for not evenly spacing the samples

Importance Sampling • Need to adjust for not evenly spacing the samples

N ! 1 Li (ωi , x)f (ωi , ωo ) cos θi ≈ N i=1 p(ωi )

What do we sample from?

What do we sample from? • BRDF

What do we sample from? • BRDF • Environment

What do we sample from? • BRDF • Environment • Both?

BRDF Sampling • Sampling depends on choice of BRDF • Common BRDFs [1982] • Cook-Torrance (similar to specular in RenderMan) • Phong [1975]

Phong BRDF • Exponentiated cosine lobe around the specular reflection direction

!

n

Li (ωi , x) cos θs cos θi dωi



θs

Phong Sampling • Convert to spherical coordinates centered around the specular direction

p(θs , φs ) ∝ cosn θs sin θs

• Normalize cosn θs sin θs

p(θs , φs ) = ! π/2 ! 2π 0

0

cosn θs sin θs dφs dθs

(n + 1) n cos θs sin θs = 2π

Inverse Transform Sampling • Discrete case

S1

S2

S3

S4

S5

Inverse Transform Sampling • Stack the transforms on top of each other and sample uniformly

Inverse Transform Sampling • Stack the transforms on top of each other and sample uniformly

S1

S2

S3

S4

S5

Inverse Transform Sampling • Stack the transforms on top of each other Uniform Sampling

and sample uniformly

S1

S2

S3

S4

S5

Inverse Transform Sampling • Stack the transforms on top of each other Uniform Sampling

and sample uniformly

S1

S2

S3

S4

S5

Inverse Transform Sampling • Analytical equivalent is to integrate over the PDF

P (Θ) =

!

Θ

p(θ)dθ

0

• P is called

Cumulative Distribution Function (CDF)

• Invert and solve for the sample direction P (Θ) = ξ P −1 (ξ) = Θ

Phong Sampling • Often better to sample over each

dimension (depends on sampling pattern)

• Two dimensional equation • Create marginal and conditional

probabilities for each dimension and sample independently

Marginal Density • Integrate over entire domain of a dimension

Marginal Density • Integrate over entire domain of a dimension

Marginal Density • Integrate over entire domain of a dimension

Marginal Density • Integrate over entire domain of a dimension

Marginal Density • Integrate over entire domain of a dimension

p(θs ) =

!



p(θs , φs )dφs

0

= (n + 1) cos θs sin θs n

Conditional Density • Using Bayes law, we can find the conditional distribution

Conditional Density • Using Bayes law, we can find the conditional distribution

Conditional Density • Using Bayes law, we can find the conditional distribution

Conditional Density • Using Bayes law, we can find the conditional distribution

p(θs , φs ) p(φs |θs ) = p(θs )

Conditional Density • Using Bayes law, we can find the conditional distribution

p(θs , φs ) 1 p(φs |θs ) = = p(θs ) 2π

Putting it all together • Integrate each to find the CDF • Invert to find the sample mapping: !

1 n+1

θs = arccos ξ1 φs = 2πξ2

"

Randomness • Given the mappings for importance

sampling integration we just to generate the uniformly random samples

• So what? Call rand().

Randomness

Randomness • rand() causes clumping

Randomness • rand() causes clumping • Blue-noise property:

Each sample point has a radius in which no other sample point can exist [Dunbar 2006]

Randomness • rand() causes clumping • Blue-noise property:

Each sample point has a radius in which no other sample point can exist [Dunbar 2006]

Low-Discrepancy Sequences • Quasi-random numbers (Deterministic)

• Maximal distance from each sample point (Stronger than blue noise property)

• Ideal coverage that looks non-regular to minimize visible aliasing 0,0

0,0

1,1

1,1

Folded Hammersley Sequence (ξ1 , ξ2 ) =

!

" i + 0.5 , Φ2 (i) N

Φ2 (i) ! 1 2 3 4

Binary! 1 10 11 100

Inverse Binary 0.1 0.01 0.11 0.001

Value 0.5 0.25 0.75 0.125

Let’s see some pictures... • Using importance sampling we can quickly produce okay results

40 Samples Per Pixel

Let’s see some pictures... • Using importance sampling we can quickly produce okay results

40 Samples Per Pixel

Deterministic Sampling

• Replace noise with aliasing

40 Samples Per Pixel

Deterministic Sampling

• Replace noise with aliasing

40 Samples Per Pixel

Deterministic Sampling

• Replace noise with aliasing

40 Samples Per Pixel

Filtered Importance Sampling

• Replace noise/aliasing with a smooth result

40 Samples Per Pixel

Filtered Importance Sampling

• Replace noise/aliasing with a smooth result

40 Samples Per Pixel

Filtered Importance Sampling

• Replace noise/aliasing with a smooth result

40 Samples Per Pixel

FIS Foundation • Warp the environment proportionally to the BRDF

FIS Foundation • Warp the environment proportionally to the BRDF

FIS Foundation • Warp the environment proportionally to the BRDF

FIS Foundation • Observing the environment proportional to the BRDF we have evenly spaced samples

Environment ! BRDF ! cos !

FIS Foundation • Observing the environment proportional to the BRDF we have evenly spaced samples

Environment ! BRDF ! cos !

FIS Foundation • Undersampling causes aliasing

FIS Foundation • Suppress the aliasing by pre-filtering

FIS Foundation

FIS Foundation • Ideal filter region

defined by going between the neighboring points

FIS Foundation • Ideal filter region

defined by going between the neighboring points

FIS Foundation • Ideal filter region

defined by going between the neighboring points

• Gives the solid angle: 1 Ωs = N · p(ωi )

FIS with Environment Maps • Must convert solid angle to a filter region in the image-based environment

• MIP-Map Filtering • Ptex Filtering (RenderMan)

MIP-Map Filtering • Pyramid of filtered images,

where each level is 1/4 the size of the previous

• Commonly available in all

renderers (including GPUs)

MIP-Map Filtering • Convert the solid angle Ωp = d(ωi ) to pixels for some mapping

• Use ratio of solid angle for a pixel to the total solid angle !

1 Ωs l = max log2 ,0 2 Ωp

"

w·h

MIP-Map Filtering • Which parameterization is ideal? • Most filtering engines treat each map of an environment independently

• Need a mapping that has overlap between other maps

MIP-Map Filtering • One solution, scaled dual paraboloid

Can we do better?

Can we do better? • •

YES! Ptex-based filtering [Burley 2008]



RenderMan

Cube map that filters across edges of faces giving seamless filters

• •

Use environment call Must convert solid angle into blur parameter:

blur =

!

3 Ωs 2π

Area Light • Environment lighting still a relatively newer construct for production

• Soft lighting for female characters in ACC

IMD’s Area Light • • • •

Decoupled model (wrong, but controllable) Visibility



Done independently and used to attenuate other components

Diffuse



Used analytical form factor computation [Baum et al. 1989]

Glossy reflections



Filtered Importance Sampling

Area Light • Still importance sample the BRDF • Send out samples to intersect area light rectangle

• Augment the rays with ray differentials to

project the filter region onto the area light

Spherical Cap • How wide do we make the ray differentials? Ωs !

Ωs θs = arccos 1 − 2π

"

θs

Ray differentials • Ideally 2 rays to capture the shape of the projected filter region

• Requires orthogonal basis vectors to the sample direction

• This requires a smooth coordinate frame

Area Light Filtering • •

Intersect

• •

Axis aligned clipping

Compute the area around the central intersection ...and filter!

Zi

Zi (a)

Zi (b)

(c)

Area Filtering

Area Light

Camera

MIP-Map FIS Results

n = 17 100 Samples

n=3 5 Samples

Environment Sampling

Reference

Filtered Sampling

MIP-Map FIS Results • Extreme anisotropy does not behave as well as isotropic BRDFs

"x = 0.01 "y = 0.01

"x = 0.01 "y = 0.08 Ward BRDF

"x = 0.01 "y = 0.29

MIP-Map FIS Results

50 Samples

200 Samples

Reference

50 Samples

5 Samples

Summary • Importance Sampling provides a good framework for numerically solving Illumination Integral

• FIS provides a production proven method of integrating glossy surface reflection

• FIS replaces alias or noise with smooth reflections ideal for production scenes

Acknowledgements • Google • ImageMovers Digital • Doug Epps • Davy Wentworth • Christophe Hery • Jaroslav Krivanek

Importance Sampling for Production Rendering

MIP-Map Filtering. • Convert the solid angle to pixels for some mapping. • Use ratio of solid angle for a pixel to the total solid angle. Ωp = d(ωi) w · h l = max[. 1. 2 log. 2. Ωs. Ωp,0] ...

3MB Sizes 1 Downloads 317 Views

Recommend Documents

Importance Sampling for Production Rendering - Semantic Scholar
in theory and code to understand and implement an importance sampling-based shading system. To that end, the following is presented as a tutorial for the ...

Importance Sampling for Production Rendering - Semantic Scholar
One of the biggest disadvantages of Monte Carlo methods is a relatively slow convergence rate. .... light from the surrounding environment is reflected toward the virtual camera (Figure 2). ...... Pattern Recognition and Machine Learning.

Importance Sampling for Production Rendering - Shader Writer Igor ...
system. To that end, the following is presented as a tutorial for the reader. 4 ..... Figure 4: Illustration of the spherical coordinates (θv, φv) for an arbitrary vector v. For continuous ...... the importance density that we computed in previous

Importance Sampling for Production Rendering - Shader Writer Igor ...
system. To that end, the following is presented as a tutorial for the reader. 4 ..... Figure 4: Illustration of the spherical coordinates (θv, φv) for an arbitrary vector v.

advances in importance sampling - Semantic Scholar
Jun 29, 2003 - 1.2 Density Estimates from 10 Bootstrap Replications . . . . . . . 15 ...... The Hj values give both the estimate of U and of the trace of V. ˆ. Uj := Hj. ¯.

advances in importance sampling
Jun 29, 2003 - in Microsoft Word. .... Fortunately, extensions of both methods converge to produce the same ..... Speeding up the rate of convergence is a mo-.

Importance Sampling-Based Unscented Kalman Filter for Film ... - Irisa
Published by the IEEE Computer Society. Authorized ..... degree of penalty dictated by the potential function. ..... F. Naderi and A.A. Sawchuk, ''Estimation of Images Degraded by Film- ... 182-193, http://www.cs.unc.edu/˜welch/kalman/media/.

Importance Sampling Kalman Filter for Image Estimation - Irisa
Kalman filtering, provided the image parameters such as au- toregressive (AR) ... For example, if we consider a first-order causal support (com- monly used) for ...

Adaptive Sampling based Sampling Strategies for the ...
List of Figures. 1.1 Surrogate modeling philosophy. 1. 3.1 The function ( ). ( ) sin. y x x x. = and DACE. 3.1a The function ( ). ( ) sin. y x x x. = , Kriging predictor and .... ACRONYMS argmax. Argument that maximizes. CFD. Computational Fluid Dyna

Importance Weighting Without Importance Weights: An Efficient ...
best known regret bounds for FPL in online combinatorial optimization with full feedback, closing ... Importance weighting is a crucially important tool used in many areas of ...... Regret bounds and minimax policies under partial monitoring.

Importance Weighting Without Importance Weights: An Efficient ...
best known regret bounds for FPL in online combinatorial optimization with full feedback, closing the perceived performance gap between FPL and exponential weights in this setting. ... Importance weighting is a crucially important tool used in many a

IMPORTANCE FOR ACCOUNTANCY 1.pdf
Sign in. Loading… Whoops! There was a problem loading more pages. Retrying... Whoops! There was a problem previewing this document. Retrying.

recommended protocols for sampling macrofungi
New York Oxford Paris San Diego. San Francisco Singapore Sydney Tokyo. ACADEMIC ... Full Service Provider: Graphic World, Inc. Composition: SNP ... Department in Oxford, UK: phone: (+44) 1865 843830, fax: (+44) 1865 853333, e-mail:.

Sampling Algorithms and Coresets for lp Regression
Email: [email protected]. ‡Computer Science, University of Pennsylvania, Philadelphia,. PA 19107. Work done while the author was visiting Yahoo! Research. Email: [email protected] ficient sampling algorithms for the classical ℓp regres- sion p

Adaptive-sampling algorithms for answering ...
queries on Computer Science, then in order to maintain a good estimation, we ... study how to use sampling techniques to answer aggregation queries online by ... answer to the query using samples from the objects in the classes relevant to ...... He

SAMPLING ALGORITHMS AND CORESETS FOR lp REGRESSION
Define the random variable Xi = (Tii|Ai⋆xopt −bi|)p, and recall that Ai⋆ = Ui⋆τ since ... Thus, since Xi − E[Xi] ≤ Xi ≤ |Ai⋆xopt − bi|p/qi, it follows that for all i such.

SAMPLING ALGORITHMS AND CORESETS FOR lp REGRESSION
regression problem for all p ∈ [1, ∞), we need tools that capture the geometry of lp- ...... Define the random variable Xi = (Tii|Ai⋆xopt −bi|)p, and recall that Ai⋆ =.

Device for cutting soil sampling tubing
Aug 27, 1997 - ABSTRACT. A device for longitudinally cutting tubing is comprised of a block presenting an engaging surface for receiving tubing, blades and ...

Sampling Instructions Navigating to a Sampling Site ...
Jul 1, 2010 - Use the steps below to navigate to a sampling site on Lake Attitash using the Garmin GPSMap 76CSx hand-held GPS. The unit used by the association has been pre-programmed with the coordinates of the sampling sites. To use a different Gar

Portable contaminant sampling system
Dec 12, 2007 - 8/1976 BrouWer. 4,092,845 A. 6/1978 Prodi et a1. .... an apple, or the surface of a machine or tool. At present, gas is sampled through the use ...

SAMPLING PRODUCTS.pdf
Sign in. Loading… Page 1. Whoops! There was a problem loading more pages. Retrying... SAMPLING PRODUCTS.pdf. SAMPLING PRODUCTS.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying SAMPLING PRODUCTS.pdf.

Sampling Methods
Solution 1: approximate integral by. ˆG = T. ∑ t=1 g(xt)p(xt)∆x, ... t=1 E[g(Xt)] = G. convergence: ... Solution 1: Probability integral transformation: If X ∼ F, then U ...

volume rendering pdf
Page 1 of 1. File: Volume rendering pdf. Download now. Click here if your download doesn't start automatically. Page 1 of 1. volume rendering pdf. volume ...

Single-strips for fast interactive rendering
vertices and connectivity, as long as the geometry and ap- pearance remains the ...... SGI Developer's Toolbox CD, Silicon Graphics (1990). 2. Arkin, E.M., Held ...