Skip to content

Commit

Permalink
UI: don't multiply color channels by alpha (bevyengine#12599)
Browse files Browse the repository at this point in the history
# Objective

- since bevyengine#12500, text is a little bit more gray in UI

## Solution

- don't multiply color by alpha. I think this was done in the original
PR (bevyengine#8973) for shadows which were not added in bevyengine#12500
  • Loading branch information
mockersf authored Mar 20, 2024
1 parent ed44eb3 commit bd90a64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_ui/src/render/ui.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ fn draw(in: VertexOutput) -> vec4<f32> {
// is present, otherwise an outline about the external boundary would be drawn even without
// a border.
let t = 1. - select(step(0.0, border_distance), smoothstep(0.0, fborder, border_distance), external_distance < internal_distance);
return vec4(color.rgb * t * color.a, t * color.a);
return color.rgba * t;
}

// The item is a rectangle, draw normally with anti-aliasing at the edges.
let t = 1. - smoothstep(0.0, fexternal, external_distance);
return vec4(color.rgb * t * color.a, t * color.a);
return color.rgba * t;
}

@fragment
Expand Down

0 comments on commit bd90a64

Please sign in to comment.