Closed mash-graz closed 6 months ago
Same for me, if not worse:
Bad gamma, maybe?
@lnicola That's how it's supposed to look. It's just that the default text color is grey, not black and that the text hinting is not particularly great (if it even exists).
The problem is that egui's pixel grid is not aligned with the pixel grid of the display:
Firefox:
In Chromium it is better, but it is still wrong vertically:
(these are blow-ups of your screenshots).
Is suspect we can fix it by tweaking how the canvas element is aligned in its parent somewhere in https://github.com/emilk/egui/blob/a15e6c21220e593932569558a31de9403e3791d0/crates/eframe/src/web/mod.rs#L127-L130
Thanks for your inspection and expert judgment.
It's such a crazy issue. One on hand it's so subtle and subliminal that you don't want to write an issue report or similar complaint about it, but on the other hand it's really annoying and disturbing any practical use of text in egui
web applications.
Would it be possible to somehow automatize the job, which you did here manually -- i.e. analyzing a screen grab of an interference pattern seen through the browsers view and figure out the best fitting correction parameters for the particular setup? A kind of self optimization.
This could be a rather user-friendly workaround to overcome the hardly manageable varieties of this issue. It may change with any new browser release again and the complex side effects of different scaling mechanisms for HiDPI displays may also become an ever-growing source of troubles.
Tim on Discord linked to this relevant article: https://webglfundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html
I can reproduce this on chromium on my Mac now, so I'm taking a look
It looks like it is the rounding-to-even added in https://github.com/emilk/egui/pull/151 that is causing the problem. Removing that makes the rendering pixel-perfect on Firefox and Chromium (on my Mac), but Safari is still blurry on most zoom levels.
Desktop Safari seems like a lost cause right now. Luckily it's not very popular.
Please help test if https://github.com/emilk/egui/pull/4299 fixes your problem!
Although some older similar issue reports exist, I want to document the
egui
Web rendering differences on firefox vs. chromium on my debian linux gnome wayland machine.The differences are rather subtle and hard to grasp, but they make it very uncomfortable to work with text in
egui
in browser based applications.I attach a view example screenshots: