-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Text blurry at HIDPI (4K, >1.25x UI scale) #1
Comments
…esults in a larger render texture and unscaled visuals. Fixed minor rounding errors by setting the render texture filter mode to point.
Hey Fluffles, On your large monitor, the text will probably be very small, but at least it shouldn't be blurry. |
I changed
to: /// <summary>The width of the window in screen space multiplied by UI scaling.</summary>
internal float width => math.floor(position.width * ( EditorGUIUtility.pixelsPerPoint / 1.5f ));
/// <summary>The height of the window in screen space multiplied by UI scaling.</summary>
internal float height => math.floor(position.height * ( EditorGUIUtility.pixelsPerPoint / 1.5f )); and
to: float2 eMousePosition = math.floor(e.mousePosition * ( EditorGUIUtility.pixelsPerPoint / 1.5f )); and now get an acceptable screen scaling, but now the mouse position is messed up even without the changes to L96 above. I assume there are other places that this value needs to be changed/adjusted, but it's a lot of code to dig through that I'm not familiar with. For now, until this is correctly fixed, I can just use it on another screen that isn't 4K. |
Yes, it's using However, I am considering rounding to the nearest full integer or power of 2. So 1.25 or 1.75 scaling will render 2x scale. And 2.x will render at 3x or 4x scale. Depending on what doesn't cause these issues that is. But now I have a clean slate to work in, unaffected by your scaling settings and that was the goal of the PR. |
Hey Fluffles, |
Scaling seems correct now, but the text is still blurry. Do you rasterize your text at one resolution only? |
Yes there is only one resolution, I used BMFont to generate a bitmap font from the TrueType font. The result you should see on your screen is the final render texture scaled x2 (with internal mouse and window positions adjusted accordingly). I want to keep these DPI workarounds simple and manageable so that I can quickly add more features without having to think about it. What about the icons and window borders, are they at least not blurry anymore? I might swap the font texture for a higher resolution one, as I should be able to use the same UVs as long as the font layout on the texture is the same. But if everything is still blurry then that won't matter much. |
The icons are fine, as long as they keep point filtering. Lines and borders never really seemed to have any issues, and I assume those are calculated in shaders. Using a separate higher resolution font texture should solve the problem, and is the solution I had in mind as well. I'm not sure how it'd look at extremes, but I'll assume that nobody is going to use much higher than 200% scaling, as 150 - 175 is already pretty big. |
Any news on this? |
Unfortunately, using a separate, higher-resolution font texture won't solve the problem, because the way I managed to solve everything else was to essentially zoom in on the render texture. So there's no pixel density left for higher detail. |
All text appears blurry when on HIDPI screens (4K) with editor UI scaling ( > 1.25x ) applied.
The text was updated successfully, but these errors were encountered: