Search Unity

TMP Distance Field SSD & Rect Mask 2D (VR)

Discussion in 'UGUI & TextMesh Pro' started by ColtonKadlecik_VitruviusVR, May 18, 2022.

  1. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Hi All,
    I recently changed the shader of my TMP from Distance Field to Distance Field SSD due to the Distance Field having a semi transparent box around the each character when viewing the text from a distance in VR that the Distance Field SSD shader does not have. Before switching I attempted to change the SP/PD ratio up/down and the render mode to no avail. The only thing that seemed to sharpen up the text was increasing the Scale X/Y under debug settings to ~8.

    After switching, it does not appear the Distance Field SSD shader works correctly with masking? I looks like the masking is fading the text when you move close/far away?

    SSD Text close up
    upload_2022-5-18_17-55-39.png

    SSD Text further away
    upload_2022-5-18_17-56-16.png

    SSD Text without Masking
    upload_2022-5-18_17-57-9.png

    Is there anyway to fix this or is it intended behaviour?

    Cheers,
    Colton
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What is the Sampling Point Size and Padding that you previously used when you were seeing the visual artifacts around each character?

    What version of Unity and TMP package are you using?

    Assuming you are using Unity 2020.3 or newer, I would suggest testing with the latest release of the TMP package which is version 3.2.0-pre.3. Be sure to re-import the TMP Essential Resources as the shaders were updated in the latest releases.
     
  3. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Hey Stephan, thanks for the quick response! The point size is 93 and the padding is 10.

    We are using Unity 2020.3.2 and TMP 3.0.6. I just updated TMP yesterday when testing but did not have preview packages enabled. I will update to 3.2 tonight at the end of the day because it took approx. 3 hours to import.

    Just the clarify, the visual artifacts only appear in VR when you move away from the text (more than ~1m), on the monitor everything looks crystal clear.

    I'll let you know how the update goes,
    Colton
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    See if increasing the padding to 15 or 20 makes any difference?

    If that makes no difference then the issue might be related to SDF Scaling which the SSD shader should resolve.
     
  5. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Attempting to update and received an error:

    Library\PackageCache\com.unity.textmeshpro@3.2.0-pre.3\Scripts\Editor\TMP_FontAssetEditor.cs(2005,77): error CS1503: Argument 2: cannot convert from 'string' to 'int

    Will try to figure it out at home
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The above error is due to the new Dynamic OS font asset feature requiring a newer version of 2020.3.

    I believe some of the FontEngine changes landed in 2020.3.27f1 or something like that. The latest for 2020.3.34f1.
     
  7. ColtonKadlecik_VitruviusVR

    ColtonKadlecik_VitruviusVR

    Joined:
    Nov 27, 2015
    Posts:
    197
    Finally got the Editor updated to 2021 LTS and TMP 3.2. Seems like all the updates did the trick, thanks!
     
    Stephan_B likes this.