-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Make PopupMenu/Panel
shadows properly visible again
#91333
base: master
Are you sure you want to change the base?
Make PopupMenu/Panel
shadows properly visible again
#91333
Conversation
I'd say this also closes godotengine/godot-proposals#8738 (by superseding it). |
131d3db
to
8d20d90
Compare
@passivestar Could you enable |
yeah that works |
8d20d90
to
eaab897
Compare
I've added a warning that appears when a Note that currently it always appears when running the game because the default project theme has rounded corners. If this is merged, it will need to be modified. |
We probably can enable transparency for the editor by default, it may increase VRAM usage a bit, but should not have any significant performance impact on modern systems. Also, I'll take a look if we can test if transparency is really supported and working (checks if compositor is active and surface/front buffer have correct format), and will add a method to the display server. |
@bruvzg Nice! But I think having the warning is a good thing nonetheless. |
eaab897
to
19520af
Compare
19520af
to
98bdb7e
Compare
Themed the menu to take advantage of this PR, makes a huge difference imo As I understand transparency needs to be an editor setting because we probably don't want a project setting to affect editor theming. Even better if enabled by default like @bruvzg suggested P.S. Clicking on the popup menu shadow doesn't close the popup which is a bit annoying with a large shadow |
98bdb7e
to
320dd6a
Compare
Got you covered. 😉 |
320dd6a
to
01f8e13
Compare
Updated to use the new |
01f8e13
to
a056b31
Compare
a056b31
to
f75ccce
Compare
f75ccce
to
c0414b5
Compare
@passivestar Indeed, it seems that this PR rotted after a while. Sadly, I don't have any time to work on this at all currently. |
c0414b5
to
c56cf20
Compare
@passivestar Welp, I'm a masochist, so I worked on it anyways. Please test again. |
c56cf20
to
4634c47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4634c47
to
4f71e58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I can't get this to work for me. (tested on Windows 11 and Linux[Wayland])
Doesn't matter whether the popup is embedded or native, in the 2D editor or running project.
Test project:
mrp1_popup_shadows.zip
@Geometror Enable |
How does the shadows look in your end in with my test project? |
Are you sure you didn't change anything? I'm on GNU/Linux (Wayland) and the shadows work fine. Maybe try rebasing it to |
Ok, I finally got it to work. Sorry, I assumed this project setting was turned on in the test project :) |
@Geometror Huh, all backends work for me. Anyways, CC @bruvzg, since you were the one who implemented it. |
Should also work on macOS (with any renderer) and on Windows with D3D 12, but Vulkan depend on the driver and NVIDIA broke it some time ago. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, haven't looked at the code yet, but functionality-wise this it's almost ready - just one thing left:
This should work regardless of the backend when subwindows are embedded (plus, it should also work in the 2D editor, but I guess this comes for free when it works for embedded subwindows)
Related to this PR, but not required/just for reference:
DisplayServer::get_singleton()->is_window_transparency_available()
doesn't report per-pixel transparency for Wayland, although it is supported (in my case) as you can see in my screenshot- Per-pixel transparency doesn't work for me on Windows 11 both with DX12 and Vulkan (single GPU system, 3060 Ti), which is kind of strange (at least when using DX12)
4f71e58
to
7c928ca
Compare
@Geometror Changes made. |
This PR does the following:
PopupMenu/Panel
nodes have spacing around them to show the shadows of their theming, as well as repositioning them accordingly with their shadows' size when popping up.PopupMenu/Panel
nodes be transparent by default. Not only this is necessary for the shadows, but also for rounded corners. It slightly breaks compatibility, as a default value is changed. But I think it's non-intrusive enough to be acceptable.Closes godotengine/godot-proposals#7532.
Closes godotengine/godot-proposals#8738.
Test Project: shadow-of-the-popups.zip