3d objects hide behind transparent object
Hi, i have some 3d objects in a 3d frame that have a translation animation and i want them to disappear when they exceed that frame. I tried doing that using the depth mask shader, but i'm having 2 problems: one is that i can still see the objects shadow and second is that after i apply this shader the objects don't have the same visual quality as before(when they are not masked). Is there any other way to be doing this? I want to achieve the same effect like the one with UI masking, only that this time is with 3d objects. Thank you so much!
Comment
Best Answer
Answer by tanoshimi · Dec 11, 2015 at 10:24 AM
Create a shader that uses the stencil buffer: https://alastaira.wordpress.com/2014/12/27/using-the-stencil-buffer-in-unity-free/
Your answer
![](https://koobas.hobune.stream/wayback/20220612052210im_/https://answers.unity.com/themes/thub/images/avi.jpg)