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.

TextMesh Pro [UI] Text becomes blurry when camera focal length is modified

Discussion in 'UGUI & TextMesh Pro' started by bali33, Jul 29, 2020.

  1. bali33

    bali33

    Joined:
    Aug 14, 2011
    Posts:
    232
    Hello,

    I have a Canvas using screen space camera linked to perspective camera with "physical camera" property activated. During game play the camera "focal length" property is modified and UI texts (Text mesh pro) become blurry. Is it normal ? Should I try "ForceMeshUpdate" on every text instance every time I change the "focal length" property ? Could be a bit painful o_O

    Unity 2019.4.3f1
    Textmeshpro 2.0.1

    Thanks
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,582
    Can you provide the steps to reproduce the behavior or a simple repro scene for me to look at?

    Most likely the issue is related to SDF Scale not getting updated as the text objects are unaware of the focal length changes.

    SDF Scale must be updated when using the standard SDF shaders when the scale of the text object changes.

    For testing purposes, I would suggest upgrading to version 2.1.1 of the TMP package and updating the TMP Essential Resources. These contain a few new shaders including 2 with SSD in their name. These SSD shaders do not require SDF Scale updates so I would be curious to see if those work better for your use case.
     
  3. bali33

    bali33

    Joined:
    Aug 14, 2011
    Posts:
    232
    Hello,

    I think you can reproduce this by just having a perspective camera and at runtime (even within the editor) change its focal length property.

    I have already updated to 2.1.1 but didn't know there was new shader that might fix that. I'll try and let you know what happened.

    Thanks.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,582
    Make sure you import the new TMP Essential Resources and use one of the SSD versions of the shaders.
     
  5. bali33

    bali33

    Joined:
    Aug 14, 2011
    Posts:
    232
    It's seems to work as expected. Thanks !
     
    Stephan_B likes this.