Skip to content

Fixed alpha blending#12

Open
funmaker wants to merge 11 commits intoderivator:mainfrom
funmaker:main
Open

Fixed alpha blending#12
funmaker wants to merge 11 commits intoderivator:mainfrom
funmaker:main

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