Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: surfel splatting #104

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ webgpu = ["bevy/webgpu"]
[dependencies]
bevy_args = { version = "1.3.0", optional = true }
bevy-inspector-egui = { version = "0.24", optional = true }
bevy_interleave = "0.2"
bevy_mod_picking = { version = "0.18", optional = true }
bevy_panorbit_camera = { version = "0.17", optional = true }
bevy_transform_gizmo = { version = "0.11", optional = true }
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ bevy gaussian splatting render pipeline plugin. view the [live demo](https://mos
- [X] depth colorization
- [X] f16 and f32 gcloud
- [X] wgl2 and webgpu
- [ ] spherical harmonic coefficients clustering
- [ ] 4D gaussian cloud wavelet compression
- [X] 3dgs
- [X] surfel splatting
- [ ] bevy_interleave codex support
- [ ] accelerated spatial queries
- [ ] temporal depth sorting
- [ ] skeletons
- [ ] volume masks
- [ ] level of detail
Expand Down Expand Up @@ -82,6 +82,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
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub mod morph;
pub mod query;
pub mod render;
pub mod sort;
pub mod surfel;
pub mod utils;

#[cfg(feature = "noise")]
Expand Down
3 changes: 3 additions & 0 deletions src/material/spherical_harmonics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ pub struct SphericalHarmonicCoefficients {
}


// TODO: modular bevy_interleave SH


#[cfg(feature = "f32")]
#[derive(
Clone,
Expand Down
2 changes: 2 additions & 0 deletions src/render/gaussian.wgsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define_import_path bevy_gaussian_splatting::gaussian

#import bevy_gaussian_splatting::bindings::{
view,
globals,
Expand Down
46 changes: 46 additions & 0 deletions src/surfel/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
use bevy::{
prelude::*,
render::render_resource::TextureFormat,
};
use bevy_interleave::prelude::*;


// TODO: automate extraction and asset loading via derive macro
// TODO: automate plugin & render pipeline
#[derive(
Debug,
Planar,
ReflectInterleaved,
StorageBindings,
TextureBindings,
)]
pub struct SurfelGaussian {
#[texture_format(TextureFormat::Rgba32Uint)]
pub position_opacity: [f32; 4],

#[texture_format(TextureFormat::Rgba32Uint)]
pub tangent_s: [f32; 4],

#[texture_format(TextureFormat::Rgba32Uint)]
pub tangent_t: [f32; 4],

#[texture_format(TextureFormat::Rgba32Uint)]
pub scale: [f32; 4],
}


pub struct SurfelRenderPipelinePlugin;
impl Plugin for SurfelRenderPipelinePlugin {
fn build(&self, _app: &mut App) {

}

fn finish(&self, _app: &mut App) {

}
}


// TODO: extract surfel asset
// TODO: queue surfel clouds
// TODO: render surfel node
2 changes: 2 additions & 0 deletions src/surfel/surfel.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// TODO: surfel render pipeline

2 changes: 2 additions & 0 deletions tools/ply_to_gcloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ fn is_point_in_transformed_sphere(pos: &[f32; 3]) -> bool {
}


// TODO: check if the ply is 2d, 3d, or 4d gaussians and output proper gcloud (enum variant)

#[allow(unused_mut)]
fn main() {
let filename = std::env::args().nth(1).expect("no filename given");
Expand Down
Loading