z-depth/gradient alpha?

Greetings. I noticed that with Camera Data node I can use z-depth to manipulate alpha and other elements on the material.

I started to wonder if there’s another way to use z-depth to make “smokyglass” effect?
Meaning I could use z-depth to dicrease transparency by distance.