Skip to content

Commit

Permalink
feat: web (#52)
Browse files Browse the repository at this point in the history
* feat: running in the web

* docs: add TODO
  • Loading branch information
mosure authored Dec 15, 2023
1 parent 5c9a20a commit 6033195
Show file tree
Hide file tree
Showing 20 changed files with 685 additions and 426 deletions.
6 changes: 5 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

[target.wasm32-unknown-unknown]
runner = "wasm-server-runner"
rustflags = ["--cfg=web_sys_unstable_apis"]
rustflags = [
"--cfg=web_sys_unstable_apis",
# "-C",
# "target-feature=+atomics,+bulk-memory,+mutable-globals", # for wasm-bindgen-rayon
]


# fix spurious network error on windows
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ jobs:

# - name: radix sort test
# run: cargo run --bin test_radix --features="debug_gpu"


# TODO: test wasm build, deploy, and run
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
debug/
target/
out/
Cargo.lock
**/*.rs.bk
*.pdb
Expand All @@ -10,3 +11,5 @@ Cargo.lock
*.gcloud

.DS_Store

www/assets/
4 changes: 3 additions & 1 deletion .vscode/bevy_gaussian_splatting.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@
"path": "../../bevy"
}
],
"settings": {}
"settings": {
"liveServer.settings.multiRootWorkspaceName": "bevy_gaussian_splatting"
}
}
21 changes: 11 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ default-run = "viewer"
default = [
"io_flexbuffers",
"io_ply",
"morph_particles",
"sort_radix",
"sort_rayon",
"sort_std",
"tooling",
"viewer",
]
Expand All @@ -48,11 +50,13 @@ io_bincode2 = ["bincode2", "flate2"]
io_flexbuffers = ["flexbuffers"]
io_ply = ["ply-rs"]

morph_particles = []

sort_radix = []
sort_rayon = [
"rayon",
"wasm-bindgen-rayon",
]
sort_std = []

tooling = [
"byte-unit",
Expand All @@ -64,7 +68,6 @@ viewer = [
]



[dependencies]
bevy-inspector-egui = { version = "0.21", optional = true }
bevy_panorbit_camera = { version = "0.9", optional = true }
Expand All @@ -84,29 +87,27 @@ wgpu = "0.17.1"
[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
wasm-bindgen = "0.2"
wasm-bindgen-rayon = { version = "1.0", optional = true }


# TODO: use minimal bevy features
[dependencies.bevy]
version = "0.12"
default-features = true

[dev-dependencies.bevy]
version = "0.12"
default-features = true
default-features = false
features = [
'debug_glam_assert',
"bevy_asset",
"bevy_core_pipeline",
"bevy_render",
"bevy_winit",
]



[dependencies.web-sys]
version = "0.3.4"
features = [
'Document',
'Element',
'HtmlElement',
'Location',
'Node',
'Window',
]
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ download [cactus.gcloud](https://mitchell.mosure.me/cactus.gcloud)
- [X] gcloud and ply asset loaders
- [X] bevy gaussian cloud render pipeline
- [X] gaussian cloud particle effects
- [X] wasm support /w [live demo](https://mosure.github.io/bevy_gaussian_splatting/index.html?arg1=icecream.gcloud)
- [ ] 4D gaussian cloud wavelet compression
- [ ] accelerated spatial queries
- [ ] wasm support /w [live demo](https://mosure.github.io/bevy_gaussian_splatting)
- [ ] temporal depth sorting
- [ ] f16 and f32 gcloud support
- [ ] skeletons
Expand Down Expand Up @@ -69,18 +69,12 @@ fn setup_gaussian_cloud(
- [gaussian cloud training pipeline](https://github.com/mosure/burn_gaussian_splatting)
- aabb vs. obb gaussian comparison via `cargo run --bin compare_aabb_obb`

## wasm support

to build wasm run:
- `cargo build --target wasm32-unknown-unknown --release`
- `wasm-bindgen --out-dir ./out/ --target web ./target/`


## compatible bevy versions

| `bevy_gaussian_splatting` | `bevy` |
| :-- | :-- |
| `0.4` | `0.12` |
| `0.4 - 0.5` | `0.12` |
| `0.1 - 0.3` | `0.11` |


Expand Down
Loading

0 comments on commit 6033195

Please sign in to comment.