We appreciate that AMD made it possible for us to update World of Warcraft: Shadowlands to include their FidelityFX Combined Adaptive Compute Ambient Occlusion (CACAO), a new implementation of screen-space ambient occlusion. This is an effect used in World of Warcraft to improve graphical fidelity. Here’s a bit of a deep dive into what CACAO is, why it was integrated into World of Warcraft: Shadowlands, and what was gained by doing so.
What is AO?
Ambient Occlusion (AO) is the concept in graphics where the overall lightness affecting a surface in an environment is diminished by the presence of other nearby surfaces. Those other surfaces block, or occlude, some of the non-directional scattered light in the scene from reaching the affected surface.
Think about a car on the highway on a sunny morning. The car would have both a shadow – a sharp outline of the silhouette of the car cast opposite the direction of the sun – and a softly shaded area on the road underneath, more-or-less centered on the car. On a very overcast day, the car may not have much of a shadow, but the shaded area underneath would still be apparent.
AO mimics the shading effect under the car which is not its direct shadow. Subjectively, AO adds subtle visual cues about the proximity of surfaces in the scene while making the resulting image appear less flat.
Switching to CACAO
FidelityFX CACAO is an AO technique like the one used in Battle for Azeroth, with optimizations, and it’s implemented in compute. The hope here is that by switching to this new implementation, players would get the same look with a smaller performance cost. CACAO also adds a new reduced-resolution operating mode, which promised a much slimmer performance profile with minimal degradation to visual quality. By being entirely implemented in compute, CACAO can be offloaded onto the compute queue, to run in parallel with graphics, although that has not yet been taken advantage of for Shadowlands.
Steps to Get There
Integrating FidelityFX CACAO into World of Warcraft went smoothly; the overall technique is so similar to the previous AO that it could easily be dropped in as a replacement, consuming the same inputs to produce similar output. As a source code distribution, CACAO includes support out-of-the-box for DirectX 12 and Vulkan APIs. Since WoW targets DirectX 11 and 12 on Windows and Metal API on MacOS, there was a modest porting effort involved to get the technique working through the API abstraction layer for tasks such as resource management and command list construction.
Fortunately, since WoW’s shader programs are (mostly) written in HLSL, very few changes were needed to the DirectX 12 version of the CACAO shaders, where most of the logic that implements the technique is.
FidelityFX CACAO in full-resolution mode produces results that are visually indistinguishable from our previous implementation and yields a modest performance improvement on most graphics cards, especially newer architectures with more mature compute capabilities. On most systems, however, we’ve elected to apply the reduced-resolution mode, which produces results that are nearly as good with a substantial improvement in performance across all compatible devices.