The situation is as follows: I would like to create an image where the pixel values (RGB) correspond to the position (XYZ) of the point in space (world coordinate).
Create a new material, like in this post How to render world position pass, seems to be a good idea. And I could render a scene with this new material overriding all materials in a scene. However, this does not take into account the current material of the object, which defines its shape using transparency. For example, a leaf is usually a rectangle with leaf texture (which composes of both leaf image and transparent parts). So this way, a leaf in Position-Image will appear as just a rectangle, and it is not desired.
I am wondering if there could be another way around, ideally a render pass that would output such XYZ values, or a way to incorporate this material with the current material of a object. Manually do so for all object is not a good idea as they are so many.