Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

TextMesh Pro Font Render Mode.

Discussion in 'UGUI & TextMesh Pro' started by username132323232, Sep 26, 2018.

  1. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    473
    Hello. In the Font Asset Creator, what "Font Render Mode" setting should be used for a TextMeshPro UGUI font?
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    If you have not already done so, I suggest you watch the Font Asset Creation video which covers the important aspect of font asset creation as well as these rendering options.

    I also recommend you watch the Working with Material Preset video as these are also very important concepts to understand with TextMesh Pro.

    P.S. Distance Field 16 is the default / recommended choice.
     
    username132323232 likes this.
  3. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,845
    @Stephan_B
    Is Distance Field 16 is still default or should we use something else like SDFAA
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    SDFAA should be fine for pretty much all use cases with perhaps the exception of when you will be rendering large text such as titles that exceed 90 point size on screen with large outline or shadow.
     
    jGate99 likes this.
  5. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,845
    So SDFAA is the new default. thanks
     
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Every mode has it PROS and CONS and use.

    Having said that, I now use SDFAA 98% of the time so that makes it my default go to ;)
     
    Nemikolh and jGate99 like this.
  7. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,845
    Thanks for reply Stephan,

    I couldnt find any documentation about these recent render modes, can you please point me to a link where i can study their differences?
     
    AuKtagon and leisztom like this.
  8. faolad

    faolad

    Joined:
    Jan 27, 2013
    Posts:
    118
  9. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    This is because the wrong shader is used. Make sure that once of the Signed Distance Field shaders is assigned to the material used by this font asset.

    I suspect that you might have first create a font asset using one of the bitmap modes and then switched to one of the SDF modes after. As such, the material was first assigned a bitmap shader.
     
  10. dpt2

    dpt2

    Joined:
    Jun 15, 2021
    Posts:
    50
    Is SDFAA still the go-to these days? In Linear color space, too? Is there a modern link to find more info about this that is relevant to this day and age?





    Seems like "Distance Field SSD" shader sort of fixes it (after importing the TMP resources and restarting Unity -- a super obscure import, by the way! Buried in Google), but the bold scaling is really off. "Bold" feels like "Bold x5".



    Edit - found that the SDF file can set adjust the bold weight:



    I think my problem is resolved. ^
     
    Last edited: Aug 3, 2021
  11. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    The SDFAA is still the goto for dynamic font assets. For static font assets and mostly large text (72 point size or larger) that is heavily styled like titles, SDF16 is usually the goto.

    In terms of the visual artifacts, these are usually the result of a Sampling Point Size to Padding Ratio that is too small. You should aim for a ratio of about 10% which will give you a decent effective range on material property while allow you to maintain a good sampling point size. There are several posts detailing the Sampling Point Size to Padding ratio and how it affects / works with fallback font assets, etc.

    Since bold adds dilation which is affect by this sampling point size to padding ratio, this is why you would see this when using bold if your ratio is small.

    When inspecting your font asset, what is the sampling point size and padding values?
     
    Dkp2 likes this.
  12. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
  13. dpt2

    dpt2

    Joined:
    Jun 15, 2021
    Posts:
    50
    Thanks for the info, here is what I have:

    upload_2021-8-10_16-41-24.png

    60 sampling point size, 9 padding... I think? If I have it set to "static" (default), I'm not quite sure if it's actually 60:9.

    Is my padding too big, then? It should be 60:9? I'll try 60:9 and get back to you.