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

Forward+ Window transparency is not working, works in Compatibility renderer #89205

Open
Khailz opened this issue Mar 6, 2024 · 16 comments
Open

Comments

@Khailz
Copy link

Khailz commented Mar 6, 2024

Tested versions

Reproducible in 4.3 all dev snapshots, 4.2 and 4.1

System information

Godot v4.3.dev4 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated AMD Radeon RX 6900 XT (Advanced Micro Devices, Inc.; 31.0.24002.92) - AMD Ryzen 9 7950X 16-Core Processor (32 Threads)

Issue description

Transparency does not work in the Forward+ renderer, at least on my system. It works fine in Compatibility renderer.

I set the correct parameters for transparency settings and I have used the same script on all the versions I tested:
4.3 all dev snapshots, 4.2 and 4.1

Project settings advanced enabled
project>project settings>Display > Window > per pixel transparency> enabled
project>project settings>Display > Window > transparent > enabled

Not sure if this an AMD issue.

Steps to reproduce

Enable Transparency settings in project settings:

Project settings advanced enabled
project>project settings>Display > Window > per pixel transparency> enabled
project>project settings>Display > Window > transparent > enabled

Create any type of node and add use a simple script to set the window and viewport to be transparent:

func _ready() -> void:
	get_tree().get_root().set_transparent_background(true)
	DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_TRANSPARENT, true, 0)
	

The window should be transparent, if not, try switching to Compatibility renderer.

Minimal reproduction project (MRP)

Bug Sample project files

@Khailz Khailz changed the title Forward + transparency is not working Forward + transparency is not working, works in Compatibility renderer Mar 6, 2024
@Khailz Khailz changed the title Forward + transparency is not working, works in Compatibility renderer Forward+ transparency is not working, works in Compatibility renderer Mar 6, 2024
@Khailz Khailz changed the title Forward+ transparency is not working, works in Compatibility renderer Forward+ Window transparency is not working, works in Compatibility renderer Mar 6, 2024
@bolognatic
Copy link

bolognatic commented May 30, 2024

This is also a problem for D3D12 in Forward+. I am running an Nvidia GPU so it isn't just AMD.

@Calinou
Copy link
Member

Calinou commented May 30, 2024

Create any type of node and add use a simple script to set the window and viewport to be transparent:

Not related to the bug itself, but you don't need the script if you have both project settings enabled already.

@DungenRobot
Copy link

DungenRobot commented Jun 20, 2024

Doesn't work for me on Mobile, Compatibility, or Forward+, just shows a black screen.
Using same setup as described in the issue
GPU is a Radeon RX 7700S

@JDDoesDev
Copy link

Can confirm, same thing happening after updating NVIDIA drivers v 556.12. It corrects when reverting to previous versions.

@Calinou
Copy link
Member

Calinou commented Jul 7, 2024

Doesn't work for me on Mobile, Compatibility, or Forward+ for me, just shows a black screen. Using same setup as described in the issue GPU is a Radeon RX 7700S

Can you reproduce this on integrated graphics using the --gpu-index command line argument to choose a GPU on startup? If not, this is due to #76167.

@DungenRobot
Copy link

Can you reproduce this on integrated graphics using the --gpu-index command line argument to choose a GPU on startup? If not, this is due to #76167.

Reproduces using integrated graphics on Forward+
Chip is an AMD Radeon 780M

@KyleReese
Copy link

KyleReese commented Aug 18, 2024

I am also seeing this with an Nvidia 2080 Super. Windows 10. Drivers: 560.81. Godot 4.3.

Forward+ shows a black background rather than transparency. With the compatibility renderer transparency works just fine.

Forward+ transparency works fine on my M3 Mac.

Edit: Adjusting the "Vulkan/OpenGL present method" setting as described here allows Forward+ to work but that isn't really a viable thing to have every user do.

@gabrieldevsouza
Copy link

Same problem with NVIDIA 3070, Windows 10, Godot 4.3 and latest drivers.

@saierXP
Copy link

saierXP commented Sep 10, 2024

Open OpenGL Triple Buffering in AMD Driver Setting, it doesn't work in Compatibility renderer(opengl3),but works in Compatibility renderer(opengl3_angle).

Forward+ render(vulkan,dx12) doesn't work.

According to the comments here, it may be amd's dxgi that causes the inability to use transparent window on vulkan.

I searched and found that AMD enables dxgi swapchain in vulkan by default and it can't be turned off by the user. DXGI Swapchain on Opengl and Vulkan Games

System info

AMD Driver version 24.5.1

