Skip to content

Commit 483f2d5

Browse files
hexrollmockersf
authored andcommitted
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. ---
1 parent 85054bb commit 483f2d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_ui/src/render/ui.wgsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ fn sd_inset_rounded_box(point: vec2<f32>, size: vec2<f32>, radius: vec4<f32>, in
117117
// get alpha for antialiasing for sdf
118118
fn antialias(distance: f32) -> f32 {
119119
// Using the fwidth(distance) was causing artifacts, so just use the distance.
120-
return clamp(0.0, 1.0, (0.5 - distance));
120+
return saturate(0.5 - distance);
121121
}
122122

123123
fn draw(in: VertexOutput, texture_color: vec4<f32>) -> vec4<f32> {

0 commit comments

Comments
 (0)