KeKsBoTer / web-splat

3D Gaussian Splatting Renderer implemented in WebGPU (WGPU) and Rust
https://web-splat.niedermayr.dev
116 stars 10 forks source link

How to build the web viewer? #1

Closed RenieWell closed 8 months ago

RenieWell commented 8 months ago

Thanks for sharing the great works!

I have successfully ran the viewer.exe in windows, but failed in linux. The problem is that the linux server don't have a GUI, and I got the following output:

thread 'main' panicked at /data/c3dgs/web-splat/src/lib.rs:499:39: called Result::unwrap() on an Err value: Os(OsError { line: 776, file: "/data/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/linux/mod.rs", error: Misc("neither WAYLAND_DISPLAY nor DISPLAY is set.") }) note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

I know nothing about the rust, but it looks like the viewer can run in a web viwer. Can you please kindly provide some detials of building the web viewer?

KeKsBoTer commented 8 months ago

You can build the web viewer by executing the build_wasm.sh file. For this you need to install wasm-bindgen-cli and add install the wasm target (e.g. with rustup target add wasm32-unknown-unknown).

This script creates the necessary files in the public folder. You can than open the public/index.html in your browser.

Note that the files have to be provided via the URL. Example:

https://keksboter.github.io/web-splat/?file=./scenes/bicycle/point_cloud/iteration_35000/point_cloud.npz&scene=./scenes/bicycle/cameras.json
RenieWell commented 8 months ago

Thanks a lot!