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
Give users control over the texture filter #1289
Comments
I think texture filtering in particular could be part of the new |
This seems like it would work, as well! For context - I am working on some pixel drawing functionality in an app, and I would like to support canvas sizes up to 1024x1024 pixels. The current approach of rendering the image to a mesh where each pixel is a rectangle scaled to the chosen zoom level is not performant once the visible area approaches 512x512 logical "pixels". I have had better results rendering a single rectangle with the appropriate texture uv, but for this to look pixel-perfect I utilize the Perhaps this could be provided as a |
I've played with an implementation of the above to get a feel for what the API surface might look like, and I noticed that much of the code that handles textures applies the texture filter on a per-texture basis to begin with. Maybe it makes sense to allow a |
I created a proof of concept here: https://github.com/emilk/egui/pull/1296/files For my use case, this sample implementation using the per-texture approach turned out to be useful. I'm able to choose "linear" when the zoom is < 1.0 and "nearest" when the scale is >= 1.0. I tried both - setting |
Closed by #1636 |
Is your feature request related to a problem? Please describe.
I wanted to utilize the
Painter::set_texture_filter
feature that was recently introduced toegui_glow
, but the only way to do so is by breaking out ofeframe
and calling intoegui_glow
directly. This... involves a lot of manual reconstruction of code that is difficult to get right, especially for someone newer to this type of programmingEdit: Per discussion below, it seems more accurate to say that I'd like to be able to specify the texture filter on a per-texture basis.
Describe the solution you'd like
Some sort of mechanism to pass backend-specific configuration tweaks via
eframe
. This could be as simple as adding a function alongsiderun_native
for that each relevant backend, perhapsrun_native_with_options
? I don't want to prescribe a specific implementation here because I am so new to this library - I don't know what the long term goals are foreframe
, or how this concept might interact with them.Describe alternatives you've considered
cfg
-gated options toNativeOptions
inepi
. This feels dirty to mePainterOptions
inepi
, which could provide a backend-agnostic way to set some global properties of the painter implemented by the backend. This seems like it could get complicated and there is a question of what to do if an option is provided that the backend in question can't actually handle.The text was updated successfully, but these errors were encountered: