Alright, so I’ve done a few tests with this technique, and it does work pretty well. It’s not 100% perfect, but I’ll get into that in a bit. First of all, the effect is really easy to implement. This is my method of implementing the invisibility effect in a Material Function that can be used in an kind of material.
Important Note: The “if” node needs to have an “Equals Threshold” appropriate for 1 frame’s distance of your player’s movement speed. I have been unable to fix a 1 frame differential between the values of the “Camera Position” node and the stored position of the player’s camera. This difference is unnoticeable if the player is not moving, but if they are, then material might think that the player’s camera is actually too far away from “Camera Position” to make the object invisible.
The Inputs and Output can handle (In my particular version) Scalars, and Vectors (Up to Vector 3 in my case, but they could handle a Vector 4 if I wanted them to). This allows them to be able to handle textures and masks as well as just the 0-1 values. Also, even though I am using this method only for opacity, it is fully capable of doing this for any material attribute, not just opacity. Here is what the Material Function looks like in a material.
Here are some examples of the effect being used in conjunction with Planar Reflections to get the desired result.
Mesh’s Reflection with Normal Material vs. Invisible Material
Particle Systems with Normal Material vs. Invisible Material
Now, I did run into a little bit of trouble trying to get this to work with particles, and I’m not 100% happy with the results, but it turns out that Particles in general have a difficult time with reflections, so I found this post (Particles aren’t reflected by Planar Reflection) that helped me solve (Mostly) the reflection problem.
Deferred Decals Using Invisible Material
So far, it seems to be a really nice solution. I think that it’s robust enough for pretty much all my needs, so I am going to use this method unless I find something that is significantly better. However, I am still interested to hear other solutions or improvements to this method if anyone has some. Anyways, thanks again for the help! I really appreciate it!