Search Unity

TextMesh Pro Version 1.4.1-Preview 1 with Dynamic SDF for Unity 2018.3 now available!

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by Stephan_B, Jan 31, 2019.

  1. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,175
    If you are migrating a project from the Legacy (non package manager versions) you will need to carefully read / follow the instruction in the following sticky post just below this one to migrate your project to the new package manager version of TextMesh Pro.
     
  2. PJbigscreen

    PJbigscreen

    Joined:
    Jul 22, 2017
    Posts:
    4
    I'm still encountering the issue reported by others where text appears as blank or a white box on objects that are scaled up from 0. This is both in the case of uniform and non-uniform scaling. TextMesh Pro 1.4.1, Unity 2018.3.9f1

    The code changes suggested earlier in the thread to fix this appear to already be there in my current version of TM Pro.

    Any ideas?
     
  3. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,175
    Can you provide me with a simple repro project that would enable me to reproduce this behavior easily?

    If it is easier, you can submit a bug report with the included project. Be sure to include the steps to reproduce and the Case # once you have it.
     
  4. PJbigscreen

    PJbigscreen

    Joined:
    Jul 22, 2017
    Posts:
    4
    Will send the repro project via dropbox link in a just a bit.
     
  5. PJbigscreen

    PJbigscreen

    Joined:
    Jul 22, 2017
    Posts:
    4
  6. mdsitton

    mdsitton

    Joined:
    Jan 27, 2018
    Posts:
    33
    @Stephan_B I think i've found a couple of bugs with the dynamic sdf support. I have a reproduction project that causes a crash. The same code worked fine on unity 2018.4.2f1 but crashes on the latest 2018.4.9f1 and any newer unity versions including 2019.2.5f1

    Which to me suggests that there was a change with the unity side of things that broke this. Specifically something with
    FontEngine.TryAddGlyphsToTexture()

    Here is an image of what it looks like in unity 2018.4.2f1:

    dynamic-sdf-bugpng.png

    And this is the crash i get in 2018.4.9f1:


    NullReferenceException: Object reference not set to an instance of an object
    TMPro.TMP_FontAsset.TryAddCharacters (System.UInt32[] unicodes, System.UInt32[]& missingUnicodes) (at Library/PackageCache/com.unity.textmeshpro@1.4.1/Scripts/Runtime/TMP_FontAsset.cs:1093)
    DynamicSDFTest.LoadFontAsset (UnityEngine.Font sourceFont, System.UInt32[] characters, System.UInt32[]& missingGlphs) (at Assets/Scripts/DynamicSDFTest.cs:76)
    DynamicSDFTest.Start () (at Assets/Scripts/DynamicSDFTest.cs:33)


    There is also a second bug with TryAddCharacters not setting the missing glyph array output. Which i have a workaround in the reproduction project for now.(this bug is in 2018.4.2f1 at least don't know if it effects newer versions or not)

    Here is the download for the repro project: https://drive.google.com/file/d/1dOHd4_rzswiUDIaGWi46HvA8cMlRLv3u/view?usp=sharing

    What i'm doing is building several font assets entirely in code, setting up fallback font assets, and populating the needed characters.Then using them on the tmp ugui object in the scene
     
  7. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,175
    I'll take a look at these tomorrow.
     
  8. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    281
    Hi @Stephan_B , are the different SDF generation modes documented somewhere? We have always used SDF16x, now I noticed there is the SDFAA which is really fast in comparison, and apparently was added for the dynamic font system. I was just wondering if there is any quality difference between them? Currently we are using just static fonts, so it probably makes sense to keep on using 16x generation, but nonetheless I'm still curious. :)
     
  9. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,175
    The SDF16 and SDF32 are very accurate but extremely slow in terms of generation. The SDFAA is not as accurate but fast enough to use for dynamic generation at runtime.

    The lower accuracy could be noticeable on text displayed at 80 point size or greater if it has an outline or shadow. So for big stylized titles, I would continue to use SDF16 or SDF32 but for anything else use the new modes.