Cool stuff! Thanks to both of you guys for opening up a whole realm of new effects for me using this method. I came up with half a dozen new shaders today that use this effect… masking objects, revealing them, swapping textures once they’re behind or in front of another object, etc… so much fun!
It got me interested in making some boolean shaders with this technique too using ColorMask A, but I think that requires some Cg to flip normals around.
Anyway, thanks again, for some reason this topic opened my mind up just a bit more to how shaders work. So much potential craziness!
I have no idea about shader scripting but i have been looking for a shader like this for a while. The only problem i am running into is if the object you put the shader on has children.
stuck on the same problem, the character part is always behind the weapon, so the occluded part on the body is always rendered will the semi-transparent pass. Any solution for this problem?