bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Window transparency broken on Windows

Open aevyrie opened this issue 2 years ago • 18 comments

Bevy version

main

The transparent_window example appears to have broken.

image

2023-02-07T09:15:10.694725Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3050 Ti Laptop GPU", vendor: 4318, device: 9632, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "527.56", backend: Vulkan }
2023-02-07T09:15:10.985257Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 11 Home", kernel: "22621", cpu: "11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz", core_count: "8", memory: "63.7 GiB" }

aevyrie avatar Feb 07 '23 09:02 aevyrie

Can't seem to repro this myself, going to try updating my drivers. Maybe should try a cargo clean/cargo run --example transparent_window

Aceeri avatar Feb 08 '23 01:02 Aceeri

Same issue occurred on Mac OS on Metal. SystemInfo { os: "MacOS 12.1 ", kernel: "21.2.0", cpu: "Apple M1", core_count: "8", memory: "8.0 GiB" }

minstrel1 avatar Feb 10 '23 14:02 minstrel1

This is known, see the docs on https://dev-docs.bevyengine.org/bevy/prelude/struct.Window.html#structfield.transparent

I opened a PR to improve the situation on macOS: https://github.com/bevyengine/bevy/pull/7617

On windows, it should be fixed by latest winit update, but I can't confirm it myself.

mockersf avatar Feb 11 '23 00:02 mockersf

Can confirm that the latest winit update has fixed this on Windows.

james7132 avatar Feb 27 '23 09:02 james7132

Doc should be updated to remove mention of issues on windows: https://github.com/bevyengine/bevy/blob/2344b943a2f65031200a19d314b328a2eea320ae/crates/bevy_window/src/window.rs#L130-L135

mockersf avatar Feb 27 '23 09:02 mockersf

This appears to be broken on main again. I've tried a cargo clean and running in release with no luck.

aevyrie avatar Mar 06 '23 06:03 aevyrie

transparent_window example not working for me either. image

cargo run --example transparent_window
    Finished dev [unoptimized + debuginfo] target(s) in 0.42s
     Running `target\debug\examples\transparent_window.exe`
2023-06-14T07:43:02.479588Z  INFO bevy_winit::system: Creating new window "Bevy App" (0v0)
2023-06-14T07:43:02.769532Z  INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce GTX 1660 Ti", vendor: 4318, device: 8593, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "528.79", backend: Vulkan }
2023-06-14T07:43:04.046657Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 10 Home", kernel: "19045", cpu:
"Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz", core_count: "6", memory: "15.8 GiB" }

morfert avatar Jun 14 '23 07:06 morfert

@aevyrie @morfert Could you try running the winit example here? https://github.com/rust-windowing/winit/blob/master/examples/transparent.rs

Will see if I can repro again this week.

Aceeri avatar Jun 16 '23 01:06 Aceeri

I cloned winit and ran cargo run --example transprent but the window was not transparent. image This may be a winit problem.

morfert avatar Jun 16 '23 09:06 morfert

Investigating a bit and it seems like that might just be an issue with their example not drawing anything?

https://github.com/rust-windowing/winit/issues/2502

Aceeri avatar Jun 16 '23 20:06 Aceeri

This might be a red herring, but blur and similar decorators were broken in the tauri-adjacent crate on Win 11 22H2 https://github.com/tauri-apps/window-vibrancy/issues/45

SecretPocketCat avatar Jun 21 '23 07:06 SecretPocketCat

This might be a red herring, but blur and similar decorators were broken in the tauri-adjacent crate on Win 11 22H2 tauri-apps/window-vibrancy#45

My bad, the bevy example is actually fine on Win 11 22H2.

SecretPocketCat avatar Jun 21 '23 16:06 SecretPocketCat

Yeah, winit is probably fine I tried drawing something.

Transparent

With:

        WindowBuilder::new()
            .with_decorations(false)
            .with_transparent(true)
            .with_inner_size(size)
            .with_min_inner_size(size)
            .build(&event_loop)
            .unwrap()

Result: image

Not transparent

With:

        WindowBuilder::new()
            .with_title("Hello Pixels")
            .with_inner_size(size)
            .with_min_inner_size(size)
            .build(&event_loop)
            .unwrap()

Result: image

Conclusion

As long as something is drawn, winit seems to properly become transparent.

Addendum

The Not transparent test is the unmodified minimal winit example from pixels.

morfert avatar Jun 22 '23 08:06 morfert

@morfert

Pixels might not be the best library to test this, because of https://github.com/parasyte/pixels/issues/370 That leads to it being either "fully transparent" or "fully opaque".

