Search Unity

TextMesh Pro TMP Text mesh fails to regenerate correctly after negative scaling

Discussion in 'UGUI & TextMesh Pro' started by xVergilx, Jan 29, 2020.

  1. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Got a weird issue, text is being like this:
    upload_2020-1-29_15-42-27.png

    After a little bit of debugging, this seems to be caused by parent's localScale going from -0.1 -> 1 value via tweening / easing function.

    Doing this to the scale:
    Code (CSharp):
    1.             if (resultScale.x < 0) resultScale.x = 0;
    2.             if (resultScale.y < 0) resultScale.y = 0;
    3.             if (resultScale.z < 0) resultScale.z = 0;
    fixes the issue, but its a workaround.

    Is this a known issue, or is there a fix for this?

    This is on Unity 2019.2.16f1 + TMP 2.0.1
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Negative scaling of the text object / parent will likely cause issue with the SDF Scale. I believe I might have improved upon this in the latest releases but I would suggest to avoid using negative scale on text objects.

    Note that new SSD (Screen Space Derivative) versions of the TMP SDF shaders have been introduced in the latest preview releases. These SSD shaders no longer SDF Scale to be passed to the shaders but this comes at a performance cost. On Desktop, this performance difference is not really measurable but on older mobile devices, the shader is 2.5 to 3X slower than the non SSD which is why passing SDF scale was initially used.
     
    xVergilx likes this.