I am rendering depth maps and store the results in OpenEXR format. To make sure things work as expected I loaded one of the renderings into Python using the OpenEXR Python bindings as follow:
import OpenEXR, Imath, array
fileexrFile = OpenEXR.InputFile('depth.exr')
FLOAT = Imath.PixelType(Imath.PixelType.FLOAT)
(R,G,B) = [array.array('f', fileexrFile.channel(Chan, FLOAT)).tolist() for Chan in ("R", "G", "B") ] # R, G and B hold the same values
print (max(R), min(R)) # will print something like (10000000000.0, 0.9885767698287964)
Before rendering, I set the camera's clip end value to 2
. What I noticed is that the clipping the camera distance does not change the large value in the rendering results. In other words, I will always have 10000000000.0
as the biggest number in the rendering result. I wonder, why doesn't the camera clipping seem to work here? Is there a way that I can clip the maximum depth distance?
I need this because when I need to be able to visualize the result. However, when I divide the numbers by the maximum distance everything is almost close to 0 and I cannot see anything on the screen. One solution that might work is to set the largest number to a much smaller value but this does not solve the problem fundamentally. So any solution would be appreciated.