Jump to content

Screen space ambient occlusion: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Tag: section blanking
Force God (talk | contribs)
No edit summary
 
(18 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{short description|Implementation of an ambient occlusion illumination in computer graphics}}
'''Screen space ambient occlusion''' ('''SSAO''') is a [[computer graphics]] technique for efficiently approximating the [[ambient occlusion]] effect in real time. It was developed by Vladimir Kajalin while working at [[Crytek]] and was used for the first time in 2007 by the video game ''[[Crysis]]'', also developed by Crytek.

'''Screen space ambient occlusion''' ('''SSAO''') is a [[computer graphics]] technique for efficiently approximating the [[ambient occlusion]] effect in real time. It was developed by Vladimir Kajalin while working at [[Crytek]] and was used for the first time in 2007 by the video game ''[[Crysis (video game)|Crysis]]'', also developed by Crytek.<ref name="urlWhat is Ambient Occlusion? Does it Matter in Games?">{{cite web |url=https://thewiredshopper.com/ambient-occlusion/?nonitro=1 |title=What is Ambient Occlusion? Does it Matter in Games? |format= |accessdate=}}</ref>

==Implementation==
[[File:Screen space ambient occlusion.jpg|right|thumb|250px|SSAO component of a typical game scene]]

The algorithm is implemented as a [[pixel shader]], analyzing the scene [[depth buffer]] which is stored in a texture. For every [[pixel]] on the screen, the pixel shader samples the depth values around the current pixel and tries to compute the amount of occlusion from each of the sampled points. In its simplest implementation, the occlusion factor depends only on the depth difference between sampled point and current point.

Without additional smart solutions, such a brute force method would require about 200 texture reads per pixel for good visual quality. This is not acceptable for [[real-time rendering]] on current graphics hardware. In order to get high quality results with far fewer reads, sampling is performed using a randomly rotated [[Kernel (image processing)|kernel]]. The kernel orientation is repeated every ''N'' screen pixels in order to have only high-frequency noise in the final picture. In the end this high frequency noise is greatly removed by a ''N''x''N'' post-process blurring step taking into account depth discontinuities (using methods such as comparing adjacent normals and depths). Such a solution allows a reduction in the number of depth samples per pixel to about 16 or fewer while maintaining a high quality result, and allows the use of SSAO in soft real-time applications like computer games.

Compared to other [[ambient occlusion]] solutions, SSAO has the following advantages:
* Independent from scene complexity.
* No data pre-processing needed, no loading time and no memory allocations in system memory.
* Works with dynamic scenes.
* Works in the same consistent way for every pixel on the screen.
* No [[CPU]] usage – it can be executed completely on the [[GPU]].
* May be easily integrated into any modern [[graphics pipeline]].

SSAO also has the following disadvantages:
* Rather local and in many cases view-dependent, as it is dependent on adjacent texel depths which may be generated by any geometry whatsoever.
* Hard to correctly smooth/blur out the noise without interfering with depth discontinuities, such as object edges (the occlusion should not "bleed" onto objects).
<!--

TODO SECTION, add technical implementation details
==Technical implementation details==

-->


==See also==
==See also==

{{portal|computer graphics}}
*[[Ambient occlusion]]
*[[Screen space directional occlusion]] (SSDO)<ref>{{cite web|author1=Tobias Ritschel|author2=Thorsten Grosch|author3=Hans-Peter Seidel|title=Approximating Dynamic Global Illumination in Image Space|url=http://people.mpi-inf.mpg.de/~ritschel/SSDO/|publisher=Proceedings ACM SIGGRAPH Symposium on Interactive 3D Graphics and Games|accessdate=25 November 2015|date=2009}}</ref>
*[[Screen space directional occlusion]] (SSDO)<ref>{{cite web|author1=Tobias Ritschel|author2=Thorsten Grosch|author3=Hans-Peter Seidel|title=Approximating Dynamic Global Illumination in Image Space|url=http://people.mpi-inf.mpg.de/~ritschel/SSDO/|publisher=Proceedings ACM SIGGRAPH Symposium on Interactive 3D Graphics and Games|accessdate=25 November 2015|date=2009}}</ref>
<!-- *[[Horizon-based ambient occlusion]] (HBAO) : Hiding as this is a redirect to a non-existent entry -->
<!-- *[[Horizon-based ambient occlusion]] (HBAO) : Hiding as this is a redirect to a non-existent entry -->
Line 11: Line 37:


==External links==
==External links==
* [http://delivery.acm.org/10.1145/1290000/1281671/p97-mittring.pdf?key1=1281671&key2=9942678811&coll=ACM&dl=ACM&CFID=15151515&CFTOKEN=6184618 Finding Next Gen – CryEngine 2]
* [https://web.archive.org/web/20090219082501/http://delivery.acm.org/10.1145/1290000/1281671/p97-mittring.pdf?key1=1281671&key2=9942678811&coll=ACM&dl=ACM&CFID=15151515&CFTOKEN=6184618 Finding Next Gen – CryEngine 2]
* [https://www.youtube.com/watch?v=ifdAILHTcZk Video showing SSAO in action]
* [https://www.youtube.com/watch?v=ifdAILHTcZk Video showing SSAO in action]
* [http://graphics.uni-konstanz.de/publikationen/2006/unsharp_masking/Luft%20et%20al.%20--%20Image%20Enhancement%20by%20Unsharp%20Masking%20the%20Depth%20Buffer.pdf Image Enhancement by Unsharp Masking the Depth Buffer]
* [http://graphics.uni-konstanz.de/publikationen/2006/unsharp_masking/Luft%20et%20al.%20--%20Image%20Enhancement%20by%20Unsharp%20Masking%20the%20Depth%20Buffer.pdf Image Enhancement by Unsharp Masking the Depth Buffer]
Line 19: Line 45:
* [http://www.pastebin.ca/953523 Source code of SSAO shader used in Crysis]
* [http://www.pastebin.ca/953523 Source code of SSAO shader used in Crysis]
* [http://www.mpi-inf.mpg.de/~ritschel/Papers/SSDO.pdf Approximating Dynamic Global Illumination in Image Space]
* [http://www.mpi-inf.mpg.de/~ritschel/Papers/SSDO.pdf Approximating Dynamic Global Illumination in Image Space]
* [http://www.gamedev.net/community/forums/topic.asp?topic_id=527170 Accumulative Screen Space Ambient Occlusion]
* [https://web.archive.org/web/20090324081000/http://www.gamedev.net/community/forums/topic.asp?topic_id=527170 Accumulative Screen Space Ambient Occlusion]
* [http://www.nzone.com/object/nzone_ambientocclusion_home.html NVIDIA has integrated SSAO into drivers]
* [http://www.nzone.com/object/nzone_ambientocclusion_home.html NVIDIA has integrated SSAO into drivers]
* [http://www.shaderx7.com/TOC.html Several methods of SSAO are described in ShaderX7 book]
* [http://www.shaderx7.com/TOC.html Several methods of SSAO are described in ShaderX7 book]
Line 25: Line 51:
* [http://www.john-chapman.net/content.php?id=8 SSAO Tutorial, extension of the technique used in Crysis]
* [http://www.john-chapman.net/content.php?id=8 SSAO Tutorial, extension of the technique used in Crysis]


[[Category:Shading]]
[[Category:Computer graphics]]
[[Category:3D computer graphics]]
[[Category:Global illumination algorithms]]
[[Category:Global illumination algorithms]]

Latest revision as of 07:42, 7 February 2024

Screen space ambient occlusion (SSAO) is a computer graphics technique for efficiently approximating the ambient occlusion effect in real time. It was developed by Vladimir Kajalin while working at Crytek and was used for the first time in 2007 by the video game Crysis, also developed by Crytek.[1]

Implementation

[edit]
SSAO component of a typical game scene

The algorithm is implemented as a pixel shader, analyzing the scene depth buffer which is stored in a texture. For every pixel on the screen, the pixel shader samples the depth values around the current pixel and tries to compute the amount of occlusion from each of the sampled points. In its simplest implementation, the occlusion factor depends only on the depth difference between sampled point and current point.

Without additional smart solutions, such a brute force method would require about 200 texture reads per pixel for good visual quality. This is not acceptable for real-time rendering on current graphics hardware. In order to get high quality results with far fewer reads, sampling is performed using a randomly rotated kernel. The kernel orientation is repeated every N screen pixels in order to have only high-frequency noise in the final picture. In the end this high frequency noise is greatly removed by a NxN post-process blurring step taking into account depth discontinuities (using methods such as comparing adjacent normals and depths). Such a solution allows a reduction in the number of depth samples per pixel to about 16 or fewer while maintaining a high quality result, and allows the use of SSAO in soft real-time applications like computer games.

Compared to other ambient occlusion solutions, SSAO has the following advantages:

  • Independent from scene complexity.
  • No data pre-processing needed, no loading time and no memory allocations in system memory.
  • Works with dynamic scenes.
  • Works in the same consistent way for every pixel on the screen.
  • No CPU usage – it can be executed completely on the GPU.
  • May be easily integrated into any modern graphics pipeline.

SSAO also has the following disadvantages:

  • Rather local and in many cases view-dependent, as it is dependent on adjacent texel depths which may be generated by any geometry whatsoever.
  • Hard to correctly smooth/blur out the noise without interfering with depth discontinuities, such as object edges (the occlusion should not "bleed" onto objects).

See also

[edit]

References

[edit]
  1. ^ "What is Ambient Occlusion? Does it Matter in Games?".
  2. ^ Tobias Ritschel; Thorsten Grosch; Hans-Peter Seidel (2009). "Approximating Dynamic Global Illumination in Image Space". Proceedings ACM SIGGRAPH Symposium on Interactive 3D Graphics and Games. Retrieved 25 November 2015.
[edit]