Search Unity

TMPro softness fills character block?

Discussion in 'UGUI & TextMesh Pro' started by thesupersoup, Jun 30, 2019.

  1. thesupersoup

    thesupersoup

    Joined:
    Nov 27, 2017
    Posts:
    70
    Hello. I have a very specific problem.
    I'm using TMPro for text in a menu. In most cases, it looks and performs fine. However, at the top of the menu screen is a smaller status bar with text which ends up looking blocky when leaving the softness settings at default.

    tmpblurblock.png

    I can remedy this by turning softnessdown to about -0.4 or using the bitmap shader, but I don't notice this sort of artifact on any other instance of the text, which is generally larger. Does anyone know what's causing this? I'd like to not have to inspect text fields one by one and just trust that they'll look as expected with general settings.

    Edit: Just found https://forum.unity.com/threads/should-softness-not-scale-with-font-size.659395/ which explains that softness should not be lower than 0, and that there's now a sharpness slider in the debug settings. Setting softness to 0 and sharpness to 0.4 achieves the same results, so awesome. But is there a way to better set up atlas generation or what not to keep this from happening?
     
    Last edited: Jun 30, 2019
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Most likely, the ratio of sampling point size to padding for your font asset is too small.

    See the following post.
     
  3. thesupersoup

    thesupersoup

    Joined:
    Nov 27, 2017
    Posts:
    70
    Thanks, that was it. I changed to 100/10 and it looks great now.
    Might be worth nothing I originally had the sampling point size set to Auto Sizing. Perhaps a bug or something?
     
    Stephan_B likes this.
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The Auto-Size mode simply tries to find the optimum point size to fit the requested characters / glyphs with specified padding in the given texture.

    This 10% ratio of sampling point size to padding is simply the recommended value to provide for a decent / effective range to work with in regards to Dilation, Outline and Underlay range.

    Depending on whether the font asset will be used to display mostly white / unstyled text or big outline, shadow, etc, you would increase / decreased this ratio to maximize sampling quality at the expense of range or vice-a-versa. Depending on the size of the text on screen, you would be able to use a smaller ration on unstyled text.

    Since there is no way to know how the user plans on using the font asset, the determination of the correct ratio of sampling point size to padding is something the user needs to set themselves.