Você está na página 1de 77

Practical Realtime Strategies for

Accurate Indirect Occlusion


to
Jorge Jimenez – Graphics R&D Technical Director (Activision Blizzard)
Xianchun Wu – Graphics R&D Programmer (Activision Blizzard)
Angelo Pesce – Graphics R&D Technical Director (Activision Blizzard)
Adrian Jarabo – Post-Doctoral Researcher (Universidad de Zaragoza)

Physically Based Shading in Theory and Practice Course

© 2015 Activision Publishing, Inc.


Authors

Jorge Jimenez Xianchun Wu Angelo Pesce Adrian Jarabo


Activision Blizzard Activision Blizzard Activision Blizzard Universidad de Zaragoza

Physically Based Shading in Theory and Practice


Notice for Offline Reading
• Hidden slides in this presentation
• Slide show mode won’t show them
• Don’t miss the speaker notes, most slides have them

Physically Based Shading in Theory and Practice


More Details Online!
• Check out:
• Technical report
• Full slide deck online

Physically Based Shading in Theory and Practice


Motivation
𝐿𝑜 𝜔𝑜 = 𝐿𝑒 𝜔𝑜 + න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝐿𝑖 𝜔𝑖 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝛺

• Physically based BRDF adoption crucial

Physically Based Shading in Theory and Practice


Motivation 𝑉(𝜔𝑖 )𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖

𝐿𝑜 𝜔𝑜 = 𝐿𝑒 𝜔𝑜 + න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝐿𝑖 𝜔𝑖 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝛺

• Physically based BRDF adoption crucial


• Occlusion also a highly important ingredient
• Diffuse
• Specular
• Use of HDR+PBR makes specular occlusion even more important

Physically Based Shading in Theory and Practice


Motivation 𝑉(𝜔𝑖 )𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖

𝐿𝑜 𝜔𝑜 = 𝐿𝑒 𝜔𝑜 + න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝐿𝑖 𝜔𝑖 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝛺

• Physically based BRDF adoption crucial


• Occlusion also a highly important ingredient
• Diffuse
• Specular
• Use of HDR+PBR makes specular occlusion even more important
• Often hacked
• Previous gen consoles required so
• Can we use accurate solutions now?

Physically Based Shading in Theory and Practice


Methodology
• Monte Carlo Ground Truth
3d ray tracer (3d geometry)
• Implemented critical parts twice to ensure correctness

Screen-space ray marcher (height map)

Horizon-based numerical integrator

Physically Based Shading in Theory and Practice


Methodology
• Monte Carlo Ground Truth
3d ray tracer (3d geometry)
• Implemented critical parts twice to ensure correctness

• Analytical problem
• Available data (engine)
• Performance targets Screen-space ray marcher (height map)

Horizon-based numerical integrator

Physically Based Shading in Theory and Practice


Methodology
• Monte Carlo Ground Truth
3d ray tracer (3d geometry)
• Implemented critical parts twice to ensure correctness

• Analytical problem
• Available data (engine)
• Performance targets Screen-space ray marcher (height map)

• Closed-form solution + Fitting residual

Horizon-based numerical integrator

Physically Based Shading in Theory and Practice


Goals
• Achieve same performance as the fastest technique we had
• MiniEngine SSAO: outstanding technique in terms of quality/performance
• Achieve high accuracy
• Make using accurate approaches a no brainer

• Used in production under 60 fps constraints


• 0.5ms on PS4@1080p

Physically Based Shading in Theory and Practice


G TA O
Ground Truth-based Ambient Occlusion

Physically Based Shading in Theory and Practice


Physically Based Shading in Theory and Practice
© 2015 Activision Publishing, Inc.
Physically Based Shading in Theory and Practice
© 2015 Activision Publishing, Inc.
Physically Based Shading in Theory and Practice
© 2015 Activision Publishing, Inc.
Physically Based Shading in Theory and Practice
© 2015 Activision Publishing, Inc.
Physically Based Shading in Theory and Practice
© 2015 Activision Publishing, Inc.
Towards Monte Carlo Ground Truth
𝑉𝑑 = 𝐿𝑜 𝑥, 𝜔𝑜 /ρ𝑑

HBAO Monte Carlo


