I’m trying to reproduce this effect:
Where important object (ie: players, objectives) areas are masked on certain tall materials (ie: Canopy, Pillar).
My first idea was to use the render queue and depth buffer to mask out a sphere around each important object that’s attached as a child. Now some of you might point out that this will do nothing in the example of the photo because the sphere would still be farther than the canopy from the camera. I wanted to try messing with the depth offset to see if I could force the depth value to always be nearer to the camera. My second idea was to have the sphere position always updated to be as close to the camera as possible in the right position so it would always be in between the obstacle and the camera.
The reason why I want to use the render queue and depth buffer technique is really just because that’s the only technique I know that could potentially work and I’ve used it before for water masking. If anyone knows of another technique please let me know. I am still very new to shaders and vfx techniques.
Now the real problem is that I can’t even get “Geometry” to be masked out at all. As I mentioned before I’ve used this technique for water:
Where the mask is rendered at “Transparent-1” and the water is rendered at “Transparent” everything works fine.
Shader "Custom/Mask"
{
SubShader
{
Tags { "Queue"="Transparent-1" }
ColorMask 0
Zwrite On
Pass{}
}
}
Now when I try to mask out “Geometry” with “Geometry-1”, this is what happens:
Just nothing. Anyone knows what’s happening here?