Monte Carlo I - PowerPoint PPT Presentation

About This Presentation
Title:

Monte Carlo I

Description:

Monte Carlo integration. Sampling from distributions. Sampling from shapes ... Monte Carlo Algorithms. Advantages. Easy to implement ... – PowerPoint PPT presentation

Number of Views:190
Avg rating:3.0/5.0
Slides: 33
Provided by: PatHan5
Category:
Tags: carlo | monte

less

Transcript and Presenter's Notes

Title: Monte Carlo I


1
Monte Carlo I
  • Previous lecture
  • Analytical illumination formula
  • This lecture
  • Numerical evaluation of illumination
  • Review random variables and probability
  • Monte Carlo integration
  • Sampling from distributions
  • Sampling from shapes
  • Variance and efficiency

2
Lighting and Soft Shadows
  • Challenges
  • Visibility and blockers
  • Varying light distribution
  • Complex source geometry

Source Agrawala. Ramamoorthi, Heirich, Moll, 2000
3
Penumbras and Umbras
4
Monte Carlo Lighting
Fixed
Random
1 eye ray per pixel 1 shadow ray per eye ray
5
Monte Carlo Algorithms
  • Advantages
  • Easy to implement
  • Easy to think about (but be careful of
    statistical bias)
  • Robust when used with complex integrands and
    domains (shapes, lights, )
  • Efficient for high dimensional integrals
  • Efficient solution method for a few selected
    points
  • Disadvantages
  • Noisy
  • Slow (many samples needed for convergence)

6
Random Variables
  • is chosen by some random process
  • probability distribution
    (density) function

7
Discrete Probability Distributions
  • Discrete events Xi with probability pi
  • Cumulative PDF (distribution)
  • Construction of samples
  • To randomly select an event,
  • Select Xi if

Uniform random variable
8
Continuous Probability Distributions
  • PDF (density)
  • CDF (distribution)

Uniform
9
Sampling Continuous Distributions
  • Cumulative probability distribution function
  • Construction of samples
  • Solve for XP-1(U)
  • Must know
  • 1. The integral of p(x)
  • 2. The inverse function P-1(x)

10
Example Power Function
  • Assume

11
Sampling a Circle
12
Sampling a Circle
RIGHT Equi-Areal
WRONG ? Equi-Areal
13
Rejection Methods
  • Algorithm
  • Pick U1 and U2
  • Accept U1 if U2 lt f(U1)
  • Wasteful?

Efficiency Area / Area of rectangle
14
Sampling a Circle Rejection
do X1-2U1 Y1-2U2 while(X2 Y2 gt 1)
May be used to pick random 2D directions Circle
techniques may also be applied to the sphere
15
Monte Carlo Integration
  • Definite integral
  • Expectation of f
  • Random variables
  • Estimator

16
Unbiased Estimator
Properties
Assume uniform probability distribution for now
17
Over Arbitrary Domains
18
Non-Uniform Distributions
19
Direct Lighting Directional Sampling
20
Direct Lighting Area Sampling
21
Examples
Fixed
Random
4 eye rays per pixel 1 shadow ray per eye ray
22
Examples
Uniform grid
Stratified random
4 eye rays per pixel 16 shadow rays per eye ray
23
Examples
Uniform grid
Stratified random
4 eye rays per pixel 64 shadow rays per eye ray
24
Examples
Uniform grid
Stratified random
4 eye rays per pixel 100 shadow rays per eye ray
25
Examples
64 eye rays per pixel 1 shadow ray per eye ray
4 eye rays per pixel 16 shadow rays per eye ray
26
Variance
  • Definition
  • Properties
  • Variance decreases with sample size

27
Direct Lighting Directional Sampling
Ray intersection
28
Sampling Projected Solid Angle
  • Generate cosine weighted distribution

29
Examples
Projected solid angle 4 eye rays per pixel 100
shadow rays
Area 4 eye rays per pixel 100 shadow rays
30
Variance Reduction
  • Efficiency measure
  • Techniques
  • Importance sampling
  • Sampling patterns stratified,

31
Sampling a Triangle
32
Sampling a Triangle
  • Here u and v are not independent!
  • Conditional probability
Write a Comment
User Comments (0)
About PowerShow.com