How to get the absolute Z-Buffer value off an object in a scene

I have a couple of problems with my setup.
I actually want the Z-Buffer values like they are in the full scene, just separated for each object.
When I render each object in its own scene the Z-Buffer value ist always the full range from 0-1 instead of the value with the other object active.
And somehow I can only use the last rendered scene, cause the others produce picturefiles that are not useable.(I get unknown picture-formats or empty-files (0kb))


What I would really like to have, would be a render of an full object by objectID with the right proportions in relation to the other objects.
Is that possible?

Thx in advance for your help.:o

yes, it’s possible but a bit more work… You can’t use the normalize node because it takes all available z-values in the image and “normalizes” them from 0-1.

this means that if a single cube is from 2-4 bu away from the camera, 2-4 is then 0-1 and if a single cube is 5-7, it will be 0-1 but a bunch of cubes from 2-10 bu will also get put into that 0-1 range and that is your problem.

What you need to do is use a map value node instead

Check out my very old but still valid link from before there was a normalize node on how to set things up to do what you want

edit: ah… Atom beat me to it… but not by much :wink:

edit2: and I would set up the map node for the whole scene 1st and then duplicate it for the other passes for consistancy, if you use a normalize node for 1 and map nodes for the others, they will give slightly different results no matter how much you tweek the map nodes…

thanks alot,
I’ll give that a try.:wink:
But I still have the problem, that blender doesn’t seem to create a proper picutre for every scene, some how it only renders the last one properly.
Any ideas on that matter?
Thx again :o