Screen space ambient occlusion
Screen Space Ambient Occlusion (SSAO) is a rendering technique for efficiently approximating the well-known computer graphics ambient occlusion effect in real time. It was used for the first time in a video game in the 2007 PC game Crysis made by Crytek.
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 modern 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 less while maintaining a high quality result, and allows the use of SSAO in 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.
Of course, it has its disadvantages, as well:
- 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).
Games using SSAO
- Crysis (2007) (PC)
- Crysis Warhead (2008) (PC)
- Battlefield: Bad Company 2 (2010) (PC)
- Gears of War 2 (2008) (Xbox 360)
- S.T.A.L.K.E.R.: Clear Sky (2008) (PC)
- Bionic Commando (2009) (PC and Xbox 360 version)
- Burnout: Paradise the Ultimate Box (2009) (PC)
- Empire: Total War (2009) (PC)
- Napoleon: Total War (2010) (PC)
- Risen (2009) (PC and Xbox 360 version)
- BattleForge (2009) (PC)
- Borderlands (2009) (PC and Xbox 360 version)
- F.E.A.R. 2: Project Origin (2009) (PC)
- Fight Night Round 4 (2009) (PlayStation 3 and Xbox 360)
- Batman: Arkham Asylum (2009) (PC and Xbox 360)
- Uncharted 2: Among Thieves (2009) (Playstation 3)
- Shattered Horizon (2009) (PC)
- NecroVision (2009) (PC)
- The Saboteur (2009) (Playstation 3, Xbox 360, and PC)
- S.T.A.L.K.E.R.: Call of Pripyat (2009) (PC)
- Red Faction: Guerrilla (2009) (PC)
- Star Trek Online (2010) (PC)
- Just Cause 2 (2010) (PC)
- Metro 2033 (2010) (PC and Xbox 360 version)
- Dead to Rights: Retribution (2010) (PlayStation 3 and Xbox 360)
- Alan Wake (2010) (Xbox 360)[1]
- Toy Story 3: The Video Game (2010) (PlayStation 3 and Xbox 360) [2]
- Halo: Reach (2010) (Xbox 360)[3][4]
- Starcraft II (2010) (PC)
- City of Heroes (2010) (PC) [5]
- ArmA 2: Operation Arrowhead (2010) (PC)[6]
- The Settlers 7: Paths to a Kingdom (2010) (PC) [7]
- Mafia II (2010) (PC)
- Amnesia: The Dark Descent (2010) (PC)
- Final Fantasy XIV (2010) (PC)
- Arcania: A Gothic Tale (2010) (PC)
- Assassin's Creed: Brotherhood (2010) (PlayStation 3 and Xbox 360)[8]
- LittleBigPlanet 2 (2011) (PlayStation 3)
- StarCraft II: Wings of Liberty (2010) (PC) (after Patch 1.2.0 released 1/12/2011)[9]
See also
References
- ^ http://forum.alanwake.com/showthread.php?t=1216
- ^ http://en.wikipedia.org/wiki/Toy_Story_3:_The_Video_Game
- ^ http://www.bungie.net/News/content.aspx?type=topnews&link=BWU_041610
- ^ http://www.eurogamer.net/articles/digitalfoundry-haloreach-beta-analysis-blog-entry
- ^ http://www.cityofheroes.com/news/patch_notes/issue_17_release_notes.html
- ^ http://community.bistudio.com/wiki?title=Ask_Bohemia_%28about_Operation_Arrowhead..._or_anything_else_you_want_to_ask%29%21&rcid=57637#Improvements_In_The_Original_ARMA_2_Game
- ^ http://www.youtube.com/watch?v=uDFqgLSAPzU
- ^ http://www.eurogamer.net/articles/digitalfoundry-assassins-creed-brotherhood-face-off?page=2
- ^ http://us.battle.net/sc2/en/blog/2053470
External links
- Finding Next Gen – CryEngine 2
- Video showing SSAO in action
- Image Enhancement by Unsharp Masking the Depth Buffer
- Hardware Accelerated Ambient Occlusion Techniques on GPUs
- Overview on Screen Space Ambient Occlusion Techniques
- Real-Time Depth Buffer Based Ambient Occlusion
- Source code of SSAO shader used in Crysis
- Approximating Dynamic Global Illumination in Image Space
- Accumulative Screen Space Ambient Occlusion
- NVIDIA has integrated SSAO into drivers
- Several methods of SSAO are described in ShaderX7 book
- SSAO Shader ( Russian )