Z-buffer output from blender as file I am trying to synthetically generate depth image mimicing a real Kinect. So I have set the camera params as below using python script. 



I have setup the nodes and able to get the depth image as shown below. Along with render params as shown in the figure. I am able to render the depth image.


But when I read the image outside, there is a cutoff after certain depth. This can be seen in the below matlab read of the image. One can see that the top rows in the image are set to constant high values. 


When I change the viewpoint of the camera to be lower, it seems to gradually improve gradienting. So I believe its having a threshold which says beyond this z value, if there is an object then just assign the highest value or something. I played around with all the camera params and couldn't figure out the issue. Please let me know if you have come across this or know of any parameter that can fix this.

Thanks in advance!
The values of the Z Buffer are in float values, and then they get clipped to &lt;0,1> (&lt;0,255>) range in your file format.


Either save the images in some hdr format (.exr for example) that will support float values
or re-map the values to the &lt;0,1> range yourself with Map Value node.