Professional Documents
Culture Documents
𝐿𝑜 𝜔𝑜 = 𝐿𝑒 𝜔𝑜 + න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝐿𝑖 𝜔𝑖 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝛺
𝐿𝑜 𝜔𝑜 = 𝐿𝑒 𝜔𝑜 + න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝐿𝑖 𝜔𝑖 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝛺
• Analytical problem
• Available data (engine)
• Performance targets Screen-space ray marcher (height map)
• Analytical problem
• Available data (engine)
• Performance targets Screen-space ray marcher (height map)
𝐿𝑜 𝜔𝑜 = 𝐿𝑒 𝜔𝑜 + න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝐿𝑖 𝜔𝑖 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝛺
Incoming
Radiance
ρ𝑑
𝐿𝑜 𝜔𝑜 =0+න 𝐿𝑖 𝜔𝑖 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝛺 𝜋
Emitted BRDF
radiance
White Dome
ρ𝑑
𝐿𝑜 𝜔𝑜 =න 𝑉 𝜔𝑖 1 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝛺 𝜋
Visibility
1
𝐿𝑜 𝜔𝑜 = ρ𝑑 න 𝑉(𝜔𝑖 ) 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖 = ρ𝑑 𝑉𝑑
𝜋 𝛺
Ambient Occlusion
1
𝑉𝑑𝑐𝑜𝑠𝑖𝑛𝑒 = න 𝑉(𝜔𝑖 ) 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝜋 𝛺
Cosine Term
• Uniformly-weighted Ambient
Occlusion:
𝑢𝑛𝑖𝑓𝑜𝑟𝑚 1
𝑉𝑑 = න 𝑉(𝜔𝑖 ) 𝑑𝜔𝑖
2𝜋 𝛺
1
𝑉𝑑𝑐𝑜𝑠𝑖𝑛𝑒 = න 𝑉(𝜔𝑖 ) 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝜋 𝛺
• Uniformly-Weighted Ambient
Occlusion:
𝑢𝑛𝑖𝑓𝑜𝑟𝑚 1
𝑉𝑑 = න 𝑉(𝜔𝑖 ) 𝑑𝜔𝑖
2𝜋 𝛺
Occluded
Slice
Occluded
Occluded
Occluded
Slice
Occluded
Occluded
Slice
Slice
𝑣𝑑
• Using horizon angles ℎ1 and ℎ2 , we have the visibility for a single slice 𝑣𝑑 :
𝑣𝑑 = 𝐼𝑛𝑡𝑒𝑔𝑟𝑎𝑡𝑒𝐴𝑟𝑐 ℎ1 , ℎ2 , 𝑛 =
ℎ1 ℎ2
න cos(𝜃 − 𝑛) sin 𝜃 𝑑𝜃 + න cos(𝜃 − 𝑛) sin 𝜃 𝑑𝜃 =
0 0
1 1
− cos 2ℎ1 − 𝑛 + cos 𝑛 + 2ℎ1 sin 𝑛 + − cos 2ℎ2 − 𝑛 + cos 𝑛 + 2ℎ2 sin(𝑛)
4 4
Monte Carlo Ground Truth GTAO
Cosine
Multiple Bounces
• Ambient occlusion is the ground truth lighting for the case of:
• Lambertian surface
• White dome (or uniform)
• Single bounce of light
• Calculate multi-bounce using Monte Carlo ray tracing @ given Single Bounce (𝑉𝑑 )
albedo ρ (4 bounces):
𝑉𝑑′
𝑉𝑑′
𝑉𝑑′ = 𝑓 𝑉𝑑 = 𝑎𝑉𝑑 + 𝑏 𝑉𝑑 + 𝑐 𝑉𝑑
Physically Based Shading in Theory and Practice
Fitting Over Varying Albedo
• Seven single to multi-bounce references, for various albedos ρ
• Fit a cubic polynomial per albedo:
Cubic Polynomial Coefficients
𝑉𝑑′ = 𝑎𝑉𝑑 + 𝑏 𝑉𝑑 + 𝑐 𝑉𝑑 ρ = 0.1
ρ = 0.4
𝑉𝑑 𝑉𝑑′
ρ = 0.9
𝑉𝑑′
𝑉𝑑
Generalizing to Other Scenes
𝑉𝑑
𝑉𝑑′
𝑉𝑑
Physically Based Shading in Theory and Practice
Finding a Symbolic Expression
• How to lerp between the fits for each albedo?
• For each albedo we have:
• 𝑉𝑑′ = 𝑎𝑉𝑑 + 𝑏 𝑉𝑑 + 𝑐 𝑉𝑑
float x = visibility;
return max( x, ( ( x * a + b ) * x + c ) * x );
}
Introduction
• Split integral approximation [Lazarov2013] [Karis2013]:
Visibility
∗
න 𝑉(𝑙)𝐿𝑒𝑛𝑣 𝑒𝑛𝑣
𝑖 (𝑙)𝑓 𝑙, 𝑣 𝑐𝑜𝑠𝜃𝑙 𝑑𝑙 ≅ න 𝑉(𝜔𝑖 )𝐷(ℎ)𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝐿𝑖 (𝜔𝑖 )𝐷(ℎ)𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω Ω Ω Ω
𝑉𝑠
∗
Ω 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
න 𝑉(𝜔𝑖 )𝐷(ℎ)𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 =
Ω 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω
න 𝑉 𝜔𝑖 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω Ω Ω Ω Ω
Occluded
• Input:
• Bent normal + AO
• Idea:
• Calculate the occlusion using the intersection of the
reflection and visibility cones Cone defined by:
• Similar to [Oat2007], but for specular lighting Ԧ Aperture 𝛼
Direction 𝑑,
1. Calculate:
• Visibility cone
Visibility cone
• Specular reflection cone
Specular reflection cone
2. Calculate solid angle of the
intersection Ω𝑖
1. Calculate:
• Visibility cone
Visibility cone
• Specular reflection cone
Specular reflection cone
2. Calculate solid angle of the
intersection Ω𝑖
3. Calculate solid angle of the specular
reflection cone Ω𝑠
1. Calculate:
• Visibility cone
Visibility cone
• Specular reflection cone
Specular reflection cone
2. Calculate solid angle of the
intersection Ω𝑖
3. Calculate solid angle of the specular
reflection cone Ω𝑠
4. Calculate percentage of occlusion:
Ω𝑖
V𝑠 =
Ω𝑠
𝑉𝑠 = න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω
• Key Idea:
• Bake the intersection of the visibility cone with the actual reflection lobe
𝑉𝑠 = න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω
𝑉𝑠 = න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω
𝑉𝑠 = න 𝑉 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω
𝑉𝑠 = න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω
𝑉𝑠 = න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω
Cancels Out
∗ ∗
න 𝑉 𝜔𝑖 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 ≅ 𝑉𝑠 න 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 = න 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑉 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω Ω Ω Ω Ω
Ground Truth Specular Occlusion
∗
න 𝑉 𝜔𝑖 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 ≅ න 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑉 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω Ω Ω