Unity text is very blurry. How can I fix it?
To be honest, I have no idea why it behaves this way:
Hope that someone faced the same problem and will be able to share how it was tackled.
Unity text is very blurry. How can I fix it?
To be honest, I have no idea why it behaves this way:
Hope that someone faced the same problem and will be able to share how it was tackled.
Make certain your UI Text object is not inadvertently upscaled.
This can happen any number of ways. In my experience, the most common occurrence of this happening is due to generating UI objects from prefabs, but it can also happen after you change the reference resolution, reorder/ reparent objects in the hierarchy and probably other situations as well.
Since the OP is using a World Space Canvas (possibly the most prone to scaling issues, as the canvas is rendered as an object in the scene vs. an overlay) I will use that as an example.
New Canvas (including World Space) rect bounds will default to whatever the game view pane is currently set to. Note that if you have your game view set to Free Aspect, that bounds is going to be something fairly arbitrary! For this example, I have set my game view to 2880 x 1920 (blue box).
As expected, our new Canvas component is scaled to 1,1,1 and is sized to our game view window size by default. I've rotated the canvas 45° in Y to utilize its "world-spaciness" and moved it a bit so it is in view of the default camera.
The text component is also scaled at 1,1,1 so everything looks just fine.
Now this is a fresh scene, created "out of the box" with just these simple components -- it's kind of hard to go wrong in this situation. Suppose instead you are knee deep in scene creation with a complex UI system. You have been moving, resizing and reparenting elements, maybe generating child UI objects from prefabs created with a different scene configuration -- pretty soon you have child objects with (up)scaling applied which is not immediately obvious. For a trivial example, let's say I created the World Canvas and then scaled it up by 10, and then created a text object child. This is the result:
The text object's local scale is still 1,1,1, but it is being upscaled 1000% by its parent canvas. The result is blurry text.
The OP in their answer already pointed out that the Canvas Scaler with its dynamic pixels per unit
setting is also key to having Text UI elements properly rendered on screen.
In order to fix the problem I just went to the game object which contains the Canvas
component and added the Canvas Scaler
. After that I played around with the Dynamic Pixels Per Unit
field value until my text got the sharpness I want.
Unity ui text is always blurred and have quality issue. You can use TextMeshPro for better quality crisp and sharp text with lots of other options for text customisations.