-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Ringing around pre-rasterized circles. #5810
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
Comments
Another update: My main suspect now is linear texture filtering in combination with sRGBA textures and premultiplied alpha. A couple of observations:
|
It must happen before unless you upsample. If you downsample a non-linear texture you introduce artifacts. Same rules as with alpha apply. TLDR; you can't correctly blend/mix samples that have a burned-in curve of some sort (gamma, whatever). Lastly, when you filter a pre-multiplied non-linear texture it gets worse at the edges (because the alpha exacerbates the error, the more transparent the sample, the more error; see also #5771). |
Oh I completely agree, which is why I'm so surprised that the spec can be that vague. That being said, I'm not convinced that the incorrect interpolation order is what is happening here. |
The reason is most likely that the spec was written by people who didn't know what they're talking about. At the risk of sounding like an old curmudgeon: as the years go by the quality of specs I'm confronted with in my line of work has steadily declined. Shockingly so if you compare with specs from the 80's or 90's. The best specs are usually those written by a single individual who were at the helm of whatever tech the spec describes. |
The bug was in `Color32::from_rgba_unmultiplied` and by extension affects: * `Color32::from_rgba_unmultiplied` * `hex_color!` * `HexColor` * `ColorImage::from_rgba_unmultiplied` * All images with transparency (png, webp, …) * `Color32::from_white_alpha` The bug caused translucent colors to appear too bright. ## More Color is hard. When I started out egui I thought "linear space is objectively better, for everything!" and then I've been slowly walking that back for various reasons: * sRGB textures not available everywhere * gamma-space is more _perceptually_ even, so it makes sense to use for anti-aliasing * other applications do everything in gamma space, so that's what people expect (this PR) Similarly, pre-multiplied alpha _makes sense_ for blending colors. It also enables additive colors, which is nice. But it does complicate things. Especially when mixed with sRGB/gamma (As @karhu [points out](#5824 (comment))). ## Related * Closes #5751 * Closes #5771 ? (probably; hard to tell without a repro) * But not #5810 ## TODO * [x] I broke the RGBA u8 color picker. Fix it --------- Co-authored-by: Andreas Reich <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug:
Rendering darker circles on a brighter background can lead to "ringing" artifacts, where the outermost pixels of the circle are brighter than both the background and the circle. The artifact only shows when "Speed up filled circles with pre-rasterization" is enabled in the Tesselation Options (default).
Some details:
rgb(200,200,200)
rgb(220,220,220)
rgb(230,230,230)
.Minimal Repro Example:
**Expected behavior
No ringing. Same visuals independent of whether pre-rasterization is enabled.
Screenshots
Bad:

Expected:

Closeup:

Desktop :
Additional context
This bears some similarities to #5751, but in a more controlled environment, given that an egui-internal texture is involved.
The text was updated successfully, but these errors were encountered: