You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Egui currently doesn't apply any dithering to it's output. That's hardly an issue with the flat default look and feel. However, when drawing gradients or images (which have been resampled) banding becomes a problem.
Describe the solution you'd like
I think ideally egui would perform dithering in the fragment shader. Given the trivial nature of the shader performing a few more operations on the ALU for some simple dithering should not have a relevant impact on rendering performance. The one exception is potentially when software rasterization.
Describe alternatives you've considered
I'm currently just drawing a noisy texture on top of gradients to mask the problem but it requires a lot more noise to be added to the gradient to make it look smooth (ironically) than doing it in a fragment shader.
I think there is also an argument that this is out of scope for egui. Other than shadows most widgets seem to use solid colors. For the shadows the fall off is quick enough that dithering isn't necessary. Even when rendering images this is likely going to be an edge case and only an issue when rendering images with smooth gradients that either aren't dithered or have been resampled to the extent that the dithering in the image is ineffective.
Additional context
I'd be happy to create a PR if dithering is considered to be in scope for egui.
The text was updated successfully, but these errors were encountered:
We should make sure to mention in a comment that this is an optional improvement, and that someone writing their own egui renderer don't need to copy if they don't want to.
Is your feature request related to a problem? Please describe.
Egui currently doesn't apply any dithering to it's output. That's hardly an issue with the flat default look and feel. However, when drawing gradients or images (which have been resampled) banding becomes a problem.
Describe the solution you'd like
I think ideally egui would perform dithering in the fragment shader. Given the trivial nature of the shader performing a few more operations on the ALU for some simple dithering should not have a relevant impact on rendering performance. The one exception is potentially when software rasterization.
Describe alternatives you've considered
I'm currently just drawing a noisy texture on top of gradients to mask the problem but it requires a lot more noise to be added to the gradient to make it look smooth (ironically) than doing it in a fragment shader.
I think there is also an argument that this is out of scope for egui. Other than shadows most widgets seem to use solid colors. For the shadows the fall off is quick enough that dithering isn't necessary. Even when rendering images this is likely going to be an edge case and only an issue when rendering images with smooth gradients that either aren't dithered or have been resampled to the extent that the dithering in the image is ineffective.
Additional context
I'd be happy to create a PR if dithering is considered to be in scope for egui.
The text was updated successfully, but these errors were encountered: