Skip to content
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

Dealing with GodSVG's blurriness #342

Closed
MewPurPur opened this issue Dec 19, 2023 · 5 comments
Closed

Dealing with GodSVG's blurriness #342

MewPurPur opened this issue Dec 19, 2023 · 5 comments
Labels

Comments

@MewPurPur
Copy link
Owner

MewPurPur commented Dec 19, 2023

The current situation with GodSVG's scaling is very unhappy.

Disabled scaling:

  • It just makes the UI too small in my opinion. It's better for something to be too big, than to be forced too small.

Canvas items scaling mode (current):

  • It scales most things regularly, so they become blurry.

The current idea is to move to disabled scaling mode, but I've decided that its downside is worse than that of canvas item scaling. So not until a setting for editor scale is added.

I imagine such a setting could go from something like 1x to 2x. I am not sure how it would be implemented: I imagine with lots of bubblegum and shoestrings. But the main things are:

  • The theme needs to be updated whenever this setting changes. So for example for 2x, things like border width and corner radius need to be doubled (some extra detail might be needed for high corner radius too).
  • A lot of things throughout the UI need to be updated too. Where do I even begin... Basically anything transform-related, for example minimum sizes, needs to be multiplied or tweaked in other ways manually, via script.
  • The SVGs used for icons will likely need some logic around reimporting them to the correct size. (Note: Keep track of [WIP] Implement native DPI scaling. godotengine/godot#86022)
  • HandlerGUI could have a static variable "edscale" used for all the above.

I feel like some things may be doable, to some extent, in more sweeping ways than via script, but I don't know which ones, how, and if there would be any complications in using those ways.

@colleen05
Copy link

colleen05 commented Feb 20, 2024

I have a 1440p monitor at a higher PPI than your typical 21"-27" 1080p display. This means that things typically look smaller on my monitor if they were made for 1080p displays. In my opinion, even with the probably-smaller-than-intended UI elements, the UI elements in the default window size are perfectly fine!

I would recommend disabling scaling by default and having UI scaling options in the preferences. This would allow for better rendering code to be written in the future for cleaner large-scale UI (e.g., a 24x24 button at 2x scale is actually rendered at 48x48, rather than the window texture being scaled up with texture filtering).

I propose three scaling options:

  1. No scaling: Everything is rendered to a texture the size of the window. The user may decide to use their OS's native window scaling.
  2. Factor scale: The user selects a factor (e.g, 150%), and the UI is rendered to a texture that is equal to the window's size when scaled by the selected factor. I.e., a 1280x720 window with 200% factored scaling will have UI rendered at 640x360.
  3. Fixed size: The user chooses a vertical and horizontal resolution of the UI. They may choose to "lock" either the width, height, or both dimensions, such that the "unlocked" dimension is solved for the aspect resolution of the window. For example, if the user selects a locked height of 720px (with the width being unlocked), and their window has an aspect ratio of 2:1, the UI will be rendered to a texture of 1440x720.

Additionally, they should be able to choose whether UI is scaled per nearest-neighbour ("Pixel-perfect"?) and bilinear ("Smoothed"?).

In the future, the texture-based scaling could be removed completely, and (as suggested before,) be replaced with code that actually renders things with the appropriate scale at full resolution. However, as GodSVG is still in alpha, I doubt this is a major focus at the moment.

@MewPurPur
Copy link
Owner Author

MewPurPur commented Feb 20, 2024

Yeah, that's the exact plan. I plan to work on theme generation soon, so that'll unlock one of the points for implementing factor scale. But I can't have a small texture get upscaled, that'd be blurry, no? Godot editor has scaling settings and even there the implementation is to just litter all of the code with EDSCALE arguments, it has to be considered for everything.

@Pacomatic1
Copy link

Maybe make those textures with SVGs and then re-render them according to the size at which they'll be seen?
Seems good at least to my meager knowledge.

@MewPurPur
Copy link
Owner Author

MewPurPur commented Feb 21, 2024

Last time I tried, I didn't find any way to apply this throughout the whole application.

@MewPurPur
Copy link
Owner Author

Pretty much solved by #661

@MewPurPur MewPurPur unpinned this issue Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants