Top Banner
Slide 1 Lastra, 03/25/22 Monte-Carlo Methods
39

Monte-Carlo Methods

Dec 30, 2015

Download

Documents

Jennifer Silva

Monte-Carlo Methods. Topics. Kajiya’s paper Showed that existing rendering methods are approximations of rendering equation. Introduced path tracing. More recent work – Lafortune, Veach. Kajiya’s Rendering Equation. Expressed as point-to-point transfer Integral is over S , - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Monte-Carlo Methods

Slide 1Lastra, 04/19/23

Monte-Carlo Methods

Page 2: Monte-Carlo Methods

Slide 2Lastra, 04/19/23

Topics

• Kajiya’s paper

–Showed that existing rendering methods are approximations of rendering equation.

–Introduced path tracing.

• More recent work – Lafortune, Veach.

Page 3: Monte-Carlo Methods

Slide 3Lastra, 04/19/23

Kajiya’s Rendering Equation

• Expressed as point-to-point transfer

• Integral is over S,

union of all surfaces

S

dxxx)Iρ(x,x',x(x, x')xxgxxI ")",("ε)',()',(

Page 4: Monte-Carlo Methods

Slide 4Lastra, 04/19/23

Rendering Equation Terms

• is unoccluded two-point transport intensity

• Energy per unit time per unit area of source per unit area of target

S

dxxx)Iρ(x,x',x(x, x')xxgxxI ")",'("ε)',()',(

)',( xxI

Page 5: Monte-Carlo Methods

Slide 5Lastra, 04/19/23

Rendering Equation Terms

• is geometry term

• 0 if x not visible from x’, 1/r2 if visible.

S

dxxx)Iρ(x,x',x(x, x')xxgxxI ")",'("ε)',()',(

)',( xxg

Page 6: Monte-Carlo Methods

Slide 6Lastra, 04/19/23

Rendering Equation Terms

• is unoccluded emittance term

S

dxxx)Iρ(x,x',x(x, x')xxgxxI ")",'("ε)',()',(

)',(ε xx

Page 7: Monte-Carlo Methods

Slide 7Lastra, 04/19/23

Rendering Equation Terms

• is unoccluded three-point transport reflectance (scattering term)

• Intensity scattered to x by x’ originating from x”

S

dxxx)Iρ(x,x',x(x, x')xxgxxI ")",'("ε)',()',(

)",',( xxx

Page 8: Monte-Carlo Methods

Slide 8Lastra, 04/19/23

Why express as point-to-point?

• Wants to set up for a path tracing solution

–Point-to-point transfer of energy

Page 9: Monte-Carlo Methods

Slide 9Lastra, 04/19/23

Relationship to OtherRendering Methods

• Compared rendering eqn. to conventional polygon rendering, ray tracing and distributed ray tracing.

• Let scattering,

S

