The Ambient Occlusion shader uses a fast and computationally inexpensive technique to simulate the effect of global illumination. It works by firing rays into a predefined hemispherical region above a given sampled point on an object's surface in order to determine the extent to which the point is blocked - or occluded - by other geometry.
Once the amount of occlusion has been determined, a bright and a dark color are used to scale the contribution of ambient light on unoccluded and occluded parts of the object surface respectively. Where the object is partially occluded the bright and dark colors are mixed in accordance with the amount of occlusion.
This shader can also be used for reflective occlusion, which is similar to ambient occlusion, but scales the contribution of a reflection map to the object's surface.
For more information about setting up ambient occlusion, see Ambient Occlusion [Indirect Illumination].
Number of Samples |
Specifies the number of sample rays used to determine occlusion. Higher settings produce a smoother result but take longer to render. If set to 0 or a negative value then mental ray will use the global Ambient Occlusion > Rays setting in the mental ray Render Options Property Editor. |
Bright Color |
This color is used to scale the ambient lighting/reflection when the sampled point is completely unoccluded. If the point is partially occluded, this color is mixed with the Dark Color. Typically, this color is set to white, but you can choose any color using the sliders. You can also drive the color using a texture. |
Dark Color |
This color is used to scale the ambient lighting/reflection when the sampled point is completely occluded. If the point is partially occluded, this color is mixed with the Bright Color. Typically, this color is set to black, but you can choose any color using the sliders. You can also drive the color using a texture. |
Spread |
Defines the angle of the cone from which sample rays are fired. A value of 0 samples only in the direction of the surface normal, while a value of 1.0 samples the entire hemisphere above the sampled point. |
Maximum Distance |
Specifies the maximum range for sample rays fired from a given point.
It's usually preferable to limit the maximum distance by using non-zero values. Distant objects generally affect the final result less because they occupy a proportionally much smaller area of the sampling hemisphere than closer objects of the same size. The slight reduction in overall occlusion that this may cause is offset by the accompanying reduction in render time. |
Reflective |
When activated, the shader performs reflection occlusion rather than ambient occlusion. This changes the sampling pattern from a cone around the surface normal to a more distributed pattern around the direction of reflection. Using reflection occlusion can help enhance the realism of reflection maps by incorporating color and detail from the surrounding environment map. |
Output Mode |
The shader had five different modes that control the output color:
In this mode, sampling is performed in the direction of the shading normal.
In this mode, the sampling direction is biased to return more of the Bright color in the blended result.
|
Occlusion in Alpha |
When activated, the scalar occlusion value is stored in the alpha channel, irrespective of the specified Output Mode. Normally, the color returned for a given point is a blend between the Bright color and the Dark color, including the alpha channel, depending on how that point on the surface is occluded. When this parameter is on, the blending between the bright and dark color is not done for the alpha channel. Instead, the alpha channel stores the actual amount of occlusion. If you need the alpha channel to be 1, independently of the occlusion, simply set the Bright color and Dark color alpha values to 1, and the blend will always return 1. |
For standard ambient occlusion, this shader is typically connected to the Material Node's Surface input or the Ambient input of a surface shader like Phong or Lambert. For reflection occlusion, it can be connected to a surface shader's Reflection input, or to the Material node's Environment input.
For more information, see Connecting the Ambient Occlusion Shader [Indirect Illumination].