Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Borders leave artifacts #12702

Closed
asafigan opened this issue Mar 25, 2024 · 1 comment · Fixed by #12725
Closed

UI Borders leave artifacts #12702

asafigan opened this issue Mar 25, 2024 · 1 comment · Fixed by #12725
Labels
A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior
Milestone

Comments

@asafigan
Copy link
Contributor

asafigan commented Mar 25, 2024

Bevy version

Main branch

[Optional] Relevant system information

`AdapterInfo { name: "Apple M2 Pro", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }`

What went wrong

If a UiNode with a border is rendered on top of the same color, it has artifacts at the outer corners. This is noticeable with border radius.

If a UiNode with a border and an UiImage of the same color, it has artifacts between the border and the inner part of the Node.

Additional information

I could remove the border if the UiImage is the same color as the border, but because of the way my code works, it would be annoying.

Screenshot 2024-03-25 at 15 17 53 Screenshot 2024-03-25 at 14 52 21
@asafigan asafigan added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Mar 25, 2024
@asafigan asafigan changed the title UI Borders leaves artifacts UI Borders leave artifacts Mar 25, 2024
@asafigan
Copy link
Contributor Author

I have also tested on Android, iOS, and Linux so I think this is present on all platforms.

@SolarLiner SolarLiner added A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets and removed S-Needs-Triage This issue needs to be labelled labels Mar 25, 2024
@alice-i-cecile alice-i-cecile added this to the 0.14 milestone Mar 25, 2024
github-merge-queue bot pushed a commit that referenced this issue May 15, 2024
Fixes #12702.

Co-authored-by: François Mockers <mockersf@gmail.com>
github-merge-queue bot pushed a commit that referenced this issue Jun 14, 2024
# Objective

- Fixes #13807

## Solution

- Before this pr we antialiased between 0.5 and -0.5. This pr changes
things to antialias between 0.25 and -0.25. I tried slightly larger
ranges, but the edge between the boxes still showed. I'm not 100% sure
this is the correct solution, but from what I could find the range you
use is more art than science.

## Testing

- Ran rounded_borders example, the code in the linked issue, and the
testing example from #12702.

---

## Changelog

- reduce antialiasing in ui shader.
mockersf pushed a commit that referenced this issue Jun 14, 2024
# Objective

- Fixes #13807

## Solution

- Before this pr we antialiased between 0.5 and -0.5. This pr changes
things to antialias between 0.25 and -0.25. I tried slightly larger
ranges, but the edge between the boxes still showed. I'm not 100% sure
this is the correct solution, but from what I could find the range you
use is more art than science.

## Testing

- Ran rounded_borders example, the code in the linked issue, and the
testing example from #12702.

---

## Changelog

- reduce antialiasing in ui shader.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants