mirror of
https://github.com/storytold/spark.git
synced 2026-10-09 00:09:53 +00:00
f60c2b0cf9
* Externalized SparkRenderer.maxPixelRadius and .minAlpha settings. Added to documentation. Added to examples/editor under Debug folder, moved sort32 there. * Added SplatEncoding concept, applied individually to SparkRenderer (rgbMin/Max, lnScaleMinMax), SplatMesh (additionally sh1Min/Max, sh2, sh3). Updated examples/editor to control settings via gui. Updated all related code to pipe along settings where needed. Added SparkRenderer.premultipliedAlpha to control blend mode and enable hyper-saturated color contributions by default. * Fix SplatLoader not passing along encoding. Complete renaming to splat encoding.
spark-internal-rs
Rust WebAssembly functions for spark-internal.
Installing build tools
First, we need to install Rust. Though it is possible to install it using Homebrew, we recommend installing rustup using the approach on the Rust homepage:
https://www.rust-lang.org/tools/install
It will most likely involve simply running:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Once you have rustup and Rust, we need to install dependencies for building Rust Wasm.
rustup target add wasm32-unknown-unknown
cargo install wasm-pack
Building
Run the following script inside spark-internal/rust:
./build_rust_wasm.sh
You can also build it manually by running these commands:
cd spark-internal-rs
wasm-pack build --target web
The generated files will be in the pkg/ subdirectory, which is already symlinked in spark-internal/package.json.