transparent-pixels-winit.zip

stefnotch avatar Aug 25 '23 13:08 stefnotch

Using the following code:

    let window = WindowBuilder::new()
        .with_title("A simple window")
        .with_transparent(true)
        .build(&event_loop)
        .expect("Builing window failed");

    let instance = wgpu::Instance::default();

    let surface = unsafe { instance.create_surface(&window) }.expect("Could not create surface");

    for ad in instance.enumerate_adapters(wgpu::Backends::all()) {
        info!(
            "Adapter : {:?}\n Supported Alpha : {:?}",
            ad.get_info(),
            surface.get_capabilities(&ad).alpha_modes
        );
    }

I enumerate to see all supported alpha_modes for all adapters on my laptop. The results are as follows:

2023-08-30T08:05:50.081235Z  INFO gapoo:
 Adapter : AdapterInfo { name: "NVIDIA GeForce GTX 1660 Ti", vendor: 4318, device: 8593, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "532.09", backend: Vulkan }
 Supported Alpha : [Opaque]
    at src\main.rs:29

2023-08-30T08:05:50.081668Z  INFO gapoo:
 Adapter : AdapterInfo { name: "Intel(R) UHD Graphics 630", vendor: 32902, device: 16027, device_type: IntegratedGpu, driver: "Intel Corporation", driver_info: "Intel driver", backend: Vulkan }
 Supported Alpha : [Opaque, Inherit]
    at src\main.rs:29

2023-08-30T08:05:50.081924Z  INFO gapoo:
 Adapter : AdapterInfo { name: "NVIDIA GeForce GTX 1660 Ti", vendor: 4318, device: 8593, device_type: DiscreteGpu, driver: "", driver_info: "", backend: Dx12 }
 Supported Alpha : [Opaque]
    at src\main.rs:29

2023-08-30T08:05:50.114292Z  INFO gapoo:
 Adapter : AdapterInfo { name: "Intel(R) UHD Graphics 630", vendor: 32902, device: 16027, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Dx12 }
 Supported Alpha : [Opaque]
    at src\main.rs:29

2023-08-30T08:05:50.123944Z  INFO gapoo:
 Adapter : AdapterInfo { name: "Microsoft Basic Render Driver", vendor: 5140, device: 140, device_type: Cpu, driver: "", driver_info: "", backend: Dx12 }
 Supported Alpha : [Opaque]
    at src\main.rs:29

Only Opaque and Inherit are available. This might be the problem.

morfert avatar Aug 30 '23 08:08 morfert

I also have transparency not working as well, are there any active workarounds?

CoryRobertson avatar Nov 20 '23 04:11 CoryRobertson

Hi, are there any updates on this problem? Looks like transparency still not working(#10929), even with winit latest versions.

lkaratl avatar Mar 20 '24 04:03 lkaratl

How do we find gpu's that support PostMultiplied Apha Mode?

bradmesserle avatar Apr 26 '24 15:04 bradmesserle

Has they're been any update on this? transparency is still not working and now I'm noticing the examples just missing from the winit repo

lunarcleint avatar May 24 '24 04:05 lunarcleint

No updates.. I have been out of town for the last month..  thanksSent from my iPhoneOn May 23, 2024, at 11:55 PM, lunarcleint @.***> wrote: Has they're been any update on this? transparency is still not working and now I'm noticing the examples just missing from the winit repo

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

bradmesserle avatar May 24 '24 08:05 bradmesserle

I also have this problem with AMD Radeon 680M on Win 11, only getting Opaque in the list of supported alpha modes. Not sure if that is related or not, but the transparency example on master does not work.

KernelKrusha avatar Jun 26 '24 21:06 KernelKrusha

This has been fixed on the latest bevy 0.14 testing, try it out :D

On Wed, Jun 26, 2024 at 2:13 PM KernelKrusha @.***> wrote:

I also have this problem with AMD Radeon 680M, only getting Opaque in the list of supported alpha modes. Not sure if that is related or not, but the transparency example on master does not work.

— Reply to this email directly, view it on GitHub https://github.com/bevyengine/bevy/issues/7544#issuecomment-2192635689, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVFSDXX6PSQY7POCYW7JUKLZJMVFZAVCNFSM6AAAAAAUTWL7ZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGYZTKNRYHE . You are receiving this because you commented.Message ID: @.***>

lunarcleint avatar Jun 27 '24 00:06 lunarcleint

This will be fantastic is so. I will update and retest…Thank you Sent from my iPhoneOn Jun 26, 2024, at 8:38 PM, lunarcleint @.***> wrote: This has been fixed on the latest bevy 0.14 testing, try it out :D

On Wed, Jun 26, 2024 at 2:13 PM KernelKrusha @.***>

wrote:

I also have this problem with AMD Radeon 680M, only getting Opaque in the

list of supported alpha modes. Not sure if that is related or not, but the

transparency example on master does not work.

Reply to this email directly, view it on GitHub

https://github.com/bevyengine/bevy/issues/7544#issuecomment-2192635689,

or unsubscribe

https://github.com/notifications/unsubscribe-auth/AVFSDXX6PSQY7POCYW7JUKLZJMVFZAVCNFSM6AAAAAAUTWL7ZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGYZTKNRYHE

.

You are receiving this because you commented.Message ID:

@.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

bradmesserle avatar Jun 27 '24 03:06 bradmesserle

Off topic but why is there not a most current version number on the bevy website? I had to look in github. The getting started or the front page should have the most current version displayed.

IMHO.. :)

