Skip to content

Transparency/Opacity#

The transparency of a surface is defined by the opacity of the material and like transmission rays, transparency is ray traced by the raytracer. However, transparency computations are slightly more optimized since outgoing ray directions are not modified by transparent surfaces.

Obviously, there's no magic, transparency increases dramatically render times specially in complex lighting scenarios. In order to manage reasonable render times, the raytracer provides 2 attributes Alpha Depth and Alpha Threshold to control transparency. Please note that transparent shadow computations are also driven by these 2 attributes.

Note

Instead of using transparency, it is possible to use Clip Maps which render a lot faster.

Alpha Depth#

By default, the raytracer evaluates an infinite number of transparency layers and is just constrained by the Alpha Threshold. This may considerably slowdown renders when scenes have many transparent surfaces because the raytracer evaluate the materials and lights of each transparent fragment indefinitely until the path eventually reaches a fully opaque surface or the background.

To constrain render times, it is highly recommended to restrict Alpha Depth to a maximum value. A typical value for Alpha Depth that is usually a good balance between quality and performance is 10.

That way, the raytracer considers the 11th geometry fragment along the path to be opaque which ends the path. Please note that shadow transparency computations also uses the value set in Alpha Depth attribute.

Alpha Threshold#

By default, the Alpha Threshold is set to 0.3922 % which means that a ray is considered opaque when its accumulated transparency is lower than 0.3922 %.

Increasing this value reduces the depth of the transparency net which in return reduces render times.

Alpha Threshold 0%

Alpha Threshold 10%

Alpha Threshold 25%

Alpha Threshold 50%

Clip Maps#

A Clip map texture is a texture used to clip a geometry. They are assigned to shading groups using either the Material Linker or Shading Layers. Clip maps render exactly as if a binary transparency mask was connected to the Opacity attribute of the material. However clip maps render way faster.

Fractal noise assigned as clip map on a sphere

Fractal noise assigned as clip map on a sphere

Using Clip maps, the material is considered transparent when the luminance value of the texture is greater or equal to 0.5.

For example, when a texture is returning a red color such as (1.0, 0.0, 0.0) it is considered as transparent. Indeed, (1.0 + 0.0 + 0.0) / 3 is less than 0.5.

However, if the texture is returning (1.0, 1.0, 0.0), it is considered as opaque. Indeed, (1.0 + 1.0 + 0.0) / 3 is greater than 0.5.

Note

Remember to always disable mipmapping when using Texture Maps as clip maps. Because of mipmapping the opacity of the texture will vary according to the distance of the object to the camera. Typically, the further the object, the more transparent it will get.