CS680: CS680: Monte Carol Integration Sung-Eui Yoon ( 윤성의 ) ( 윤성의 ) C Course URL: URL http://jupiter.kaist.ac.kr/~sungeui/SGA/
Course Administration Course Administration ● Due is this Thur. ● HW HW 2
● Rendering equation Previous Time Previous Time ● Radiometry Radiometry 3
Two Forms of the Rendering Equation Equation ● Hemisphere integration Hemisphere integration ● Area integration 4
Radiance Evaluation Radiance Evaluation ● Fundamental problem in GI algorithm Fundamental problem in GI algorithm ● Evaluate radiance at a given surface point in a given direction given direction ● I nvariance defines radiance everywhere else 5
Radiance Evaluation Radiance Evaluation 6
Why Monte Carlo? Why Monte Carlo? ● Radiace is hard to evaluate Radiace is hard to evaluate From kavita’s slides From kavita s slides ● Sample many paths ● I ntegrate over all incoming directions g g ● Analytical integration is difficult ● Need numerical techniques q 7
Monte Carlo Integration Monte Carlo Integration ● Numerical tool to evaluate integrals Numerical tool to evaluate integrals ● Use sampling ● Stochastic errors ● Unbiased ● On average, we get the right answer 8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
• Consider p(x) for estimate C ( ) f • We will study it as importance sampling later 24
25
26
27
28
Example MC Integration - Example MC Integration ● Variance ● I ntegral I ntegral 29
30
31
32
Advantages of MC Advantages of MC 1 ● Convergence rate of Convergence rate of O O ( ( ) ) N ● Simple ● Sampling ● Point evaluation P i t l ti ● General G l ● Works for high dimensions ● Deals with discontinuities crazy functions etc ● Deals with discontinuities, crazy functions, etc. 33
34
35
Importance Sampling Importance Sampling ● Take more samples in important regions, Take more samples in important regions where the function is large From kavita’s slides 36
37
38
39
40
Sampling according to pdf Sampling according to pdf ● I nverse cumulative distribution function I nverse cumulative distribution function ● Rejection sampling 41
Inverse Cumulative Distribution Function Function – Discrete Case Discrete Case , given uniform sampling 42
Continuous Random Variable Continuous Random Variable ● Algorithm Algorithm ● Pick u uniformly from [0, 1) y ● Output y = P 1 (u), where ● Output y = P -1 (u) where P P ( ( y ) ) p ( ( x ) ) dx d 43
44
45
46
47
Rejection Method Rejection Method ● Often not possible to compute the inverse Often not possible to compute the inverse of cdf From kavita’s slides 1 48
Summary Summary ● Monte Carlo integration Monte Carlo integration ● Estimators ● Sampling non-uniform distribution f 49
● Monte Carlo ray tracing Monte Carlo ray tracing Next Time Next Time 50
Recommend
More recommend