Skip to content

Commit ed0266b

Browse files
authored
Fix glTF importer wrongly ignoring sampler filters (#19118)
## Objective Fix #19114. ## Solution #17875 changed the glTF importer to make sure that sampler filters are linear when anisotropic filtering is enabled - this is required by `wgpu`. But the condition was mistakenly inverted, so it forces the filtering to linear when anisotropic filtering is _not_ enabled. ## Testing ``` cargo run --example color_grading cargo run --example testbed_3d ```
1 parent 3d9fc5c commit ed0266b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_gltf/src/loader/gltf_ext/texture.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub(crate) fn texture_sampler(
5151

5252
// Shouldn't parse filters when anisotropic filtering is on, because trilinear is then required by wgpu.
5353
// We also trust user to have provided a valid sampler.
54-
if sampler.anisotropy_clamp != 1 {
54+
if sampler.anisotropy_clamp == 1 {
5555
if let Some(mag_filter) = gltf_sampler.mag_filter().map(|mf| match mf {
5656
MagFilter::Nearest => ImageFilterMode::Nearest,
5757
MagFilter::Linear => ImageFilterMode::Linear,

0 commit comments

Comments
 (0)