![]() |
![]() |
![]() |
depth | dust | pposition_ |
This tutorial shows how to create Z Depth, dust, and Object Position masks that can be used in a compositing package to layer shading effects such as depth of field, dirt, dust, or snow. They use a combination of Arnold shaders such as utility, range, and state_float. Thanks to Slava Sych for the assistance with this tutorial.
A scene file can be found here.
Create a state_float shader. Set the variable parameter to ray_length (Rl).
Create a range shader and connect the state_float shader output to the input of the range shader. Change the following parameters of the range shader:
input_min: 0.6 (this value depends on the distance from the camera your object is).
output_max: 1.5 (this value depends on the distance from the camera your object is).
smoothstep : Enabled
This mask directly depends on the distance from the camera.