diff --git a/crates/bevy_ui/src/render/ui.wgsl b/crates/bevy_ui/src/render/ui.wgsl index 89dbed1f6668a..cd30d4e363613 100644 --- a/crates/bevy_ui/src/render/ui.wgsl +++ b/crates/bevy_ui/src/render/ui.wgsl @@ -123,7 +123,8 @@ fn sd_inset_rounded_box(point: vec2, size: vec2, radius: vec4, in // get alpha for antialiasing for sdf fn antialias(distance: f32) -> f32 { // Using the fwidth(distance) was causing artifacts, so just use the distance. - return clamp(0.0, 1.0, 0.5 - distance); + // This antialiases between the distance values of 0.25 and -0.25 + return clamp(0.0, 1.0, 0.5 - 2.0 * distance); } fn draw(in: VertexOutput, texture_color: vec4) -> vec4 {