Skip to content

Commit

Permalink
feat: gaussian surfels (#114)
Browse files Browse the repository at this point in the history
* feat: surfel rasterization, requires accumulation

* feat: 2dgs

* chore: bump version 2.6.0

* fix: lint

* fix: normal rendering
  • Loading branch information
mosure authored Oct 16, 2024
1 parent 399fba9 commit 9f79e26
Show file tree
Hide file tree
Showing 10 changed files with 607 additions and 77 deletions.
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bevy_gaussian_splatting"
description = "bevy gaussian splatting render pipeline plugin"
version = "2.5.0"
version = "2.6.0"
edition = "2021"
authors = ["mosure <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -234,6 +234,11 @@ name = "compare_aabb_obb"
path = "tools/compare_aabb_obb.rs"
required-features = ["tooling"]

[[bin]]
name = "surfel_plane"
path = "tools/surfel_plane.rs"
required-features = ["tooling"]

[[bin]]
name = "test_gaussian"
path = "tests/gpu/gaussian.rs"
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ bevy gaussian splatting render pipeline plugin. view the [live demo](https://mos
- [X] depth colorization
- [X] f16 and f32 gcloud
- [X] wgl2 and webgpu
- [X] 3dgs
- [X] 2dgs
- [ ] spherical harmonic coefficients clustering
- [ ] 4D gaussian cloud wavelet compression
- [ ] accelerated spatial queries
Expand Down Expand Up @@ -83,6 +85,7 @@ fn setup_gaussian_cloud(

# credits

- [2d-gaussian-splatting](https://github.com/hbb1/2d-gaussian-splatting)
- [4d gaussians](https://github.com/hustvl/4DGaussians)
- [4d-gaussian-splatting](https://fudan-zvg.github.io/4d-gaussian-splatting/)
- [bevy](https://github.com/bevyengine/bevy)
Expand Down
21 changes: 21 additions & 0 deletions src/gaussian/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,23 @@ pub enum GaussianCloudDrawMode {
}


#[derive(
Clone,
Copy,
Debug,
Default,
Eq,
Hash,
PartialEq,
Reflect,
)]
pub enum GaussianMode {
#[default]
Gaussian3d,
GaussianSurfel,
}


#[derive(
Clone,
Copy,
Expand All @@ -46,9 +63,11 @@ pub struct GaussianCloudSettings {
pub global_opacity: f32,
pub global_scale: f32,
pub transform: Transform,
pub opacity_adaptive_radius: bool,
pub visualize_bounding_box: bool,
pub sort_mode: SortMode,
pub draw_mode: GaussianCloudDrawMode,
pub gaussian_mode: GaussianMode,
pub rasterize_mode: GaussianCloudRasterize,
}

Expand All @@ -59,9 +78,11 @@ impl Default for GaussianCloudSettings {
global_opacity: 1.0,
global_scale: 1.0,
transform: Transform::IDENTITY,
opacity_adaptive_radius: true,
visualize_bounding_box: false,
sort_mode: SortMode::default(),
draw_mode: GaussianCloudDrawMode::default(),
gaussian_mode: GaussianMode::default(),
rasterize_mode: GaussianCloudRasterize::default(),
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ pub use gaussian::{
packed::Gaussian,
cloud::GaussianCloud,
rand::random_gaussians,
settings::GaussianCloudSettings,
settings::{
GaussianCloudRasterize,
GaussianCloudSettings,
GaussianMode,
},
};

pub use material::spherical_harmonics::SphericalHarmonicCoefficients;
Expand Down
Loading

0 comments on commit 9f79e26

Please sign in to comment.