[Bavoil2008] Ground Truth

Physically Based Shading in Theory and Practice


Towards Monte Carlo Ground Truth
𝑉𝑑 = 𝐿𝑜 𝑥, 𝜔𝑜 /ρ𝑑

HBAO GTAO Monte Carlo


[Bavoil2008] Cosine Ground Truth

Physically Based Shading in Theory and Practice


Towards Monte Carlo Ground Truth
𝑉𝑑 = 𝐿𝑜 𝑥, 𝜔𝑜 /ρ𝑑

HBAO GTAO GTAO Monte Carlo


[Bavoil2008] Cosine Cosine + Multi Bounce Ground Truth

Physically Based Shading in Theory and Practice


Towards Monte Carlo Ground Truth
𝑉𝑑 = 𝐿𝑜 𝑥, 𝜔𝑜 /ρ𝑑

HBAO GTAO GTAO GTAO Monte Carlo


[Bavoil2008] Cosine Cosine + Multi Bounce Cosine + Colored Multi Bounce Ground Truth

Physically Based Shading in Theory and Practice


What Is Ambient Occlusion?

𝐿𝑜 𝜔𝑜 = 𝐿𝑒 𝜔𝑜 + න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝐿𝑖 𝜔𝑖 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝛺

Emitted BRDF Incoming


radiance Radiance

Physically Based Shading in Theory and Practice


What Is Ambient Occlusion?

Incoming
Radiance

ρ𝑑
𝐿𝑜 𝜔𝑜 =0+න 𝐿𝑖 𝜔𝑖 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝛺 𝜋

Emitted BRDF
radiance

Physically Based Shading in Theory and Practice


What Is Ambient Occlusion?

White Dome

ρ𝑑
𝐿𝑜 𝜔𝑜 =න 𝑉 𝜔𝑖 1 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝛺 𝜋

Visibility

1 if 𝜔𝑖 hits the sky


𝑉 𝜔𝑖 =ቊ
0 if 𝜔𝑖 do not hit the sky
Physically Based Shading in Theory and Practice
What Is Ambient Occlusion?
• Ambient occlusion is the ground truth lighting for the case of:
• Lambertian surface
• White dome (or uniform)
• Single bounce of light

1
𝐿𝑜 𝜔𝑜 = ρ𝑑 න 𝑉(𝜔𝑖 ) 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖 = ρ𝑑 𝑉𝑑
𝜋 𝛺

Ambient Occlusion

Physically Based Shading in Theory and Practice


Problem Statement
• Cosine-Weighted Ambient Occlusion:

1
𝑉𝑑𝑐𝑜𝑠𝑖𝑛𝑒 = න 𝑉(𝜔𝑖 ) 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝜋 𝛺

Cosine Term
• Uniformly-weighted Ambient
Occlusion:

𝑢𝑛𝑖𝑓𝑜𝑟𝑚 1
𝑉𝑑 = න 𝑉(𝜔𝑖 ) 𝑑𝜔𝑖
2𝜋 𝛺

Physically Based Shading in Theory and Practice


Problem Statement
• Cosine-Weighted Ambient Occlusion:

1
𝑉𝑑𝑐𝑜𝑠𝑖𝑛𝑒 = න 𝑉(𝜔𝑖 ) 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖
𝜋 𝛺

• Uniformly-Weighted Ambient
Occlusion:

𝑢𝑛𝑖𝑓𝑜𝑟𝑚 1
𝑉𝑑 = න 𝑉(𝜔𝑖 ) 𝑑𝜔𝑖
2𝜋 𝛺

Physically Based Shading in Theory and Practice


Input Data
• Visibility function
• Depth buffer (height field)
• Surface normal
• Normal buffer, or
• Derived from depth buffer

Physically Based Shading in Theory and Practice


Double Integral
𝜋 𝜋ൗ
1 1 2
𝑉𝑑 = න 𝑉(𝜔𝑖 ) 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖 = න න 𝑉 𝜃, 𝜙 𝑛 ∙ 𝜔𝑖 sin 𝜃 𝑑𝜃 𝑑𝜙
𝜋 𝛺 𝜋 0 −𝜋ൗ
2

Occluded
Slice
Occluded
Occluded

