I am looking to create a render pass that takes a scene and outputs, for each pixel, the 3D world coordinate of the center of the object to which that pixel belongs. In other words, all pixels that show the same object should have the same value.
Now, what I could do, is render a separate pass for each object where only the pixels of that object are white, and then set the values manually, but I was wondering if there was a better/quicker method.
Thanks a lot!