How to hide object in a cube hole?

Viewed 47

I'm trying to hide an object in a hole, after searching for a solution, I followed this example & successfully create a hole:

https://stemkoski.github.io/AR-Examples/hole-box.html

But when I placed an object inside, it's overlap the hole, instead of being covered behind the faces (image 3)

Image 2 is what I want to achieve but haven't found a way so far.

enter image description here

I tried with clipping & masking (postprocessing) as well without success.

It would be great if someone could give me a clue.

I found this, it's exactly what I'm looking for, but the source was removed.

0 Answers
Related