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

Minor rendering differences between skia and wgpu backend #14

Open
DorianRudolph opened this issue Dec 19, 2023 · 1 comment
Open

Minor rendering differences between skia and wgpu backend #14

DorianRudolph opened this issue Dec 19, 2023 · 1 comment

Comments

@DorianRudolph
Copy link

DorianRudolph commented Dec 19, 2023

I'm comparing the winit+metal example of egui_skia with the egui_demo_app wgpu. It seems like the text in egui_skia is slightly off and harder to read. Also, the highlight around the text box appears less vibrant and has white points in the corners. This is only noticeable for me on a non-retina screen. The white dots are also in the corners of the right sidebar.

Here is a screenshot from the code editor example:

skia:
image

wgpu:
image

Both at 400%
image

EDIT:

Perhaps this could be related to some alpha blending issue? Perhaps related to gamma (not quite sure yet what that it is, but egui says in the release notes that since 0.20.0 all color blending has to be done in gamma space)? In the Bezier curve example, the blended red and green colors on the checkboard background look much lighter in skia. The antialasing is also off, perhaps because egui uses alpha for anti aliasing.

skia:
image

wgpu:
image

@DorianRudolph
Copy link
Author

image

Antialiasing at least seems to work better with

layer.set_pixel_format(MTLPixelFormat::RGBA8Unorm_sRGB);

Surface::from_backend_render_target(...,  ColorType::SRGBA8888, ...)

let r = linear_u8_from_linear_f32(linear_f32_from_gamma_u8(c.r()));
let g = linear_u8_from_linear_f32(linear_f32_from_gamma_u8(c.g()));
let b = linear_u8_from_linear_f32(linear_f32_from_gamma_u8(c.b()));
colors.push(Color::from_argb(c.a(), r, g, b));

But this is also not quite correct. The surface is not supposed to be srgb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant