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