I’m trying to find some way (I think a shader is probably going to be what works) to make everything in front of a mesh disappear. Basically, what i want the shader to act like the mask shader on the wiki but to mask everything IN FRONT of the object rather than behind it. I have messed around with the mask shader and gotten something that kind of approaches what i want. As far as i can tell it causes everything in front of the object with the shader not to obscure other objects, but does not cause it not to be rendered; the result is that things look kind of ghostly and semi-transparent in the area in front of the object with the shader. I feel like it’s close to working but i don’t know what I need to do to make it work! Can anyone give me any tips about what to do to make this work?
Here’s what I have so far:
Shader "Masked/BackMask" {
SubShader {
Tags {"Queue" = "Geometry" }
Lighting Off
ZTest GEqual
Blend One One
ZWrite On
ColorMask 0
Pass {
}
}
}