Skip to content

Commit

Permalink
Respect mipmap_filter when create ImageDescriptor with linear()/neare…
Browse files Browse the repository at this point in the history
…st() (bevyengine#6349)

Respect mipmap_filter when create ImageDescriptor with linear()/nearest()

# Objective

Fixes bevyengine#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>
  • Loading branch information
2 people authored and ItsDoot committed Feb 1, 2023
1 parent 472b8ac commit 4af850c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_render/src/texture/image.rs
Expand Up @@ -144,6 +144,7 @@ impl ImageSampler {
wgpu::SamplerDescriptor {
mag_filter: wgpu::FilterMode::Linear,
min_filter: wgpu::FilterMode::Linear,
mipmap_filter: wgpu::FilterMode::Linear,
..Default::default()
}
}
Expand All @@ -154,6 +155,7 @@ impl ImageSampler {
wgpu::SamplerDescriptor {
mag_filter: wgpu::FilterMode::Nearest,
min_filter: wgpu::FilterMode::Nearest,
mipmap_filter: wgpu::FilterMode::Nearest,
..Default::default()
}
}
Expand Down

0 comments on commit 4af850c

Please sign in to comment.