Neural Network Ambient Occlusion

04/10/2016

At SIGGRAPH Asia this year I am presenting Neural Network Ambient Occlusion. This short paper uses Machine Learning to produce ambient occlusion from the screen space depth and normals. A large database of ambient occlusion is rendered offline and a neural network trained to produce ambient occlusion from a small patch of screen space information. This network is then converted into a fast runtime shader that runs in a single pass and can be used as a drop-in replacement to other screen space ambient occlusion techniques.

I've provided the learned network weights (represented as filter images) and shader code below. Additionally included in the code & data downloads are good implementations of SSAO, SSAO+, SAO, and HBAO for comparison which also may be of interest to people.

Update: Since this paper was accepted I've found the performance can be significantly improved by adopting the spiral based sampling method used in Scalable Ambient Obscurance (SAO). This produces good results with far fewer samples and reduces the runtime of NNAO by over half to around 1.5ms. This update is included in the code and data linked before, as well as an additional comparison to SAO.

WebpagePaperVideoSlidesShader & FiltersCode & Data

Abstract: We present Neural Network Ambient Occlusion (NNAO), a fast, accurate screen space ambient occlusion algorithm that uses a neural network to learn an optimal approximation of the ambient occlusion effect. Our network is carefully designed such that it can be computed in a single pass - allowing it to be used as a drop-in replacement for existing screen space ambient occlusion techniques.