Depth map of the entire scene in HDRP

Hello there,
I’m struggling against HDRP since two days. I would like to have some sort of Custom Pass which, once it is assigned to my HD camera, is able to reproduce a depth map of the entire scene (i.e.: if the object is far from the camera, it will be rendered darker).

An example:
151634-before-depth.png

151635-after-depth.png

I’ve googled a lot and the only interesting thing which I found is this forum discussion: https://forum.unity.com/threads/camera-depth-texture-sampling-with-2018-3-and-hdrp-4-x-mip-map-issue.594160/

Any ideas?

Hello there, I’m struggling against HDRP since two days. I would like to have some sort of Custom. When I use the HDRP shader, the clear flag option for cameras got removed and replaced with Background Type.