What DirectX 11 is, and What It Means to You
Ambient Occlusion
Achieving great realism through light and shadows
It’s all about light. Without light, you can’t see. In 3D games, all lighting is created using mathematical cheats—approximations of how real-world lighting behaves. Some of the most interesting lighting effects lie in the absence of light: darkness and shadows.
Shadows have evolved from simplistic shadow maps—where the shadows all looked the same from any angle—to the more sophisticated techniques used in today’s games.
Variations on ambient occlusion are becoming increasingly more popular. Ambient occlusion takes into account how light falls on objects to create shadows, and that the properties of light and shadows change over distance. Crysis was one of the first games to attempt a form of ambient occlusion, known as screen space ambient occlusion (SSAO). SSAO techniques try to determine where a point in the scene exists relative to other points, and the effect that light falling onto that point has on other parts of the scene. Objects have reflective properties, and may in turn bounce light to other parts of the scene—even those blocked from the direct light source.
Real-world objects tend to have crevices, wrinkles, and depressions, which may not be directly lit by a light source (the sun, for example). But they aren’t dark, either—they pick up light being bounced off other parts of the environment or even a nearby surface of the same object that is in direct light. Previous games often ignored this, so crevices and depressions were either completely dark or looked as brightly lit as the other parts of the object.
Other types of ambient occlusion found in newer games include high-definition ambient occlusion (HDAO) and horizon-based ambient occlusion (HBAO). These are still variations on the same idea—that where a pixel exists relative to other pixels determines how light falls on it, how it bounces that light, and what type of light it is (direct or reflected.)
Without Ambient Occlusion
With Ambient Occlusion
The circled areas in this DirectX 11 SDK example show how high-definition ambient occlusion (HDAO) produces more realistic details. Notice the increased depth, sharper lines, and greater shadowing.
Above is an HDAO sample from the DirectX SDK. Note the internal shadowing made possible in the lower screen by using this ambient occlusion technique. It is relatively subtle, but the overall scene seems more realistic when you’re running the application in full-screen mode. In the top shot, HDAO is disabled; the bottom one has HDAO enabled.
With DirectX 11, a new technique is emerging called contact hardening. If you think about how real-world shadows behave, you’ll realize that a shadow doesn’t look the same along its full length. Close to the object—say, at the base of a lamp post or tree—the line between shadow and light is sharply delineated (the “hard” in contact hardening.) The farther away from the object, the shadow is more diffuse. That’s because farther away, light seeps into the shadow area from the surrounding environment. Contact hardening shadows using Direct 11 graphics emulate this look. Right now, the only game using contact hardening shadows is STALKER: Call of Pripyat (below).
In this DirectX 11 SDK sample, shadows have harder edges near the object and softer edges farther away, as in real life.
Next page: Postprocessing Effects >>