Why does shader show chars as rectangles?

I am using the shader I found by Eric Haines in http://wiki.unity3d.com/index.php/3DText

I have the following problem using this shader in Unity4—text transforms 3d testMesh to a “string” of disjoint filled bounding rectangles, one for each letter. “Good news” is these rectangles now seem correctly occluded by other meshes.

I am new to Unity but not to computer graphics. I do not yet know enough about shader syntax to see exactly how this “should” work, but am browsing some tutorials.

Attached are test images–before and after I added shader.

This is related to the texture you’re using with Eric’s 3D text shader. It usually happens because we can’t select the default 3d text material the built-in shader for 3D text uses, so you have to recreate a font texture. Thankfully, I think Eric also provides some editor script for that.

First, read the entire tutorial Eric wrote for use with his custom 3D Text shader:


Then, realizing that you need a new font texture, use his SaveFontTexture script to create it:


Thanks for the reply. I did not realize I needed a new font texture. In fact I am not clear on what the issue is, but then again I have not puzzled out the code involved.

I have tried to follow this solution but so far without success. I believe I correctly used the script of SaveFontTexture and used it to make a new Material and applied it, but this has not changed how things look.

I am confused on a couple of things—maybe it will become clear as I continue to work on this. But the SaveFontTexture in code and comments refers to GUIText objects and but I am using (and need to use) 3d Text.

Also, in SaveFontTexture instructions, it further instructs to use some other shader from http://wiki.unity3d.com/index.php/TexturedFont. I am assuming that I am to use the 3D TexturedFont of ttp://wiki.unity3d.com/index.php?title=3DText. (None of these seems to resolve my basic problem of showing the text).

Attached are two files—one of my game in blender so you can see what I am really trying to do. Note how the frame appears in front of the green M and S. In this game I need to quickly change the letters on the cube.6209-unitydcube.jpg The second is from my Unity version showing the problem if one uses the standard shader—see how the F and D appear to be outside the frame.