Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

3D Text always blurry

Discussion in 'Immediate Mode GUI (IMGUI)' started by friendlydev, Mar 5, 2009.

  1. friendlydev

    friendlydev

    Joined:
    Dec 21, 2008
    Posts:
    153
    Hi there,

    in my current project, I want to render some text and I want to do this directly in my game view and not as GUI text.

    Anyway, I perfectly managed to create my text, which isn't too difficult anyway :) "Game Object > Create Other > 3D Text".

    Now that I got my text, it always seems to be really blurry. I tried to change the character size in inspector and then manually size it down, using the size tool, but that doesnt do the trick.

    I even tried to import a new .ttf and use that one instead of the default font, but that didnt help either.

    Maybe someone can show me the right direction, as it seems to be possible somehow. When I checked on the "Text Mesh" example in the reference manual, it appeared, as if they had a big text perfectly sharp.

    Thanks in advance!
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,300
    Did you change the font size in the import settings for the font? It should probably be at least 90 if you want decent-sized text, and that should result in a texture size somewhere around 1024x512, depending on the character set you choose.

    --Eric
     
    dobranoc likes this.
  3. friendlydev

    friendlydev

    Joined:
    Dec 21, 2008
    Posts:
    153
    Well, I remember importing the font by drag and drop. Simply placed it into my project view. So, I missed something, obviously. How would you correctly import a font? Thanks
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,300
    Click on the font and then click on "Settings...".

    --Eric
     
    joanfictio likes this.
  5. friendlydev

    friendlydev

    Joined:
    Dec 21, 2008
    Posts:
    153
    Thanks man! Awsome, that did the trick :) Thanks again for saving the newbie :)
     
  6. Navezof

    Navezof

    Joined:
    Dec 2, 2012
    Posts:
    22
    I'm reviving a 5 years old post, but thanks for the tip, it's working perfectly!
     
  7. OpticalOverride

    OpticalOverride

    Joined:
    Jan 13, 2013
    Posts:
    157
    There is another (somewhat easier way) to fix this problem as well, and it doesn't require importing a new font. (For anyone who just wants to use the standard Arial!)

    After adding the 3D Text object, just scale the object down (say the x, y, and z scale components to 0.1) and then scale the Font Size of the Text Mesh up (say to 100). This will give crystal clear text without having to import new fonts!
     
  8. tonic

    tonic

    Joined:
    Oct 31, 2012
    Posts:
    405
    If you'd use text mesh, the text can still end up looking a bit jaggy if character size is too big and you have scaled text down, or the text can end up looking blurry if your character size is too small and text is scaled too big. For example, if you work on mobile platforms, depending on dpi resolution and screen resolution, the text mesh can look bad on one device even if you tweaked it to be perfect on another.

    So, I'd like to mention my new addition to the asset store. It works like text mesh, but you only need to set the size in world units, with no need to set some arbitrary size and then scale the text. And then it figures out the best actual pixel size to render text with...

    Check out Dynamic Text in Asset Store.

    The Dynamic Text component is used for displaying pixel-perfect camera-facing text. The size and position are defined in world units. If compared to Unity's built-in text components, Dynamic Text is sharp like built-in GUIText, but part of the scene like TextMesh.

    The same dynamic fonts are used what you would use with TextMesh, and also the same standard font material and shader are in use. It works both with orthogonal and perspective cameras, and suits best for situations where font size on screen stays mostly static. Regardless of font's unit size on screen or camera distance, the text will be renderer pixel-perfect.

    Dynamic Text website has more info (e.g. interactive demo for Unity web player or a YouTube video of the demo).

    The web site actually has some example images to describe the exact problem I mentioned first which one can get when working with built-in GUI Text or TextMesh.
     
    Spooneroonie likes this.
  9. rbosse

    rbosse

    Joined:
    May 21, 2015
    Posts:
    18
    I fixed this by simply changing the Character Size. I made it 0.1 and then everything went super smooth.
     
    AForApple, SimRuJ and LiloE like this.
  10. chongxi_lai

    chongxi_lai

    Joined:
    Nov 22, 2020
    Posts:
    2
    upload_2020-11-28_10-22-46.png

    Adjust in the Text Mesh: 1. Increase the `Font Size`; 2. Decrease the `Character Size`.
     
    tsapapolis likes this.
unityunity