Screen Space Ambient Occlusion
Encyclopedia
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 developed by Vladimir Kajalin while working at Crytek and was used for the first time in a video game in the 2007 PC game Crysis
made by Crytek
.
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 soft real-time applications like computer games.
Compared to other ambient occlusion
solutions, SSAO has the following advantages:
Of course, it has its disadvantages, as well:
Ambient occlusion
Ambient occlusion is a shading method used in 3D computer graphics which helps add realism to local reflection models by taking into account attenuation of light due to occlusion...
effect in real time. It was developed by Vladimir Kajalin while working at Crytek and was used for the first time in a video game in the 2007 PC game Crysis
Crysis
Crysis is a science fiction first-person shooter video game developed by Crytek , published by Electronic Arts for Microsoft Windows, and released in November 2007. It is the first game of a trilogy. A separate game entitled Crysis Warhead was released on September 12, 2008, and follows similar...
made by Crytek
Crytek
Crytek is a German video game company founded in 1999 by three Turkish brothers: Cevat, Avni and Faruk Yerli. Crytek's main headquarters are in Frankfurt, Germany, with five other studios in Kiev, Budapest, Nottingham, Sofia and Seoul. The company is best known for developing the game Far Cry and...
.
Implementation
The algorithm is implemented as a pixel shader, analyzing the scene depth buffer which is stored in a texture. For every pixelPixel
In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....
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 soft real-time applications like computer games.
Compared to other ambient occlusion
Ambient occlusion
Ambient occlusion is a shading method used in 3D computer graphics which helps add realism to local reflection models by taking into account attenuation of light due to 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
- CrysisCrysisCrysis is a science fiction first-person shooter video game developed by Crytek , published by Electronic Arts for Microsoft Windows, and released in November 2007. It is the first game of a trilogy. A separate game entitled Crysis Warhead was released on September 12, 2008, and follows similar...
(2007) (Windows) - Gears of War 2Gears of War 2Gears of War 2 is a third-person shooter video game developed by Epic Games with lead design by Cliff Bleszinski, and published by Microsoft Game Studios for the Xbox 360. It is the second installment of the Gears of War series. The game was officially released in North America, Europe and...
(2008) (Xbox 360) - S.T.A.L.K.E.R.: Clear SkyS.T.A.L.K.E.R.: Clear SkyS.T.A.L.K.E.R.: Clear Sky, is the prequel to S.T.A.L.K.E.R.: Shadow of Chernobyl, a first-person shooter video game by Ukrainian developer GSC Game World. The game consists of a roughly 50/50 mix of new areas and old, remodeled areas from the previous game...
(2008) (Windows) - Crysis WarheadCrysis WarheadCrysis Warhead is a science fiction first-person shooter computer game developed by the studio Crytek Budapest, Hungary, and published by Electronic Arts. Crysis Warhead is a stand-alone expansion game and does not require Crysis installed to play...
(2008) (Windows) - Bionic Commando (2009) (Windows and Xbox 360 versions)
- Burnout: Paradise the Ultimate BoxBurnout ParadiseBurnout Paradise is the seventh game in the Burnout racing video game series. It was developed by Criterion Games and published by Electronic Arts. It was released in January 2008 for PlayStation 3 and Xbox 360 and on February 5, 2009 for Microsoft Windows...
(2009) (Windows) - Empire: Total WarEmpire: Total WarEmpire: Total War is a turn-based strategy and real-time tactics computer game developed by The Creative Assembly and published by Sega. The fifth instalment in the Total War series, the game was released in North America on 3 March 2009, and in the rest of the world the following day...
(2009) (Windows) - Risen (2009) (Windows and Xbox 360 versions)
- BattleForgeBattleForgeBattleForge is a video game developed by EA Phenomic and published by Electronic Arts. It was released on Windows in March 2009. A demo was released in the same month...
(2009) (Windows) - BorderlandsBorderlands (video game)Borderlands is a science fiction based first-person shooter with RPG elements that was developed by Gearbox Software for PlayStation 3, Xbox 360, Microsoft Windows and Mac OS X. It was first revealed in the September 2007 issue of Game Informer magazine...
(2009) (Windows and Xbox 360 versions) - F.E.A.R. 2: Project Origin (2009) (Windows)
- Fight Night ChampionFight Night ChampionFight Night Champion is a boxing video game developed by EA Canada and published by EA Sports. It is the fifth entry in the Fight Night series and was released on March 1, 2011 for the PlayStation 3 and Xbox 360...
(2011) (PlayStation 3 and Xbox 360) - Batman: Arkham AsylumBatman: Arkham AsylumBatman: Arkham Asylum is a 2009 action-adventure stealth video game based on DC Comics' Batman developed for PlayStation 3, Xbox 360, Mac OS X and Microsoft Windows. It was developed by Rocksteady Studios and published by Eidos Interactive in conjunction with Warner Bros. Interactive Entertainment...
(2009) (Windows and Xbox 360 versions) - Uncharted 2: Among ThievesUncharted 2: Among ThievesUncharted 2: Among Thieves is an action-adventure platform third-person shooter video game developed by Naughty Dog and published by Sony Computer Entertainment for the PlayStation 3. It is the sequel to the 2007 game Uncharted: Drake's Fortune. It was first shown and announced on December 1, 2008...
(2009) (PlayStation 3) - Shattered HorizonShattered HorizonShattered Horizon is a first-person shooter video game developed and published by Futuremark Games Studio. The game was released on the Steam digital distribution service on 4 November 2009. On 19 November 2009, Futuremark Games Studio and Steam released three Guest Passes each to owners of the game...
(2009) (Windows) - NecroVisionNecrovisionis World War I "alternate" history horror first-person shooter developed by Polish developer The Farm 51 and published by 505 Games. It was released for the Microsoft Windows platform on 20 February 2009. The game was also published by Aspyr Media in the United States, on May 25, 2009, and Canada...
(2009) (Windows) - S.T.A.L.K.E.R.: Call of PripyatS.T.A.L.K.E.R.: Call of PripyatS.T.A.L.K.E.R.: Call of Pripyat is the sequel to S.T.A.L.K.E.R.: Shadow of Chernobyl, a first-person shooter computer game by Ukrainian developer GSC Game World. S.T.A.L.K.E.R.: Call of Pripyat is the third game in the S.T.A.L.K.E.R. series....
(2009) (Windows) - Red Faction: GuerrillaRed Faction: GuerrillaRed Faction: Guerrilla is an open-world third-person action video game developed by Volition, Inc. and published by THQ. It was released for the PlayStation 3 and Xbox 360 in June 2009 and for Microsoft Windows in September 2009...
(2009) (Windows) - Napoleon: Total WarNapoleon: Total WarNapoleon: Total War is a turn-based strategy and real-time tactics video game developed by The Creative Assembly and published by Sega for the PC. Napoleon was released in North America on 23 February 2010, and in Europe on February 26. The game is the sixth stand-alone instalment in the Total...
(2010) (Windows) - Star Trek OnlineStar Trek OnlineStar Trek Online, often abbreviated as STO, is a massively multiplayer online role-playing game developed by Cryptic Studios based on the popular Star Trek series created by Gene Roddenberry. The game is set in the 25th century, 30 years after the events of Star Trek Nemesis...
(2010) (Windows) - Just Cause 2Just Cause 2Just Cause 2 is an open world action-adventure video game developed by Avalanche Studios, published by Eidos Interactive, and distributed by Square Enix. It is the sequel to the 2006 video game Just Cause....
(2010) (Windows) - Metro 2033 (2010) (Windows and Xbox 360 versions)
- Dead to Rights: RetributionDead to Rights: RetributionDead to Rights: Retribution is a 2010 third-person action game. It is the reboot of the Dead to Rights franchise. Featuring, Grant City police officer Jack Slate and his canine companion Shadow. Developed by Volatile Games and published by Namco Bandai Games for the Xbox 360 and PlayStation 3,...
(2010) (PlayStation 3 and Xbox 360) - Alan WakeAlan WakeAlan Wake is a story-driven action game in the psychological thriller genre, developed by Remedy Entertainment and published by Microsoft Game Studios, released for the Xbox 360 video game console in 2010...
(2010) (Xbox 360) - Toy Story 3: The Video GameToy Story 3: The Video GameToy Story 3: The Video Game is a platform video game loosely based on the film Toy Story 3. It was published by Disney Interactive Studios and developed by Avalanche Software , Asobo Studio and n-Space...
(2010) (PlayStation 3 and Xbox 360) - Eve OnlineEVE OnlineEve Online is a video game by CCP Games. It is a player-driven, persistent-world MMORPG set in a science fiction space setting. Characters pilot customizable ships through a galaxy of over 7,500 star systems. Most star systems are connected to one or more other star systems by means of stargates...
(Nvidia GPUs only) - Halo: ReachHalo: ReachHalo: Reach is a first-person shooter video game developed by Bungie and published by Microsoft Game Studios for the Xbox 360 console. Reach was released in North America, Australia, and Europe on September 14, 2010. The game takes place in the year 2552, where humanity is locked in a war with the...
(2010) (Xbox 360) - Transformers: War for CybertronTransformers: War for CybertronTransformers: War for Cybertron is a third-person shooter video game developed by High Moon Studios and published by Activision. It was released in North America on June 22, 2010 and in PAL regions on June 25, 2010 for Xbox 360, PlayStation 3, and PC. Two portable versions were released for the...
(2010) (PlayStation 3 and Xbox 360) - StarCraft II: Wings of Liberty (2010) (Windows) (after Patch 1.2.0 released 1/12/2011)
- City of HeroesCity of HeroesCity of Heroes is a massively multiplayer online role-playing game based on the superhero comic book genre, developed by Cryptic Studios and published by NCsoft. The game was launched in North America on April 27, 2004 and in Europe on February 4, 2005 with English, German and French language...
(2010) (Windows) - ArmA 2: Operation ArrowheadArmA 2ARMA 2 is a tactical shooter video game for the PC developed by Bohemia Interactive Studio. It is considered the spiritual successor in the Operation Flashpoint-series following its predecessor, ArmA: Armed Assault . ARMA 2 was released in June and July 2009...
(2010) (Windows) - The Settlers 7: Paths to a KingdomThe Settlers 7: Paths to a KingdomThe Settlers 7: Paths to a Kingdom is a real time strategy and city-building video game developed by Blue Byte Software and published by Ubisoft. It was released on March 23, 2010 for Microsoft Windows and Mac OS X. It is the seventh game in The Settlers series.-Gameplay:Paths to a Kingdom features...
(2010) (Windows) - Mafia IIMafia IIMafia II is a third-person action-adventure video game, the sequel to Mafia: The City of Lost Heaven. It is developed by 2K Czech, previously known as Illusion Softworks, and is published by 2K Games...
(2010) (Windows and Xbox 360) - Amnesia: The Dark DescentAmnesia: The Dark DescentAmnesia: The Dark Descent is a survival horror video game by Frictional Games, who previously developed the Penumbra series. Released for Windows, Mac OS X, and Linux platforms, the game features an unarmed protagonist exploring a dark and foreboding castle, while avoiding monsters and other...
(2010) (Windows) - Arcania: A Gothic Tale (2010) (Windows)
- Assassin's Creed: BrotherhoodAssassin's Creed: BrotherhoodAssassin's Creed: Brotherhood is a historical third person, stealth action-adventure video game developed by Ubisoft for PlayStation 3, Xbox 360, Microsoft Windows and Mac OS X. It was released for PlayStation 3 and Xbox 360 in November 2010, Microsoft Windows in March 2011 and Mac OS X in May 2011...
(2010) (PlayStation 3 and Xbox 360) - Battlefield: Bad Company 2Battlefield: Bad Company 2Battlefield: Bad Company 2 is a first-person shooter video game developed by the Swedish firm EA Digital Illusions CE and published by Electronic Arts for Microsoft Windows, PlayStation 3, Xbox 360, iOS and Mac OS X systems. It is a direct sequel to Battlefield: Bad Company and is part of the...
(2010) (Windows) (uses HBAO - improved form of SSAO) - James Bond 007: Blood StoneJames Bond 007: Blood StoneJames Bond 007: Blood Stone is an action-adventure video game, developed by Bizarre Creations and published by Activision for the Microsoft Windows, Nintendo DS, PlayStation 3 and Xbox 360 platforms. It is the 24th game in the James Bond series although it is not a direct sequel to any game; it is...
(2010) (PlayStation 3, Xbox 360 and Windows) - Dragon Age IIDragon Age IIDragon Age II is a role-playing video game developed by BioWare's Edmonton studios, and published by Electronic Arts. It is the second major game in BioWare's Dragon Age franchise...
(2011) (Windows) - Crysis 2Crysis 2Crysis 2 is a first-person shooter video game developed by Crytek, published by Electronic Arts and released in North America, Australia, and Europe in March 2011 for Microsoft Windows, PlayStation 3, and Xbox 360...
(2011) (Windows, Xbox 360 and PlayStation 3) - IL-2 Sturmovik: Cliffs of Dover (2011) (Windows)
- The Witcher 2: Assassins of KingsThe Witcher 2: Assassins of KingsThe Witcher 2: Assassins of Kings is a third-person role-playing video game developed by Polish studio CD Projekt RED for Microsoft Windows and Xbox 360. It is a sequel to the 2007 video game The Witcher, and was released internationally on May 17, 2011. Just like its predecessor, the game is based...
(2011) (Windows) - L.A. NoireL.A. NoireL.A. Noire is a 2011 crime video game developed by Team Bondi and published by Rockstar Games. It was released for PlayStation 3, Xbox 360, Microsoft Windows. It was released as a 3-disc game for the Xbox 360 console, which prompts the player to switch to another disc at certain points in the...
(2011) (PlayStation 3 and Xbox 360) - Infamous 2Infamous 2Infamous 2, stylized as inFAMOUS 2, is a 2011 open world video game for the PlayStation 3 video game console developed by Sucker Punch Productions and published by Sony Computer Entertainment...
(2011) (PlayStation 3) - Deus Ex: Human Revolution (2011) (PlayStation 3, Xbox 360 and Windows)
- Dead IslandDead IslandDead Island is a first person horror action-adventure video game developed by Techland and published by Deep Silver for Microsoft Windows, Xbox 360, and PlayStation 3. It is centered on the challenge of survival on a zombie-infested open world island with a major emphasis on melee combat. It was...
(2011) (PlayStation 3, Xbox 360 and Windows) - Battlefield 3Battlefield 3Battlefield 3 is a first-person shooter video game developed by EA Digital Illusions CE and published by Electronic Arts. The game was released in North America on October 25, 2011 and in Europe on October 28, 2011 for Microsoft Windows, PlayStation 3, Xbox 360 and EA Mobile confirmed a port for...
(2011) (PlayStation 3, Xbox 360 and Windows) - Call of Duty: Modern Warfare 3Call of Duty: Modern Warfare 3Call of Duty: Modern Warfare 3 is a first-person shooter video game, developed by Infinity Ward and Sledgehammer Games, with Raven Software having assisted in development...
(2011) (Windows version only) - Saints Row: The Third (2011) (PlayStation 3, Xbox 360 and Windows)
See also
- Ambient occlusionAmbient occlusionAmbient occlusion is a shading method used in 3D computer graphics which helps add realism to local reflection models by taking into account attenuation of light due to occlusion...
- CryEngine 2, CryEngine 3
- Leadwerks EngineLeadwerks EngineThe Leadwerks Engine is a 3D game engine powered by OpenGL 2.1. It was designed by Leadwerks Software. Leadwerks Engine 2.0 made its debut in The Game Creators May Newsletter on May 1, 2008. The engine makes use of the Newton Game Dynamics SDK 2.0 for physics, and OpenAL and EAX for sound and 3D...
- Unreal Engine 3Unreal Engine 3Unreal Engine 3 is a computer game engine developed by Epic Games. It is the third generation of Unreal Engine, designed for DirectX 9/10/11 personal computers , the Xbox 360, the PlayStation 3, the PlayStation Vita, the Wii U, Android and OpenGL-based operating systems such as iOS and Mac OS X...
- UnigineUnigineUnigine Engine is a proprietary cross-platform computer graphics middleware, developed by Unigine Corp. It is used as either a game engine or as an engine for virtual reality systems, serious games and visualization. The most popular Unigine-powered product is .The strongest feature of Unigine is...
- Unity EngineUnity (game engine)Unity is an integrated authoring tool for creating 3D video games or other interactive content such as architectural visualizations or real-time 3D animations. Unity's development environment runs on Microsoft Windows and Mac OS X, and the games it produces can be run on Windows, Mac, Xbox 360,...
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 )