8/2/2019 ICG 2010 Oral Presentation
1/27
Screen Space AmbientOcclusion(SSAO)
B97902099
B97902045 B98902077
8/2/2019 ICG 2010 Oral Presentation
2/27
Why we need SSAO?
We have learned that a shadow is generated when the rayintersects a surface before it meets a light source.
8/2/2019 ICG 2010 Oral Presentation
3/27
What if we are in the sunlight shadowalready?
In the real world
8/2/2019 ICG 2010 Oral Presentation
4/27
8/2/2019 ICG 2010 Oral Presentation
5/27
8/2/2019 ICG 2010 Oral Presentation
6/27
If we are already in theshadow,we need somethingelse...
8/2/2019 ICG 2010 Oral Presentation
7/27
Ambient Occlusion
Ambient OcclusionAmbient = (Ambient Light)
Occlusion = , ,
Occluded
Ambient Light
8/2/2019 ICG 2010 Oral Presentation
8/27
What's AO
8/2/2019 ICG 2010 Oral Presentation
9/27
What's AO
8/2/2019 ICG 2010 Oral Presentation
10/27
What's AO
8/2/2019 ICG 2010 Oral Presentation
11/27
8/2/2019 ICG 2010 Oral Presentation
12/27
8/2/2019 ICG 2010 Oral Presentation
13/27
AO Equation
V(p,p') is the visibility function from p' to p,
Recall Rendering Equation:
Since ambient is undirectional and uniform.
http://www.codecogs.com/latex/eqneditor.php
8/2/2019 ICG 2010 Oral Presentation
14/27
AO Equation
integrating the visibility function over the hemisphere with respect to projected solid angle
8/2/2019 ICG 2010 Oral Presentation
15/27
SSAO
SSAO = Screen Space Ambient OcclusionAOScreen Space
8/2/2019 ICG 2010 Oral Presentation
16/27
SSAO
Depth Buffer
==>
8/2/2019 ICG 2010 Oral Presentation
17/27
SSAO
poisson-disk
sample
8/2/2019 ICG 2010 Oral Presentation
18/27
SSAOAO-factor
8/2/2019 ICG 2010 Oral Presentation
19/27
SSAO
, AO mapAmbient
+
=
+...
8/2/2019 ICG 2010 Oral Presentation
20/27
THE END
Thanks for Attention
8/2/2019 ICG 2010 Oral Presentation
21/27
Problem & Goal
1. 2.
8/2/2019 ICG 2010 Oral Presentation
22/27
Algorithm
A. Read depth map as a height map
B. For each pixel (denotes p0), sample neighbor pixels todetermine how much p0 will be occluded.
(It can be executed in Fragment Shader)
C. Write the p0 to the output buffer. The output buffer is calledAO-map.
8/2/2019 ICG 2010 Oral Presentation
23/27
Algorithm
Input: DepthBuffer as Texture2DGeometry: A QuadOutput: AO-Map composed of the results of ssao()
vec4 ssao(Texture2D depthMap, vec2 center){sample neighbors of the centercalculate how much the center will be occluded.AO-factor = some-function( some parameters )
return AO-factor}
8/2/2019 ICG 2010 Oral Presentation
24/27
With OpenGL
First Pass:Draw Models to G-Buffer (Depth & Normals).
Second Pass:
Use G-Buffer as textures, post-process it with SSAO function.Output its result to AO-map buffer.
Final Pass:Draw Models to Display Buffer, with the calculated AO-map
buffer as a special texture.
8/2/2019 ICG 2010 Oral Presentation
25/27
Algorithm (OpenGL)
1st-Pass:
Draw Models/Scene to Depth Buffer
8/2/2019 ICG 2010 Oral Presentation
26/27
Algorithm (OpenGL)
2nd-Pass:Use SSAO shader,Draw a Full-screen Quad with Depth Buffer as Texture
8/2/2019 ICG 2010 Oral Presentation
27/27
AO Equation
Recall Rendering Equation