Depth, Dust, & Position Procedural Masks

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

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

Object Position (n) Dust Mask

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

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.