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

Visual glitches with shadows with large blur radius #4238

Closed
emilk opened this issue Mar 26, 2024 · 0 comments · Fixed by #4245
Closed

Visual glitches with shadows with large blur radius #4238

emilk opened this issue Mar 26, 2024 · 0 comments · Fixed by #4245
Assignees
Labels
bug Something is broken epaint rerun Desired for Rerun.io

Comments

@emilk
Copy link
Owner

emilk commented Mar 26, 2024

There are two separate issues.
One is that a blur radius larger than the width/height of a rect looks borked:

Screenshot 2024-03-26 at 20 13 46

The other is a strange bug in the rect tessellator:

Screenshot 2024-03-26 at 20 14 49 Screenshot 2024-03-26 at 20 15 38
@emilk emilk added bug Something is broken rerun Desired for Rerun.io labels Mar 26, 2024
@emilk emilk self-assigned this Mar 26, 2024
@emilk emilk added the epaint label Mar 26, 2024
@emilk emilk added this to the Next Patch Release milestone Mar 27, 2024
emilk added a commit that referenced this issue Mar 27, 2024
* Part of #4238

When one side of a rectangle is all rounding we need to take care not to
produce duplicated vertices in the rectangle path generator.

The old code only handled three sides, but forgot the last side (the
right side).
The new code handles the right side, and also handles the other sides
more robustly (with a floating point eps) and efficiently (in a single
pass).

The glitch was most notable in shadows with a high blur width.

Examples of the glitch:

<img width="203" alt="Screenshot 2024-03-26 at 20 15 38"
src="https://github.com/emilk/egui/assets/1148717/dc1c0a06-35f0-4fda-a011-0e37d18454a0">

<img width="220" alt="Screenshot 2024-03-27 at 09 48 48"
src="https://github.com/emilk/egui/assets/1148717/c278b28e-c3f9-4c82-ba20-0480621efd2f">

<img width="33" alt="Screenshot 2024-03-27 at 09 49 21"
src="https://github.com/emilk/egui/assets/1148717/379ddf77-6590-4444-9c2e-67ab1e071f0f">
emilk added a commit that referenced this issue Mar 27, 2024
* Closes #4238

The comment in the code explains it well, but the short of it is this:
we can't handle a shadow blur width larger than the shadow rectangle, so
we need to clamp the blur. This means smaller things will cast shadows
with a smaller blur width, but that's better than having visual
glitches.
hacknus pushed a commit to hacknus/egui that referenced this issue Oct 30, 2024
…lk#4244)

* Part of emilk#4238

When one side of a rectangle is all rounding we need to take care not to
produce duplicated vertices in the rectangle path generator.

The old code only handled three sides, but forgot the last side (the
right side).
The new code handles the right side, and also handles the other sides
more robustly (with a floating point eps) and efficiently (in a single
pass).

The glitch was most notable in shadows with a high blur width.

Examples of the glitch:

<img width="203" alt="Screenshot 2024-03-26 at 20 15 38"
src="https://github.com/emilk/egui/assets/1148717/dc1c0a06-35f0-4fda-a011-0e37d18454a0">

<img width="220" alt="Screenshot 2024-03-27 at 09 48 48"
src="https://github.com/emilk/egui/assets/1148717/c278b28e-c3f9-4c82-ba20-0480621efd2f">

<img width="33" alt="Screenshot 2024-03-27 at 09 49 21"
src="https://github.com/emilk/egui/assets/1148717/379ddf77-6590-4444-9c2e-67ab1e071f0f">
hacknus pushed a commit to hacknus/egui that referenced this issue Oct 30, 2024
* Closes emilk#4238

The comment in the code explains it well, but the short of it is this:
we can't handle a shadow blur width larger than the shadow rectangle, so
we need to clamp the blur. This means smaller things will cast shadows
with a smaller blur width, but that's better than having visual
glitches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken epaint rerun Desired for Rerun.io
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant