Corners Don't Look Like That: A Critique of Screenspace Ambient Occlusion
Corners Don't Look Like That: A Critique of Screenspace Ambient Occlusion
Screenspace Ambient Occlusion (SSAO) frequently produces unrealistic, overly dark corners in 3D rendering because it relies on a flawed assumption that concave boundaries in the real world are naturally dark. Through photographic evidence and luminance graphing, Sean Barrett argues that the dramatic darkening seen in games is often a misinterpretation of other lighting phenomena, such as soft shadows or perceptual illusions.
The Failure of SSAO in Real-World Corners
Real-world corners rarely exhibit the deep, uniform darkening that SSAO simulates. When dark corners do appear in photographs, they are typically the result of specific lighting conditions rather than a general property of ambient occlusion.
Barrett identifies four primary factors that contribute to the unrealistic appearance of SSAO:
- Approximation Errors: The gap between SSAO (a screen-space approximation) and true Ambient Occlusion (AO), and the further gap between AO and full radiosity (the study of diffuse light reflection).
- Lighting Application Errors: Applying SSAO darkening to all lighting sources rather than restricting it to ambient lighting.
- Tuning Errors: Heuristic weighting of the AO effect that is too strong, leading to exaggerated results.
- Conceptual Errors: The belief that room corners are inherently dark, which leads developers to write code that reinforces this misconception.
Evidence from Luminance Graphing
To test the theory that corners are not inherently dark, Barrett used a Canon 5D Mk II to photograph various corners in his apartment and analyzed the pixel brightness (sRGB) using 5x5 box-filter averaging.
Soft Shadows vs. Ambient Occlusion
In cases where corners appeared dark, the analysis revealed that the darkening was often caused by soft shadows from a light source just off-screen, rather than AO. For example, in one photograph of a darkened corner, the darkening on one wall was primarily a soft shadow, while the other wall remained relatively bright because it was more exposed to the light.
The Role of Perceptual Illusions
Barrett notes that the darkening effect is often a psychological or perceptual artifact rather than a physical one. He specifically mentions Mach banding, a visual illusion where the brain exaggerates the contrast at the edge between two different shades, creating a perceived darkening that does not exist in the linear light values of the image.
Analysis of Indirectly Lit Spaces
In tests of indirectly lit areas—such as the space above a cabinet or a dark bathroom—the luminance graphs remained relatively flat. Even in the "darkest room in the house," the actual pixel values showed very little darkening as they approached the corner edge. This suggests that the "ambient" darkening effect simulated by SSAO is a barely perceptible phenomenon in reality.
Industry Perspectives and Counterpoints
Discussion among graphics professionals and enthusiasts suggests that while SSAO is physically inaccurate, its purpose is not always photorealism, but rather visual depth and clarity.
The Trade-off Between Realism and Aesthetics
Some argue that SSAO is used because it provides a cheap way to give geometry depth and make objects "look good" without the need for expensive ray tracing or complex light placement. As one commenter noted:
"Realism is not usually the point, the point is to look good... most of reality is pretty dull looking!"
The Utility of AO as a Visual Aid
Others point out that AO is a natural phenomenon—specifically contact shadows (the dark line between two touching surfaces)—and that SSAO is a useful, albeit crude, approximation of these contact shadows to prevent raster engines from looking flat.
Modern Alternatives
With the advances in hardware, the industry is moving toward more physically accurate solutions. Some mention RTGI (Real-Time Global Illumination) and FidelityFX CACAO as modern methods that handle occlusion more realistically than the screen-space approximations of the 2000s and 2010s.