In Arnold 5.0 surfaces and volume shaders return closures rather than final colors. Closures describe the way surfaces and volumes scatter light, leaving the lights loops and integration to Arnold. This approach makes more optimizations and better rendering algorithms possible.
BSDF and BSSRDF Closures
BSDF and BSSRDF closures define how light scatters on and below surfaces.
Refraction BSDFs and Absorption
For refraction, the BSDF takes an interior closure list parameter that defines the interior of the object. This can be used to model volume absorption or scattering inside glass for example.
The emission closure is used to emit light from surfaces.
Transparent and Matte Closures
Surfaces are opaque by default, and the transparent and matte closures can be used to make them transparent or to affect the alpha channel. When making a surface transparent or matte, other surface closures should have their weight reduced accordingly, so that the total weight of all closures does not exceed 1 and energy is conserved. Mixing with other closures can be done as follows:
The transparent closure makes the surface transparent, revealing objects behind it. The matte closure creates a hole in the alpha channel, while blocking objects behind the surface. This can be used to composite other objects into the image after rendering.
The relation to opacity and alpha is as follows:
opacity = 1 - transparent
alpha = 1 - transparent - matte
For best performance stochastic opacity should be used. For OSL shaders this is applied automatically, for C++ it can be done like this. Note that for shadow rays only opacity is needed and creating BSDF and evaluating any parameters needed for them should be skipped for best performance.
The weights of volume closures are absorption, scattering and volume coefficients, with higher values resulting in denser volumes. Shadow rays only need absorption, and so may skip computation of scattering and emission and avoid evaluating any linked parameters needed for them.
Shaders using closures can not write lighting to AOVs themselves, rather Light Path Expression AOVs can be used.