NiklasEi / bevy_asset_loader

Bevy plugin helping with asset loading and organization
Apache License 2.0
459 stars 52 forks source link

Crashes when loading a decent size folder of GLTF #228

Open ethereumdegen opened 2 weeks ago

ethereumdegen commented 2 weeks ago

So I am loading my GLTF files like this :

#[derive(AssetCollection, Resource)]
pub struct GltfAssets {

     #[asset(path = "models/doodads", collection(typed, mapped))]
    pub(crate) doodad_models: HashMap<String, Handle<Gltf>>,

}

And that folder (models/doodads) has a total of about 1000 gltf models in it. While my app runs this, it crashes:

 .add_loading_state(
                    LoadingState::new(AssetLoadState::GltfAssetsLoad)
                        .continue_to_state(AssetLoadState::ShaderAssetsLoad)

                         .load_collection::<GltfAssets>() 

                )

I assume because this crate is trying to add too much to the stack or to memory at once instead of piecing it out,

NiklasEi commented 2 weeks ago

If it's some form of out-of-memory, loading them piece by piece will not help, since you want to keep them all in memory, no? Could you please investigate more about what the actual issue is?

If it crashes while adding the loading state, I don't think it has to do with the asset loading, since that will happen later async.