Ambient occlusion allows you to simulate the soft shadows that occur in the cracks and crevices of your 3D objects when indirect lighting is cast out onto your scene. The soft shadows that are created from ambient occlusion can help to define the separation between objects in your scene and add another level of realism to your render.
For example, you could use ambient occlusion to help enhance the visible separation between individual bricks on a brick wall that might otherwise seem to run together. Ambient occlusion shading aren't the same as shadows you'd get from direct lighting, but they're are actually fake indirect shadows that are added into the render by rays that get cast out from each surface on your geometry.
If these rays come into contact with another surface, that area will become darker. If it doesn't find another surface it will stay brighter. In most 3D applications, ambient occlusion is calculated using a special ambient occlusion shader that is applied to your geometry. Once rendered, the ambient occlusion pass is typically something added onto the final render in a photo compositing software, like Photoshop, where further manipulating and fine tuning of the ambient occlusion can be achieved.
Since ambient occlusion is simulated by casting out rays to sample nearby geometry, any object with a transparency map applied to it won't get calculated. That's because ambient occlusion doesn't look at the texture maps applied to geometry, but instead works by sampling nearby geometry that blocks or occludes light, given that light passes through a transparent object.
Ambient occlusion is great for softening the overall lighting in your scene if it is too bright. There is no need to add additional lights because ambient occlusion does not work in the same way as something like final gather where a light source must be used to cast out rays. Ambient occlusion also shows subtle variations in lighting to help your eyes detect surface details that would otherwise be washed out or unnoticeable. It's also great for visualizing a model that hasn't even been textured yet.
Tips for Setting Up Ambient Occlusion
A great way to speed up render time when incorporating ambient occlusion is to bake out the ambient occlusion pass. This is especially important when rendering an animation, because with every frame rendered the computer will need to recalculate the ambient occlusion pass which can greatly increase the render time.
If you are getting undesirable results from your ambient occlusion pass, like shadows that are much too wide or to shallow, you can adjust the max distance in the ambient occlusion settings. When this is adjusted it determines how far the rays travel in order to find geometry, The further these rays travel the wider the shadow will be. Increasing the distance will increase the amount of shadows cast onto your scene. If you decrease this distance the rays don't travel as far, creating a much tighter level of shadows that only appear when other geometry is very close to the surface. Play with these settings in order to achieve the look you want.
A great way to add another level of realism to your ambient occlusion pass is to utilize a directional ambient occlusion pass found in most rendering applications. This allows you to use the light’s position in the scene to add more directionality to the ambient occlusion, and not have it completely based off of surrounding geometry, which can often result in unrealistic shadows depending on the light setup in your scene.
In some cases you may not even need to render out a separate ambient occlusion pass because you can find ambient occlusion integrated straight into certain materials. In most 3D applications like, 3ds Max, Maya or Softimage they have ambient occlusion settings built into architectural and design materials. So before you start setting up a separate render pass, first see if your materials have ambient occlusion settings integrated in.
Ambient Occlusion can do wonders to make your renders look professional and more realistic. Find out more about Ambient Occlusion and other rendering techniques with our popular CG101: Rendering tutorial or more 3D lighting tutorials.