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

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.

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.

6498298--731374--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?

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?

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.

1 Like

Awesome. Thanks for clearing things up, and for the great support :slight_smile:

It’s look like it don’t work properly now (Unity 2020.2.3f1 & TextMeshPro 3.0.4). Text just ignore softness.

1 Like

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 :smile:

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.

@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.

7443686--912551--Screen Shot 2021-08-24 at 5.06.48 PM.png

1 Like

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.

2 Likes

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.

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

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.

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

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?

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?

1 Like

yeah, got same problem as JamesArndt stated but in Unity 2020.3.24f1.

The softness still affects caret but not texts.

1 Like

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 :smile:

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.

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

The same here with my project with the latest version

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