Skip to content

Commit

Permalink
reduce the antialias strength
Browse files Browse the repository at this point in the history
  • Loading branch information
hymm committed Jun 11, 2024
1 parent d659a1f commit 6ea98f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/bevy_ui/src/render/ui.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ fn sd_inset_rounded_box(point: vec2<f32>, size: vec2<f32>, radius: vec4<f32>, 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<f32>) -> vec4<f32> {
Expand Down

0 comments on commit 6ea98f5

Please sign in to comment.