diff --git a/Cargo.toml b/Cargo.toml index 01f0c11b..7f7e3df3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bevy_gaussian_splatting" description = "bevy gaussian splatting render pipeline plugin" -version = "2.7.4" +version = "2.7.5" edition = "2021" authors = ["mosure "] license = "MIT OR Apache-2.0" diff --git a/src/camera.rs b/src/camera.rs index 5814e929..3da7af8c 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -38,7 +38,6 @@ fn apply_camera_warmup( ) { for mut camera in cameras.iter_mut() { if camera.warmup { - info!("camera warmup..."); camera.warmup = false; } } diff --git a/src/sort/mod.rs b/src/sort/mod.rs index a227fa5b..787f5206 100644 --- a/src/sort/mod.rs +++ b/src/sort/mod.rs @@ -271,6 +271,12 @@ fn auto_insert_sorted_entries( #[cfg(feature = "buffer_texture")] mut images: ResMut>, ) { + let camera_count = gaussian_cameras.iter().len(); + + if camera_count == 0 { + return; + } + for ( entity, gaussian_cloud_handle, @@ -292,7 +298,7 @@ fn auto_insert_sorted_entries( let cloud = cloud.unwrap(); let sorted_entries = sorted_entries_res.add(SortedEntries::new( - gaussian_cameras.iter().len(), + camera_count, cloud.len_sqrt_ceil().pow(2), #[cfg(feature = "buffer_texture")] images, @@ -322,6 +328,11 @@ fn update_sorted_entries_sizes( let camera_count: usize = gaussian_cameras.iter().len(); for handle in sorted_entries.iter() { + if camera_count == 0 { + sorted_entries_res.remove(handle); + continue; + } + let sorted_entries = sorted_entries_res.get(handle).unwrap(); if sorted_entries.camera_count != camera_count { let new_entry = SortedEntries::new(