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

Sampler descriptor moved into EguiSettings #179

Merged
merged 1 commit into from
Jul 10, 2023
Merged

Sampler descriptor moved into EguiSettings #179

merged 1 commit into from
Jul 10, 2023

Conversation

GlummixX
Copy link
Contributor

Hi, I've moved the sampler descriptor into the EguiSettings, since the hardcoded linear_descriptor is not desirable for pixel perfect usecases. I've also had to implement a compare_descriptors function to keep the PartialEq functionality. The sampler_descriptor can now be set to:

  • (Default) linear and clamping to edge
  • (use_nearest_descriptor function) nearest and clamping to edge
  • (use_bevy_descriptor function) derived from the bevy ImagePlugin setup
  • completely custom

A simple demo. Left is linear, right is nearest.
image

@mvlabat
Copy link
Owner

mvlabat commented Apr 28, 2023

Hey. Thanks for the PR. I think we want to move this field to the plugin instance. Resources are meant for the settings that can be changed during runtime, but as far as I understand (please correct me if I'm wrong) this one is to be configured only once.

https://bevyengine.org/learn/migration-guides/0.8-0.9/#use-plugin-setup-for-resource-only-used-at-setup-time

@GlummixX
Copy link
Contributor Author

Hi, did some testing and it can be changed during runtime, the change will be visible after a cycle where is no egui rendered. Possible usecase is: nearest for pixel-perfect UI, while in game and linear for some different elements like showing images with lore. The bevy default cannot be changed after plugin setup. But the descriptor itself allows for changes.

@mvlabat
Copy link
Owner

mvlabat commented Jul 10, 2023

Ok, sounds good! And sorry for the late reply. Merged.

@mvlabat mvlabat merged commit ff38e01 into mvlabat:main Jul 10, 2023
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

Successfully merging this pull request may close these issues.

2 participants