Presentation is loading. Please wait.

Presentation is loading. Please wait.

Monte Carlo I Previous lecture Analytical illumination formula This lecture Numerical evaluation of illumination Review random variables and probability.

Similar presentations


Presentation on theme: "Monte Carlo I Previous lecture Analytical illumination formula This lecture Numerical evaluation of illumination Review random variables and probability."— Presentation transcript:

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 1 eye ray per pixel 1 shadow ray per eye ray FixedRandom

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 X i with probability p i Cumulative PDF (distribution) Construction of samples To randomly select an event, Select X i 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 X=P -1 (U) Must know: 1.The integral of p(x) 2.The inverse function P -1 (x)

10 Example: Power Function Assume Trick

11 Sampling a Circle

12 RIGHT  Equi-ArealWRONG  Equi-Areal

13 Rejection Methods Algorithm Pick U 1 and U 2 Accept U 1 if U 2 < f(U 1 ) Wasteful? Efficiency = Area / Area of rectangle

14 Sampling a Circle: Rejection May be used to pick random 2D directions Circle techniques may also be applied to the sphere do { X=1-2*U 1 Y=1-2*U 2 } while(X 2 + Y 2 > 1)

15 Monte Carlo Integration Definite integral Expectation of f Random variables Estimator

16 Unbiased Estimator Assume uniform probability distribution for now Properties

17 Over Arbitrary Domains a b

18 Non-Uniform Distributions

19 Direct Lighting – Directional Sampling Ray intersection Sample uniformly by

20 Direct Lighting – Area Sampling Ray direction Sample uniformly by

21 Examples 4 eye rays per pixel 1 shadow ray per eye ray FixedRandom

22 Examples 4 eye rays per pixel 16 shadow rays per eye ray Uniform gridStratified random

23 Examples 4 eye rays per pixel 64 shadow rays per eye ray Uniform gridStratified random

24 Examples 4 eye rays per pixel 100 shadow rays per eye ray Uniform gridStratified random

25 Examples 4 eye rays per pixel 16 shadow rays per eye ray 64 eye rays per pixel 1 shadow ray per eye ray

26 Variance Definition Properties Variance decreases with sample size

27 Direct Lighting – Directional Sampling Ray intersection Sample uniformly by

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 Here u and v are not independent! Conditional probability


Download ppt "Monte Carlo I Previous lecture Analytical illumination formula This lecture Numerical evaluation of illumination Review random variables and probability."

Similar presentations


Ads by Google