Thanks

On Wed, Jun 26, 2024 at 11:07 PM Brad Messerle @.***> wrote:

This will be fantastic is so. I will update and retest…

Thank you Sent from my iPhone

On Jun 26, 2024, at 8:38 PM, lunarcleint @.***> wrote:



This has been fixed on the latest bevy 0.14 testing, try it out :D

On Wed, Jun 26, 2024 at 2:13 PM KernelKrusha @.***> wrote:

I also have this problem with AMD Radeon 680M, only getting Opaque in the list of supported alpha modes. Not sure if that is related or not, but the transparency example on master does not work.

— Reply to this email directly, view it on GitHub https://github.com/bevyengine/bevy/issues/7544#issuecomment-2192635689,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AVFSDXX6PSQY7POCYW7JUKLZJMVFZAVCNFSM6AAAAAAUTWL7ZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGYZTKNRYHE>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/bevyengine/bevy/issues/7544#issuecomment-2192847352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABX2FUOSJ42N75E36CRW2DZJNNJDAVCNFSM6AAAAAAUTWL7ZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSHA2DOMZVGI . You are receiving this because you commented.Message ID: @.***>

-- Reminder to all what it means to be an American. 1969.. https://www.youtube.com/watch?v=TZBTyTWOZCM

bradmesserle avatar Jun 27 '24 14:06 bradmesserle

updated my little sample app to bevy 0.14-rc3.

Still getting errors on Windows.

This is error log... warning: trader-seth-event-calendar (bin "trader-seth-event-calendar") generated 3 warnings Finished dev profile [unoptimized + debuginfo] target(s) in 1m 53s Running target\debug\trader-seth-event-calendar.exe 2024-06-27T20:04:30.672264Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 11 Home", kernel: "22631", cpu: "12th Gen Intel(R) Core(TM) i7-12700H", core_count: "14", memory: "15.7 GiB" } 2024-06-27T20:04:32.601736Z INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3060 Laptop GPU", vendor: 4318, device: 9568, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "551.86", backend: Vulkan } 2024-06-27T20:04:33.752522Z INFO bevy_winit::system: Creating new window "Trader Seth - Event Calendar" (Entity { index: 0, generation: 1 }) thread 'Compute Task Pool (7)' panicked at C:\Users\bradm.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.20.1\src\backend\wgpu_core.rs:751 :18: Error in Surface::configure: Validation Error

Caused by: Requested alpha mode PostMultiplied is not in the list of supported alpha modes: [Opaque]

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Encountered a panic in system bevy_render::view::window::create_surfaces!

Thank You

On Thu, Jun 27, 2024 at 10:05 AM Brad Messerle @.***> wrote:

Off topic but why is there not a most current version number on the bevy website? I had to look in github. The getting started or the front page should have the most current version displayed.

IMHO.. :)

Thanks

On Wed, Jun 26, 2024 at 11:07 PM Brad Messerle @.***> wrote:

This will be fantastic is so. I will update and retest…

Thank you Sent from my iPhone

On Jun 26, 2024, at 8:38 PM, lunarcleint @.***> wrote:



This has been fixed on the latest bevy 0.14 testing, try it out :D

On Wed, Jun 26, 2024 at 2:13 PM KernelKrusha @.***> wrote:

I also have this problem with AMD Radeon 680M, only getting Opaque in the list of supported alpha modes. Not sure if that is related or not, but the transparency example on master does not work.

— Reply to this email directly, view it on GitHub https://github.com/bevyengine/bevy/issues/7544#issuecomment-2192635689,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AVFSDXX6PSQY7POCYW7JUKLZJMVFZAVCNFSM6AAAAAAUTWL7ZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGYZTKNRYHE>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/bevyengine/bevy/issues/7544#issuecomment-2192847352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABX2FUOSJ42N75E36CRW2DZJNNJDAVCNFSM6AAAAAAUTWL7ZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSHA2DOMZVGI . You are receiving this because you commented.Message ID: @.***>

-- Reminder to all what it means to be an American. 1969.. https://www.youtube.com/watch?v=TZBTyTWOZCM

-- Reminder to all what it means to be an American. 1969.. https://www.youtube.com/watch?v=TZBTyTWOZCM

bradmesserle avatar Jun 27 '24 20:06 bradmesserle

sorry i had to update to Opaque mode.. and it works.

Thank You for the support !!!

On Thu, Jun 27, 2024 at 4:07 PM Brad Messerle @.***> wrote:

updated my little sample app to bevy 0.14-rc3.

Still getting errors on Windows.

This is error log... warning: trader-seth-event-calendar (bin "trader-seth-event-calendar") generated 3 warnings Finished dev profile [unoptimized + debuginfo] target(s) in 1m 53s Running target\debug\trader-seth-event-calendar.exe 2024-06-27T20:04:30.672264Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 11 Home", kernel: "22631", cpu: "12th Gen Intel(R) Core(TM) i7-12700H", core_count: "14", memory: "15.7 GiB" } 2024-06-27T20:04:32.601736Z INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3060 Laptop GPU", vendor: 4318, device: 9568, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "551.86", backend: Vulkan } 2024-06-27T20:04:33.752522Z INFO bevy_winit::system: Creating new window "Trader Seth - Event Calendar" (Entity { index: 0, generation: 1 }) thread 'Compute Task Pool (7)' panicked at C:\Users\bradm.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.20.1\src\backend\wgpu_core.rs:751 :18: Error in Surface::configure: Validation Error

Caused by: Requested alpha mode PostMultiplied is not in the list of supported alpha modes: [Opaque]

note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Encountered a panic in system bevy_render::view::window::create_surfaces!

Thank You

On Thu, Jun 27, 2024 at 10:05 AM Brad Messerle @.***> wrote:

Off topic but why is there not a most current version number on the bevy website? I had to look in github. The getting started or the front page should have the most current version displayed.

IMHO.. :)

Thanks

On Wed, Jun 26, 2024 at 11:07 PM Brad Messerle @.***> wrote:

This will be fantastic is so. I will update and retest…

Thank you Sent from my iPhone

On Jun 26, 2024, at 8:38 PM, lunarcleint @.***> wrote:



This has been fixed on the latest bevy 0.14 testing, try it out :D

On Wed, Jun 26, 2024 at 2:13 PM KernelKrusha @.***> wrote:

I also have this problem with AMD Radeon 680M, only getting Opaque in the list of supported alpha modes. Not sure if that is related or not, but the transparency example on master does not work.

— Reply to this email directly, view it on GitHub < https://github.com/bevyengine/bevy/issues/7544#issuecomment-2192635689>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/AVFSDXX6PSQY7POCYW7JUKLZJMVFZAVCNFSM6AAAAAAUTWL7ZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSGYZTKNRYHE>

. You are receiving this because you commented.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/bevyengine/bevy/issues/7544#issuecomment-2192847352, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABX2FUOSJ42N75E36CRW2DZJNNJDAVCNFSM6AAAAAAUTWL7ZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJSHA2DOMZVGI . You are receiving this because you commented.Message ID: @.***>

-- Reminder to all what it means to be an American. 1969.. https://www.youtube.com/watch?v=TZBTyTWOZCM

-- Reminder to all what it means to be an American. 1969.. https://www.youtube.com/watch?v=TZBTyTWOZCM

-- Reminder to all what it means to be an American. 1969.. https://www.youtube.com/watch?v=TZBTyTWOZCM

bradmesserle avatar Jun 27 '24 20:06 bradmesserle

The example from https://github.com/bevyengine/bevy/blob/release-0.14.0/examples/window/transparent_window.rs does not work for me. I'm getting a black background.

Bevy 0.14, Windows 10, Vulkan, [Opaque]

SystemInfo { os: "Windows 10 Pro", kernel: "19045", cpu: "Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz", core_count: "6", memory: "15.9 GiB" }
AdapterInfo { name: "NVIDIA GeForce GTX 1080", vendor: 4318, device: 7040, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "556.12", backend: Vulkan }

Arrekin avatar Aug 02 '24 10:08 Arrekin