I feel like this has been done, maybe even by me, but now I’m stumbling on how, ha.
I have frames rendered from elsewhere with color and depth data. I want to use the depth exr data as my depth for a render pass so i can render things in the same scene that respect depth from the other program’s render. Trying to just render a card with color and depth in my initial render than use passes with that depth after that. In wiki it says “Depth is output through a variable declared as out float depthName. You can name these variables whatever you want.”
I’m trying to write out an additional float this way in my pixel shader and don’t seem to be having much luck. Any pointers as to best practices here? Is this feasible? I guess I can use a POP to set depth via TOP to POP and render that instead as my first render.
I have this defined in my shader before main, after oFragColor:
out float oDepthData;
And then i have
oDepthData = texture(myDepthSampler, texCoord.st).r;
I guess i don’t see how this gets into the pipes to replace the under the hood depth write, and using a depth TOP on the render indeed does not seem to be showing my input depth image.