Dualbox - GPU-accelerated AO computing
During my work as an intern engineer at Dioxygen Software, I was tasked with the development and the implementation of a progressive ambient occlusion algorithm compatible with WebGL.
Computed scene AO, applied on a white material. Run it
This algorithm provides a high fidelity computing of the AO for a provided scene, and is executed on the GPU, allowing for improved compute times. The algorithm is equivalent to launching several hundreds of thousands of primary rays, which turned out to be tricky when limited to webGL
The computation can be made over multiple frames, to keep the scene from freezing when computing the AO.
The algorithm can be applied in a few different pipelines:
-
You can run it has a screen-space AO pass, allowing for pixel perfect resolution. In this mode though, the compute process has to restart every time the scene or the camera changes:
This approach gives the best results overall quality-wise, and doesn’t require anything like a UV map to be set up, making it work in pretty much all scenarios.
With a powerful enough machine, it might be able to run in real-time, with its sampling rate toned down.
-
The next approach is to use the algorithm to compute the AO texture directly. This allows for a one-time AO computing, provided the scene doesn’t change as well.
While it can provide great results with a nicely mapped mesh, you’re not safe from encountering issues related to bad UV mapping.
-
One last approach is to use the algorithm to compute a per-vertex AO value. It features the same advantages as the AO map approach, but doesn’t require any UV map to be set up beforehand.
Its main issue though is that if the vertex count is too low, it can lead to artifacts.
Sadly, I cannot delve too much on the inner workings of the algorithm, as it is confidential, I can only discuss them with specific authorization. Contact me if interested.
You can try it here
Additional examples: