Depth fading, sometimes called fog or atmospherics, adds an element of realism to a scene by creating a sense of depth by adding a layer of ambient-like color (usually black or gray) in relation to an object's distance from the camera. You can create depth fading in a scene by applying a volume shader.
Below, the scene is without depth fading (top image), and with a depth fading effect (bottom image). The fade color is set to black with no transparency. Notice how the spheres appear to be less visible over distance.
Select the pass to which you will apply the depth-fading effect and open its Render Pass Property Editor.
In the Volume stack window, click Add to open the browser at the Volume folder, and select the Fog shader.
Click OK and the Volume_Fog shader is added to the shader stack.
Select the Volume_Fog shader in the Volume stack window and click Inspect. This opens the shader's property editor, where you can define the Start and End distances, as well as the fog color and transparency.
For more information on how to use this particular volume shader, click the help icon in the shader's property editor.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License