You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like mipmaps doesn't respected. There is a screenshot. Top row is basis image with mipmaps. The bottom row is png image without mipmaps. It looks the same, pixelated:
I'm expecting the correct interpolation between mipmap levels based on image size. Something like this:
Additional information
I found this happens because bevy::render::texture::ImageSettings::linear_descriptior() do not set mipmap_filter option:
It is FilterMode::Nearest by default. With this setting I was even unable to fetch color with textureSampleLevel in wgsl shader, it always return data from mip level 0.
Changing ImageSettings didn't help, possibly because of #5744.
The only workaround i found is to set mipmap_filter manually, as suggested in #5744:
jkb0o
changed the title
No mipmap interpolation, mipmap level 0 fetches by default.
No mipmap interpolation, mipmap level 0 fetched by default.
Oct 23, 2022
jkb0o
added a commit
to jkb0o/bevy
that referenced
this issue
Oct 23, 2022
…st() (#6349)
Respect mipmap_filter when create ImageDescriptor with linear()/nearest()
# Objective
Fixes#6348
## Migration Guide
This PR changes default `ImageSettings` and may lead to unexpected behaviour for existing projects with mipmapped textures. Users should provide custom `ImageSettings` resource with `mipmap_filter=FilterMode::Nearest` if they want to keep old behaviour.
Co-authored-by: Yakov Borevich <j.borevich@gmail.com>
…st() (bevyengine#6349)
Respect mipmap_filter when create ImageDescriptor with linear()/nearest()
# Objective
Fixesbevyengine#6348
## Migration Guide
This PR changes default `ImageSettings` and may lead to unexpected behaviour for existing projects with mipmapped textures. Users should provide custom `ImageSettings` resource with `mipmap_filter=FilterMode::Nearest` if they want to keep old behaviour.
Co-authored-by: Yakov Borevich <j.borevich@gmail.com>
Bevy version
8.1
Relevant system information
What you did
I render single image with mipmaps (
circle.basis
) multiple times with different sizes using bevy ui:bevy_issue_mipmaps.zip
What went wrong
Looks like mipmaps doesn't respected. There is a screenshot. Top row is basis image with mipmaps. The bottom row is png image without mipmaps. It looks the same, pixelated:
I'm expecting the correct interpolation between mipmap levels based on image size. Something like this:
Additional information
I found this happens because
bevy::render::texture::ImageSettings::linear_descriptior()
do not setmipmap_filter
option:bevy/crates/bevy_render/src/texture/image.rs
Lines 142 to 148 in 7989cb2
It is
FilterMode::Nearest
by default. With this setting I was even unable to fetch color withtextureSampleLevel
in wgsl shader, it always return data from mip level 0.Changing ImageSettings didn't help, possibly because of #5744.
The only workaround i found is to set mipmap_filter manually, as suggested in #5744:
While researching I found the same behaviour in 3d as well: by default mipmap level 0 fetched.
The text was updated successfully, but these errors were encountered: