Mon, Sep 28, 2009

Papervision SSAO phase II

In the example above, the SSAO layers brightness, contrast, alpha, blur and blend mode can be adjusted to achieve different effects. Included are 7 presets as examples of what can be achieved with just these parameters. Click and drag to reposition the camera.

Screen Space Ambient Occlusion is a post processing technique for approximating the shading achieved by ambient occlusion. Rather than using scene information such as geometry and lights to calculate shading, SSAO requires only a 2D depth buffer. For each pixel in the depth buffer multiple samples are taken from nearby and used to approximate the level of occlusion, this value can then be used to shade the output pixel.

The example scene above is made entirely of Papervision cubes and spheres and contains no lights and no shader materials. Each object renders it's bitmap texture as expected but also renders it's depth to the depth buffer. The depth buffer is filtered using my SSAO Pixel Bender kernel then blurred and brightness/contrast adjusted using standard Flash filters.

For a purely post processed effect the results are remarkably good adding a lot of depth to a flat scene. However there is still lots of room for improvement. The halo around objects could be minimized with a custom blur filter. The self-occluding surface issue is the result of no normal information and I have a few potential solutions for that. Still, not bad for phase 2!