Side View (Slice) Front View


Horizon-Based Ambient Occlusion [Bavoil2008]
𝜋 𝜋ൗ
1 1 2
𝑉𝑑 = න 𝑉(𝜔𝑖 ) 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖 = න න 𝑉 𝜃, 𝜙 𝑛 ∙ 𝜔𝑖 sin 𝜃 𝑑𝜃 𝑑𝜙
𝜋 𝛺 𝜋 0 −𝜋ൗ
2

Occluded
Slice
Occluded
Occluded

Side View (Slice) Front View


Horizon-Based Ambient Occlusion [Bavoil2008]
𝜋 𝜋ൗ
1 1 2
𝑉𝑑 = න 𝑉(𝜔𝑖 ) 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖 = න න 𝑉 𝜃, 𝜙 𝑛 ∙ 𝜔𝑖 sin 𝜃 𝑑𝜃 𝑑𝜙
𝜋 𝛺 𝜋 0 −𝜋ൗ
2

Slice

Side View (Slice) Front View


Horizon-Based Ambient Occlusion [Bavoil2008]
𝜋 𝜋ൗ
1 1 2
𝑉𝑑 = න 𝑉(𝜔𝑖 ) 𝑛 ∙ 𝜔𝑖 𝑑𝜔𝑖 = න න 𝑉 𝜃, 𝜙 𝑛 ∙ 𝜔𝑖 sin 𝜃 𝑑𝜃 𝑑𝜙
𝜋 𝛺 𝜋 0 −𝜋ൗ
2
Analytic solution per slice Numerical integral on the longitude

Slice

Side View (Slice) Front View


Cosine Weighting
• Ambient occlusion equation:
𝜋
1 𝜋 ൗ2
𝑉𝑑𝑐𝑜𝑠𝑖𝑛𝑒 = න න 𝑉 𝜃, 𝜙 cos 𝜃 − 𝑛 sin 𝜃 𝑑𝜃 𝑑𝜙
𝜋 0 −𝜋ൗ
2

𝑣𝑑
• 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

Physically Based Shading in Theory and Practice


Relaxing the Assumptions
• Ambient occlusion is the ground truth lighting for the case of:
• Lambertian surface
• White dome (or uniform)
• Single bounce of light
• Extend the regular ambient occlusion equation by relaxing the assumptions:
• Lambertian surface
• White dome (or uniform)
• Neighboring albedos ρm ≈ the albedo ρ1 of current point being shaded
• Allows to approximate multiple bounces
• [Silvennoinen2015] is an alternative solution using screen space bounces, could not afford due to our limited budget

Physically Based Shading in Theory and Practice


Multiple Bounces
• Method:
• Calculate single-bounce using Monte Carlo ray tracing:
𝑉𝑑

• Calculate multi-bounce using Monte Carlo ray tracing @ given Single Bounce (𝑉𝑑 )
albedo ρ (4 bounces):
𝑉𝑑′

• Fit a function 𝑓 that translates from single to multi-bounce


results:
𝑉𝑑′ = 𝑓 𝑉𝑑 , ρ

Multi Bounce (𝑉𝑑′ )


Physically Based Shading in Theory and Practice
Fitting for a Fixed Albedo
• Fitting a brightness remapping curve for an albedo of ρ=0.6
𝑓

𝑉𝑑′

Single Bounce (𝑉𝑑 ) Multi Bounce (𝑉𝑑′ )


𝑉𝑑

𝑉𝑑′ = 𝑓 𝑉𝑑 = 𝑎𝑉𝑑 + 𝑏 𝑉𝑑 + 𝑐 𝑉𝑑
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

𝑉𝑑′

ρ = 0.1 ρ = 0.2 ρ = 0.3 ρ = 0.4 ρ = 0.5 ρ = 0.7 ρ = 0.9

𝑉𝑑
Generalizing to Other Scenes
𝑉𝑑

(a) (b) (c)

(d) (e) (f) (g)


(a) (b) (c)

(d) (e) (f)


Final Fit Over All Data
• Using all the input data jointly

𝑉𝑑′

𝑉𝑑
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:
• 𝑉𝑑′ = 𝑎𝑉𝑑 + 𝑏 𝑉𝑑 + 𝑐 𝑉𝑑

