This operator computes ambient occlusion at the point
P with the normal
N. Just as in the Irradiance operator, the hemisphere is sampled.
However, unlike Irradiance, Occlusion ensures that surfaces which are
intersected during the hemisphere sampling are not shaded.
For this function to work properly, either a constant background color
bgcolor) or an environment map (
envmap) must be specified. Most likely,
it will be necessary to specify a transform space (
envobj) for the
environment map evaluations. Also, if an environment map is specified,
it is possible to tint the resulting color (
Other parameters include the Bias (
bias), which gives control over
self-intersections, and Number Of Samples (
samples), which specifies the
amount of samples should be sent out to filter rays.
If the position (
P) and normal vector (
N) are not connected, the global
variables by the same names will be used instead. If the maximum ray
maxdist) is not connected, the rays will be allowed to travel
The Object Scope parameter is a list of object names to occlude, and the Object Selection parameter is a list of categories to occlude.
occlusion() operation does not accept a per-point maximum distance. This value needs to be a constant.