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 authored and sanbox-irl committed Mar 27, 2024
1 parent ca05418 commit cd97e17
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 cd97e17

Please sign in to comment.