- Home /
Does Unity have 2D/3D Masking/Occlusion?
Hello,
Is it possible to mask out an object with another object? What I mean is, for example, in Photoshop you can apply a mask to any drawing layer with any defined mask you apply and it will remove the drawing layer as defined.
So, for example I'm working on an in-scene GUI system and I want to be able to slide a plane over some text, but I don't want the users to see this plane, I simply want it to mask out the text, so it looks like my text is 'wiping' away as the plane slides over, whilst seeing the background.
Any ideas? Thanks
Answer by whydoidoit · Oct 16, 2013 at 04:46 PM
You can do that by using a depth based shader that writes no image - it will clip things inside it's volume, so you should actually write a "Cube" or a plane to depth only and anything behind it will be obscured.
does the depth mask allow soft mask generated by the masking object texture or vertex alpha ?
and if not, is there such a solution which would work as soft alpha masking in flash or after effects? by just 2 planes with transparent texture
Your answer
![](https://koobas.hobune.stream/wayback/20220613120039im_/https://answers.unity.com/themes/thub/images/avi.jpg)