• A linear function for each coefficient 𝑎, 𝑏 and 𝑐:


• 𝑎 = 𝑎0 + 𝑎1 ρ

Coefficient 𝑎 Coefficient 𝑏 Coefficient 𝑐


Shader Code
float3 GTAOMultiBounce( float visibility, float3 albedo )
{
float3 a = 2.0404 * albedo - 0.3324;
float3 b = -4.7951 * albedo + 0.6417;
float3 c = 2.7552 * albedo + 0.6903;

float x = visibility;
return max( x, ( ( x * a + b ) * x + c ) * x );
}

Physically Based Shading in Theory and Practice


GTAO Monte Carlo Ground Truth GTAO
Cosine + Single Bounce Cosine + Colored Multi Bounce
HBAO GTAO
[Bavoil2008] Cosine + Colored Multi Bounce
GTSO
Ground Truth-based Specular Occlusion

Physically Based Shading in Theory and Practice


Physically Based Shading in Theory and Practice
Physically Based Shading in Theory and Practice
1 if 𝜔𝑖 hits the sky
𝑉 𝜔𝑖 = ቊ
0 if 𝜔𝑖 do not hit the sky

Introduction
• Split integral approximation [Lazarov2013] [Karis2013]:
Visibility

න 𝐿𝑖 𝜔𝑖 𝑓 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 ≅ න 𝑉 𝜔𝑖 𝐿𝑒𝑛𝑣


𝑖 𝜔𝑖 𝑓 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 ≅ න 𝑉 𝜔𝑖 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑓 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω Ω Ω Ω
𝐿𝑖
Probe convolution Environment LUT

Physically Based Shading in Theory and Practice


Introduction
• We further split the visibility calculation 𝑉𝑠 , which is our specular occlusion
• Can be thought as prefiltering the visibility

න 𝑉(𝜔𝑖 )𝐿𝑒𝑛𝑣 𝑒𝑛𝑣


𝑖 (𝜔𝑖 )𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 ≅ න 𝑉(𝜔𝑖 )𝐿𝑖 𝜔𝑖 𝐷(ℎ)𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω Ω Ω
∗ ∗

න 𝑉(𝑙)𝐿𝑒𝑛𝑣 𝑒𝑛𝑣
𝑖 (𝑙)𝑓 𝑙, 𝑣 𝑐𝑜𝑠𝜃𝑙 𝑑𝑙 ≅ න 𝑉(𝜔𝑖 )𝐷(ℎ)𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝐿𝑖 (𝜔𝑖 )𝐷(ℎ)𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω Ω Ω Ω

𝑉𝑠

Physically Based Shading in Theory and Practice


Split Sum Term Normalization
• Star (*) means to normalize the integral
• As in the split integral approximation previous work
• For the new visibility term:


‫׬‬Ω 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
න 𝑉(𝜔𝑖 )𝐷(ℎ)𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 =
‫׬‬Ω 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω

Physically Based Shading in Theory and Practice


∗ ∗ ∗

න 𝑉 𝜔𝑖 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω Ω Ω Ω Ω

Two Split Monte Carlo Ground Truth Three Split


First 𝑉𝑠 Attempt
• Assumptions: Visible
• Visibility can be approximated as a cone Inside of
• BRDF can be approximated as a cone the cone

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 𝑑,

Physically Based Shading in Theory and Practice


Method
1. Calculate:
• Visibility cone
Visibility cone
• Specular reflection cone
Specular reflection cone

Physically Based Shading in Theory and Practice


Method Ω𝑖

1. Calculate:
• Visibility cone
Visibility cone
• Specular reflection cone
Specular reflection cone
2. Calculate solid angle of the
intersection Ω𝑖

Physically Based Shading in Theory and Practice


Method Ω𝑖
Ω𝑠

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 Ω𝑠

Physically Based Shading in Theory and Practice


Method Ω𝑖
Ω𝑠

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𝑠 =
Ω𝑠

Physically Based Shading in Theory and Practice


Final Specular Visibility Calculation
Solid angle of the intersection

