28 June 2008. I just ran across IƱigo Quilez – RGBA’s treasure trove of AO experimentation and research references. He’s the rgba responsible for the SSAO demos kindernoiser and kindercrasher. This explanation of the lighting in Plastic 195/95/256 is an example of the quality, in depth information you’ll find there.
Plastic by RGBA.
Screen-Space Ambient Occlusion has recently been popularized by Crytek’s Martin Mittring in a presentation at Siggraph 2007, see section 8.5.4.3 for details. The basic idea is to do a full screen pass wherein z-buffer data is sampled around each pixel and a darkening value is computed based on depth differences. Sampling occurs randomly in three space in a sphere around each pixel (see the paragraph for details), and darkening is proportional to the number of sampled occluders. Here’s an example of their results:

Some debate on the technique has occurred on gamedev.net, with the initial discussion here resulting in an algorithm and techniques for resolving sampling artifacts that occur on flat gradients in the scene. Ultimately a nice 4k demo using the technique on rendered Julia fractals is presented. This method based strictly on depth sampling works best with this sort of highly detailed geometry.
25 May 2008. A new version of the demo Kindercrasher has been posted. Inigo has a page of explanation including some shader fragments here.

Robust methods for achieving hardware accelerated AO are presented in the influential paper Hardware Accelerated Ambient Occlusion Techniques on GPUs by Perumaal Shanmugam and Okan Arikan. Unlike most presentations, this method yields results similar to ground truth AO calculations. In this paper, the AO search is split into two phases, one for high frequency near detail, and another phase for low frequency detail with a wider search. The second phase in particular is of interest, it allows large objects to occlude each other as they pass. The low frequency pass is described by this image:

Peter-Pike Sloan et al., have recently published Image-Based Proxy Accumulation for Real-Time Soft Global Illumination which works by accumulating shadowing and indirect illumination in screen space splats. As with other AO methods, a further pass is necessary to introduce direct illumination.

A very cheap method is developed within Blender by Mike Pan, with convincing results. The effect is a bit much at deep depth discontinuities, but given the simplicity of the approach, it could be considered quite acceptable. The image on the left is the simple flat shaded image for comparison. The trick involved here is very clever – the depth buffer is blurred, then subtracted from the original depth buffer. The image is clamped and scaled to reduce artifacts and subtracted from the original image. This method is about a zillion times cheaper than any of the others presented on this page.

This technique and several variations are discussed in detail in the Siggraph 2006 paper, Image Enhancement by Unsharp Masking the Depth Buffer. Several NPR effects are achieved by mapping the depth discontinuities to look up tables to get Gooch like effects. For more, see the project website.
Another technique just in, pointed out by Ignacio in the comments: Ambient Occlusive Crease Shading, by Fox & Compton. For each pixel, nearby pixels are sampled, and dot products between normals are scaled by distance between samples to compute occlusion. The resulting pass is bloomed, blurred, and contrast enhanced before being applied to the framebuffer. The page includes the pixel shader doing the work.

19 April 2008
Via Ziggyware: Alex Urbano Alvarez has generously released an SSAO implementation for XNA GS 2.
The movie shows that in general screen space ambient occlusion makes for a lively and attractive image. It also highlights artifacts that can result from not taking linear depth into account. The effect here is not scaling well with depth; shadows are uniformly thick no matter how far the object is from the camera, note that the shadow halo around the top of the pillars is as wide as the halo on the bottom of the pillars. The effect is not taking depth discontinuity into account. This variation of the effect could be further developed for NPR applications; for example, with some thresholding an attractive toon shader could result.
This thread at BlitzBasic shows what I believe to be the same algorithm as Alvarez. The artifacts in the game example late in the thread are largely hidden by the lighting in the scene. It seems if you are not after a photorealistic result, this algorithm can sweeten your look.




