Depth map obtained from orthographic camera has no white pixels even when there is no object before the far clipping plane I'd like to generate a height map from my scene that goes from -50m to +50m (the idea is to use that height map to flatten out ocean waves as they get nearer to the shore, and possibly more advanced effects later).

My problem is that my height map values are not in the expected range. I get near-black, but no white, even in parts where there is nothing in front of the camera (actually, this only happens in the center of the depth image, where the near clipping plane "cuts off" the top of the terrain; that terrain actually has a square base that is somewhat higher up than -50m - see the attached screenshot - so I do not expect white pixels anywhere except in the clipped-off area).

The camera is orthographic, looking straight down from a height of 51m, with the near clipping plane at 1m and the far clipping plane at 101m. I was expecting this to cover the range from +50m to -50m I mentioned above.

In the compositor, I use the Depth output of the Render Layers node, which I plug into a Map range that maps the range 1..101 to 0..1. And that's my output.

But like I said, there is no white on it. The brightest pixel that I get is a CECECE.

Can someone tell me what I'm doing wrong?
In order to save a render as image, the scene linear values have to be transformed into the chosen display color space. This is what the Display Device and View Transform settings are for in the Color Management panel. However depth information are non-color data that shouldn't be transformed (except for mapping to the value range the image format can store). Therefore you either need to save the image as OpenEXR, which will store the scene linear values or you can choose another format, but then you will have to set the View Transform to Raw. You can find more information about the color management settings in Blender's manual.



Since you don't want to store the actual depth values, but rather normalized values in the range $\left[0,1\right]$ (or $\left[0,255\right]$) you will have to normalize the depth pass. Switch to the compositor and enable Use nodes. Add a Normalize node (Add > Vector > Normalize) and connect the Depth socket with its input Value socket. Connect the output Value socket to the Image socket of the Composite node.



With these settings you should get the expected values in your saved image.