godot icon indicating copy to clipboard operation
godot copied to clipboard

Fix blurred content of embedded windows

Open scgm0 opened this issue 1 year ago • 10 comments

Fix #54030, https://github.com/godotengine/godot/issues/95387

I honestly don't know if I'm doing it the right way, but the issue seems to be forgotten and after a flurry of attempts I'm getting good results. before: 图片 after: 图片 example: embedded-window.zip

scgm0 avatar Oct 02 '24 17:10 scgm0

In the screenshot, the circles of Test2 and Test3 seem to have become an octagon (the newly introduced white outline probably making it a full circle I'd assume)

hsvfan-jan avatar Oct 02 '24 18:10 hsvfan-jan

In the screenshot, the circles of Test2 and Test3 seem to have become an octagon (the newly introduced white outline probably making it a full circle I'd assume)

It seems to be a problem caused by viewport_set_global_canvas_transform. I don’t know where the specific problem is.

scgm0 avatar Oct 02 '24 19:10 scgm0

In the screenshot, the circles of Test2 and Test3 seem to have become an octagon (the newly introduced white outline probably making it a full circle I'd assume)

When I manually assign the radio_unchecked icon in the theme (radio_unchecked.svg was copied from godot), there is no white border around the icon, so maybe the problem is related to the theme cache? 图片 图片

scgm0 avatar Oct 03 '24 22:10 scgm0

The problem of viewport_set_global_canvas_transform should not be within the scope of this PR. What needs to be discussed now is whether the solution of this PR is qualified and whether there are any side effects.

scgm0 avatar Oct 05 '24 21:10 scgm0

Tested locally, works fine. It doesn't remove all blurriness, but decreases it a lot. Before: изображение After: изображение

Summersay415 avatar Oct 06 '24 03:10 Summersay415

Tested locally, works fine. It doesn't remove all blurriness, but decreases it a lot. Before: изображение After: изображение

Have you enabled the font msdf?

scgm0 avatar Oct 06 '24 07:10 scgm0

No

Summersay415 avatar Oct 06 '24 07:10 Summersay415

No

Give it a try?

scgm0 avatar Oct 06 '24 07:10 scgm0

Hello, It seems that this fix solves https://github.com/godotengine/godot/issues/95387, with no side-effect seen so far.

eldidou avatar Oct 09 '24 08:10 eldidou

Hello, It seems that this fix solves #95387, with no side-effect seen so far.

That's great if there's no problem.

scgm0 avatar Oct 09 '24 10:10 scgm0

Tooltip and popup menu are still blurred: test-4.zip

Peek 2024-10-28 09-51

Texture filtering is not inherited I think.

timothyqiu avatar Oct 28 '24 01:10 timothyqiu

Tooltip and popup menu are still blurred: test-4.zip

Peek 2024-10-28 09-51 Peek 2024-10-28 09-51

Texture filtering is not inherited I think.

What is blurred is only the texture with constant resolution, which does not belong to the content of this PR, Whether the texture filtering mode is inherited should be discussed separately?

scgm0 avatar Oct 28 '24 02:10 scgm0

Tooltip and popup menu are still blurred: test-4.zip

Peek 2024-10-28 09-51 Peek 2024-10-28 09-51

Texture filtering is not inherited I think.

图片 图片 It still looks like this problem can be solved by not using the original texture, but a CanvasTexture, and setting the texture filtering mode in the CanvasTexture. It makes me miss 3.x being able to set the filter mode directly on the texture without the need for CanvasTexture. This is also an obvious change since 4.0. How to improve it is beyond the scope of this PR.

scgm0 avatar Oct 28 '24 02:10 scgm0

In general, I think the blurring issues mentioned in #54030 and #95387 are caused by a combination of issues such as the window's scaling mode, resolution, texture filtering mode inheritance, and so on.

This PR resolves some of those but not all. So I'd suggest making the title a bit more detailed and not marking it as closing those two issues.

So how should I change the title and issue markup?

scgm0 avatar Oct 30 '24 01:10 scgm0

I edited the title and removed the auto-close.

@timothyqiu Do you think it is fine to go ahead with merging this as-is?

clayjohn avatar Nov 09 '24 04:11 clayjohn

Just wondering if there is something wrong with having this pr so it hasn't been merged yet?

scgm0 avatar Dec 20 '24 01:12 scgm0

Just wondering if there is something wrong with having this pr so it hasn't been merged yet?

There's nothing wrong a priori, but it needs reviews from maintainers familiar with the Viewport and Window code (such as @bruvzg or @Sauermann).

akien-mga avatar Dec 20 '24 15:12 akien-mga

Code seems fine, will fully check it tomorrow.

bruvzg avatar Dec 20 '24 15:12 bruvzg

Thanks!

akien-mga avatar Dec 21 '24 23:12 akien-mga