Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Dennis Roseman · Dec 29, 2012 at 01:41 PM · shaderstextmesh

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.alt text

shadertest00.jpg (106.9 kB)
shadertest02.jpg (90.2 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dennis Roseman · Dec 30, 2012 at 03:00 PM 0
Share

What I was missing was not just a shader, but also understanding

how font textures are (and can be) used in Unity. Once I found

out (recall I am new to Unity) that I could "open up" my font to

expose the font texture, I was able to drag-drop this into my new

material and then drag-drop that material onto my text and all is

good. Dennis

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by CHPedersen · Dec 29, 2012 at 03:54 PM

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:

http://wiki.unity3d.com/index.php?title=3DText

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

http://wiki.unity3d.com/index.php?title=SaveFontTexture

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Dennis Roseman · Dec 29, 2012 at 08:05 PM

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.alt text 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.


blenderdcube.jpg (17.3 kB)
unitydcube.jpg (16.8 kB)
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Loius · Dec 29, 2012 at 08:57 PM 0
Share

That's transparency fighting, happens a lot. Try adding 'zwrite on' to your shader passes.

Also don't forget, post a comment with the comment button, leave the answer area for actual answers to the question :)

Specifically my shader has this directly below 'category':

 Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
 Blend SrcAlpha One$$anonymous$$inusSrcAlpha
 AlphaTest Greater .01
 Color$$anonymous$$ask RGB
 Cull Off Lighting Off ZWrite On

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Shader on TMP works perfectly in editor, but not in build. 0 Answers

How to update TMP Pro Sprite Shader using script/C#? 1 Answer

Is there's any benefit when using mobile shader vs normal shader? - TextMeshPro 1 Answer

Text Material Shader Not Working Properly 1 Answer

How can I achieve advanced text effects? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges