Lets assume, we have two depth maps with us and their corresponding color maps. Now, our task is to populate a final image that will be displayed.
Each pixel in the final image needs to be calculated from the given 4 maps - two color and corresponding depth. I am simply aiming to create a final image considering the occlusion of one depth map over the other.
My idea is to just compare the depth values and then take the color value from the map whichever is closer to the camera.
Is this a right way to approach the problem?
PS: This problem popped up as part of a hybrid rendering solution am working on - combining ray marching and rasterization to get triangles as well as metaballs working. So, one of the pair of maps above comes from rasterization and the other comes from ray marching.