Skip to content

Commit

Permalink
fix: use correct alpha blending function
Browse files Browse the repository at this point in the history
more information on #733
  • Loading branch information
Syndelis committed Dec 9, 2023
1 parent 8b2722d commit 05f54c9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions imgui-glium-renderer/src/lib.rs
Expand Up @@ -9,8 +9,8 @@ use glium::uniforms::{
MagnifySamplerFilter, MinifySamplerFilter, Sampler, SamplerBehavior, SamplerWrapFunction,
};
use glium::{
program, uniform, vertex, Blend, DrawError, DrawParameters, IndexBuffer, Program, Rect,
Surface, Texture2d, VertexBuffer,
program, uniform, vertex, Blend, BlendingFunction, DrawError, DrawParameters, IndexBuffer,
LinearBlendingFactor, Program, Rect, Surface, Texture2d, VertexBuffer,
};
use imgui::internal::RawWrapper;
use imgui::{BackendFlags, DrawCmd, DrawCmdParams, DrawData, TextureId, Textures};
Expand Down Expand Up @@ -253,7 +253,13 @@ impl Renderer {
tex: Sampler(texture.texture.as_ref(), texture.sampler)
},
&DrawParameters {
blend: Blend::alpha_blending(),
blend: Blend {
alpha: BlendingFunction::Addition {
source: LinearBlendingFactor::One,
destination: LinearBlendingFactor::OneMinusSourceAlpha,
},
..Blend::alpha_blending()
},
scissor: Some(Rect {
left: f32::max(0.0, clip_rect[0]).floor() as u32,
bottom: f32::max(0.0, fb_height - clip_rect[3]).floor()
Expand Down

0 comments on commit 05f54c9

Please sign in to comment.