World position for z depth pass


I’m wondering if there is a way to instead of the z depth being calculated from the cameras position, you can make it so it is being calculated from any position in the scene.
Essentially like this:

Is there a way to do this with the internal blender render?

Any help is much appreciated!


Yes. Could make a shadeless material that feeds the position value as the color and use that material to override it in a render layer.

I’m a bit new to Blender so if possible, could you explain in a bit more detail how to set that up? :slight_smile:
Thank you!

The node setups can be simplified from that

It’s a node material that is set to override every other material in the render layer properties.

Compositor gets the rendering through the render layer node and can automatically run it through the set node setup, which substracts the same value that was added before, and the result has negative values for negative world coordinates.

Thank you so much! I really appreciate it!