Difference between revisions of "Screen Space Ambient Occlusion (SSAO)"

From Valve Developer Community
Jump to: navigation, search
Line 1: Line 1:
 
{{stub}}
 
{{stub}}
 
[[File:AmbientOcclusionExample.jpg|right|210px|thumb|An example of traditional ''prerendered'' ambient occlusion in Blender 3D. SSAO attempts to mimic this look in real-time.]]
 
[[File:AmbientOcclusionExample.jpg|right|210px|thumb|An example of traditional ''prerendered'' ambient occlusion in Blender 3D. SSAO attempts to mimic this look in real-time.]]
 +
{{TODO|Expand the article to include different methods of SSAO. The method described is one of many.}}<br>
 
'''Ambient Occlusion (AO)''' is a type of fake [[lighting]] technique applied to create the appearance of more realistic lighting. AO simulates global ambient lighting, creating the appearance of soft shadows between surfaces that are close together. This process is completely independent of normal lighting calculations and therefore is not influenced by the lights in a scene. The look of AO can be rendered in real-time through '''[[Wikipedia:Screen Space Ambient Occlusion|Screen Space Ambient Occlusion (SSAO)]]''', a shading method which is able to closely simulate the effects of real AO with little loss of performance.
 
'''Ambient Occlusion (AO)''' is a type of fake [[lighting]] technique applied to create the appearance of more realistic lighting. AO simulates global ambient lighting, creating the appearance of soft shadows between surfaces that are close together. This process is completely independent of normal lighting calculations and therefore is not influenced by the lights in a scene. The look of AO can be rendered in real-time through '''[[Wikipedia:Screen Space Ambient Occlusion|Screen Space Ambient Occlusion (SSAO)]]''', a shading method which is able to closely simulate the effects of real AO with little loss of performance.
  
Line 11: Line 12:
 
== SSAO in the Source Engine ==
 
== SSAO in the Source Engine ==
 
{{Note|For faked Ambient Occlusion per model within the Source Engine, see [[$ambientocclusion]].}}
 
{{Note|For faked Ambient Occlusion per model within the Source Engine, see [[$ambientocclusion]].}}
{{TODO|Write a tutorial on how to increase the drawn depth in Source's depth buffer. SSAO will only work 128 units ahead unless this is done first.}}
+
{{TODO|Write a tutorial on creating an SSAO shader and implementing it into the engine. See [[Shader Authoring]].}}
<br>{{TODO|Write a tutorial on creating an SSAO shader and implementing it into the engine. See [[Shader Authoring]].}}
 
  
  

Revision as of 00:42, 18 January 2011

An example of traditional prerendered ambient occlusion in Blender 3D. SSAO attempts to mimic this look in real-time.

To do: Expand the article to include different methods of SSAO. The method described is one of many.
Ambient Occlusion (AO) is a type of fake lighting technique applied to create the appearance of more realistic lighting. AO simulates global ambient lighting, creating the appearance of soft shadows between surfaces that are close together. This process is completely independent of normal lighting calculations and therefore is not influenced by the lights in a scene. The look of AO can be rendered in real-time 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.

Screen space ambient occlusion 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.

As with traditional AO, SSAO is completely independent of the normal lighting system. This means that both the performance and appearance of the shader are unaffected by the lights used in a level.

The depth buffer is measured from the camera, and so SSAO is view-dependent - the size and locations of the "shadows" created by SSAO may change as the player moves the camera around. Additionally, the shading may look different along the edges of the screen - this can be combated by rendering additional information outside of the current camera's bounds.

SSAO in the Source Engine

Note.png Note: For faked Ambient Occlusion per model within the Source Engine, see $ambientocclusion.

To do: Write a tutorial on creating an SSAO shader and implementing it into the engine. See Shader Authoring.


External links