In the late 90s and early 2000, gamer designers were trying to improve graphics. At that time, textures and polygons were used in graphics. Later, developers understood the importance of lighting for real-time rendering of characters and their shadows in real-time. Then Ambient Occlusion technique was developed to simulate the way light interacts with different surfaces. In this article, I will explain Ambient Occlusion and how it works. I will also explain different types of Ambient Occlusion.
Ambient Occlusion
Ambient Occlusion is a technique used in computer graphics and 3D rendering to simulate the way light interacts with surfaces in a realistic manner. It helps to enhance the visual quality of a scene by adding subtle shading effects that occur due to the presence of nearby objects or surfaces obstructing the direct path of ambient light.
What Does Ambient Occlusion Do?
Ambient occlusion approximates the occlusion, or blockage, of ambient light in areas where surfaces are close to each other. In reality, when objects are close together, they prevent some of the ambient light from reaching the surfaces that are hidden or partially obstructed. This leads to darker areas around the edges, crevices, and corners of objects, giving a more grounded and three-dimensional appearance to the scene.
Ambient occlusion helps to add depth and realism to rendered images. It creates a sense of contact and interaction between different surfaces, making them feel more physically present in the scene.
Types of Ambient Occlusion
There are several types of ambient occlusion techniques used in computer graphics to simulate the way light interacts with surfaces. These techniques vary in their approach and computational complexity, and they offer different levels of realism and visual quality. Here are some common types of ambient occlusion:
Screen-Space Ambient Occlusion (SSAO): SSAO is one of the most commonly used techniques for ambient occlusion in real-time rendering. It operates in screen space and calculates occlusion effects based on the depth information of pixels on the screen. It’s relatively fast to compute but might not capture occlusion as accurately as some other techniques.
Horizon-Based Ambient Occlusion (HBAO): HBAO is an improvement over basic SSAO. It focuses on capturing occlusion near the horizon of objects and considers surface curvature to determine occlusion. This leads to more realistic and visually appealing results in comparison to SSAO.
High-Definition Ambient Occlusion (HDAO): HDAO is an enhanced version of SSAO that uses a more advanced algorithm to calculate occlusion. It considers more complex relationships between depth samples, resulting in higher-quality occlusion effects with better detail in corners and crevices.
Voxel-Based Ambient Occlusion (VXAO): VXAO operates in 3D space and breaks the scene into voxels (3D pixels). It calculates occlusion in a more volumetric manner, which can result in highly accurate occlusion effects, especially in complex scenes. VXAO is computationally more intensive than screen-space techniques.
Ray-Traced Ambient Occlusion (RTAO): RTAO traces rays from the surfaces to simulate occlusion more accurately by considering the actual geometry of the scene. It’s computationally intensive but produces very realistic results, capturing occlusion effects that other techniques might miss.
Multi-Pass Ambient Occlusion: In multi-pass ambient occlusion, the scene is rendered multiple times with variations in lighting and occlusion. The resulting images are then combined to achieve a more accurate occlusion effect. This technique can be resource-intensive but offers flexibility in controlling the occlusion quality.
CryEngine Ambient Occlusion (Crysis AO): This technique is used in CryEngine, the game engine developed by Crytek. It combines aspects of both screen-space and voxel-based methods to achieve high-quality and efficient ambient occlusion effects.
Ground Truth Ambient Occlusion (GTAO): GTAo is an advanced ambient occlusion technique used in modern game engines. It combines several approaches to create accurate occlusion effects with minimal artifacts.
Should You Use Ambient Occlusion?
Whether you should use ambient occlusion depends on the context of your project. If you are aiming for a realistic or detailed visual representation, ambient occlusion can greatly enhance the overall appearance of your scenes. While ambient occlusion enhances realism, it also requires additional computational resources. In real-time applications like video games, careful consideration is needed to balance visual quality with performance. In certain cases, like stylized or minimalist art styles, ambient occlusion might not be necessary and could even clash with the desired aesthetic. For pre-rendered images or animations where computational resources are less of a concern, ambient occlusion can be a valuable tool to improve the final output.
How can ambient occlusion affect performance?
Ambient occlusion can have a significant impact on performance in real-time rendering applications, such as video games or interactive simulations, due to its computational requirements. Here’s how ambient occlusion can affect performance:
- Computational Complexity: Calculating ambient occlusion involves evaluating how much ambient light reaches each point on a surface, considering the interactions with nearby objects. This process can be computationally intensive, especially when accurate results are desired. More complex scenes with numerous objects and surfaces require more calculations, which can strain the graphics processing unit (GPU) and central processing unit (CPU).
- Frame Rate Impact: In real-time applications, maintaining a smooth and consistent frame rate is crucial for a good user experience. If the calculations required for ambient occlusion are too resource-intensive, it can lead to a drop in frame rates, causing the scene to appear choppy or laggy.
- GPU Load: Ambient occlusion calculations are typically done on the GPU, which handles rendering tasks. If the GPU is already heavily loaded with other rendering tasks like shading, lighting, and physics simulations, adding ambient occlusion calculations can further burden the GPU and potentially lead to performance drops.
- Resolution and Quality: The quality and accuracy of ambient occlusion effects can be adjusted, with higher-quality settings demanding more computational resources. Higher resolution and more accurate calculations result in better visual fidelity but also require more processing power.
- Real-Time vs. Offline Rendering: In non-real-time rendering, such as when generating images or animations offline, the computational cost of ambient occlusion might be less of a concern since there’s more time available for calculations. However, in real-time applications, the calculations need to be performed within a fraction of a second for each frame, which can be challenging.
To manage the impact of ambient occlusion on performance, developers, and artists often use techniques such as: Quality Settings, Optimization, Caching, and Hardware Acceleration.
Games and applications often offer different quality presets that adjust the level of detail for ambient occlusion. Lower settings might use simpler or faster calculations to maintain performance. Developers can implement optimizations and algorithms that make the ambient occlusion calculations more efficient without sacrificing too much visual quality. In some cases, results from previous frames can be reused if the scene has not changed much, reducing the need for recalculating ambient occlusion in every frame. Utilizing modern GPU features and hardware-accelerated techniques can help distribute the computational load more efficiently.
Ultimately, the decision to use ambient occlusion and the level of detail to apply depending on the desired balance between visual quality and performance in a particular application.







