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

imgui-glium-renderer has wrong alpha blending settings #733

Closed
Lateasusual opened this issue Jun 23, 2023 · 2 comments · Fixed by #756
Closed

imgui-glium-renderer has wrong alpha blending settings #733

Lateasusual opened this issue Jun 23, 2023 · 2 comments · Fixed by #756

Comments

@Lateasusual
Copy link

The winit Blend::alpha_blending() used in the glium renderer backend produces an incorrect blending function for our purposes.

Winit provides (and imgui-glium-renderer uses):

alpha: BlendingFunction::Addition {
    source: LinearBlendingFactor::SourceAlpha,
    destination: LinearBlendingFactor::OneMinusSourceAlpha
},

where the correct function for "overlay" alpha blending should be

alpha: BlendingFunction::Addition {
    source: LinearBlendingFactor::One,
    destination: LinearBlendingFactor::OneMinusSourceAlpha,
},

Screenshots:

Without the change - even though the window background is fully opaque, the drawn imgui windows overwrite the alpha with an incorrect value.
image

With the change, the window opacity is preserved as expected.
image

If this is not intentional (which i presume it isn't) and is not deemed to be a mistake in winit upstream then I will submit a PR later when I get the chance.

@sanbox-irl
Copy link
Member

Looking through the code, I believe this is definitely on us. Could you submit that PR?

Syndelis added a commit to Syndelis/imgui-rs that referenced this issue Dec 9, 2023
Syndelis added a commit to Syndelis/imgui-rs that referenced this issue Dec 27, 2023
Syndelis added a commit to Syndelis/imgui-rs that referenced this issue Dec 27, 2023
Syndelis added a commit to Syndelis/imgui-rs that referenced this issue Jan 25, 2024
Syndelis added a commit to Syndelis/imgui-rs that referenced this issue Mar 27, 2024
@jjungo
Copy link

jjungo commented Mar 27, 2024

I have the same issue, #756 solve it on my side.

sanbox-irl pushed a commit that referenced this issue Mar 27, 2024
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 a pull request may close this issue.

3 participants