Apologies for another one of these, but I’m yet to find an existing thread where this issue was definitively solved.
I’m using TextMeshPro in the UI for our game. It looks great in Screen Space - Overlay, but when using Screen Space - Camera the text becomes quite ugly.
This example shows the effect I’m referencing in the Game window on the right-hand side, but interesting to note it looks nice and crisp in the Scene window on the left (in fact looks exactly like Overlay mode, which makes me think maybe the camera is the issue?).
I assume it has something to do with the extreme scaling inherent with using Screen Space - Camera?
To me, it looks like it’s being drawn very small, then being blown up after the fact to match the screen.
I’ve read through quite a few threads for possible solutions, but none seem to have any effect yet.
I’ve tried:
no canvas scaling mode
using SSD shader variants
upgrading TMPro
deleting / reinstalling TMPro
including all shader channels (as texCoord 2 is supposed to pass depth info right?)
setting the Plane Distance to be far enough away that the canvas scale is about 1
lots of other hacky things too dumb to mention.
I haven’t filed a bug report as I understand quite a few people have already.
If anyone has any insight that would be super helpful! x
Can you project me with a sample project to look at where I would be able to reproduce this behavior?
If needed, you can provide me with a private link to this project via a Private Message on the forum.
Note: The text should render cleanly especially with the SSD shaders so perhaps something else is at play here. Just for fun set the Perspective Filtering in the debug section of material inspector to zero and see if that affects the text.
Thanks Stephan, I’ll send out an isolated project in the morning.
The perspective filter doesn’t seem to have any effect, if that gives you any clues?
Just realised I don’t know if it’s relevant but I’m also using cinemachine. I just turned it off in playmode which didn’t make any difference, but I could try totally stripping that out if there’s any known trouble between the two systems?
Oh something interesting, I turned off post-processing (which as a knock-on effect disabled anti-aliasing) on the camera, and that seems to have finally fixed the issue! The only problem is that another effect in our game relies on anti-aliasing. Of the two issues, we’d rather have clean UI than water caustics so it’s not the worst thing in the world, but it does make me wonder if it’s meant to do that?
I’ve been having this issue too in URP: both Screen Space Camera & World Space have really messy font displays with TMP, especially at smaller sizes. It looks like speckled white noise smeared across the text.
FXAA was the culprit for me. I switched to SMAA and that looks much better.
Screenshot (cropped) for reference, text on the right affected by FXAA:
***This applies to users who use both Text Mesh Pro and the Pixel Crushers Dialogue System and are experiencing blurry text and prefer to enable FXAA:
I need FXAA and I already have a second UI camera to render my UI but while that solves most issues if you use the Dialogue System the text will still be blurry.
Solution: You see by default the Dialogue manager in your scene has a child Canvas that does the UI rendering for the Dialogue System. That is not the main UI and you SHOULD NOT put your main canvas into the “Default Canvas” slot because you likely have a custom setup like I do using a 2 camera’s for UI with one of them needing to be screen space camera.
So actually there’s no need to change the default canva’s the Dialogue Manager is using no all you need to do is to add a canvas scaler to the Dialogue Manager’s child Canvas! To make this even easier just copy the same settings that your main canvas uses so they both match.
Now perfect crisp UI without any compromise!
Personally my preferred settings to scale very well is to use these scale settings:
*By doing what I just did here you if you decide to edit the template UI’s what you see inside the canvas window in terms of positioning will also fit with what you actually see in game. This was not the case before since there was no canvas scalor for some reason. This may be a bug by the author or intentional whatever.