- Home /
Semi transparent Object behind walls?
I want to make an object to appear semi transparent when it is behind walls so that the camera would still be able to render it but in less solid form. Does this have to do with shaders or raycast? I not sure on the right keyword to search for the problem or even where to start. Hopefully someone could point me to the right direction. Thank you.
This might be a stupid thing to ask, but I can't help my curiosity - Why is the object visible in the first place, if it's behind a wall? Is the wall itself transparent?
I want it to be visible because the object is some sort of guidance to the player so that the player knows the location of the object wherever they are. The object is solid if the camera looks directly at the object and the camera would render it semi transparent when behind walls (will render through walls).
Answer by Waz · Aug 08, 2011 at 09:52 AM
Shaders. Basically, you need to render the object with two shaders: the normal material and one with an inverted Z test (as well as whatever glowing rim lit transparent whatever effect). Keywords:
ztest greater shader
Try to make something with the Strumpy Shader Editor, or modify an existing shader source. This is a good simple intro to Shaders. You'll find they're quite fun.
Note that to render with two materials, you can just give it two materials in the $$anonymous$$eshRenderer.
Your answer
Follow this Question
Related Questions
Several questions about OnRenderObject and Camera projection matrix use. 0 Answers
Is there any way to hide only part of an object from the camera? (unity free) 2 Answers
Shader Edges Transparent Relative to Camera 0 Answers
Glow effect - alpha channel ignored to some specific android device 0 Answers