Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

[Bug?] TMP Text Smoothness Fade not working in 2019.4.12

Discussion in 'UGUI & TextMesh Pro' started by Dorodo, Nov 6, 2020.

  1. Dorodo

    Dorodo

    Joined:
    Mar 8, 2015
    Posts:
    45
    upload_2020-11-6_16-1-35.png

    Just wanted to be sure if this is a bug before I submit a ticket. This happened after I upgraded my project from 2018.4.22 to 2019.4.12.

    This is reproducible on an empty project.

    To reproduce, simply add an object with a Rect Mask 2D component on it, and add a child with a TMP Text with the Smoothness Y parameter set to 100 on the material.

    What seems to be happening is that the parameter value is not changing for some reason. If you open TMP_SDF-Mobile.shader and TMPro_Properties.cginc and rename the parameters _MaskSoftnessX and _MaskSoftnessY to anything else or try to set a hardcoded value, the problem stops occurring.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    The issue is related to the recent addition of support for Softness and Padding to the RectMask2D (a seen below) where the same property names are used. As such, when the Canvas is rendered and contains a RectMask2D, whatever values are defined for softness ends up overriding the material properties with the same name.

    upload_2020-11-6_13-10-34.png

    So the question is: Is providing control for softness per RectMask2D more convenient for your use case or does it need to be control per material?
     
  3. Dorodo

    Dorodo

    Joined:
    Mar 8, 2015
    Posts:
    45
    Oh, you're so right. Stupid me, didn't even notice the new addition to rect mask.

    This actually seems like a better idea rather than keeping it per material. It's gonna be tougher to setup in an existing project, but gives us more flexibility overall.

    Just a question, how is this being sent to the shader? is this written on a specific texture coordinate when creating the geometry or something like this?

    Additionally, shouldn't this field be gone from the material then?
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    When the Canvas batcher iterates over all objects affected by the RectMask2D, it sets those properties on the relevant materials. As such, it overrides the values set in the inspector.

    Depends on whether users want to keep this functionality per material or per RectMask2D.

    If users find it better to have these settings on the RectMask2D, then I would remove them from the Material. However, if users want to keep this functionality per material, we would have to rename those properties to avoid the conflict.
     
    Dorodo likes this.
  5. Dorodo

    Dorodo

    Joined:
    Mar 8, 2015
    Posts:
    45
    Awesome. Thanks for clearing things up, and for the great support :)
     
  6. sp_unity946

    sp_unity946

    Joined:
    Nov 20, 2020
    Posts:
    1
    It's look like it don't work properly now (Unity 2020.2.3f1 & TextMeshPro 3.0.4). Text just ignore softness.
     
    JamesArndt likes this.
  7. PandaArcade

    PandaArcade

    Joined:
    Jan 2, 2017
    Posts:
    131
    We've run into this quirk.

    I'd like to put my hand up for having the text elements adhere to the RectMask2D mask softness for convenience :D

    Having to possibly create and maintain a set of separate materials for each soft masking scenario would be cumbersome. We're going to avoid soft masks for now.
     
  8. hugogfadams

    hugogfadams

    Joined:
    Jul 27, 2020
    Posts:
    6
    @Stephan_B I'm unsure if this is related. RectMask2D's softness variable does not effect a TextMeshProUGUI component. I am using Unity 2020.3.9 with TMP 3.0.6.

    I want to use this feature of rectMask2D for a scrolling input field.

    I have included an image, green is TMP text, red is unity Text.
     

    Attached Files:

    JamesArndt likes this.
  9. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Support for RectMask2D Softness was added in the most recent preview release of the TMP packages. These are version 1.6.0-preview.1 for Unity 2018.4, 2.2.0-preview.1 for Unity 2019.4 and version 3.2.0-preview.1 for Unity 2020 or newer.

    Please note this package will require that you use one of the latest release of 2020.3.

    This new feature also requires updating the TMP Essential Resources which includes the new shaders that support this new softness. You will also need to update the TMP Examples & Extras if they are contained in your project.
     
    Neohun and hugogfadams like this.
  10. Dorodo

    Dorodo

    Joined:
    Mar 8, 2015
    Posts:
    45
    Hi @Stephan_B , has this behavior changed in the latest versions of TMP?

    I've tried creating an empty project with TMP 3.0.6 (+ Essential Resources) in Unity 2021.1.7, and now it behaves like the old workflow where you had to manually set a softness value in the material itself.

    upload_2021-11-28_21-29-12.png

    Changing the Rect Mask softness value doesn't do anything.

    upload_2021-11-28_21-28-45.png
     

    Attached Files:

  11. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Just tested on my end and the softness is working as expected.

    Which shader are you using?

    You did indicate that you re-imported the TMP Essential Resources to get the update shaders but just in case, verify all of your TMP shaders are now contained in "TextMesh Pro/Shaders/...". I would also suggest you re-import them again just to make sure they are in fact the latest versions.
     
  12. Elkis

    Elkis

    Joined:
    Jun 15, 2013
    Posts:
    87
    I also have the same issue as @Dorodo: TMP 3.0.6 and re-imported everything on Unity 2021.1.4 and the Rect Mask softness value doesn't do anything to TMP-Text
     
  13. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Makes sure that all your TMP shaders are contained in the same folder which should be "TextMesh Pro/Shader/..." and that you have re-imported the TMP Essential Resources via the Window - TextMeshPro - Import ... menu.

    If the softness issue persists, check if you can reproduce this behavior with a newly created text object or does this only occur on some of your objects in your scene?
     
  14. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,938
    Can confirm in 2021.2.6f1 the "softness" property for the Rect Mask 2D is not softening the mask for any of the TextMeshPro labels I have within the hierarchy. TMP Essential Resources are imported, package is the latest, issue still persists even when creating new TextMeshPro labels within the hierarchy. Are there any updates as to what the issue is?
     
    NikoBay likes this.
  15. NikoBay

    NikoBay

    Joined:
    Aug 15, 2018
    Posts:
    39
    yeah, got same problem as JamesArndt stated but in Unity 2020.3.24f1.

    The softness still affects caret but not texts.
     
    JamesArndt likes this.
  16. Sipel

    Sipel

    Joined:
    Jan 13, 2015
    Posts:
    4
    I think one of the problems is that most of the people here are not using TMP 3.2.0-preview.1, as you suggested, but 3.0.6. That said I've tried with the 3.2.0-preview.3, reimporting the TMP folder and rebooting multiple times, but that didn't work either. I confirm that the shaders are contained in the folder at the path you wrote. Didn't try a new project with fresh import and gameobjects cause it's not so urgent to me to have this feature, just wanted to let you know some of the tests I've made hoping it could help :D
     
  17. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Again make sure that you re-imported the TMP Essential Resources after updating to version 3.2.0-pre.3.

    If you did and the softness controls on the Rect Mask 2D still do not work, then please let me know and I'll look again.
     
  18. dagerob

    dagerob

    Joined:
    Mar 23, 2018
    Posts:
    3
    This is still an issue in Unity 2019.4.36 with TextMeshPro 2.2.0-preview.3. Tried with all the packages and none worked
     
  19. khrysller

    khrysller

    Joined:
    Mar 14, 2019
    Posts:
    125
  20. nikescar

    nikescar

    Joined:
    Nov 16, 2011
    Posts:
    168
    I've ticked "Enable Pre-release Packages" in Project Settings -> Package Manager -> Advanced Settings and the only TMP version available to me is 3.0.6. Is there another way to get 3.2.0.

    I'm having the same issue as the rest. In addition to this: LINK

    I'm using 2021.3.5f1
     
    Last edited: Jul 28, 2022
  21. brendan122

    brendan122

    Joined:
    May 6, 2022
    Posts:
    3
    Having this issue as well after upgrading a project from 2019.4 to 2020.3.2 LTS
    Fixed it by going into the material and changing the mask settings here as well to the same settings I have on my Rect 2D mask. Very odd.
    upload_2022-8-10_13-18-41.png
     
    chriscode likes this.
  22. valentin56610

    valentin56610

    Joined:
    Jan 22, 2019
    Posts:
    159
    I'm using TextMeshPro 3.0.6 in a brand new Unity project (2021.3.25f1) and this is not working either...

    Anyone knows what's going on??

    EDIT: Just created a brand new 2022.3.5f1 project, imported TMPro, same issue, so this is a real bug
     
  23. obsidian1269

    obsidian1269

    Joined:
    May 12, 2011
    Posts:
    24
    Hey @Stephan_B, having the same problem also on Unity 2021.3.31 even with TMP Essential Resources installed. Package Manager says I'm using TextMeshPro 3.0.6 with no option to update even after enabling pre-releases. Annoyingly, I also cannot enable Soft Mask on my TMP FontAsset material for some reason so @brendan122's solution will not work for me.
     
  24. chriscode

    chriscode

    Joined:
    Mar 2, 2015
    Posts:
    52
    Seems same here 2020.3.44f1 - cheers
     
    Last edited: Apr 14, 2024