-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
StyleBoxFlat aliasing looks blurry (regression between 3.2beta5 and 3.2beta6) #35279
Comments
@Zylann I think this use case can be fixed easily by adjusting the expand margin on either the tab itself or the panel. Although, in the current version it's limited because values are rounded to integers. So I've made a little fix in PR #35286 to allow finer tuning. It seems to look fine with this change after tweaking the following value in your script: Note: Border anti-aliasing size has slightly changed several times since 3.2 Beta 3 in order to fix some inconsistencies. This case with no border on one side wasn't working at all prior to 3.2 (see PR #34488), so there's no retro-compatibility issue here. |
I did not scale anything in the project. I only upscaled the screenshots in an image editor using nearest-neighbor quality just so you don't have to squint to see the details. Your screenshots look all blurry Oo |
@Zylann I'm not sure what is causing this difference in our screenshots when zoomed in, but let's focus on the different artefacts and how to solve them.
In general, I don't really understand what the problem is with decimal values to adjust UI settings (it just seems like it allows more control to me). But if we want to be able to setup everything with integer values only, then we'll need a deeper rework of how this stylebox aa works. |
With With
Line disappeared but the rest is still blurry.
No, I scaled by 2x (integer amount) and keeping ratio.
Yeah, I'm pretty sure it's the neighbor tab. Increasing margin does that.
I don't have a problem with decimal values, but the fact it becomes necessary to enter half-way numbers to obtain a non-blurry result. It's not intuitive, as I would have expected the opposite to happen: integer values should surely line up vertical and horizontal lines, while half-way values should produce blurry pixel lines. After fiddling around, this is the best I could get:
As said above I'm not against decimals, but I feel we need true AA or a rework of the way it's done (if faked?). It takes time to fiddle around precise decimals until they all line up properly. Note: to allow decimals in editor I had to change these lines: ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_left", PROPERTY_HINT_RANGE, "-10,2048,0.01"), "set_expand_margin", "get_expand_margin", MARGIN_LEFT);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_right", PROPERTY_HINT_RANGE, "-10,2048,0.01"), "set_expand_margin", "get_expand_margin", MARGIN_RIGHT);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_top", PROPERTY_HINT_RANGE, "-10,2048,0.01"), "set_expand_margin", "get_expand_margin", MARGIN_TOP);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "expand_margin_bottom", PROPERTY_HINT_RANGE, "-10,2048,0.01"), "set_expand_margin", "get_expand_margin", MARGIN_BOTTOM); |
Ok, I think I understand now what you're trying to achieve. You would like border sides to be solid lines and only corners to use aa, right? What you call blurry is actually the expected behavior from the way aa is implemented right now. It adds some alpha inside and outside all along the border to make things consistent in different cases (it's faked aa as you guessed). In some cases, you get solid lines and I'm not sure why. Maybe the decimal values cause a one pixel line of alpha to be skipped depending on the resolution. Also I've figured out why the rendering was blurry for me. My screen is high DPI, so I have to check the project option "Allow HighDpi" if I want to keep the high resolution. It makes UI very small instead of the blurry scale up I had before. So here's my result with your latest settings on my screen: What I can propose is to look again at the aa code and see if I can make it so border sides would be solid like you expect. I think it does make sense since we probably need only the corners to be anti-aliased. But there are lots of different combinations to handle, I'm not sure what other problems I might hit. I'll let you know. Note: The missing sliders for decimal values are addressed in PR #35287. |
After multiple changes to the transparent drawing used for AA, it ended up being consistently applied all around the borders inside and outside, which is not the intended behavior. This change makes sure border flat sides are solid instead of blurry. Fixes godotengine#35279
What's the status on this as of 3.2.3? Is this reproducible in the |
Yes it's still there in 3.2.3. (someone had the same problem on Discord today) |
I can still reproduce this in 4.0.dev.custom_build [b5b633f]. |
I think the issue with AA should be fixed rather than trying to bypass the issue. Either that or there should be new properties that allow certain sides of borders to be blurry and sharp. |
One way to fix this would be to change StyleBoxFlat's antialiased property to use an enum instead, with three possible values:
|
@Calinou That sounds like a great idea! We could do that for 3.x since proper antialiasing will be probably supported only in 4.x. |
Switching to an enum for the Also, I doubt 2D MSAA will be supported in time for 4.0's release, so this is still worth implementing in |
@Calinou Couldn't we handle compatibility in 3.x by overriding the property |
Godot 3.2 beta5
Same stylebox, two versions.
Godot 3.2, beta5, worked fine:
Godot 3.2, beta6 and rc1:
Now it is blurry and has a line at the bottom.
Turning off antialiasing "fixes" it, but it looks worse than before.
Project:
TabContainerTheme.zip
It might have been broken in #34830, but if you look closely at the screenshots, only the inner parts were lacking anti-alias, while the outline parts were fine all along.
The text was updated successfully, but these errors were encountered: