-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Adjust texture filtering presets. #19127
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
base: main
Are you sure you want to change the base?
Conversation
Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke! If it's expected, please add the M-Deliberate-Rendering-Change label. If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it. |
Now that's an interesting artifact |
Major factor is that these elements don't have any padding and are tiny, that's why it's so intense. Things start at |
Although fine on modern PCs, 16x AF seems to slow down CPU rendering by up to 6 times and might also work bad on some mobile targets. I take it back, this PR is just for coherent generators. |
Now that `ImageSamplerDescriptor::default()` actually represents engine-wide default, we can derive plugin defaults.
This one relied on `default()` being nearest.
Please also update the lightmap bicubic_sampling docs. |
@JMS55 why tho? We seem to be using custom interpolation code and it's actual bicubic, which is not provided by wgpu (afaik neither Vulcan or DirectX don't expose it natively) bevy/crates/bevy_pbr/src/lightmap/lightmap.wgsl Lines 26 to 45 in 95470df
|
The shader code doesn't need to be touched, but the docs should be updated to remove the reference to linear, and replace it with bilinear/trilinear (not sure if lightmaps typically use mipmaps?) https://docs.rs/bevy/latest/bevy/pbr/struct.Lightmap.html#structfield.bicubic_sampling |
Objective
ImageSamplerDescriptor::default()
not being the actual default (it's nearest instead of linear;nearest()
doesn't trustdefault()
to be nearest even though it is).Make 16x anisotropic filtering an engine-wide default. The previous default is trilinear. The difference is present only with mipmapped textures, and aniso is just better looking with not that big of a performance impact.Solution
ImageSamplerDescriptor::default()
's hierarchy. It now returns the preset we currently consider default. Everything builds uponnearest()
instead.linear()
fortrilinear()
.Switched the default.