Thank you for your helo @kelly. I followed your advice. I also downloaded a sample from depthkit video page analize the metadata.
Based on this i was able to determine how i could remap the black and white depth pass to a color pass. It looks like the color spectrum on this sample is from yellow(closest) to violet(furthest) and i’m assuming it goes full way to red etc. I tried to mimic that using a pre-renered zdepth and here are some examples
Here is a link to the video of how that works. https://youtu.be/7PVu9Xrya64 (sorry for the quality as i did not have my main recording equipment at the moment)
I also used this code that got from the depth kit sample and your suggestions
I was not able to find the documentation for the metadata so this is trial and error.
For the most part it is working ok but there are large artifacts present on the edges when the front plane meets the background.
The same image while using the grey scale zdepth image does not have any artifacts but does not allow for animation. Looks like the gray scale image is using the background pixels to fill in the space and the color coded material is using the object pixels to fill it in. There is also some kind of a choker that Easts a way the edges of the character using the gray scale image. I am assuming that helps to fill in the edges.
I think there could be some color spill when converting the zdepth to color that might be causing this. but i am not sure.
Is it possible to know what is the difference in converting the material from zdepth and form the color depth. ? looks like the depth version is superior as it builds the depth from 0-1 based on the brightness.
Trying to find a way to move forward but it is very close. There are hours of pre-rendered materials that could be converted to play on the looking glass if this works.