mib_fast_occlusion

 
 
 

Category: mental ray > Texture

Shader Family: Texture

Output: Color

This shader is an alternative to the mib_amb_occlusion shader, with similar functions, but fully utilizing the ambient occlusion facilities built into mental ray. This shader offers optimal rendering performance and the possibility to benefit from the ambient occlusion cache, if enabled.

This shader cannot be used as a light shader.

Name

The name of the shader node displayed in the render tree. Enter any name you like, or leave the default.

samples

The number of probe rays that are sent. More rays yield a smoother image. If the ambient occlusion cache is enabled, this parameter is ignored: the number of points to use for cache interpolation is controlled by the cache_points option.

bright

The color used when no occluding objects are found. For partial occlusion, a gradual mix between this color and the dark color is returned.

dark

The color used when total occlusion occurs. In most practical cases, it is set to black.

spread

Defines how large an area of the hemisphere above the point is sampled. Unlike the mib_amb_occlusion shader, this value is the cosine of the angle between the normal and the maximum direction. Its value ranges from 0.0 for a cone that covers the entire hemisphere to 1.0 for a cone that is a single direction.

spread_exp

The exponent of the spread angle. It controls how the rays shot from the sampling point are concentrated around the normal. A higher value means more density around the normal.

This parameter is not currently supported by mental ray, but is provided for future versions.

max_distance

The range within which geometry is probed. If it is zero, the entire scene is sampled. If it is a non-zero value, only objects within this distance are considered (which makes sampling much faster). Objects outside this range do not occlude at all, and objects that are closer occlude more strongly as the distance approaches zero.

reflective

If this option is off, sampling is performed in a cone area based around the surface normal.

If this option is on, the samples are instead distributed around the reflection direction. This generates reflective occlusion which can greatly enhance the realism of reflection mapping.

output_mode

Defines what the returned color is:

  • Mode 0 enables standard occlusion behaviour.

  • Mode 1 enables environment sampling. This changes the behavior of the shader slightly. As directions are probed for occlusion, the current environment is also sampled and weighted based on how occluded that particular direction is. With mode 1, the output of the function is the gathered weighted environment colors multiplied by the bright color, with the dark color added for convenience.

  • Mode 2 enables bent normals (see mib_bent_normal_env). The average unoccluded world space normal direction is calculated and returned, encoded as a color where red is X, green is Y, and blue is Z.

  • Mode 3 is the same as 2, except that the normals are encoded in the camera coordinate space.

  • Mode 4 is the same as 2 except that the normals are in object space.

occlusion_in_alpha

Puts the scalar occlusion value in the returned color's alpha component, regardless of what is set for output_mode. The other color components remain as before.

cache_points

Controls the number of ambient occlusion points to lookup for interpolation in the ambient occlusion cache. If the the cache is not enabled, this option is ignored.

A value of 0 means the number of ambient occlusion points are determined by mental ray settings. Values greater than 0 override the setting for the current object. Values smaller than 64 give more precise results, but artifacts can appear. Higher values tend to produce a blurry image.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License