- Home /
3D Text Shade do not work properly (Characters occluding other characters)
Greetings,
I have a 3D Text Shader, which make 3D text to not be rendered through walls and object.
Here is the Shader
Shader "GUI/3D Text Shader" {
Properties {
_MainTex ("Font Texture", 2D) = "white" {}
_Color ("Text Color", Color) = (1,1,1,1)
}
SubShader {
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
Lighting Off Cull Off ZWrite On Fog { Mode Off }
Blend SrcAlpha OneMinusSrcAlpha
Pass {
Color [_Color]
SetTexture [_MainTex] {
combine primary, texture * primary
}
}
}
}
When I rotate my text, it does not render correctly. Parts disappear, sometime whole letters. As seen here : http://img832.imageshack.us/img832/707/bug3dtext.png
Any ideas what might happen? I used this shader in an old version of unity 3D (3.0) and it worked perfectly. Even now, If I open that old project. It still works perfectly.
Edit: I've found the bug, some fonts are non-standard and characters overlaps. This cause and occluding/rendering error.
So to rectify this, I'd need some way that characters does not occlude letter parts of the same mesh.
This is the @Eric5h5 text shader posted in the wiki. Have you followed the other steps to set the font material as well? Failing in doing this may produce weird errors. Take a look at the original article to check all the steps: http://www.unifycommunity.com/wiki/index.php?title=3DText
It is that one, I had forgot where I've gotten it.
Still, it does not work. It seems that my font may be not entirely compatible with it, as I've used my old font and it worked quite well. ($$anonymous$$inus the Texture disappearing error, which is another matter.)
Is the screenshot from a single Text$$anonymous$$esh or there are multiple?
Single text mesh. As said in the Edit, the source of the bug has been identified. I need a solution now, I'm trying to come up with one, if someone already know how, it would be helpful.
Answer by luizgpa · Jan 04, 2012 at 02:14 AM
Change
ZWrite On
to
ZWrite Off
The drawback is that one TextMesh behind another one may be rendered after and appear in the front.
Your answer
Follow this Question
Related Questions
Render problems in web build (wrong colors) 1 Answer
My new computer can't render Unity GameObjects 0 Answers
plane rendering problem 4 Answers
3D Text Looks Like It's Behind A Plane, When It's Not? 1 Answer
Green lines are gone? 1 Answer