Skip to content

Commit

Permalink
feat: webgl2, formats, materials, and queries (#56)
Browse files Browse the repository at this point in the history
* feat: scaffold lighting, material, query

* feat: draw all, selected, highlight selected modes

* feat: selection, inverting, draw modes, live output

* fix: disable sparse select on startup

* feat: cpu SH noise material

* remove unused

* fix: unused import warning

* more credits

* fix: allow degree 0 SH

* chore: clean default features

* refactor: feature-driven gaussian cloud format

* refactor: render pipeline packed vs. planar separation

* feat: packed and planar f32

* fix: wgsl struct packing differences

* checkin

* remove unused

* fix: f16 build errors

* chore: web feature bundle

* chore: more static asserts and features for input buffers

* fix: planar has bugs

* docs: credit

* feat: f16 support

* feat: buffer texture f16

* fix: unpacking

* fix: sh0 padding

* fix: web build

* fix: web dependency issue

* fix: storage texture -> texture

* fix: sorted texture binding

* fix: webgl2 GL_ANGLE_multi_draw isn't default

* fix: improve cpu sort throttling and webgl2 SH

* fix: prioritize storage buffers and disable rayon sort camera debounce

* fix: planar f32 build
  • Loading branch information
mosure authored Jan 2, 2024
1 parent 94fb90e commit 507a28d
Show file tree
Hide file tree
Showing 63 changed files with 4,110 additions and 571 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ jobs:
- name: lint
run: cargo clippy

- name: test
- name: test (default)
run: cargo test

- name: test (web)
run: cargo test --no-default-features --features="web io_ply tooling"

# - name: gaussian render test
# run: cargo run --bin test_gaussian

Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rust-analyzer.linkedProjects": [
"./Cargo.toml"
]
}
72 changes: 60 additions & 12 deletions 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 = "1.0.0"
version = "2.0.0"
edition = "2021"
authors = ["mosure <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -36,10 +36,23 @@ default-run = "viewer"
default = [
"io_flexbuffers",
"io_ply",
"morph_particles",

# "packed",
"planar",

"buffer_storage",
# "buffer_texture",

# "f32",
"f16",

"query_select",
"query_sparse",

"sort_radix",
"sort_rayon",
"sort_std",

"tooling",
"viewer",
]
Expand All @@ -50,37 +63,69 @@ io_bincode2 = ["bincode2", "flate2"]
io_flexbuffers = ["flexbuffers"]
io_ply = ["ply-rs"]

material_noise = ["noise", "dep:noise"]

morph_particles = []

noise = []

f32 = []
f16 = ["half"]

packed = []
planar = []

buffer_storage = []
buffer_texture = []

query_raycast = []
query_select = []
query_sparse = ["kd-tree", "query_select"]

sort_radix = []
sort_rayon = [
"rayon",
]
sort_rayon = ["rayon"]
sort_std = []

tooling = [
"byte-unit",
]
tooling = ["byte-unit"]

viewer = [
"bevy-inspector-egui",
"bevy_panorbit_camera",
# "bevy_transform_gizmo",
]

web = [
"buffer_texture",
"f16",
"io_flexbuffers",
"planar",
"sort_std",
"viewer",
"webgl2",
]

webgl2 = ["bevy/webgl2"]


[dependencies]
bevy-inspector-egui = { version = "0.21", optional = true }
bevy_panorbit_camera = { version = "0.9", optional = true }
bevy-inspector-egui = { version = "0.22", optional = true }
bevy_mod_picking = { version = "0.17", optional = true }
bevy_panorbit_camera = { version = "0.10", optional = true }
bevy_transform_gizmo = { version = "0.9", optional = true }
bincode2 = { version = "2.0", optional = true }
byte-unit = { version = "5.0", optional = true }
bytemuck = "1.14"
flate2 = { version = "1.0", optional = true }
flexbuffers = { version = "2.0", optional = true }
half = { version = "2.3.1", optional = true, features = ["serde"] }
kd-tree = { version = "0.5", optional = true }
noise = { version = "0.8.2", optional = true }
ply-rs = { version = "0.1", optional = true }
rand = "0.8"
rayon = { version = "1.8", optional = true }
serde = "1.0"
static_assertions = "1.1"
typenum = "1.17.0"
wgpu = "0.17.1"


Expand All @@ -89,7 +134,6 @@ console_error_panic_hook = "0.1"
wasm-bindgen = "0.2"


# TODO: use minimal bevy features
[dependencies.bevy]
version = "0.12"
default-features = false
Expand All @@ -102,7 +146,7 @@ features = [


[dependencies.web-sys]
version = "0.3.4"
version = "0.3"
features = [
'Document',
'Element',
Expand Down Expand Up @@ -162,6 +206,10 @@ name = "test_radix"
path = "tests/gpu/radix.rs"
required-features = ["debug_gpu", "sort_radix"]

[[example]]
name = "minimal"
path = "examples/minimal.rs"


[[bench]]
name = "io"
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ bevy gaussian splatting render pipeline plugin. view the [live demo](https://mos
- [X] gaussian cloud particle effects
- [X] wasm support /w [live demo](https://mosure.github.io/bevy_gaussian_splatting/index.html?arg1=cactus.gcloud)
- [X] depth colorization
- [X] f16 and f32 gcloud
- [X] wgl2 and webgpu
- [ ] 4D gaussian cloud wavelet compression
- [ ] accelerated spatial queries
- [ ] temporal depth sorting
- [ ] f16 and f32 gcloud support
- [ ] skeletons
- [ ] volume masks
- [ ] level of detail
Expand Down Expand Up @@ -87,17 +88,21 @@ fn setup_gaussian_cloud(
- [dreamgaussian](https://github.com/dreamgaussian/dreamgaussian)
- [dynamic-3d-gaussians](https://github.com/JonathonLuiten/Dynamic3DGaussians)
- [ewa splatting](https://www.cs.umd.edu/~zwicker/publications/EWASplatting-TVCG02.pdf)
- [gaussian-grouping](https://github.com/lkeab/gaussian-grouping)
- [gaussian-splatting](https://github.com/graphdeco-inria/gaussian-splatting)
- [gaussian-splatting-viewer](https://github.com/limacv/GaussianSplattingViewer/tree/main)
- [gaussian-splatting-web](https://github.com/cvlab-epfl/gaussian-splatting-web)
- [gir](https://3dgir.github.io/)
- [making gaussian splats smaller](https://aras-p.info/blog/2023/09/13/Making-Gaussian-Splats-smaller/)
- [masked-spacetime-hashing](https://github.com/masked-spacetime-hashing/msth)
- [onesweep](https://arxiv.org/ftp/arxiv/papers/2206/2206.01784.pdf)
- [pasture](https://github.com/Mortano/pasture)
- [phys-gaussian](https://xpandora.github.io/PhysGaussian/)
- [point-visualizer](https://github.com/mosure/point-visualizer)
- [rusty-automata](https://github.com/mosure/rusty-automata)
- [spacetime-gaussians](https://github.com/oppo-us-research/SpacetimeGaussians)
- [splat](https://github.com/antimatter15/splat)
- [splatter](https://github.com/Lichtso/splatter)
- [sturdy-dollop](https://github.com/mosure/sturdy-dollop)
- [sugar](https://github.com/Anttwo/SuGaR)
- [taichi_3d_gaussian_splatting](https://github.com/wanmeihuali/taichi_3d_gaussian_splatting)
Binary file modified assets/scenes/icecream.gcloud
Binary file not shown.
6 changes: 6 additions & 0 deletions examples/minimal.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// TODO: minimal app


fn main() {
println!("Hello, world!");
}
Loading

0 comments on commit 507a28d

Please sign in to comment.