-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Closed
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
Description
Bevy version
0.3.0
Operating system & version
Arch Linux
What you did
Tried to load a .glb file with images in rgb8 format
What you expected to happen
A scene with my model in it? Not a panic, that's for sure.
What actually happened
The scene was not loaded. Instead, this was printed:
thread 'IO Task Pool (0)' panicked at 'called `Result::unwrap()` on an `Err` value: AssetLoaderError(Failed to convert image to rgb8.)', /home/joenor/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_asset-0.3.0/src/asset_server.rs:295:60
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Additional information
I noticed there's a call to image.as_rgba8, here:
bevy/crates/bevy_gltf/src/loader.rs
Lines 134 to 136 in 4fecb89
| let image = image | |
| .as_rgba8() | |
| .ok_or(GltfError::ImageRgb8ConversionFailure)?; |
The error message suggests that the intention was to convert from one format to another, but this method doesn't actually convert anything. It just matches the type of image, and if it already was in rgba8 format, returns it. Otherwise you get None. I'm guessing what you want is into_rgba8.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-AssetsLoad files from disk to use for things like images, models, and soundsLoad files from disk to use for things like images, models, and soundsC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior