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

Support for Transparent Windows #224

Open
GPeaky opened this issue Dec 17, 2023 · 9 comments
Open

Support for Transparent Windows #224

GPeaky opened this issue Dec 17, 2023 · 9 comments

Comments

@GPeaky
Copy link

GPeaky commented Dec 17, 2023

Hello, i am making a desktop app that need some windows in transparent mode because they are builded above of a game. Making like an external overlay and i don´t actually know if floem have support for it

@GPeaky
Copy link
Author

GPeaky commented Dec 17, 2023

In windows

@panekj
Copy link
Collaborator

panekj commented Dec 18, 2023

All windows in floem are transparent by default

@GPeaky
Copy link
Author

GPeaky commented Dec 18, 2023

Okay!, thanks i will try it. Floem have better performance than other options like tauri?

@dominikwilkowski
Copy link
Contributor

Can you share what you end up with here once you got something transparent working. I'd love to use it too and maybe add it to the examples too

@GPeaky
Copy link
Author

GPeaky commented Dec 18, 2023

Screenshot 2023-12-18 210120

All the leaderboards, etc. are external to the game, and are fully transparent (The game in running in a windowed Fullscreen)

@dominikwilkowski
Copy link
Contributor

Can you share the code for the transparent window?

@GPeaky
Copy link
Author

GPeaky commented Dec 18, 2023

This is what an example doit in tauri, i am trying to make it work with floem, but at the moment i could not doit

@jrmoulton
Copy link
Collaborator

@GPeaky the issue is here

alpha_mode: wgpu::CompositeAlphaMode::Auto,

The issue is that vger auto selects the blend mode for the alpha channel and by default sets it to opaque and makes it so that windows aren't transparent. On macOS i need to change this to PostMultiplied in order to get it to work.

This should be fixable in a configurable way but I'm not sure how

@jrmoulton
Copy link
Collaborator

After changing to PostMultiplied and setting my backround color to have a 70% alpha.
Screenshot 2023-12-18 at 1 58 21 PM

I think this setting is platform dependent. @dzhou121 might know more

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

No branches or pull requests

4 participants