Alex Dunn - Horizon Based Ambient Occlusion

Here is my implementation of NVIDIA's Horizon Based Ambient Occlusion, an image effect that is processed in screen space to approximate the ambient occlusion lighting term. The HBAO technique provides greater visual results over other screenspace techniques such as SSAO (screen-space ambient occlusion).

Ambient occlusion is commonly used in games as a way of providing perception of depth and approximate global illumination. It is often seen a soft shadow in the corners of a mesh or rather, anywhere two faces of geometry meet with inside angles less than 180 degrees. The main difference between this techniqe and standard SSAO is, this technique performs calculations in image space, and therefor, the math is mostly done in 2D, whereas normal SSAO transforms into world space and back again. This makes the process much faster and has the ability to provide better visual quality for the same cost. The HBAO implementation includes the use of an angle bias, which can be used to remove artifacts that might appear when the geometry being rendered is of low tesselation. Such Geometry provides false occlusion information which, before HBAO, would of been very difficult to exclude from the attenuation integral.

Because of the approximate nature of this algorithm, there are several issues to overcome before the effect is at the correct visual level. Most notably of those is the jittery artifact caused by using a noise texture - the noise texture is used to generate random directions used for checking occlusion. The artifact can be minimised by bluring the buffer created from the ambient occlusion calculations. When performing the blur, it is essential to take into account the difference in depth between the current blur radius and it's center, so as to not blur over edges where the AO shouldn't be. In the demo below you can enable/disable blurring by using the toggle box in the controls.