From 15facbb96409f5efcdcd911c1b3e31e680b1ee20 Mon Sep 17 00:00:00 2001 From: "Hexroll by Pen, Dice & Paper" <143178036+hexroll@users.noreply.github.com> Date: Mon, 20 Jan 2025 21:31:20 +0000 Subject: [PATCH] Fixing ui antialiasing clamp call parameters order (#14970) (#17456) # Objective Fixes #14970 ## Solution It seems the clamp call in `ui.wgsl` had the parameters order incorrect. ## Testing Tested using examples/ui in native and my current project in wasm - both in linux. Could use some help with testing in other platforms. --- --- crates/bevy_ui/src/render/ui.wgsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bevy_ui/src/render/ui.wgsl b/crates/bevy_ui/src/render/ui.wgsl index 342fd4d380..3fd339405d 100644 --- a/crates/bevy_ui/src/render/ui.wgsl +++ b/crates/bevy_ui/src/render/ui.wgsl @@ -117,7 +117,7 @@ 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)); + return saturate(0.5 - distance); } fn draw(in: VertexOutput, texture_color: vec4) -> vec4 {