Hello.
How can I mask a rendered opaque or transparent object in the scene. I don’t simply mean putting it into another layer and culling it with camera, I mean to mask it inside the scene with its depth cutoff and everything. Here’s an image to explain it better.
You will have to add stencil values to your shaders so that some shaders will “stencil” a part of the screen that other shaders can choose to only render inside or outside the stencil area.
This is a difficult process to explain from scratch, so try learning it with this manual page and I can answer questions if you get stuck. There are some image examples at the bottom. Unity - Manual: ShaderLab command: Stencil
1 Like