diff --git a/crates/bevy_gltf/src/lib.rs b/crates/bevy_gltf/src/lib.rs index 90f8443aabc36..e7d5d84573d97 100644 --- a/crates/bevy_gltf/src/lib.rs +++ b/crates/bevy_gltf/src/lib.rs @@ -44,7 +44,13 @@ impl Plugin for GltfPlugin { .add_asset::() .add_asset::() .add_asset::() - .add_asset::(); + .add_asset::() + // Add the gltf loader first without support for compressed formats. This will be overwritten + // once the render device is initialized. + .add_asset_loader::(GltfLoader { + supported_compressed_formats: CompressedImageFormats::NONE, + custom_vertex_attributes: self.custom_vertex_attributes.clone(), + }); } fn finish(&self, app: &mut App) { @@ -53,6 +59,7 @@ impl Plugin for GltfPlugin { None => CompressedImageFormats::NONE, }; + // Overwrite the gltf loader with support for compressed formats. app.add_asset_loader::(GltfLoader { supported_compressed_formats, custom_vertex_attributes: self.custom_vertex_attributes.clone(),