See Utility Shaders in the Arnold User Guide for the full shader documentation. |
The distance shader uses sample rays to estimate the distance from the shading point to the nearest surface. This distance is mapped to a color linear gradient from near_color to far_color. You can use trace sets to include or exclude objects from the distance measurement.
A scene file that demonstrates the distance shader can be found here.
Scene files that demonstrates distance.out_direction shader can be found here.
distance.out_direction x (multiplyed by red)