In your render settings, select the advanced tab
Then the Canvases tab
Add a new canvas
Select the "depth" type
And here's what you get
Render as usual
Save that very white render somewhere
To the path you saved your render in, a folder has been created with your canvases
And inside... a mysterious .exr file
Open it in photoshop
Choose "as transparency"
What you'll get is a very white image
Choose image > mode > 8 Bits/Channel
Choose Merge
... equalize histogram
Hello you beautiful depth map !
Copy your depth map...
... And paste it on top of your initial render
You can use this map in many ways. Basically, it's an opacity mask. You can use it for an atmospheric haze, for a progressive blur, to hide and show elements, for artistic purposes...
Basically, it adds a layer of depth to anything.
So let's try an atmospheric haze.
create anoter layer on top of everything. Fill it with a color.
Add a layer mask to it
Alt+left click on your newly created layer mask to make it the active object
And paste your depth map to it
Click on the top layer again to quit the layer mask's edition and...
OooOOoOoh ! Depth !
Move your depth blue layer and associate it with the render with CTRL+ALT+G
Now you can play with levels on the layer mask to make it more or less pronounced. Hue staturation to play with the color, etc...