- Home /
How would you do partial gameobject transparency on a custom mesh?
Hello all. I am currently building a custom mesh, with each part potentially having a different material. Picture legos that combine to form a larger structure.
Now, I want to have portions of the terrain 'phase' in and out in a trap fashion. If a player hits a trap, the ground below will become transparent and fade out, causing the player to fall and die. Unfortunately, this leads to issues where the trap can be placed on a non-transparent block that then needs to become transparent. Can this be done?
I was thinking of using either the alpha in vertex colors for the mesh, or using a cutout shader that blends transparency into the blocks it encompasses. But before I ventured into either route, I wanted to know if anyone else has had experience with making non-transparent materials transparent somehow, or if the cutout path would even work.
Tl;dr: Is there a way to layer something onto a non-transparent material to make said material appear transparent/fade in and out?
Thank you all for your help.
Answer by Cherno · Jan 21, 2015 at 09:48 AM
For fading in and out objects, use either a shader that supports transparency (Transparent Diffuse, for example), or one that support Vertex colors nad change the vertices's alpha. What exactly is your question? :)
I updated my post to include a Tl;dr. Basically, I want to have transparent functionality on the mesh without forcing the user to always use transparent materials.
Could you maybe provide one or two simple images that show what you are trying to achieve? It's not clear to me if you want a whole mesh to become transparent, or just some part of it (a sub$$anonymous$$esh). Generally, it should be possible to achieve what you want, but some more information on how your traps and terrain blocks are made would be helpful :)
Your answer