Ω𝑖 𝐼𝑛𝑡𝑒𝑟𝑠𝑒𝑐𝑡𝑖𝑜𝑛 cos(𝛼𝑣 , cos(𝛼𝑠 ), 0.5cos(𝛽) + 0.5)


𝑉𝑠 = =
Ωs 2𝜋(1 − cos(𝛼𝑠 ))

Solid angle of the reflection cone

• 𝑉𝑠 can be baked to a 32x32x32 BC4 look up table (8-bit)


• 16x16x16 BC4 still acceptable, quality-wise

Physically Based Shading in Theory and Practice


𝑉𝑠 = න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω

AO as SO [Lagarde2014] Ours Phong Reference


Our gloss to aperture fit

Physically Based Shading in Theory and Practice


Second 𝑉𝑠 Attempt
• Assumption:
• Visibility can be approximated as a cone
• BRDF can be approximated as a cone

Physically Based Shading in Theory and Practice


Intersection with Accurate Reflection Lobes
Ω𝑖 𝐼𝑛𝑡𝑒𝑟𝑠𝑒𝑐𝑡𝑖𝑜𝑛 cos(𝛼𝑣 , cos(𝛼𝑠 ), 0.5cos(𝛽) + 0.5)
𝑉𝑠 = =
Ωs 2𝜋(1 − cos(𝛼𝑠 ))

• 𝑉𝑠 currently calculates the intersection of two cones


• 𝑉𝑠 is baked into a LUT
• We can calculate the intersection with any other shape efficiently

• Key Idea:
• Bake the intersection of the visibility cone with the actual reflection lobe

Physically Based Shading in Theory and Practice


Intersection with Accurate Reflection Lobes
• Use the distribution function to shape the lobe
• Intersect with the visibility cone

𝑉𝑠 = 𝐿𝑈𝑇(𝛼𝑣 , 𝛽, 𝑟) = න 𝑉 𝜔𝑖 , 𝛼𝑣 , 𝛽 𝐷 ℎ, 𝑟 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖


Ω

Determined using the


visibility cone
𝛼𝑣 = visibility aperture angle
𝛽 = angle between bent normal and reflection direction
𝑟 = roughness (or specular power if using Phong)
Phong Cone/Cone Phong Reference Phong Cone/Lobe
Intersection Intersection
Ground Truth Specular Occlusion
• We want to derive a specular occlusion definition analogous to ambient occlusion:
• Ground truth results if the probe is uniform

• Our current definition does not comply with that:


𝑉𝑠 = න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω

Physically Based Shading in Theory and Practice


Ground Truth Specular Occlusion
• We want to derive a specular occlusion definition analogous to ambient occlusion:
• Ground truth results if the probe is uniform

• Our current definition does not comply with that:


𝑉𝑠 = න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω

• However, this definition complies:


𝑉𝑠 = න 𝑉 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω

Physically Based Shading in Theory and Practice


Ground Truth Specular Occlusion
• We want to derive a specular occlusion definition analogous to ambient occlusion:
• Ground truth results if the probe is uniform

• Our current definition does not comply with that:


𝑉𝑠 = න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω

• However, this definition complies:

‫ 𝑖𝜔 𝑟𝑓 𝑖𝜔 𝑉 ׬‬, 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖


𝑉𝑠 = Ω
‫׬‬Ω 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖

Physically Based Shading in Theory and Practice


Ground Truth Specular Occlusion
• We want to derive a specular occlusion definition analogous to ambient occlusion:
• Ground truth results if the probe is uniform

• Our current definition does not comply with that:


𝑉𝑠 = න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω

• However, this definition complies:

‫ 𝑖𝜔 𝑟𝑓 𝑖𝜔 𝑉 ׬‬, 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖


𝑉𝑠 = Ω
‫׬‬Ω 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖

Cancels Out
∗ ∗

න 𝑉 𝜔𝑖 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 ≅ 𝑉𝑠 න 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 = න 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑉 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω Ω Ω Ω Ω
Ground Truth Specular Occlusion

න 𝑉 𝜔𝑖 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 ≅ න 𝐿𝑒𝑛𝑣
𝑖 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑉 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖
Ω Ω Ω

