Skip to content

Commit 6ea98f5

Browse files
committed
reduce the antialias strength
1 parent d659a1f commit 6ea98f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/bevy_ui/src/render/ui.wgsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ fn sd_inset_rounded_box(point: vec2<f32>, size: vec2<f32>, radius: vec4<f32>, in
123123
// get alpha for antialiasing for sdf
124124
fn antialias(distance: f32) -> f32 {
125125
// Using the fwidth(distance) was causing artifacts, so just use the distance.
126-
return clamp(0.0, 1.0, 0.5 - distance);
126+
// This antialiases between the distance values of 0.25 and -0.25
127+
return clamp(0.0, 1.0, 0.5 - 2.0 * distance);
127128
}
128129

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

0 commit comments

Comments
 (0)