Skip to content

Backend integration: Use linear or nearest neighbour filtering? #98

Answered by emilk
realcundo asked this question in Q&A
Discussion options

You must be logged in to vote

Hello!

When integrating egui with other backends, should I use linear or nearest neighbour filtering?

Egui should work with either texture filtering mode. In particular, egui_glium and egui_web both use bilinear filtering, but sample the texels right in the middle anyway, so it doesn't matter.

If you are on a display with one physical pixel per point, then the default monospace font (at size 13) should look pixel-perfect with all pixels either perfectly on or off (even with bilinear sampling). Like this:

Magnified:


When painting anything but text, Egui doesn't use textures at all (it just samples the (0,0) texel which is pure white). In particular, the line_segment example you showed…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by realcundo
Comment options

You must be logged in to vote
2 replies
@emilk
Comment options

@realcundo
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants