From 085d26974047020a7f0ec3916601936aa69aa180 Mon Sep 17 00:00:00 2001 From: mosure Date: Wed, 6 Nov 2024 17:36:42 -0600 Subject: [PATCH 1/2] fix: support gaussian clouds with no gaussian cameras --- src/camera.rs | 1 - src/sort/mod.rs | 13 ++++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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( From 5b31d1c65922deaf8a46651f0da08865187d1eac Mon Sep 17 00:00:00 2001 From: mosure Date: Wed, 6 Nov 2024 17:37:46 -0600 Subject: [PATCH 2/2] chore: bump version 2.7.5 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"