From bd90a64ae063ad5429c4fc355f9cba5d869cc202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Mockers?= Date: Thu, 21 Mar 2024 00:15:40 +0100 Subject: [PATCH] UI: don't multiply color channels by alpha (#12599) # Objective - since #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 (#8973) for shadows which were not added in #12500 --- crates/bevy_ui/src/render/ui.wgsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bevy_ui/src/render/ui.wgsl b/crates/bevy_ui/src/render/ui.wgsl index 7a73382a650ce..bb312713c5c03 100644 --- a/crates/bevy_ui/src/render/ui.wgsl +++ b/crates/bevy_ui/src/render/ui.wgsl @@ -300,12 +300,12 @@ fn draw(in: VertexOutput) -> vec4 { // 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