dxxx)Iρ(x,x',xM ")",'("

Page 10: Monte-Carlo Methods

Slide 10Lastra, 04/19/23

Relationship to “Utah Approx.”

• Geometry term, g, only computed to eye.

• g is ambient term.

• Scattering operator, M, only operates on point sources (0), ignores visibility to light (no shadows).

• M is now only sum over lights, not integration

• Later extensions for shadows and area lights

0εε gMgI

Page 11: Monte-Carlo Methods

Slide 11Lastra, 04/19/23

Relationship to Ray Tracing

• M0 now one reflection, one refraction, and cosine for diffuse term

• Computes visibility, g, of point lights (generates shadow)

• M still small sum

00000 gεgεε gMgMgMgI

Page 12: Monte-Carlo Methods

Slide 12Lastra, 04/19/23

Relationship to Distributed Ray Tracing

• Similar equation to Whitted’s

• Now need to evaluate M as integral

• M now distribution around reflection, refraction, and shadow ray

• Ambient term still “elusive”

Page 13: Monte-Carlo Methods

Slide 13Lastra, 04/19/23

Relationship to Radiosity

• Solves energy balance, but only for diffuse.

• Derives equations for radiosity from the one presented.

• Points out that solving visibility is expensive and that you may not need radiosity for all surfaces (on other hand, you might).

Page 14: Monte-Carlo Methods

Slide 14Lastra, 04/19/23

Kajiya’s Path Tracing

Page 15: Monte-Carlo Methods

Slide 15Lastra, 04/19/23

Method

• At each hit,

–One ray cast based on specular, diffuse, and transmission coefficients

–One random ray per light

• Constant number of rays per pixel (40)

Page 16: Monte-Carlo Methods

Slide 16Lastra, 04/19/23

Markov Chains for Solution

Absorbing state

p = 0.11

p = 0.08

p = 0.02 p = 1

Page 17: Monte-Carlo Methods

Slide 17Lastra, 04/19/23

Algorithm

1. Choose pt. x’ visible from eye

2. Add in radiated intensity

3. For length of Markov path

1. Select pt. x” and compute g(x’, x”)

2. Calculate reflectance (x, x’, x”), multiply by (x’, x”)

3. Add contribution to pixel

Page 18: Monte-Carlo Methods

Slide 18Lastra, 04/19/23

Sampling

• Most important factor in Monte Carlo

– Need to avoid bias

– But also need to make most out of few rays

– Otherwise, noisy images

• Kajiya discusses several ways.

• Better to look in more modern reference

– Glassner

– Recent dissertations

Page 19: Monte-Carlo Methods

Slide 19Lastra, 04/19/23

Path Tracing

• Postulates that even for ray tracing, following one path (probabilistically) is better.

• Why? Most contribution from first ray.

• Need to be careful about proportion of reflection, refraction, and shadow rays.

Page 20: Monte-Carlo Methods

Slide 20Lastra, 04/19/23

Results

401 minutes401 minutes 533 minutes533 minutes

256 x 256 image256 x 256 image

Ray TracedRay Traced(no ambient)(no ambient) Path TracedPath Traced

Light Light scattered scattered by sphereby sphere

Page 21: Monte-Carlo Methods

Slide 21Lastra, 04/19/23

Results

Objects are gray, except for spheres and base.

Color bleeding

Caustics

Page 22: Monte-Carlo Methods

Slide 22Lastra, 04/19/23

Current Methods

• Bi-directional path tracing (Lafortune and Veach)

• Metropolis (Veach)

Page 23: Monte-Carlo Methods

Slide 23Lastra, 04/19/23

Pure Path Tracing

Page 24: Monte-Carlo Methods

Slide 24Lastra, 04/19/23

Pure Path Tracing

Best for big luminaires.

If lights small, few hits and large variance.

Page 25: Monte-Carlo Methods

Slide 25Lastra, 04/19/23

With Shadow Ray to Lights

Page 26: Monte-Carlo Methods

Slide 26Lastra, 04/19/23

With Shadow Ray to Lights

Small lights OK.

Best for specular surfaces.

Page 27: Monte-Carlo Methods

Slide 27Lastra, 04/19/23

Light Tracing

Page 28: Monte-Carlo Methods

Slide 28Lastra, 04/19/23

Light Tracing

Small lights OK.

Best for caustics.

Page 29: Monte-Carlo Methods

Slide 29Lastra, 04/19/23

Bi-Directional Path Tracing

Page 30: Monte-Carlo Methods

Slide 30Lastra, 04/19/23

Bi-Directional Path Tracing

Page 31: Monte-Carlo Methods

Slide 31Lastra, 04/19/23

Generating Samples

• Generated as groups

• Prefix from light joined with suffix from (to) eye (if edge is not obstructed)

• Russian roulette to cut off path

• Contribution must be multiplied by probability of generating path

Page 32: Monte-Carlo Methods

Slide 32Lastra, 04/19/23

Results (from Veach)

Page 33: Monte-Carlo Methods

Slide 33Lastra, 04/19/23

Metropolis

• Method for importance sampling

• A path is a sequence of points from a light to the eye.

• Let be the image contribution function, a measure of contribution over path

• is flux contributed by paths D

• Strategy: generate sequence of paths

with probability proportional to ƒ

x

x

Page 34: Monte-Carlo Methods

Slide 34Lastra, 04/19/23

Mutations

• New path Xi+1 mutated from Xi

• Probability of rejecting each mutation keeps paths distributed according to contribution

• Discard start-up to reduce bias

• Can be run from a set of seed paths

• Run some bi-directional paths to find good seeds

Page 35: Monte-Carlo Methods

Slide 35Lastra, 04/19/23

Implementation

• Path selection important

– minimize rejected paths, but not too correlated

– finds sub-paths and replace

– or perturb vertices of path (for caustics, etc)

• Mutation of “lens” path, (L|D)DS*E, to cover image pixels

• Adds direct lighting

– rejects path if found by Metropolis

Page 36: Monte-Carlo Methods

Slide 36Lastra, 04/19/23

Results

Light for this example comes only through crack in doorway

Page 37: Monte-Carlo Methods

Slide 37Lastra, 04/19/23

Results

There are specific mutations to capture caustics.

Page 38: Monte-Carlo Methods

Slide 38Lastra, 04/19/23

Advantages

• Works well for difficult lighting

–because it “stays” in important area

• Like bi-directional path tracing there’s just a little work to get a new path

Page 39: Monte-Carlo Methods

Slide 39Lastra, 04/19/23

References

• Kajiya, Jim, “The Rendering Equation”, SIGGRAPH ‘86.

• Lafortune papers and thesis

• Veach papers and thesis

• Jensen papers

• Shirley draft of MC book on his web page

• Kalos & Whitlock, Monte Carlo Methods, 1986.