Share

Depth, Dust, and Position Procedural Masks - Arnold for Maya

Depth, dust, and P Position

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.

Depth Mask

  • 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

Note that this mask directly depends on the distance from the camera.

Object Position (n) Dust Mask

  • Create a utility shader. Set the following parameters for the utility shader:

  • color mode: normal (n)

  • shade mode: flat

  • Create a range shader and connect the utility shaders output G to the input of the range shader. Enable smoothstep and control the mask position with the input min/max parameters.

If you cannot connect a single out color (Out G) to an Input in your DCC, use a rgba to float (mode G) shader to convert it.

Object Position (P) Mask

  • Create a utility shader. Set the following parameters for the utility shader:

  • color mode: shading point (P)

  • shade mode: flat

  • Create a range shader and connect the utility shaders output G to the input of the range shader. Enable smoothstep and control the mask position with the input min/max parameters.

If you cannot connect a single out color (Out G) to an Input in your DCC, use a rgba to float (mode G) shader to convert it.

Was this information helpful?