Skip to content

Commit

Permalink
feat: running in the web
Browse files Browse the repository at this point in the history
  • Loading branch information
mosure committed Dec 15, 2023
1 parent 59b8e97 commit 41ae2d2
Show file tree
Hide file tree
Showing 19 changed files with 681 additions and 425 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 .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
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
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 41ae2d2

Please sign in to comment.