Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
3
Question by Matrix211v1 · Jun 25, 2010 at 08:58 PM · textmesh

TextMesh looking fuzzy

Is there anyway to have the TextMesh so it's not blocky or fuzzy?

Here is an example: http://simpson3d.com/forum/HelloWorld.png

Thanks!

Comment
Add comment
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

6 Replies

· Add your reply
  • Sort: 
avatar image
33

Answer by kishsolanki · Feb 09, 2016 at 05:11 PM

I am putting it late, But maybe someone can get help from this because what I did to make it look awesome (even with inbuilt fonts) is set the CHARACTER SIZE of text mesh as minimum (I keep it 0.03) , and increased the FONT SIZE to 355. So I think by reducing the CHARACTER SIZE and increasing FONT SIZE, it won't look fuzzy. See the imagetextmesh


textmesh.png (175.2 kB)
Comment
Add comment · Show 5 · 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 derdimi · Jun 12, 2017 at 05:38 PM 0
Share

Brilliant. Thank you very much!

avatar image RishabhRyber · Jan 03, 2018 at 07:13 PM 0
Share

That's really helpful thanks, bro.

avatar image roointan · Jun 04, 2018 at 02:36 PM 0
Share

That works. Thanks.

avatar image iswaryapanamontech · Sep 29, 2018 at 07:58 AM 0
Share

thanks its work

avatar image Helbino · Jan 16, 2021 at 03:16 AM 0
Share

Still a necessary and effective work around!

avatar image
6

Answer by Bhoomi · Jun 11, 2013 at 03:25 PM

Try to reduce the scale of your GameObject and increase the font size instead.

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 Remus-Ciprian · Apr 17, 2014 at 02:31 PM 0
Share

That's it! Thanks!

avatar image
4

Answer by Eric5h5 · Jun 25, 2010 at 10:10 PM

Import the font at a larger size.

Comment
Add comment · Show 4 · 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 Tetrad · Jun 25, 2010 at 11:00 PM 1
Share

I looks like he's using the default font, so it's probably worth mentioning that he probably should import some font so he can set the size of it.

avatar image Eric5h5 · Jun 26, 2010 at 01:37 AM 0
Share

Good point; I believe the built-in font is Arial, if you want to use the same thing.

avatar image dpk · Nov 24, 2012 at 08:05 PM 4
Share

In addition, set your font size high in the Text $$anonymous$$esh and scale down the object accordingly. Otherwise you'll still end up with an ugly mess.

avatar image jtok4j · Sep 07, 2014 at 09:56 AM 1
Share

set your font size high in the Text $$anonymous$$esh and scale down the object accordingly

Wow, this was exactly what I needed. I'm simply using the default Arial font, and making the font really big and scaling the 3d Text object down, make it super clear! Thanks!

avatar image
2

Answer by zeh · Sep 28, 2014 at 02:37 PM

Sedesikus' solution didn't work well for me because of varying screen resolutions (e.g. running in different platforms and screen sizes). Here's a more generic solution that changes characterSize and fontSize according to the current window resolution so you can always have sharp text regardless of the size of the window or text. I could not find anything like this online, so hopefully it'll work as future reference for someone else:

 using System;
 using UnityEngine;

 public class TextMeshSharpener:MonoBehaviour {

     /*
     Makes TextMesh look sharp regardless of camera size/resolution
     Do NOT change character size or font size; use scale only
     */

     // Properties
     private float lastPixelHeight = -1;
     private TextMesh textMesh;

     void Start() {
         textMesh = GetComponent<TextMesh>();
         resize();
     }

     void Update() {
         // Always resize in the editor, or when playing the game, only when the resolution changes
         if (Camera.main.pixelHeight != lastPixelHeight || (Application.isEditor && !Application.isPlaying)) resize();
     }

     private void resize() {
         float ph = Camera.main.pixelHeight;
         float ch = Camera.main.orthographicSize;
         float pixelRatio = (ch * 2.0f) / ph;
         float targetRes = 128f;
         textMesh.characterSize = pixelRatio * Camera.main.orthographicSize / Math.Max(transform.localScale.x, transform.localScale.y);
         textMesh.fontSize = (int)Math.Round(targetRes / textMesh.characterSize);
         lastPixelHeight = ph;
     }
 }

Save this as TextMeshSharpener.cs, add this as a script to a TextMesh and it'll automagically work.

The catch with this solution, as stated in the comments, is that you don't change the characterSize or fontSize yourself: you let the script handle it. Instead you change the TextMesh's scale to whatever you want.

targetRes is a magic number that declares the target resolution of the text texture. You normally won't need to change this ever. It can be tweaked to create even sharper text (not recommended, 128 is already pretty good) or to create textures with less resolution that use less memory (at the cost of being a little blurrier).

One other caveat is that this doesn't re-calculate the resolution when animating the object. Doing so would make the animation a bit jaggy since it'd be changing the texture resolution. So it'll resize the texture "as-is", as it would with a normal TextMesh. That feature can easily be added by also checking the scale on Update though.

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 Woj_Gabel_FertileSky · Mar 06, 2013 at 12:23 AM

Old, but I want to leave the info for everybody for placing textmesh in ortho view. Import text and set it's size to whatever you like. For example font size 12. Then set its size to

 var pixelRatio : float = (camera.orthographicSize  * 2) / cam.pixelHeight;
 characterSize = 1;
 transform.localScale = Vector3(pixelRatio*10,pixelRatio*10 ,pixelRatio * 0.1);
 go.transform.localPosition.x += 0.001f;
 go.transform.localPosition.y += 0.001f;

It's a hack, but it works for me. If anyone will happen to know a better solution, let me know.

Comment
Add comment · Show 2 · 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 downpour · Aug 07, 2014 at 08:56 PM 0
Share

Sedesikus' solution worked for me. I've included the C# version of what he said below. Note that if you make your text mesh a prefab you can set the character size and local position on the prefab and don't need to adjust it here (but you can if you want to).

 // where myText is the instance of your text mesh in the scene
 float pixelRatio = (Camera.main.orthographicSize * 2.0f) / Camera.main.pixelHeight;
 myText.transform.localScale = new Vector3(pixelRatio * 10.0f, pixelRatio * 10.0f, pixelRatio * 0.1f);
 
avatar image sabint · Jan 17, 2015 at 11:46 PM 0
Share

Wouldn't this produce texts of different sizes on devices with different resolutions? Perhaps a better solution would be to simultaneously both decrease the object and increase the font size in the Text$$anonymous$$esh so their product is the same as before.

  • 1
  • 2
  • ›

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

13 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 avatar image avatar image avatar image

Related Questions

Is there a way to get access to the mesh geometry in a TextMesh? 1 Answer

How to draw 3D text from code 4 Answers

Why does unity expect a file when I try to put text on a mesh? 1 Answer

How can I add a normal to a text mesh so that it lights correctly? 0 Answers

Unity Meshes for C# generated objects 0 Answers


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