Cropped some HLSL code and got up and running SSAO (Screen Space Ambient Occlusion – more details on how its done: http://www.gamerendering.com/category/lighting/ssao-lighting/ ).
The first pass in the scene: render depth information in a texture’s alpha channel and scene normals (World*View matrix transform) in the RGB channels, then use this information to render SSAO in a render target. It uses the normals and pixel depth to compute the occlusion between current pixel and several samples around that pixel, chosen by sampling texels from depth map around it, using a random normals texture (more on the page above).
Some SSAO screenies:

No SSAO

With SSAO, observe shadowing
