Screen Space Ambient Occlusion (SSAO): Difference between revisions
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
{{Note|Enabling Nvidia's forced SSAO can cause significant performance penalties.}} | {{Note|Enabling Nvidia's forced SSAO can cause significant performance penalties.}} | ||
==Supported games== | ==Supported games== | ||
[[{{ns:6}}:Prop ragdoll.jpg|thumb| | [[{{ns:6}}:Prop ragdoll.jpg|thumb|right|250px|Nvidia's SSAO implementation in game - the shading effect is highly visible between Breen and the table, and in the corners of the room. Note the edge "glow" bug around Breen's arm.]] | ||
All [[Source]] engine games except [[Portal]] have driver profiles to enable Nvidia's SSAO. SSAO in Portal can be forced on by editing Portal's driver profile with an external application such as nHancer. | All [[Source]] engine games except [[Portal]] have driver profiles to enable Nvidia's SSAO. SSAO in Portal can be forced on by editing Portal's driver profile with an external application such as nHancer. | ||
==Graphical Bugs== | ==Graphical Bugs== | ||
[[{{ns:6}}:Ao_renderbug_trees.jpg|thumb|left|200px|The shadows being rendered on top of fog are noticable on distant trees.]] | [[{{ns:6}}:Ao_renderbug_trees.jpg|thumb|left|200px|The shadows being rendered on top of fog are noticable on distant trees.]] | ||
Nvidia's SSAO implmentation was designed to be general purpose, and as such, does not take a lot of Source's stock effects into account during it's calculations. This leads to bleeding in scenes with heavy fog, which can be seen on the picture below. As a fault of the actual SSAO shader, Ghosting and other related artifacts, pictured on the image above, can occur. It is recommended that you use a more modern SSAO implementation that takes the scene's normals into account if you intend to design your own shader for use in Source. | Nvidia's SSAO implmentation was designed to be general purpose, and as such, does not take a lot of Source's stock effects into account during it's calculations. This leads to bleeding in scenes with heavy fog, which can be seen on the picture below. As a fault of the actual SSAO shader, Ghosting and other related artifacts, pictured on the image above, can occur. It is recommended that you use a more modern SSAO implementation that takes the scene's normals into account if you intend to design your own shader for use in Source. |
Revision as of 19:36, 22 December 2010
Ambient Occlusion (AO) is a type of lighting technique applied in-game to create more realistic lighting. AO simulates soft shadows created by two surfaces that are close together. Typically AO is rendered in realtime through Screen Space Ambient Occlusion (SSAO), a shading method which is able to closely simulate the effects of real AO with little loss of performance.
SSAO works by examining an onscreen pixel, and then comparing its location in the depth buffer to the pixels around it. Pixels which are close together but not coplanar (on the same face) are shaded to simulate soft shadows. To maintain playable framerates, it is not possible to sample every pixel every frame, so random sampling is used, which will inevitably create noise/grain which may be more noticeable with movement. To counter this, the SSAO pass is often Gaussian blurred to remove such grain.
The depth buffer is measured from the camera, and as a result SSAO is viewing-angle dependent - the shading may look different depending on where the camera is located. This can be combated by rendering additional information outside of the current camera's bounds.
SSAO in the Source Engine

Enabling and Using Nvidia's Forced Driver SSAO
Nvidia's drivers feature a method that allows for SSAO to be forced on in almost any game, thanks to a clever method of hooking into the current render process and retrieving the current scene's depth buffer through the video driver. Enabling this driver feature is as simple as turning it on within Nvidia's driver control panel.

Supported games
All Source engine games except Portal have driver profiles to enable Nvidia's SSAO. SSAO in Portal can be forced on by editing Portal's driver profile with an external application such as nHancer.
Graphical Bugs
Nvidia's SSAO implmentation was designed to be general purpose, and as such, does not take a lot of Source's stock effects into account during it's calculations. This leads to bleeding in scenes with heavy fog, which can be seen on the picture below. As a fault of the actual SSAO shader, Ghosting and other related artifacts, pictured on the image above, can occur. It is recommended that you use a more modern SSAO implementation that takes the scene's normals into account if you intend to design your own shader for use in Source.