Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

TextMesh Pro Should Softness Not Scale With Font-size?

Discussion in 'UGUI & TextMesh Pro' started by dadude123, Apr 10, 2019.

  1. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    It feels like this is a bug that has existed for a very long time.
    Increasing the font size of a TMP Text will eventually cause it to become invisible.

    For large text (example from fortnite: https://fortniteintel.com/wp-content/uploads/2018/11/food-fight-ltm.jpg ) this is a huge issue.

    The "softness" slider can alleviate the issue a little bit, but since it's a global control that's of course not right.
    When looking at the text from a perspective (in the example screenshot that'd be from the side or below the wall) the issue will still appear.

    The softness/sharpness control seems to take the size of the symbol on screen into account, but it doesn't do it right somehow.

    The softness should be constant, no matter the on-screen-size.

    To reproduce, simple create a SDF based text, and play around with font-size and smoothness.
    If you reduce the smoothness and increase the size it will disappear.

    Maybe the implementation is right for other situations, but I'm experiencing lots of cases where the font is either too sharp (close to disappearing), or too blurry (when moving closer to the text).
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Can you post images of the result you are getting?

    The Softness you are referring to is the property in the Material Inspector correct?

    Material properties such as Outline, Dilation, Softness, Underlay, etc. are all relative to the ratio of Sampling point size to padding and should remain consistent regardless of the point size of the text being displayed.

    SDF Scaling can affect this and result in the text appearing too soft or too sharp depending on scale of the text object but that should be handled automatically. If the geometry of the text is being modified outside of TMP and via some other ways to get around / break the correct SDF scaling but I am not sure it is the case here. Need to see some images of what you are observing to provide more insight.
     
  3. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789


    Yes I'm talking about the softness in the material inspector.

    You can see that the font becomes sharper, even jagged, and then finally disappears.
    There's no scaling going on (RectTransform or vertex modification).


    edit:

    25px size: https://i.imgur.com/jeECcXQ.png
    jagged edges when increasing font size: https://i.imgur.com/acHgaSl.png
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Are you getting these results using a Canvas with a Canvas Scaler?

    If so, compare the results in the GameView vs Scene View.

    BTW: The text should not be getting sharper or softer based on point size. That is in the game view and outside of using a Canvas Scaler or something else that alters the scale of the text object. So unless it is one of those cases, this should not be happening so I'll need a simple repro project or something to take a closer look.
     
  5. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    I just tried to see if those things made any difference.

    I get the exact same result in game view and scene view.
    Canvas scaler in any mode, or disabled, or completely removed (so only a canvas with no scaler) makes no difference.

    Unity version 2018.3.12f1, TMP 1.4.0
     
  6. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Simple repro steps:
    - New project
    - install tmp 1.4.0
    - create a font in dynamic sdfaa mode
    - set the smoothness to -0.05
    - create a tmp text and just increase the font size
    No canvas scaler, or anything else needed. It happens with by just changing the font size.
    Let me know if you want me to create a repro project for that.
     
  7. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    I am assuming you mean Softness. Correct?

    That value was never meant to go negative and just like on the Mobile Distance Field shader, should be clamped between 0 and 1. A positive value should behave consistently with point size.

    The shaders / clamping limit will be updated in the next or subsequent release of TMP.

    Shaders were updated in 1.4.0 where a new Sharpness property was added in the Debug section.

    Scale X and Scale Y in the debug section can also be used to tweak sharpness of the SDF scale.
     
  8. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Ah that makes sense, thank you for that explanation!

    I tried that new sharpness property and it works really well.
    The issue I had is completely gone now, awesome!
     
    Stephan_B likes this.