ambient occlusion screen space - chalmers · horizon based ambient occlusion: hbao v is the...
TRANSCRIPT
![Page 1: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/1.jpg)
Screen Space Ambient Occlusion
Daniel Kvarfordt & Benjamin Lillandt
![Page 2: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/2.jpg)
Ambient light
● Same from all directions.● Lambertian shading doesn't show form well.
● Need shadows to see form.
● Global illumination can be used, but is expensive.
![Page 3: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/3.jpg)
Ambient occlusion
AO is the amount of ambient light that is stopped from reaching a point.
Calculate diffuse shadows from ambient light.
![Page 4: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/4.jpg)
Examples: Cryengine 2
![Page 5: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/5.jpg)
Ambient occlusion
Little occlusion - light A lot of occlusion - dark
![Page 6: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/6.jpg)
Irradiance from ambient light without ambient occlusion
E(p,n) surface irradianceOmega hemisphere at pLA ambient incoming irradiance
Constant value for all points and normals
![Page 7: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/7.jpg)
Visibility v(p,l) is 0 or 1 depending on if the direction l is occluded or not.
Irradiance from ambient light with ambient occlusion
Little occlusion A lot of occlusion
![Page 8: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/8.jpg)
Ambient occlusion value (factor)
Darkening factor kA between 0 (fully occluded) and 1 (fully visible).
![Page 9: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/9.jpg)
Using the ambient occlusion value kA, the ambient irradiance equation becomes simple:
![Page 10: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/10.jpg)
How to compute the occlusion values kA(p) in real time
● In object space○ Raycasting against geometry○ Slow, requires simplifications and/or spatial data
structures○ Depends of scene complexity
● In screen space○ Done in a post-rendering pass○ No pre-processing required○ Doesn't depend on scene complexity○ Simple○ Not physically accurate
![Page 11: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/11.jpg)
Ambient occlusion approximation: limited radius
Limit to local occlusion in a hemisphere of radius R. More efficient and works better in enclosed areas such as indoors, that would be fully occluded otherwise.
R
R
![Page 12: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/12.jpg)
SSAO:Ambient occlusion using the z-buffer
Use the readily available depth buffer as an approximation of the scene geometry.Take samples in a sphere around each pixel and test against buffer.
viewdirectiondepth
![Page 13: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/13.jpg)
SSAO:Ambient occlusion using the z-buffer
If more than half of the samples are inside, AO is applied, amount depending on ratio of samples that pass and fail depth test.Uses sphere instead of hemisphere, since normal information isn't available.
viewdirectiondepth
![Page 14: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/14.jpg)
SSAO:Ambient occlusion using the z-buffer
Approximation of the scene geometry, some fails are incorrect. The one behind the red line for example. False occlusions.Samples are not weighted by cos(theta), so not physically accurate, but looks convincing.
viewdirectiondepth
![Page 15: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/15.jpg)
Occlusion functionOcclusion function used to relate to sample depth delta and distance from the central point
● Negative depth deltas give zero occlusion● Small positive depth delta produces high occlusion term● Large positive depth delta tend to zero (calculation happens in screen space)● Simple exponentials or lookups used
Advanced ComputerGraphicsCS 563: Screen SpaceGI Techniques: Real‐Time WilliamDiSanto
![Page 16: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/16.jpg)
SSAO: False occlusions, halos
No SSAO SSAO
![Page 17: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/17.jpg)
SSAO: Full geometry not known
SSAO "Real" AO
Images from "Multi-Layer Dual-Resolution Screen-Space Ambient Occlusion" Louis Bavoil, Miguel Sainz 2009
Can be solved by rendering multiple layers of depth, "Depth peeling".
![Page 18: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/18.jpg)
Choosing samples● More samples -> greater accuracy● Many samples are needed for a good result,
but for performance only about 16 samples are used.
● Positions from randomized texture to avoid banding.
● Noisy result, blurred with edge preserving blur.
![Page 19: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/19.jpg)
Multi-Layer Dual-Resolution Screen-Space Ambient Occlusion, Louis Bavoil, Miguel Sainz, NVIDIAhttp://developer.download.nvidia.com/presentations/2009/SIGGRAPH/Bavoil_MultiLayerDualResolutionSSAO.pdf
![Page 20: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/20.jpg)
![Page 21: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/21.jpg)
Horizon based ambient occlusion: HBAOAlso done in screen space.Approximates ray-tracing the depth buffer.Requires that the normal is known, and only samples in a hemisphere.
Screen Space Ambient Occlusion, Louis Bavoil, Miguel Sainz 2008http://developer.download.nvidia.com/SDK/10.5/direct3d/Source/ScreenSpaceAO/doc/ScreenSpaceAO.pdf
![Page 22: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/22.jpg)
Horizon based ambient occlusion: HBAO
V is the visibility function, 0 or 1.W is an attenuation function.
Attenuates the contribution for each ray for a more accurate result. (normally based on distance from P to occlusion and angle from normal, I think)
Image-Space Horizon-Based Ambient Occlusion, Louis Bavoil, Miguel Sainz, Rouslan Dimitrov 2008http://dl.acm.org/citation.cfm?id=1401061
![Page 23: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/23.jpg)
Battlefield 3 - No SSAO
![Page 24: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/24.jpg)
Battlefield 3 - SSAO
![Page 25: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/25.jpg)
Battlefield 3 - HBAO
![Page 26: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/26.jpg)
Battlefield 3 - SSAO
![Page 27: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/27.jpg)
Battlefield 3 - HBAO
![Page 28: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/28.jpg)
Half resolution AO
AO is usually low frequency, so SSAO/HBAO is performed at half resolution for significant speedup.Smart blur is done using full resolution z-buffer to avoid edge bleeding.
![Page 29: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/29.jpg)
Half-res SSAO flickering
Small high frequency geometry like grass can cause flickering / shimmering due to the half resolution.
![Page 30: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/30.jpg)
Half-res SSAO flickering
Solution in Battlefield 3: Temporal filtering● AO is dependent only on scene geometry,
not camera position.● Use AO from last frame. Reproject it to the
current view and interpolate between new and old AO.
http://dice.se/wp-content/uploads/GDC12_Stable_SSAO_In_BF3_With_STF.pdf
![Page 31: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/31.jpg)
Other GI approximations in screen space
● SSDO○ Screen space directional occlusion○ Directional shadows○ Indirect color bleeding (bounces)○ See "Approximating Dynamic Global Illumination is Screen Space" by
Ritschel et al 2009.
Tobias Ritschel, Thorsten Grosch, Hans-Peter SeidelApproximating Dynamic Global Illumination in Screen SpaceProceedings ACM SIGRAPH Symposium on Interactive 3D Graphics and Games, Boston, MA, February 27—March 1, 2009.
http://www.mpi-inf.mpg.de/~ritschel/SSDO/
![Page 32: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/32.jpg)
Demo
![Page 33: Ambient Occlusion Screen Space - Chalmers · Horizon based ambient occlusion: HBAO V is the visibility function, 0 or 1. W is an attenuation function. Attenuates the contribution](https://reader034.vdocuments.mx/reader034/viewer/2022043014/5fb223f6e8e87e27bd70b837/html5/thumbnails/33.jpg)
Questions?
Linkshttp://developer.download.nvidia.com/SDK/10.5/direct3d/Source/ScreenSpaceAO/doc/ScreenSpaceAO.pdf
http://sirkan.iit.bme.hu/~szirmay/ambient8.pdf
http://developer.download.nvidia.com/presentations/2009/SIGGRAPH/Bavoil_MultiLayerDualResolutionSSAO.pdf
http://graphics.cs.williams.edu/papers/AOVHPG10/McGuire10AOVPoster.pdf
https://otik.uk.zcu.cz/bitstream/11025/1268/1/Sheer.pdf
http://www.cs.ncl.ac.uk/publications/trs/papers/1319.pdf
http://dl.acm.org/citation.cfm?id=1507161
http://web.cs.wpi.edu/~emmanuel/courses/cs563/S12/slides/cs563_Will_DiSanto_ssdo_wk6_p1.pdf
Temporal coherence
http://www.cg.tuwien.ac.at/~matt/gpupro/tssao.pdfhttp://www.cg.tuwien.ac.at/~matt/tssao/ssao.pdfhttp://dice.se/publications/stable-ssao-in-battlefield-3-with-selective-temporal-filtering/