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

Fixed alpha blending #12

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Fixed alpha blending #12

wants to merge 11 commits into from

Conversation

funmaker
Copy link

@funmaker funmaker commented Oct 3, 2022

Right now egui_vulkano does not use correct blending for premultiplied alpha causing weird glitches, eg in my application windows shadow when rendered on top of the game, cause the alpha of frame buffer to drop and game window becomes transparent around egui windows. That's because alpha channel is blended incorrectly, it should use (ONE, ONE_MINUS_SRC_ALPHA) for both color and alpha, right now it is (SRC_ALPHA, ONE_MINUS_SRC_ALPHA), so the source alpha gets squared and does not add up to 1 when drawing a transparent element over opaque destination.

This PR fixes it.

@derivator
Copy link
Owner

Sounds good, I want to test it first, but I will probably merge this soon.

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

Successfully merging this pull request may close these issues.

3 participants