Masking (Depth Mask?)

Hi,

I’m trying to make parts of an object hidden while keeping the other part visible, basically what I have is a long wall (a box) and I want parts of it to be invisible (the invisible parts could change every frame though).

Look at that image, the first wall is just a resized Cube and the second one is what I want, to have the marked part of the wall hidden.

From what I have found on the forums and on google this seems to be doable with a “Depth Mask shader”, but shaders are completely new to me and I don’t know where to start or even what a Depth Mask is.

I’d be grateful for any help or info you can give!
Thanks!

Without hearing more, I don’t think that depth masking is what you want. I’d guess at a procedural mesh where certain triangles aren’t drawn. Next guess would be alpha testing. Have you ruled these out already?

Hi,
no, I haven’t ruled them out, mostly because I didn’t know about them though. These things are generally out of my scope so I’d be really grateful if you could elaborate a little more on what alpha testing is and how I would create a procedural mesh in unity.

Thanks!

See what you can get from these; ask questions to further your knowledge if necessary:

If you are using Booleans (like in Maya), you could create a Boolean on the wall and then don’t delete its object history (preserving the shapes that made the boolean). You might then be able to manipulate the boolean effect by manipulating the subtractive object. You could use a separate collider object to preserve collision.

It doesn’t work like that outside of 3D programs…

Thank you Jessy, the procedural mesh approach worked great!