- Home /
Mesh with Transparent material makes TextMesh in front of it invisible
Okay, so I have a problem with my game. I have Text Mesh objects generated via a script above 3 doors in my game Normally, it looks like this (albeit with an easier to see font).
This works fine, however, because the wall is in the way when you open the door to a new room, we put in a transparency script that makes the room semi-transparent when the character is covered by a wall. However, when we enable this by changing the room's material from Bumped Diffuse to Transparent Bumped Diffuse to enable the alpha channel, this happens.
The text over the doors disappears. I have no idea why, especially considering the text is positioned in front of the wall and is not intersecting. The textMeshes still appear on my hierarchy though and when I activate the transparenct feature I mentioned, they suddenly reappear while the room is transparent.
When the room returns to relatively solid form, the text meshes no longer appear. Additionally, I can see them in the scene view, but ONLY at certain angles, most notably behind the room.
My programmer and I are utterly baffled as to why this is happening. It looks fine with regular material but this messes up as soon as I switch to a material type with a transparency.
Does anyone have any idea why this is happening?
Answer by fighder · Nov 24, 2015 at 03:24 PM
I never tested this, and I just found it when I was googling for the same problem: There seems to be problems with text mesh materials and transparent materials, as stated in this question, http://answers.unity3d.com/questions/207238/why-does-my-textmesh-dissappear-from-certain-camer.html, when you use cutout instead, the problems go away.
http://forum.unity3d.com/threads/shader-depth-issue-object-disappears.74181/ here the solution seems to be editing the shader code, as the problem seems to be the render queue of both the wall and text mesh are at the same time, so their rendering order is never clearly determined, therefore fucking up the rendering. I couldn't find a way to edit the default shader for the text mesh, but if you find a way, you try using the solution.
Look forward to you solving this :)
Answer by Girish-sruthkia · Nov 24, 2015 at 09:32 AM
This is because, you are using Transparent Shaders for both Room and your text. Since both shader's Zwrite is off, you will experience depth sorting problems. Try to use "Transparent/Cutout/TransparentDiffuse" shader for your "Text". If you are using unity 5, use Standard shader and keep the rendering mode to cutout for the text.
Answer by Skquark · Aug 07, 2017 at 03:06 AM
Had the same problem using TextMesh Pro in front of objects that I needed to fade transparency in and out, so I couldn't just switch it to Cutout since it doesn't let me fade. The solution for me was to change the Standard Shader (actually using Holotoolkit/Fast Configurable, but it's the same) Rendering Mode from Transparent to Advanced, then change the Render Queue from 3000 Transparent to 2999 Transparent-1 and I was able to see the text from all angles again.. That glitch was annoying me for a while, hope this helps someone facing the same issues...
@Skquark ,, thanks, I am having this exact same problem. I did not understand your instructions though. How do you change the StandardShader Render $$anonymous$$ode to "Advanced"? I only see "Opaque","Cutout","Fade","Transparent". I can't see how to set Advanced or change the Render Queue. I am looking at the inspector for both my 3d object and my 3d text mesh... Thank you for any help!