Ambient occlusion is a fast technique for producing soft, diffuse lighting in open spaces by using ray tracing. It is computed by determining how much of the hemisphere above a point is blocked by other surfaces in the scene, and producing a darker lighting value when the point is heavily occluded. This technique can be useful when you need a GI-like effect without paying the price for full global illumination.
With this particular example, an Ambient Occlusion light and some geometry is provided in the form of a Digital Asset. An Environment Light was used, and it’s parameters were promoted for easy access.
Optimizing performance/quality for ambient occlusion
There are two ways to adjust the quality and performance of renders using ambient occlusion.
Decreasing the sample count allows you to improve render time at the expense of some additional noise in the render. The following render uses the same shader as the image above but decreases the samples from the default of 256 to 16. This value is set on the Sampling Quality under the Occlusion tab of the asset.
Irradiance caching is a technique that allows ambient occlusion values to be shared across a surface to improve performance. To enable irradiance caching, turn on the Enable Irradiance Cache option on the Irradiance tab of a mantra ROP.
When using irradiance caching, it is possible for artifacts to appear near sharp edges in the scene. For example, on the rim of the teapot lid there are some pixels that are brighter than they should be. To resolve these artifacts, decrease the Max Pixel Spacing parameter on the Irradiance tab. The following image was rendered with a spacing of 3.
If you have a smooth environment map, it is possible to replace the global background color (white) with the value from an environment map. To do this, change the Environment Map parameter under Occlusion tab.