Download presentation
Presentation is loading. Please wait.
1
黃聰賢
2
Render Equation BRDF Importance Sampling Implementation
3
is the radiance from a point to given direction w o ωoωo x
4
is the emitted radiance is non-zero if x is emissive(a light source) ωoωo x
5
Sum of the contribution from all of the other direction in the scene ωoωo x ωiωi
6
Rendering Equation (4) Radiance from all hemisphere direction ωoωo x ωiωi
8
eye Spherical sample direction x L(x,w o ) = (2 PI / #samples) * ∑ [BRDF(x,w o,w i )*L(y i,-w i ) * cos(n,ω i )] y0y0 y1y1 yiyi normal ω0ω0 ω1ω1 ωiωi
9
Generate two uniform random variables in [0,1) : ξ x, ξ y x = sin(θ) cos(φ) y = sin(θ) sin(φ) z = cos(θ) φ
11
Too ManyToo CoarseImportance
13
1. Generate enough samples (uniform samples) 2. Compute the importance of each sample 3. Build the CDF of importance 4. Generate uniform random variables over [0,1) 5. Use Inverse CDF to choose a sample 6. Divide the contribution of each sample by its probability
14
Use Phong Lighting Model. Add the lighting effect if visibility is one. N E R L I * (Kd * dot(N, L) + Ks * pow(dot(E, R), Ns) )
15
Use importance sampling to choose direction If the direction hits a point y i, compute the y i direct lighting eye x y0y0 y1y1 yiyi normal ω0ω0 ω1ω1 ωiωi
16
L(x, ω o ) = (2 PI / #samples) * ∑ [BRDF(x, ω o, ω i )*L(y i,-ω i ) * cos(n,ω i )] L(x, ω o ) = (1.0 / #samples) * ∑ { L(y i,-ω i ) * [Kd * dot(ω i, N) + Ks * pow(dot(E, reflect(ω i, N)), Ns) ] } E x yiyi N ωiωi
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.