Godot v4.3.stable - Windows 10.0.19045 - GLES3 (Compatibility) - AMD Radeon RX 7800 XT (Advanced Micro Devices, Inc.; 31.0.24033.1003) - 12th Gen Intel(R) Core(TM) i5-12400F (12 Threads)

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated AMD Radeon RX 7800 XT (Advanced Micro Devices, Inc.; 31.0.24033.1003) - 12th Gen Intel(R) Core(TM) i5-12400F (12 Threads)

@abstractionfactory
Copy link
Contributor

abstractionfactory commented Sep 23, 2024

Hi folks, we seem to have isolated it to an NVIDIA graphics driver upgrade from version 546.33 to at least 546.33 with RTX cards on two systems:

System 1:

Doesn't work on:

Godot v4.3.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 Ti (NVIDIA; 32.0.15.5585) - Intel(R) Core(TM) i7-14700KF (28 Threads)

However, switching to compatibility mode works:

Godot v4.3.stable - Windows 10.0.22631 - GLES3 (Compatibility) - NVIDIA GeForce RTX 4070 Ti (NVIDIA; 32.0.15.5585) - Intel(R) Core(TM) i7-14700KF (28 Threads)

System 2:

Works on NVIDIA 546.33:

Godot v4.3.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4060 Ti (NVIDIA; 32.0.15.6109) - Intel(R) Core(TM) i7-10700KF CPU @ 3.80GHz (16 Threads)

After an upgrade to 561.03 it's broken. Again, switching to compatibility mode worked.

@IFevre
Copy link

IFevre commented Oct 3, 2024

(Up to date AMD rig here) - Others' godot projects with transparent windows is broken. I cannot ask other creators to export in compatibility mode, and the comments on one suggested they already had.
Transparency made with pygame and gamemaker is working fine.
I cannot really pickup godot if this doesn't have a universal fix.

@saierXP
Copy link

saierXP commented Oct 9, 2024

AMD driver 23.9.1 work for me,but 23.9.2 doesn't.
23.9.1 uses vulkan 2.0.270,
23.9.2 uses vulkan 2.0.283.
Data From Radeon™ Vulkan® Drivers Version Table and vulkaninfo --summary Command.

My other computer is an AMD integrated graphics card, and its vulkan support stopped at 2.0.297, but the transparent window worked fine.
So I suspect there is a problem with the vulkan drive between 2.0.279 and 2.0.283

Another software also had a similar issue, his amd driver working at 23.8.1 and not working at 23.10.1

Transparency made with pygame and gamemaker is working fine.

@IFevre Maybe they use opengl.

@Calinou
Copy link
Member

Calinou commented Oct 15, 2024

I cannot ask other creators to export in compatibility mode, and the comments on one suggested they already had.

You can force a project to run with Compatibility by adding --rendering-method gl_compatibility to the launch options (e.g. right-click in Steam library > Properties). See Command line tutorial for a full list of options.

@ProxyCC
Copy link

ProxyCC commented Oct 25, 2024

Same issue here.
The solution listed by setting Vulkan/OpenGL Present mode to prefer native doesn't work for me and other users of my application.
Won't work on NVIDIA 10 series.
Not a single AMD dedicated graphics card work (Only integrated cards work)
No idea about Intel integrated or dedicated graphics cards.

@BeakyFudd
Copy link

BeakyFudd commented Nov 30, 2024

For me, turning off VSync in the project settings, and not using fullscreen or exclusive fullscreen fixed this! I can't believe the solution was so simple.

@ChildLearningClub
Copy link
Contributor

ChildLearningClub commented Dec 5, 2024

#65487 Didn't see this thread until now, so had posted here, but looks to be the same thing. Only single Nvidia gpu on my system. Will have to try rolling back the driver, but odd that it would have been an issue, resolved then broke again.

Yes, it was in fact related to the Nvidia GPU Vertical sync, If on Windows also make sure that within NVIDIA Control Panel that Manage 3D settings Vertical sync is set to "Use the 3D application setting" which is the default, or set to "off"


EDIT: I came back to my project today with the transparent background turning black again. I had not changed anything. I don't know if it has something to do with the driver, but toggling vsync in the project settings did nothing, changing Nvidia Vsync to off did nothing. I'm not sure if restarting the pc helped, but after that played with toggling some more and it magically worked again. turned vsync on in the project settings and it still worked as expected. So hard to tell what is the cause. Godot 4.4 dev 6 Nvidia driver version 560.94

Created as simple of a project as possible to help with testing here #65487 for anyone that wants to test and see what results they get.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests