New answers tagged depth-buffer
First of all, please give a complete source code of (small error-prone version of) your project, because this kind of problem depends on lots of things. However, there are lots of reasons that can make unwanted black screen, most common mistakes that I can guess in your case, are: mathematics mistakes camera matrix (in your case see your clipping range) ...
Following Draco18s comment, I'm using a 3D object which is moved around the screen by tracking the live video object. Then I apply a depth mask to this object which behaves as if there was an actual object there since it allows my background to be seen wherever this object would be usually seen while still remaining invisible.
Top 50 recent answers are included