Occlusion#
The Occlusion texture is very comprehensive texture used to evaluate the geometry occlusion that occurs around the evaluated geometric fragment. It is a really useful texture that can be used for many different things such as decimating point clouds or creating weathering effects in materials.
Attribute | Description |
---|---|
Color | Set the color of the texture |
Occlusion Color | Set the color of the occlusion. |
Evaluate Transparency | Evaluate transparent surface for occlusion rays. If disabled, transparent surfaces are considered opaque. |
Merge Objects | When activated, rays ignore the surface of two objects that are in contact. |
Merge Threshold | Maximum distance for which the objects are considered merged. |
Occlusion Gain | Set the gain of the occlusion. |
Normal Falloff | Control the intensity of the occlusion according to the dot product between the normal of the shaded fragment and the normal on the occluder. |
Distance Falloff | Control the intensity of the occlusion according to the distance. |
Occlusion Mode | Set the type of occlusion. |
Occluders | Define which geometries are occluders. By default it uses the geometries of the scene |
Normal Mode | Choose the normal that is used to compute the occlusion. |
Space Mode | Set the space to use when applying a bias. |
Bias Mode | Specify if the value of the bias is absolute or if it is relative to the slope on the geometry. |
Bias | Apply a bias on the normal. |
Radius | Set the radius of the occlusion. |
Angle | Set the opening angle of the hemisphere used for the occlusion. |
Slope Threshold | Set the minimum angle that a surface must have in order to be considered as a slope. This value corresponds to the angle between the bias direction and the normal of the surface. |
Quality | Set the number of rays used to evaluate the occlusion. Higher value yields to better results but increases the computation time. |
Color#
The Color of the occlusion is defined by two attributes: Color and Occlusion Color. Color defines the color of the texture when there's no occlusion while Occlusion Color defines the color of the occlusion. The Occlusion Gain attribute on the other hand is the weight of the Occlusion Color over the texture color.
Occlusion Mode#
It is possible to define the direction of the occlusion rays by using the Occlusion Mode attribute:
- When set to Ambient, the rays are fired in the same direction as the surface normal (outside).
- When set to Inner, the rays are fired in the opposite direction of the normal (inside the surface).
- When set to Ambient & Inner rays are fired in both direction (outside and inside the surface).
Normal Mode#
It is possible to choose which normal is used to compute occlusion. When setting to Geometry, the occlusion texture uses the real normal defined by the geometry. While in Shading, it uses the shading normal which is the normal modified by the material network which happens when having a normal or bump map.
Angle#
The Angle attributes defines the angle of the cone around the normal on which rays are launched from the surface. When set to 0, the ray directly travels along the normal. However, when the Angle is greater than 0, the ray is randomly sampled on a cone defined by the specified angle that is aligned to the normal of the surface. In other words, the smaller the angle, the sharper the occlusion gets.
Radius#
The Radius attribute defines the maximum distance the rays will travel from the surface to detect occluders. The bigger the radius the longer the ray travels to potentially hit an occluder in the scene. Note that the smaller the radius the faster the evaluation of the occlusion gets.
Quality#
The Quality attribute defines the number of samples used to compute the occlusion which directly translates to a number of rays. Higher value yields to better results but increases the computation time.
Occluders#
The Occluders attribute allows you to specify group of occluders to be used for the occlusion computations. By default the texture is computing occlusion on the geometries of the scene.
Bias#
By default, rays are aligned to the surface normal. The Bias attribute allows you to orient the rays using a specified vector. This feature is very useful since it allows to "shape" the occlusion to do effects such as dirt resulting from rain fall.
Using a bias in Y and a fractal noise texturing the radius.
Space Mode#
The Space Mode attribute controls the space on which the Bias vector is defined. When set to World Space the Bias vector is defined in world coordinates. However, when set to Object Space, the Bias vector is defined in local coordinates on the surface. It doesn't take into account the transformation of the object.
Bias Mode#
The Bias Mode attribute controls how the bias is applied. When set to Absolute, the bias is always applied. However, when set to Follow Slope, the bias is only applied when the surface is considered as a slope.
Slope Threshold#
The Slope Threshold attribute defines the minimum angle a surface must have in order to be considered as a slope. This value corresponds to the angle between the bias direction and the normal of the surface.
Merge Objects#
Merge Objects allows you to consider objects that are close to each other as if the were merged together. When enabled, the occlusion basically ignores occlusion from objects that are below the threshold specified by Merge Threshold. For example, let's imagine we have a geometry that is made of multiple cubes next to each other. Without Merge Objects, each cube gets the occlusion of neighbor cubes. Using Merge Objects, the occlusion texture ignores the faces of the neighbor cubes.
Merge Objects Off. We clearly see the occlusion from the inner faces of the cubes
Merge Objects On. Occlusion of the inner faces has been greatly reduced.
Falloff#
Normal and Distance Falloff curves allows to control the intensity of the Occlusion color according to the normal and the distance of the occluders.
Normal Falloff#
The Normal Falloff curve control the intensity of the occlusion according to the angle (actually the dot product) between the normal of the surface and the normal of the occluding surface.
Angle set to 0 and no normal falloff
Angle set to 0 and normal falloff enabled.
Distance Falloff#
The Distance Falloff curve control the intensity of the occlusion according to the distance between the surface and the occluding surface.
Angle set to 0 and no distance falloff
Angle set to 0 and distance falloff enabled.