Im using Unity version 2019.1, and the newest text mesh pro. I’ve tried multiple fonts but if i change anything in the material settings it creates a box around the text. I’ve also regenerated the font atlas in different resolutions and ive changed the padding and render mode, but nothing changes.
Does anyone have this problem and know how to fix it? It also seems to be like this once the game is built.
Typically a semi transparent box around the text is the result of the sampling point size to padding being too small. You should normal aim for a ratio of about 10%.
In the image above, it doesn’t look like this box is semi transparent so perhaps the incorrect shader is assigned to the material?
Can you post an image showing the Face Info of your font asset?
Can you also post an image of the Material inspector on the text object making sure that I can also see the setting in the Debug section of the material.
Still need to see the Face Info on the font asset but I suspect your ratio of sampling point size to padding is too small given your padding is 6 and the atlas texture 8K x 8K which is likely excessive in terms of size.
With regards to the atlas texture size and given the new Dynamic SDF system is available, you should aim for 1024 X 1024 or a maximum of 2048 x 2048 where you would have a static primary font asset that contains the known text in the project with a dynamic fallback assigned to it as a catch all for user input.
Your Sampling Point Size is 1352 and your padding is 6 for a ratio of 0.4% which is why you are seeing this grey box around the text. Your Sampling Point Size to Padding ratio should be about 10%
Rule of thumb, also aim for a Sampling Point Size of about 72 to 96 points. 1352 is way too high.
Regenerate your font asset with more reasonable values. Use an atlas texture size of 1024 x 1024 if all you are adding to the font asset is Extended ASCII.
I was having the same issue with certain TextMeshPro fonts. I found that you can also eliminate the problem by adjusting the Perspective Filter slider bar in the inspector down to 0 in the Debug Settings. Well it worked for me anyway, hopefully others might find it helpful.
Perspective filtering can also cause a similar issue but most of the time, the above is related to the Sampling Point Size to Padding ratio being too small. So step one should always to check this Ratio to make sure it is about 10%.
If that doesn’t resolve the behavior then next check Perspective Filtering.
Im trying to fix the same issue but when I adjust sampling point size and apply, unity seems to reimport the asset for ever, the task manager shows unity is reading around 6meg/sec but this goes on for ever until I kill unity. Why is this ?
It’s kinda terrible that the auto size option is on by default and doesn’t set an appropriate padding value. Worse, it hides the current autogenerated size from the user so they have to switch over to manual to even know what the current point size is, so they can calculate what the padding value ought to be. But worse! There’s no tooltip or information in the manual to let the user know that they should adjust the padding value in this way… the only way they could figure it out is to find this forum thread (or presumably, to sit through a long tutorial video in the hopes of finding the resolution to the issue).
I see students and indie developers with this issue all the time. It’s always a late-breaking panic when they find out some user on low-spec hardware wants to run the game at a lower resolution and suddenly there are rectangles everywhere that weren’t visible in editor. It sucks, guys! I’m back here at this thread for the third time myself because it only crops up for me about once a year and I have no way to remember the totally arbitrary (from the user’s POV) rule - particularly since the relevant value (point size) is by default invisible to the user.
The TMP shaders were updated several months ago to include a new property to control culling. Updating the shaders by re-importing the TMP Essential Resources should resolve that. You can choose to only import the shaders.