advanced computer graphics cs 563: screen space real time...
TRANSCRIPT
![Page 1: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/1.jpg)
Advanced Computer Graphics CS 563: Screen Space Real‐time GI
AlgorithmScreen‐Space Directional Occlusion
Xin WangFeb,21,2012
Computer Science Dept.Worcester Polytechnic Institute (WPI)
![Page 2: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/2.jpg)
Overview
Real‐time Global Illumination Approximation Computed in image space
Extension of Ambient Occlusion Small‐scale geometry Independent of scene complexity Directional Occlusion Indirect Bounces
Complements classic illumination
![Page 3: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/3.jpg)
Ambient Occlusion (AO)
Global illumination Coarse approximation Efficient (e.g. real‐time) Plausible results Perceptually important
[Langer and Bülthoff 1999]
Idea: Compute average visibility Multiply with unoccluded illumination at run‐time Can be precomputed (vertex / texel)
![Page 4: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/4.jpg)
Previous Work
Ambient illumination model[Zhukov et al. 1998]
Production rendering[Landis 2002]
Moving rigid objects[Kontkanen et al. 2005, Malmer et al. 2007]
Approximate color bleeding[Mendez et al. 2006]
Point‐based occlusion/indirections [Christensen 2008]
Screen‐Space[Mittring 2007, Shanmugam and Arikan 2007, Bavoil et al. 2008, Filion et al. 2008]
![Page 5: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/5.jpg)
Screen‐Space Ambient Occlusion
SSAO Used in current games Ambient Occlusion for each
framebuffer pixel No precomputation
Dynamic scenes Simple implementation Independent of scene
complexity, real‐time on recent GPUs
![Page 6: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/6.jpg)
Ambient Occlusion Review
Directionally‐varying light is ignored
Example:Shadow at point P should be green because only the red light is occluded
AO computes unoccluded illumination first (=yellow) and scales by a single occlusion value (=0.4)
shadow at P is brown
P
![Page 7: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/7.jpg)
Ideal Approach Traditional SSAO
[Shanmugam and Arikan 2007]
Observation: If loop though a number of
samples for each pixel, why not just integrating the incoming radiance for each direction ?
Screen‐Space Directional Occlusion (SSDO) Approximate visibility for each
sample Accumulate only visible
illumination
P PMultiply byunoccluded illumination
P
*
![Page 8: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/8.jpg)
SSDO Visibility
For each pixel in framebuffer Compute N samples (A – D) in the
upper hemisphere of P with user‐defined radius rmax
For each sample Backproject sample to image Compute position on surface from
z‐Buffer If the sample point goes up, it is
treated as occluded (A,B,D) If the sample goes down, P is
illuminated from this direction (C) (blurred envmap, filter ) N/2
A
B
C
D
P
Env.map
n
maxr
![Page 9: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/9.jpg)
Equations
SSDO is a improvement of SSAO Irradiance of each fragment
Indirect Bounces
i
N
iiiindir VLPL cos)()()(
1
21
coscos))(1()(i
risisN
iipixelind d
AVLPL
![Page 10: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/10.jpg)
Directional Occlusion
SSDO shadows Oriented Colored
SSAO shadows Not oriented Grey
Similar computations SSDO overhead: 3.6%
![Page 11: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/11.jpg)
Indirect Illumination
Each sample is a small area light Oriented around pixel normal Radiance = direct light
For each sample Compute form factor to P and
accumulate contributions Results in one indirect bounce
of light for nearby geometry
P
Env.map
maxr
![Page 12: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/12.jpg)
Indirect Illumination
Direct light using e.g. Environment map (Sky) Point light with shadow
map (Sun) Temporal coherence Overhead: ~30%
![Page 13: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/13.jpg)
Comparison with PBRT
![Page 14: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/14.jpg)
Speed‐up: Interleaved Sampling
Reduce the computation for each pixel[Keller and Heidrich 2001, Segovia et al. 2006]
Not all N samples are used Instead: Use blocks of MxM pixels Each pixel uses only
N/(MxM) samples Apply geometry‐aware blur
[Laine et al. 2007]
![Page 15: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/15.jpg)
Exmple Scene
GeForce 8800 GTX
Resolution:Polys:
SSDO:Bounce:
1024 x 768~300k
55 – 80 fps40 – 65 fps
3D Model from Dosch Design
![Page 16: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/16.jpg)
Non‐polygonal Scenes and Animations
GeForce 8800 GTX
Resolution:Volume:
1024 x 768256^3
Volume Data from UTCT
![Page 17: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/17.jpg)
Limitation I
Visibility is an approximation Only nearby geometry:
No occluders outside sphere Wrong classification Sample A:
treated as an occluder Sample B:
treated as visibleA B
P
Env.map
n
maxr
1z
![Page 18: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/18.jpg)
Solutions
Sample A: Depth Peeling
[Lischinski et al. 1998, Everitt 2001]
Sample B: Use multiple samples on a line
A
P
Env.map
n
maxr
B
1z
2z
![Page 19: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/19.jpg)
Limitations II
Only visible senders can contribute to indirect illumination Especially grazing angles Fade in/out of indirect light Fortunately no abrupt
changes visible Solution:
Use multiple cameras
![Page 20: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/20.jpg)
Solution – Multiple Cameras
Color Bleeding from senders viewed from a grazing angle
Four cameras Placed manually Lower resolution
Overhead: 50%‐160% 1x fill‐rate 4x transform‐rate
![Page 21: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/21.jpg)
Extend Object‐based Techniques
Idea:Add SSDO on top of existing Global Illumination techniques
Example:Shadow Mapping Typical problem:
Details and contact shadows are lost due to the depth bias
Can be corrected in image space
p bP
l
Shadow Mapping, 218 fps
)( max br
![Page 22: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/22.jpg)
Extend Object‐based Techniques
Idea:Add SSDO on top of existing Global Illumination techniques
Example:Shadow Mapping Typical problem:
Details and contact shadows are lost due to the depth bias
Can be corrected in image space
rmax correction, 103 fps
Peeled correction,two depth layers, 73 fps
Shadow Mapping, 218 fps
![Page 23: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/23.jpg)
Application: Natural Illumination
![Page 24: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/24.jpg)
Overall Summary
SSDO: Screen‐Space Directional Occlusion Approximation of Global Illumination in image space Correctly oriented, colored shadows One bounce of indirect light possible Interactive to real‐time frame rates, independent of scene
complexity
![Page 25: Advanced Computer Graphics CS 563: Screen Space Real time ...emmanuel/courses/cs563/S12/slides/cs563_xin_w… · Screen‐Space Ambient Occlusion SSAO Used in current games Ambient](https://reader033.vdocuments.us/reader033/viewer/2022060901/609e6ce2f8ed486d4d6bf547/html5/thumbnails/25.jpg)
References
Approximating Dynamic Global Illumination in Image Space. Thorsten Grosch, ACM I3D ’09, Boston, MA
http://www.cnblogs.com/atyuwen/archive/2010/03/31/ssdo.html