Physically Based Shading in Theory and Practice


Ground Truth Specular Occlusion

න 𝑉 𝜔𝑖 1𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 = න 1𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 න 𝑉 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖


Ω Ω Ω

Physically Based Shading in Theory and Practice


Ground Truth Specular Occlusion

න 𝑉 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑖 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 = න 𝑉 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖


Ω Ω

Physically Based Shading in Theory and Practice


∗ ∗

𝑉𝑠 = න 𝑉 𝜔𝑖 𝐷 ℎ 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖 𝑉𝑠 = න 𝑉 𝜔𝑖 𝑓𝑟 𝜔𝑖 , 𝜔𝑜 𝑐𝑜𝑠𝜃𝑖 𝑑𝜔𝑖


Ω Ω

Previous 𝑉𝑠 Ground Truth New 𝑉𝑠


Ground Truth Ground Truth
Conclusions
• Occlusion is as important as using physically based BRDFs
• Our main contributions:
• Showing accurate approximations for:
• Ambient Occlusion (with multiple bounces)
• Specular Occlusion (for arbitrary BRDFs)
• A specular occlusion definition
• Analogous to the widely-used ambient occlusion one
• Showing that accurate approximations can be used in game production
• Full multi-bounce GTAO (0.5ms in the PS4@1080p)
• Prototype of GTSO used for faces

Physically Based Shading in Theory and Practice


Q&A - Acknowledgements
Special thanks to the course organizers:
Stephen Hill and Stephen McAuley

• Christer Ericson • Josiah Manson


• Danny Chan • Manny Ko
• Dimitar Lazarov • Michal Drobot
• Eran Rich • Michal Iwanicki
• Jennifer Velazquez • Peter-Pike Sloan
• Josh Blommestein • Ville Timonen

Physically Based Shading in Theory and Practice


© 2015 Activision Publishing, Inc.
References & Relevant Work
• [Aalund2013] A Comparative Study of Screen-Space Ambient Occlusion Methods
• [Bavoil2008] Image-Space Horizon-Based Ambient Occlusion
• [Bavoil2012] Stable SSAO in BF3 with STF
• [Bavoil2014] Deinterleaved Texturing for Cache-Efficient Interleaved Sampling
• [Drobot2014a] Low Level Optimizations for GCN
• [Drobot2014b] Hybrid Reconstruction Anti-Aliasing
• [Drobot2014c] GPU Pro5 Physically Based Area Lights
• [DSSIM] https://en.wikipedia.org/wiki/Structural_similarity
• [Filion2008] StarCraft II Effects & Techniques
• [Jimenez2013] Next-Generation Character Rendering
• [Jimenez2016] Filmic SMAA: Sharp Morphological and Temporal Antialiasing
• [Lagarde2014] Moving Frostbite to Physically based rendering
• [Landis2002] Production-ready global illumination
• [Mattausch2010] High Quality Screen Space Ambient Occlusion using Temporal Coherence
• [Mazonka2012] Solid Angle of Conical Surfaces, Polyhedral Cones, and Intersecting Spherical Caps

Physically Based Shading in Theory and Practice


References & Relevant Work
• [McGuire2011] The alchemy screen-space ambient obscurance algorithm
• [McGuire2012] Scalable Ambient Obscurance
• [Mittring2007] Finding next gen: Cryengine 2
• [Mittring2012] The technology behind the unreal engine 4 elemental demo
• [Oat2007] Ambient Aperture Lighting
• [Silvennoinen2015] Multi-Scale Global Illumination in Quantum Break
• [Sloan2010] Volumetric obscurance
• [Timonen 2010] Scalable Height Field Self-Shadowing
• [Timonen2013a] Line-Sweep Ambient Obscurance
• [Timonen2013b] Screen-Space Far-Field Ambient Obscurance
• [TV2001] How common is the funnel-like energy landscape in protein-protein interactions?
• [Uludag2014] GPU Pro5 Hi-Z Screen-Space Cone-Traced Reflections
• [Walter2007] Microfacet Models for Refraction through Rough Surfaces
• [Wright2015] Dynamic Occlusion with Signed Distance Fields

Physically Based Shading in Theory and Practice

Você também pode gostar