I am using augmented reality to put a 3D object on top of a "camera detected" object.
The 3D object can be though of as leaves that go above the real world object but also fall in front / behind / on the sides of it.
The leaves are not uniform so they appear as arcs which let more of the "camera detected" object be seen in some parts and less in others.
Because of this I want to only show the leaves that would normally be seen if there was a real 3D object (instead of the camera detected one) in that place. But since the camera detected one is just a background image part of the leaves on the side or behind are seen when the object is rotated.
I was thinking it might be possible to use an "invisible" object that moves and rotates the same way as the "camera detected" one so it behaves as a placeholder for depth testing but is not actually rendered.
Is this possible? May I have some pointers on how to achieve this?