gaussian-splat-lite 0.1.16 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -2
- package/CONTRIBUTING.md +18 -33
- package/NOTICE +4 -0
- package/README.md +90 -196
- package/THIRD_PARTY_LICENSES.md +59 -0
- package/dist/assets/worker-BHxN_MMl.js.map +1 -0
- package/dist/assets/worker-CW34rfGQ.js.map +1 -0
- package/dist/assets/worker-CYVKgRmx.js.map +1 -0
- package/dist/assets/worker-CuJRms5j.js.map +1 -0
- package/dist/assets/worker-CvWvxnf1.js.map +1 -0
- package/dist/assets/worker-JFU-GAtN.js.map +1 -0
- package/dist/gaussian-splat-lite.cjs +32742 -4118
- package/dist/gaussian-splat-lite.cjs.map +1 -1
- package/dist/gaussian-splat-lite.min.cjs +479 -49
- package/dist/gaussian-splat-lite.min.cjs.map +1 -1
- package/dist/gaussian-splat-lite.module.js +11275 -4143
- package/dist/gaussian-splat-lite.module.js.map +1 -1
- package/dist/gaussian-splat-lite.module.min.js +7576 -2508
- package/dist/gaussian-splat-lite.module.min.js.map +1 -1
- package/dist/types/data/IndexedSplats.d.cts +68 -0
- package/dist/types/data/IndexedSplats.d.ts +68 -0
- package/dist/types/data/RadPagedSplats.d.cts +65 -0
- package/dist/types/data/RadPagedSplats.d.ts +65 -0
- package/dist/types/data/SogRegionSplats.d.cts +19 -0
- package/dist/types/data/SogRegionSplats.d.ts +19 -0
- package/dist/types/data/SplatOpacityTable.d.cts +31 -0
- package/dist/types/data/SplatOpacityTable.d.ts +31 -0
- package/dist/types/{Splats.d.cts → data/Splats.d.cts} +14 -7
- package/dist/types/{Splats.d.ts → data/Splats.d.ts} +14 -7
- package/dist/types/{defines.d.cts → data/defines.d.cts} +5 -1
- package/dist/types/{defines.d.ts → data/defines.d.ts} +5 -1
- package/dist/types/{splatCodec.d.cts → data/splatCodec.d.cts} +4 -2
- package/dist/types/{splatCodec.d.ts → data/splatCodec.d.ts} +4 -2
- package/dist/types/data/splatData.d.cts +11 -0
- package/dist/types/data/splatData.d.ts +11 -0
- package/dist/types/data/splatRange.d.cts +3 -0
- package/dist/types/data/splatRange.d.ts +3 -0
- package/dist/types/data/textureLayout.d.cts +9 -0
- package/dist/types/data/textureLayout.d.ts +9 -0
- package/dist/types/data/unpack.d.cts +9 -0
- package/dist/types/data/unpack.d.ts +9 -0
- package/dist/types/index.d.cts +18 -12
- package/dist/types/index.d.ts +18 -12
- package/dist/types/loaders/SplatLoader.d.cts +16 -0
- package/dist/types/loaders/SplatLoader.d.ts +16 -0
- package/dist/types/loaders/assetUrl.d.cts +2 -0
- package/dist/types/loaders/assetUrl.d.ts +2 -0
- package/dist/types/loaders/loadSplatData.d.cts +21 -0
- package/dist/types/loaders/loadSplatData.d.ts +21 -0
- package/dist/types/loaders/loadTypes.d.cts +46 -0
- package/dist/types/loaders/loadTypes.d.ts +46 -0
- package/dist/types/{postDecode.d.cts → loaders/postDecode/builder.d.cts} +7 -164
- package/dist/types/{postDecode.d.ts → loaders/postDecode/builder.d.ts} +7 -164
- package/dist/types/loaders/postDecode/compiler.d.cts +15 -0
- package/dist/types/loaders/postDecode/compiler.d.ts +15 -0
- package/dist/types/loaders/postDecode/operations.d.cts +3 -0
- package/dist/types/loaders/postDecode/operations.d.ts +3 -0
- package/dist/types/loaders/postDecode/optimizer.d.cts +3 -0
- package/dist/types/loaders/postDecode/optimizer.d.ts +3 -0
- package/dist/types/loaders/postDecode/program.d.cts +13 -0
- package/dist/types/loaders/postDecode/program.d.ts +13 -0
- package/dist/types/loaders/postDecode/protocol.d.cts +165 -0
- package/dist/types/loaders/postDecode/protocol.d.ts +165 -0
- package/dist/types/loaders/postDecode/registers.d.cts +12 -0
- package/dist/types/loaders/postDecode/registers.d.ts +12 -0
- package/dist/types/loaders/postDecode/runtime.d.cts +2 -0
- package/dist/types/loaders/postDecode/runtime.d.ts +2 -0
- package/dist/types/loaders/rad/RadSource.d.cts +78 -0
- package/dist/types/loaders/rad/RadSource.d.ts +78 -0
- package/dist/types/loaders/rad/radFormat.d.cts +58 -0
- package/dist/types/loaders/rad/radFormat.d.ts +58 -0
- package/dist/types/loaders/rad.d.cts +6 -0
- package/dist/types/loaders/rad.d.ts +6 -0
- package/dist/types/loaders/sog/SogSource.d.cts +5 -0
- package/dist/types/loaders/sog/SogSource.d.ts +5 -0
- package/dist/types/loaders/sog/sogZip.d.cts +17 -0
- package/dist/types/loaders/sog/sogZip.d.ts +17 -0
- package/dist/types/loaders/sog.d.cts +9 -0
- package/dist/types/loaders/sog.d.ts +9 -0
- package/dist/types/loaders/source.d.cts +22 -0
- package/dist/types/loaders/source.d.ts +22 -0
- package/dist/types/loaders/stream/StreamByteBudget.d.cts +7 -0
- package/dist/types/loaders/stream/StreamByteBudget.d.ts +7 -0
- package/dist/types/loaders/stream/StreamWorkerPool.d.cts +43 -0
- package/dist/types/loaders/stream/StreamWorkerPool.d.ts +43 -0
- package/dist/types/loaders/stream/rad-stream/RadSelectionState.d.cts +19 -0
- package/dist/types/loaders/stream/rad-stream/RadSelectionState.d.ts +19 -0
- package/dist/types/loaders/stream/rad-stream/RadStreamBatch.d.cts +12 -0
- package/dist/types/loaders/stream/rad-stream/RadStreamBatch.d.ts +12 -0
- package/dist/types/loaders/stream/rad-stream/RadStreamLoader.d.cts +40 -0
- package/dist/types/loaders/stream/rad-stream/RadStreamLoader.d.ts +40 -0
- package/dist/types/loaders/stream/rad-stream/RadStreamScheduler.d.cts +84 -0
- package/dist/types/loaders/stream/rad-stream/RadStreamScheduler.d.ts +84 -0
- package/dist/types/loaders/stream/rad-stream/RadStreamWorker.d.cts +6 -0
- package/dist/types/loaders/stream/rad-stream/RadStreamWorker.d.ts +6 -0
- package/dist/types/loaders/stream/rad-stream/radFade.d.cts +16 -0
- package/dist/types/loaders/stream/rad-stream/radFade.d.ts +16 -0
- package/dist/types/loaders/stream/rad-stream/radLod.d.cts +33 -0
- package/dist/types/loaders/stream/rad-stream/radLod.d.ts +33 -0
- package/dist/types/loaders/stream/rad-stream/worker.d.cts +43 -0
- package/dist/types/loaders/stream/rad-stream/worker.d.ts +43 -0
- package/dist/types/loaders/stream/rad-stream/workerHandlers.d.cts +46 -0
- package/dist/types/loaders/stream/rad-stream/workerHandlers.d.ts +46 -0
- package/dist/types/loaders/stream/sog-stream/SogStreamBatch.d.cts +18 -0
- package/dist/types/loaders/stream/sog-stream/SogStreamBatch.d.ts +18 -0
- package/dist/types/loaders/stream/sog-stream/SogStreamLoader.d.cts +49 -0
- package/dist/types/loaders/stream/sog-stream/SogStreamLoader.d.ts +49 -0
- package/dist/types/loaders/stream/sog-stream/SogStreamScheduler.d.cts +67 -0
- package/dist/types/loaders/stream/sog-stream/SogStreamScheduler.d.ts +67 -0
- package/dist/types/loaders/stream/sog-stream/SogStreamWorker.d.cts +6 -0
- package/dist/types/loaders/stream/sog-stream/SogStreamWorker.d.ts +6 -0
- package/dist/types/loaders/stream/sog-stream/sogLod.d.cts +69 -0
- package/dist/types/loaders/stream/sog-stream/sogLod.d.ts +69 -0
- package/dist/types/loaders/stream/sog-stream/sogVisibility.d.cts +27 -0
- package/dist/types/loaders/stream/sog-stream/sogVisibility.d.ts +27 -0
- package/dist/types/loaders/stream/sog-stream/worker.d.cts +41 -0
- package/dist/types/loaders/stream/sog-stream/worker.d.ts +41 -0
- package/dist/types/loaders/stream/sog-stream/workerHandlers.d.cts +48 -0
- package/dist/types/loaders/stream/sog-stream/workerHandlers.d.ts +48 -0
- package/dist/types/loaders/stream/streamOptions.d.cts +45 -0
- package/dist/types/loaders/stream/streamOptions.d.ts +45 -0
- package/dist/types/loaders/workerDecode.d.cts +13 -0
- package/dist/types/loaders/workerDecode.d.ts +13 -0
- package/dist/types/{GaussianSplatRenderer.d.cts → rendering/GaussianSplatRenderer.d.cts} +118 -23
- package/dist/types/{GaussianSplatRenderer.d.ts → rendering/GaussianSplatRenderer.d.ts} +118 -23
- package/dist/types/{cameraRelative.d.cts → rendering/SortCenterCache.d.cts} +0 -10
- package/dist/types/{cameraRelative.d.ts → rendering/SortCenterCache.d.ts} +0 -10
- package/dist/types/{SplatAccumulator.d.cts → rendering/SplatAccumulator.d.cts} +15 -17
- package/dist/types/{SplatAccumulator.d.ts → rendering/SplatAccumulator.d.ts} +15 -17
- package/dist/types/rendering/SplatCapture.d.cts +51 -0
- package/dist/types/rendering/SplatCapture.d.ts +51 -0
- package/dist/types/rendering/SplatGeometry.d.cts +8 -0
- package/dist/types/rendering/SplatGeometry.d.ts +8 -0
- package/dist/types/rendering/StochasticResolvePass.d.cts +68 -0
- package/dist/types/rendering/StochasticResolvePass.d.ts +68 -0
- package/dist/types/rendering/backend.d.cts +25 -0
- package/dist/types/rendering/backend.d.ts +25 -0
- package/dist/types/rendering/rendererUtils.d.cts +15 -0
- package/dist/types/rendering/rendererUtils.d.ts +15 -0
- package/dist/types/rendering/stochastic.d.cts +19 -0
- package/dist/types/rendering/stochastic.d.ts +19 -0
- package/dist/types/rendering/tsl/GenerateProgram.d.cts +26 -0
- package/dist/types/rendering/tsl/GenerateProgram.d.ts +26 -0
- package/dist/types/rendering/tsl/ProjectionProgram.d.cts +37 -0
- package/dist/types/rendering/tsl/ProjectionProgram.d.ts +37 -0
- package/dist/types/rendering/tsl/ResolveMaterial.d.cts +4 -0
- package/dist/types/rendering/tsl/ResolveMaterial.d.ts +4 -0
- package/dist/types/rendering/tsl/SplatBackend.d.cts +17 -0
- package/dist/types/rendering/tsl/SplatBackend.d.ts +17 -0
- package/dist/types/rendering/tsl/SplatMaterial.d.cts +27 -0
- package/dist/types/rendering/tsl/SplatMaterial.d.ts +27 -0
- package/dist/types/rendering/tsl/shaderUtils.d.cts +15 -0
- package/dist/types/rendering/tsl/shaderUtils.d.ts +15 -0
- package/dist/types/rendering/tsl/viewUniforms.d.cts +16 -0
- package/dist/types/rendering/tsl/viewUniforms.d.ts +16 -0
- package/dist/types/rendering/uniforms.d.cts +94 -0
- package/dist/types/rendering/uniforms.d.ts +94 -0
- package/dist/types/rendering/webgl/AccumulatorGenerator.d.cts +16 -0
- package/dist/types/rendering/webgl/AccumulatorGenerator.d.ts +16 -0
- package/dist/types/rendering/webgl/OrderingTexture.d.cts +10 -0
- package/dist/types/rendering/webgl/OrderingTexture.d.ts +10 -0
- package/dist/types/rendering/webgl/ResolveMaterial.d.cts +3 -0
- package/dist/types/rendering/webgl/ResolveMaterial.d.ts +3 -0
- package/dist/types/rendering/webgl/SplatBackend.d.cts +20 -0
- package/dist/types/rendering/webgl/SplatBackend.d.ts +20 -0
- package/dist/types/rendering/webgl/textureUtils.d.cts +3 -0
- package/dist/types/rendering/webgl/textureUtils.d.ts +3 -0
- package/dist/types/rendering/webgl-fallback/AccumulatorGenerator.d.cts +13 -0
- package/dist/types/rendering/webgl-fallback/AccumulatorGenerator.d.ts +13 -0
- package/dist/types/rendering/webgl-fallback/SplatBackend.d.cts +15 -0
- package/dist/types/rendering/webgl-fallback/SplatBackend.d.ts +15 -0
- package/dist/types/rendering/webgpu/ProjectedSplats.d.cts +42 -0
- package/dist/types/rendering/webgpu/ProjectedSplats.d.ts +42 -0
- package/dist/types/rendering/webgpu/ProjectionCache.d.cts +34 -0
- package/dist/types/rendering/webgpu/ProjectionCache.d.ts +34 -0
- package/dist/types/rendering/webgpu/RadixSort.d.cts +41 -0
- package/dist/types/rendering/webgpu/RadixSort.d.ts +41 -0
- package/dist/types/rendering/webgpu/SplatBackend.d.cts +17 -0
- package/dist/types/rendering/webgpu/SplatBackend.d.ts +17 -0
- package/dist/types/runtime/SplatWorker.d.cts +19 -0
- package/dist/types/runtime/SplatWorker.d.ts +19 -0
- package/dist/types/runtime/WorkerRpc.d.cts +25 -0
- package/dist/types/runtime/WorkerRpc.d.ts +25 -0
- package/dist/types/runtime/abort.d.cts +8 -0
- package/dist/types/runtime/abort.d.ts +8 -0
- package/dist/types/runtime/wasm.d.cts +4 -0
- package/dist/types/runtime/wasm.d.ts +4 -0
- package/dist/types/{worker.d.cts → runtime/worker.d.cts} +3 -19
- package/dist/types/{worker.d.ts → runtime/worker.d.ts} +3 -19
- package/dist/types/runtime/workerServer.d.cts +2 -0
- package/dist/types/runtime/workerServer.d.ts +2 -0
- package/dist/types/{SplatEdit.d.cts → scene/SplatEdit.d.cts} +0 -2
- package/dist/types/{SplatEdit.d.ts → scene/SplatEdit.d.ts} +0 -2
- package/dist/types/{SplatMesh.d.cts → scene/SplatMesh.d.cts} +6 -6
- package/dist/types/{SplatMesh.d.ts → scene/SplatMesh.d.ts} +6 -6
- package/dist/types/utils/index.d.cts +7 -0
- package/dist/types/utils/index.d.ts +7 -0
- package/dist/types/{float16.d.cts → utils/numeric.d.cts} +2 -0
- package/dist/types/{float16.d.ts → utils/numeric.d.ts} +2 -0
- package/dist/types/utils/three.d.cts +6 -0
- package/dist/types/utils/three.d.ts +6 -0
- package/dist/types/{splatTransform.d.cts → utils/transforms.d.cts} +9 -0
- package/dist/types/{splatTransform.d.ts → utils/transforms.d.ts} +9 -0
- package/docs/Architecture.md +127 -0
- package/docs/GaussianSplatRenderer.md +137 -25
- package/docs/PostDecode.md +24 -38
- package/docs/RadStreamScheduler.md +76 -0
- package/docs/SogStreamScheduler.md +60 -0
- package/docs/SplatAccumulator.md +11 -9
- package/docs/SplatEdit.md +9 -39
- package/docs/SplatFileType.md +7 -10
- package/docs/SplatLoader.md +39 -1
- package/docs/SplatMesh.md +72 -14
- package/docs/Splats.md +27 -25
- package/package.json +15 -11
- package/dist/assets/worker-C26a7h-J.js.map +0 -1
- package/dist/assets/worker-Cx-xVLFg.js.map +0 -1
- package/dist/types/SplatGeometry.d.cts +0 -4
- package/dist/types/SplatGeometry.d.ts +0 -4
- package/dist/types/SplatLoader.d.cts +0 -34
- package/dist/types/SplatLoader.d.ts +0 -34
- package/dist/types/SplatWorker.d.cts +0 -32
- package/dist/types/SplatWorker.d.ts +0 -32
- package/dist/types/postDecodeRuntime.d.cts +0 -19
- package/dist/types/postDecodeRuntime.d.ts +0 -19
- package/dist/types/utils.d.cts +0 -28
- package/dist/types/utils.d.ts +0 -28
- package/dist/types/wasm.d.cts +0 -2
- package/dist/types/wasm.d.ts +0 -2
- package/dist/types/workerIdleTimeout.d.cts +0 -12
- package/dist/types/workerIdleTimeout.d.ts +0 -12
- /package/dist/types/{shaders.d.cts → rendering/webgl/shaders.d.cts} +0 -0
- /package/dist/types/{shaders.d.ts → rendering/webgl/shaders.d.ts} +0 -0
- /package/dist/types/{transferable.d.cts → runtime/transferable.d.cts} +0 -0
- /package/dist/types/{transferable.d.ts → runtime/transferable.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,83 @@ and this project follows [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.0.1] - 2026-09-11
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Added runtime `splatBudget` updates to `RadStreamScheduler` and `SogStreamScheduler`. Assigning a positive safe integer requests a new LOD selection even for stationary views, discards results computed for an older budget, and preserves displayed coverage through loading and fades.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Changed streamed SOG LOD selection to distance-based priorities with a level multiplier of 1.5, using camera-to-bounds distance instead of region size or authored errors.
|
|
19
|
+
- Changed streamed SOG refinement to use the finest cached LOD up to the target. Gaps of at least four levels load a midpoint; smaller gaps and coarsening load the target directly. Regions without usable coverage start at the coarsest LOD.
|
|
20
|
+
- Reworked RAD LOD scoring to prepare camera position and projection bounds once per view, using camera pixel scale and inverse object-space center distance for perspective and orthographic cameras. Nodes inside the actual viewport receive full priority, accounting for zoom and view offsets; off-screen priority tapers toward 5%, with 5% retained behind the camera. Non-invertible transforms are rejected.
|
|
21
|
+
- Changed RAD LOD radius estimates from the largest axis scale to the arithmetic mean of the three axis scales, lowered the base pixel threshold from `2` to `1`, and reduced hysteresis from 15% to 5%.
|
|
22
|
+
- Reduced RAD traversal work by marking child ranges per page, skipping per-node work on leaf-only pages, and pruning refinements that cannot fit the remaining budget while preserving single-child refinements and stable source order.
|
|
23
|
+
- Kept RAD selection baselines in the LOD worker and referenced them by ID, avoiding per-request copies of the displayed cut. Combined changed-page detection and fade preparation into one pass, skipped fade-buffer allocation for unchanged cuts, and included retained worker selections in resident-byte statistics.
|
|
24
|
+
- Moved streamed RAD page downloads and local page reads into decoding workers, keeping application URL and file resolution on the calling thread. Preserved Range validation and checked resource versions and lengths across parallel responses before publication; local inputs send only the requested page.
|
|
25
|
+
- Reduced RAD streaming replies to packed render records and a scalar root radius, transferring tree arrays to the LOD worker without duplicate copies or unused sort centers on the main thread. Updated pending-byte estimates and removed the unreachable non-LOD radius fallback.
|
|
26
|
+
- Simplified internal RAD selection clearing and removed unused duplicate-index fade handling, keeping prepared selection commits and shared fade groups.
|
|
27
|
+
- Unified RAD/SOG load lifecycle handling in `StreamWorkerPool`, including worker leases, task IDs, cancellation, download accounting, and balanced `LoadingManager` notifications, while retaining separate pools and format-specific cache ownership.
|
|
28
|
+
- Reduced SOG streaming transfers and pending-copy reservations with tightly packed region records that omit per-region texture padding and duplicate sort centers.
|
|
29
|
+
- Reduced streamed SOG metadata to four fields per LOD, keeping the spatial tree and a float32 upgrade-ratio table in the LOD worker. Memory statistics include both threads' retained arrays.
|
|
30
|
+
- Shared ordering texture allocation, resizing and disposal between the WebGL backends while preserving their partial-upload paths; removed unused native WebGPU CPU-ordering members.
|
|
31
|
+
- Optimized `postDecode` by combining single-use multiply/add and add/multiply expressions while preserving intermediate float32 rounding and operand order, caching decoded scale values on demand, and combining related packed-field and sort-center writes.
|
|
32
|
+
- Compacted native WebGPU projection output into visible slots and repurposed the source-index buffer for stable coverage seeds, preserving the 32-byte projected record layout without an extra seed texture.
|
|
33
|
+
- Kept RAD validation and assembly helpers and TSL texture-layout constants local to their modules by removing unused exports.
|
|
34
|
+
- Set viewer camera damping to `0.1`.
|
|
35
|
+
|
|
36
|
+
### Removed
|
|
37
|
+
|
|
38
|
+
- Removed unused `SplatEdits.sdfFloatData` and `editFloatData` fields. Float views can be created from the current `sdfData.buffer` and `editData.buffer` when needed.
|
|
39
|
+
- Removed the unused `debugFlag` uniform and its automatic updates. Custom shaders that use it must now define and update their own uniform.
|
|
40
|
+
- Removed `utils.threeMrtArray`; all supported Three.js versions provide array-based multiple render targets.
|
|
41
|
+
- Removed the unused `mode` tag from the internal serialized `postDecode` condition format.
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- Stabilized stochastic color and depth coverage when streamed LOD selections or combined mesh ranges are remapped. All three rendering backends now derive sampling seeds from mesh identity and physical source records, preventing unchanged Splats from receiving new noise patterns after remapping.
|
|
46
|
+
- Removed camera-rotation-dependent scale inflation from RAD LOD scoring.
|
|
47
|
+
- Corrected viewer overlay stacking so the drop overlay and toast messages appear above other controls.
|
|
48
|
+
|
|
49
|
+
## [1.0.0] - 2026-09-09
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- Added `WebGPURenderer` support for native WebGPU, `forceWebGL`, and automatic WebGL2 fallback, using shared TSL shaders. Native WebGPU projects and culls Splats before 32-bit GPU sorting and indirect drawing; both WebGL backends use asynchronous Worker/WASM sorting. The new read-only `synchronousSort` property reports the backend's sorting mode.
|
|
54
|
+
- Added `stochastic` and `autoStochastic` for sorting-free transparency, plus `renderDepth` for companion depth draws with stochastic alpha coverage. Automatic mode uses stochastic rendering during camera motion until a fresh sort is ready.
|
|
55
|
+
- Added `StochasticResolvePass` for spatial noise reduction through direct scene composition, WebGL `EffectComposer`, or a custom render graph. Manual stochastic rendering and per-eye resolve support WebGL/WebGPU XR; automatic switching is disabled in XR.
|
|
56
|
+
- Added SOG V1/V2 loading from ZIP bundles or directory metadata through the existing loading APIs, with HTTP Range access, concurrent property-image downloads, and grouped decoding.
|
|
57
|
+
- Added Spark RAD version 1 loading for monolithic `.rad` files and split files with external `.radc` pages, including all property codecs and SH0–SH3/codebooks. Ordinary loading detects the RAD0 signature and extracts leaf records before applying `postDecode`.
|
|
58
|
+
- Added `RadStreamScheduler` and `SogStreamScheduler` for camera-driven LOD and on-demand loading of RAD pages and Streamed SOG `lod-meta.json` scenes. Both support WebGL/WebGPU rendering, SDF edits, raycasting, visibility fades, LOD crossfades, cancellation, retries, and streaming statistics.
|
|
59
|
+
- Added shared streaming controls for Splat budgets, upload allowance, load concurrency, and cooldown retirement. Defaults are 3,000,000 Splats, 8 MiB per update, four concurrent loads, 100 cooldown ticks, and 200 ms fades. LOD workers run separately from decoding workers and coalesce pending requests to the latest view; fixed source slots, compact visible indices, and partial uploads reduce repeated work.
|
|
60
|
+
- Added `resolveFile` for local SOG companion images and RAD pages, accepting synchronous or asynchronous URL, Blob, or byte-array results with cancellation support.
|
|
61
|
+
- Added an optional `AbortSignal` to `SplatLoader.loadAsync()`. Disposing loaded sources or replacing their initialization cancels pending downloads and decoding.
|
|
62
|
+
- Added `Splats.extractRange()` to copy packed records, spherical harmonics, and sort centers into an independent source.
|
|
63
|
+
- Added Splat record indices to raycast hits and `RadStreamScheduler.getGlobalIndex()` to map current batch indices to stable file-global RAD node indices.
|
|
64
|
+
- Added viewer backend switching, output color-space and stochastic controls, WebGPU Inspector integration, and a toggleable grid with X/Z reference axes. The viewer accepts SOG/RAD files, streamed scene URLs, and multi-file selection or drop for local split assets.
|
|
65
|
+
|
|
66
|
+
### Changed
|
|
67
|
+
|
|
68
|
+
- Updated the Three.js peer dependency from `>=0.185.1` to `>=0.186.0`, pinned development to `0.186.0`, and removed compatibility workarounds fixed upstream.
|
|
69
|
+
- Replaced `stream` and `streamLength` loading inputs with `file: Blob` (including `File`) in `Splats` and `SplatMesh`. PLY/SPZ files stream inside the worker; local SOG/RAD files use random reads. Existing `url` and `fileBytes` inputs remain available.
|
|
70
|
+
- Changed the default `preBlurAmount` from `0` to `0.3` and `blurAmount` from `0.3` to `0`, expanding projected Splats without the previous blur opacity compensation. Set them to `0` and `0.3`, respectively, to restore the previous behavior.
|
|
71
|
+
- Corrected `minPixelRadius` to use screen pixels independently of `focalAdjustment`. Its default remains `1`; divide previous values by `focalAdjustment` to preserve the old cutoff.
|
|
72
|
+
- Increased the default `SplatMesh.minRaycastOpacity` from `0.1` to `0.15`.
|
|
73
|
+
- Moved built-in Splat color conversion to vertex shaders and trimmed wide-kernel coverage using a conservative alpha bound while preserving the full-support visibility cutoff. Native WebGPU projection quantization can produce slight visual differences, and equal-depth Splats have no guaranteed source order.
|
|
74
|
+
- Unified PLY/SPZ/SOG/RAD decoding around the platform-independent Rust library and shared receiver output, with thin WASM bridges. Reused PLY batches and SPZ decompression buffers, and reduced packed-buffer reads, writes, and temporary allocations.
|
|
75
|
+
- Reorganized source code into data, loaders, runtime, scene, rendering, and utility modules while preserving existing package entry-point exports. Extracted offscreen capture, shared packed-data loading, and separate post-decode building, compilation and execution modules without changing public APIs. Simplified the README and API references, and added architecture and streaming guides.
|
|
76
|
+
- Updated the viewer to use reversed depth buffers where supported and allow only one GPU frame in flight while retaining pending redraws and processing camera input. Replaced the bundled Lion model with Multi Material Splats by hybridherbst in SPZ v4 with SH3 data and CC BY 4.0 attribution.
|
|
77
|
+
- Changed `npm run dev` to serve source directly through Vite, consolidated WASM builds into a cross-platform Node script, and split ES module and CommonJS bundle builds. Removed `build:watch` and the platform-specific WASM scripts.
|
|
78
|
+
|
|
79
|
+
### Fixed
|
|
80
|
+
|
|
81
|
+
- Corrected shared SH exponent selection in Rust and TypeScript so coefficients between powers of two no longer saturate at the lower power. Preserved finite color channels when another channel is NaN, and preserved the SH2 coefficient stored alongside SH1 when updating SH1. The packed layout and shader decoding are unchanged.
|
|
82
|
+
- Rebuilt Splat textures when either source buffer, typed-array offset, or length changes, preventing stale GPU data.
|
|
83
|
+
- Validated legacy SPZ gzip header and payload checksums, decoded sizes, trailers, and trailing data. Validated SPZ v4 Zstandard checksums and declared frame sizes against the stream table, rejecting corrupt or inconsistent files.
|
|
84
|
+
- Corrected WebXR projection to use each eye's viewport dimensions instead of the full drawing buffer.
|
|
85
|
+
- Recreated terminated WebGL sorting workers on the next sort and discarded late sorting results after renderer disposal.
|
|
86
|
+
|
|
10
87
|
## [0.1.16] - 2026-09-03
|
|
11
88
|
|
|
12
89
|
### Changed
|
|
@@ -43,7 +120,7 @@ and this project follows [Semantic Versioning](https://semver.org/).
|
|
|
43
120
|
|
|
44
121
|
### Added
|
|
45
122
|
|
|
46
|
-
- Added `tan`, `asin`, `atan`, and vector-aware `atan2(y, x)` operations to the
|
|
123
|
+
- Added `tan`, `asin`, `atan`, and vector-aware `atan2(y, x)` operations to the post-decode expression API.
|
|
47
124
|
|
|
48
125
|
## [0.1.12] - 2026-08-31
|
|
49
126
|
|
|
@@ -193,7 +270,9 @@ and this project follows [Semantic Versioning](https://semver.org/).
|
|
|
193
270
|
|
|
194
271
|
- Initial public release of the Three.js Gaussian Splatting renderer.
|
|
195
272
|
|
|
196
|
-
[Unreleased]: https://github.com/WilliamLiu-1997/Gaussian-Splat-Lite/compare/
|
|
273
|
+
[Unreleased]: https://github.com/WilliamLiu-1997/Gaussian-Splat-Lite/compare/v1.0.1...HEAD
|
|
274
|
+
[1.0.1]: https://github.com/WilliamLiu-1997/Gaussian-Splat-Lite/compare/v1.0.0...v1.0.1
|
|
275
|
+
[1.0.0]: https://github.com/WilliamLiu-1997/Gaussian-Splat-Lite/compare/v0.1.16...v1.0.0
|
|
197
276
|
[0.1.16]: https://github.com/WilliamLiu-1997/Gaussian-Splat-Lite/compare/v0.1.15...v0.1.16
|
|
198
277
|
[0.1.15]: https://github.com/WilliamLiu-1997/Gaussian-Splat-Lite/compare/v0.1.14...v0.1.15
|
|
199
278
|
[0.1.14]: https://github.com/WilliamLiu-1997/Gaussian-Splat-Lite/compare/v0.1.13...v0.1.14
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,62 +1,52 @@
|
|
|
1
1
|
# Contributing
|
|
2
2
|
|
|
3
|
-
Thanks for contributing to `gaussian-splat-lite`.
|
|
4
|
-
|
|
5
3
|
## Development setup
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
toolchain installed through `rustup`, and the `wasm32-unknown-unknown` target.
|
|
5
|
+
Requires Node.js 20.9+, Rust via `rustup`, and the `wasm32-unknown-unknown` target.
|
|
9
6
|
|
|
10
7
|
```bash
|
|
11
8
|
npm ci
|
|
12
9
|
npm run build:wasm
|
|
10
|
+
npm run dev
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
Check WebGL2, WebGPU, and WebGPU · WebGL2 in the viewer. For depth changes, compare mesh occlusion and transparent edges; disable **Automatic stochastic** to expose **Force Splat depth**.
|
|
14
|
+
|
|
15
|
+
See [Source architecture](docs/Architecture.md) for module responsibilities and backend boundaries.
|
|
16
16
|
|
|
17
17
|
## Validation
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Before opening a pull request:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
npm run release:check
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
source, runs the tests, builds the package, and verifies the npm tarball.
|
|
25
|
+
Builds WASM, the viewer, and the package; runs type checks, lint, tests, and npm package validation.
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
update the pinned `allowScripts` entries with `npm approve-scripts`.
|
|
27
|
+
Review new or changed dependency install scripts and update `allowScripts` with `npm approve-scripts`.
|
|
30
28
|
|
|
31
29
|
## Pull requests
|
|
32
30
|
|
|
33
31
|
- Keep changes focused on one problem.
|
|
34
|
-
- Update the
|
|
32
|
+
- Update the relevant API docs when behavior changes; keep the README focused on setup and capabilities.
|
|
35
33
|
- Add or update tests for behavior that can be exercised without WebGL.
|
|
36
|
-
- Include a minimal reproduction and captures for rendering changes
|
|
37
|
-
possible.
|
|
34
|
+
- Include a minimal reproduction and captures for rendering changes where possible.
|
|
38
35
|
- Add user-visible changes to the `Unreleased` section of `CHANGELOG.md`.
|
|
39
|
-
- Do not commit generated `dist/`, `site-dist/`, Rust `target/`, or wasm-pack
|
|
40
|
-
`pkg/` directories.
|
|
36
|
+
- Do not commit generated `dist/`, `site-dist/`, Rust `target/`, or wasm-pack `pkg/` directories.
|
|
41
37
|
|
|
42
38
|
## Maintainer releases
|
|
43
39
|
|
|
44
|
-
|
|
45
|
-
`v*` tag is pushed. The workflow rejects tags that do not match the version in
|
|
46
|
-
`package.json`, skips versions already present on npm, and creates the GitHub
|
|
47
|
-
release from `CHANGELOG.md`.
|
|
40
|
+
Pushing a `v*` tag runs `.github/workflows/publish.yml`. It requires a matching `package.json` version, skips existing npm versions, and creates the GitHub release from `CHANGELOG.md`.
|
|
48
41
|
|
|
49
|
-
|
|
50
|
-
publish the package once from a maintainer account so that its npm settings
|
|
51
|
-
exist:
|
|
42
|
+
To publish manually from a maintainer account:
|
|
52
43
|
|
|
53
44
|
```bash
|
|
54
45
|
npm run release:check
|
|
55
46
|
npm publish --access public
|
|
56
47
|
```
|
|
57
48
|
|
|
58
|
-
|
|
59
|
-
for future releases:
|
|
49
|
+
Configure GitHub Actions as the trusted publisher with a current npm CLI:
|
|
60
50
|
|
|
61
51
|
```bash
|
|
62
52
|
npm trust github gaussian-splat-lite \
|
|
@@ -65,15 +55,10 @@ npm trust github gaussian-splat-lite \
|
|
|
65
55
|
--allow-publish
|
|
66
56
|
```
|
|
67
57
|
|
|
68
|
-
|
|
69
|
-
Publisher** page. The workflow uses short-lived OIDC credentials, so no
|
|
70
|
-
`NPM_TOKEN` repository secret is required after this setup.
|
|
58
|
+
Alternatively, use npm **Settings → Trusted Publisher**. The workflow uses OIDC; no `NPM_TOKEN` secret is needed.
|
|
71
59
|
|
|
72
60
|
For each release:
|
|
73
61
|
|
|
74
|
-
1. Move
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
`npm version <version> --no-git-tag-version`.
|
|
78
|
-
3. Run `npm run release:check`, commit the release changes, then create and push
|
|
79
|
-
`v<version>`.
|
|
62
|
+
1. Move `Unreleased` entries into a dated version section.
|
|
63
|
+
2. Run `npm version <version> --no-git-tag-version` to update both package files.
|
|
64
|
+
3. Run `npm run release:check`, commit, then create and push `v<version>`.
|
package/NOTICE
CHANGED
|
@@ -5,6 +5,10 @@ This product includes software derived from SparkJS v2.1.0,
|
|
|
5
5
|
Copyright © 2025 WORLD LABS TECHNOLOGIES, INC., licensed under the MIT
|
|
6
6
|
License. See THIRD_PARTY_LICENSES.md for the complete license notice.
|
|
7
7
|
|
|
8
|
+
This product includes software adapted from SuperSplat 3.0.0-alpha,
|
|
9
|
+
Copyright (c) 2011-2026 PlayCanvas Ltd., licensed under the MIT License.
|
|
10
|
+
See THIRD_PARTY_LICENSES.md for the complete license notice.
|
|
11
|
+
|
|
8
12
|
This product includes ruzstd v0.7.3,
|
|
9
13
|
Copyright © 2019 Moritz Borcherding, licensed under the MIT License.
|
|
10
14
|
See THIRD_PARTY_LICENSES.md for the complete license notice.
|
package/README.md
CHANGED
|
@@ -6,34 +6,26 @@
|
|
|
6
6
|
[](https://github.com/WilliamLiu-1997/Gaussian-Splat-Lite/actions/workflows/ci.yml)
|
|
7
7
|
[](LICENSE)
|
|
8
8
|
|
|
9
|
+
**Three.js Gaussian Splatting · WebGPU · Depth Rendering · Streaming**
|
|
10
|
+
|
|
9
11
|
<p align="center">
|
|
10
12
|
<img src="./Gaussian-Splat-Lite.svg" alt="Gaussian Splat Lite" width="1000">
|
|
11
13
|
</p>
|
|
12
14
|
|
|
13
15
|
</div>
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
It works alongside standard Three.js scenes, cameras, meshes, and render loops, and supports unified generation, sorting, and blended rendering of multiple Splat objects.
|
|
17
|
+
3D Gaussian Splatting renderer for **Three.js**, with **WebGPU/WebGL2**, **depth rendering for scene occlusion**, and **large-scene streaming**. Load PLY/SPZ/SOG/RAD files into standard Three.js scenes, stream RAD and SOG scenes with camera-driven LOD, and render multiple Splat objects together.
|
|
18
18
|
|
|
19
19
|
## Features
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
- Camera-relative rendering for large GIS/ECEF world coordinates
|
|
30
|
-
- TypeScript declarations, ESM, and CommonJS builds
|
|
31
|
-
|
|
32
|
-
## Requirements
|
|
33
|
-
|
|
34
|
-
- A modern browser with WebGL2, WebAssembly, Web Workers, and ES modules
|
|
35
|
-
- Three.js `0.185.1` or newer
|
|
36
|
-
- Correct CORS headers when loading Splat files from another origin
|
|
21
|
+
| Focus | What you get |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| **WebGPU / WebGL2** | Shared Three.js scene API with GPU sorting on native WebGPU and asynchronous Worker/WASM sorting on both WebGL2 backends |
|
|
24
|
+
| **Depth Rendering** | Separate unsorted depth draw with stochastic coverage at transparent edges |
|
|
25
|
+
| **Large-scene streaming** | RAD tree LOD and SOG `lod-meta.json` scenes with camera-driven selection, on-demand loading, worker decoding, caching, and opacity crossfades for smooth LOD changes on both backends |
|
|
26
|
+
| **Stochastic rendering** | Sorting-free rendering for responsive camera movement, with optional spatial resolve to reduce noise |
|
|
27
|
+
| **SDF edits** | Region-based color and opacity editing without moving Splats |
|
|
28
|
+
| **Data and precision** | PLY/SPZ/SOG/RAD from URLs, files, or bytes; camera-relative rendering for large GIS/ECEF coordinates |
|
|
37
29
|
|
|
38
30
|
## Installation
|
|
39
31
|
|
|
@@ -41,44 +33,42 @@ It works alongside standard Three.js scenes, cameras, meshes, and render loops,
|
|
|
41
33
|
npm install gaussian-splat-lite three
|
|
42
34
|
```
|
|
43
35
|
|
|
36
|
+
Requires Three.js `>=0.186.0`.
|
|
37
|
+
|
|
44
38
|
## Quick start
|
|
45
39
|
|
|
40
|
+
`SplatMesh` is a scene object. One `GaussianSplatRenderer` handles generation, sorting, and drawing for all visible Splat objects.
|
|
41
|
+
|
|
42
|
+
### WebGPU
|
|
43
|
+
|
|
46
44
|
```js
|
|
47
45
|
import * as THREE from "three";
|
|
46
|
+
import { WebGPURenderer } from "three/webgpu";
|
|
48
47
|
import { GaussianSplatRenderer, SplatMesh } from "gaussian-splat-lite";
|
|
49
48
|
|
|
49
|
+
const renderer = new WebGPURenderer({ antialias: false });
|
|
50
|
+
await renderer.init(); // Initialize before constructing GaussianSplatRenderer.
|
|
51
|
+
renderer.setPixelRatio(window.devicePixelRatio);
|
|
52
|
+
renderer.setSize(window.innerWidth, window.innerHeight);
|
|
53
|
+
document.body.appendChild(renderer.domElement);
|
|
54
|
+
|
|
50
55
|
const scene = new THREE.Scene();
|
|
51
56
|
const camera = new THREE.PerspectiveCamera(
|
|
52
|
-
60,
|
|
53
|
-
window.innerWidth / window.innerHeight,
|
|
54
|
-
0.1,
|
|
55
|
-
1000,
|
|
57
|
+
60, window.innerWidth / window.innerHeight, 0.1, 1000,
|
|
56
58
|
);
|
|
57
59
|
camera.position.set(0, 0, 3);
|
|
58
60
|
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
const splatRenderer = new GaussianSplatRenderer({
|
|
62
|
+
renderer,
|
|
63
|
+
renderDepth: true, // Add Splat depth after the sorted color draw.
|
|
62
64
|
});
|
|
63
|
-
renderer.setPixelRatio(window.devicePixelRatio);
|
|
64
|
-
renderer.setSize(window.innerWidth, window.innerHeight);
|
|
65
|
-
document.body.appendChild(renderer.domElement);
|
|
66
|
-
|
|
67
|
-
// One GaussianSplatRenderer is normally enough for each Three.js renderer.
|
|
68
|
-
const splatRenderer = new GaussianSplatRenderer({ renderer });
|
|
69
65
|
scene.add(splatRenderer);
|
|
70
66
|
|
|
71
67
|
const splat = new SplatMesh({ url: "/assets/scene.spz" });
|
|
72
68
|
scene.add(splat);
|
|
73
|
-
|
|
74
|
-
// Wait before reading loaded data such as the count or bounding box.
|
|
75
69
|
await splat.initialized;
|
|
76
|
-
console.log(`Loaded ${splat.numSplats} splats`);
|
|
77
|
-
|
|
78
|
-
renderer.setAnimationLoop(() => {
|
|
79
|
-
renderer.render(scene, camera);
|
|
80
|
-
});
|
|
81
70
|
|
|
71
|
+
renderer.setAnimationLoop(() => renderer.render(scene, camera));
|
|
82
72
|
window.addEventListener("resize", () => {
|
|
83
73
|
camera.aspect = window.innerWidth / window.innerHeight;
|
|
84
74
|
camera.updateProjectionMatrix();
|
|
@@ -86,206 +76,110 @@ window.addEventListener("resize", () => {
|
|
|
86
76
|
});
|
|
87
77
|
```
|
|
88
78
|
|
|
89
|
-
|
|
79
|
+
### WebGL2
|
|
90
80
|
|
|
91
|
-
|
|
81
|
+
`WebGPURenderer` automatically falls back to its WebGL2 backend when WebGPU is unavailable. To force this backend while keeping TSL materials:
|
|
92
82
|
|
|
93
83
|
```js
|
|
94
|
-
|
|
84
|
+
const renderer = new WebGPURenderer({ antialias: false, forceWebGL: true });
|
|
85
|
+
await renderer.init();
|
|
95
86
|
```
|
|
96
87
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
### From a URL
|
|
88
|
+
For the classic WebGL renderer, replace the WebGPU renderer creation and initialization with:
|
|
100
89
|
|
|
101
90
|
```js
|
|
102
|
-
const
|
|
103
|
-
url: "/assets/model.ply", // .spz is also supported.
|
|
104
|
-
onProgress: (event) => {
|
|
105
|
-
if (event.lengthComputable) {
|
|
106
|
-
console.log(`${Math.round((event.loaded / event.total) * 100)}%`);
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
onLoad: (mesh) => console.log(mesh.numSplats),
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
scene.add(splat);
|
|
113
|
-
await splat.initialized;
|
|
91
|
+
const renderer = new THREE.WebGLRenderer({ antialias: false });
|
|
114
92
|
```
|
|
115
93
|
|
|
116
|
-
|
|
94
|
+
Keep the rest of the example, including `renderDepth`.
|
|
117
95
|
|
|
118
|
-
|
|
96
|
+
## Streaming large scenes
|
|
119
97
|
|
|
120
|
-
|
|
121
|
-
import { SplatFileType, SplatMesh } from "gaussian-splat-lite";
|
|
122
|
-
|
|
123
|
-
const file = fileInput.files[0];
|
|
124
|
-
const fileType = file.name.toLowerCase().endsWith(".spz")
|
|
125
|
-
? SplatFileType.SPZ
|
|
126
|
-
: SplatFileType.PLY;
|
|
127
|
-
|
|
128
|
-
const splat = new SplatMesh({
|
|
129
|
-
fileName: file.name,
|
|
130
|
-
fileType,
|
|
131
|
-
stream: file.stream(),
|
|
132
|
-
streamLength: file.size,
|
|
133
|
-
onProgress: ({ loaded, total }) => console.log(loaded, total),
|
|
134
|
-
});
|
|
98
|
+
Use `RadStreamScheduler` for RAD files, or `SogStreamScheduler` for SOG scenes. Both work with the same `GaussianSplatRenderer` on WebGPU and WebGL2, loading and retaining data as the camera moves.
|
|
135
99
|
|
|
136
|
-
|
|
137
|
-
await splat.initialized;
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Complete in-memory file data can also be supplied:
|
|
100
|
+
For RAD, replace the `SplatMesh` loading and animation loop in the quick start with:
|
|
141
101
|
|
|
142
102
|
```js
|
|
143
|
-
|
|
144
|
-
const splat = new SplatMesh({
|
|
145
|
-
fileBytes: bytes,
|
|
146
|
-
fileType: SplatFileType.SPZ,
|
|
147
|
-
});
|
|
148
|
-
```
|
|
103
|
+
import { RadStreamScheduler } from "gaussian-splat-lite";
|
|
149
104
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
105
|
+
const streaming = new RadStreamScheduler({
|
|
106
|
+
url: "/assets/scene.rad",
|
|
107
|
+
splatBudget: 3_000_000,
|
|
108
|
+
fadeDurationMs: 200, // Smooth LOD transitions (default).
|
|
109
|
+
});
|
|
110
|
+
scene.add(streaming.group);
|
|
111
|
+
await streaming.initialized;
|
|
153
112
|
|
|
154
|
-
|
|
155
|
-
|
|
113
|
+
const size = new THREE.Vector2();
|
|
114
|
+
renderer.setAnimationLoop(() => {
|
|
115
|
+
renderer.getDrawingBufferSize(size);
|
|
116
|
+
streaming.update(camera, { width: size.x, height: size.y });
|
|
117
|
+
renderer.render(scene, camera);
|
|
118
|
+
});
|
|
156
119
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
color: op.mul(splat.color, [1, 0.8, 0.8]),
|
|
160
|
-
}));
|
|
120
|
+
// The update loop must be running before awaiting the first visible data.
|
|
121
|
+
await streaming.firstRenderable;
|
|
161
122
|
|
|
162
|
-
|
|
123
|
+
// When removing the model:
|
|
124
|
+
// streaming.dispose();
|
|
125
|
+
// streaming.group.removeFromParent();
|
|
163
126
|
```
|
|
164
127
|
|
|
165
|
-
|
|
166
|
-
quaternions, scale, and spherical harmonics.
|
|
167
|
-
|
|
168
|
-
When the input URL does not have a recognizable extension, specify `fileType` explicitly or provide a `.ply` / `.spz` name through `fileName`.
|
|
169
|
-
|
|
170
|
-
### Creating Splats in code
|
|
128
|
+
For streamed SOG, use this constructor and call `streaming.update(camera)` before rendering each frame; the group and readiness lifecycle are the same:
|
|
171
129
|
|
|
172
130
|
```js
|
|
173
|
-
import
|
|
174
|
-
import { SplatMesh } from "gaussian-splat-lite";
|
|
175
|
-
|
|
176
|
-
const splat = new SplatMesh({
|
|
177
|
-
maxSplats: 100,
|
|
178
|
-
constructSplats: (data) => {
|
|
179
|
-
data.pushSplats([{
|
|
180
|
-
center: new THREE.Vector3(0, 0, 0),
|
|
181
|
-
scales: new THREE.Vector3(0.2, 0.1, 0.1),
|
|
182
|
-
quaternion: new THREE.Quaternion(),
|
|
183
|
-
opacity: 1, // Raw opacity; 0..1 alpha, >1 LoD coverage (max 1000).
|
|
184
|
-
color: new THREE.Color(0x4f8cff),
|
|
185
|
-
sh: [], // Optional: 0, 3, 8, or 15 coefficients for SH0/1/2/3.
|
|
186
|
-
}]);
|
|
187
|
-
},
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
scene.add(splat);
|
|
191
|
-
await splat.initialized;
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
## Core concepts and public API
|
|
195
|
-
|
|
196
|
-
| API | Purpose |
|
|
197
|
-
| --- | --- |
|
|
198
|
-
| [`GaussianSplatRenderer`](docs/GaussianSplatRenderer.md) | Integrates with Three.js and generates, sorts, and draws every visible Splat |
|
|
199
|
-
| [`SplatMesh`](docs/SplatMesh.md) | A transformable, visible, and raycastable Gaussian Splat scene object |
|
|
200
|
-
| [`SplatLoader`](docs/SplatLoader.md) | A Three.js Loader-style PLY/SPZ decoder |
|
|
201
|
-
| [`Splats`](docs/Splats.md) | The built-in mutable Splat source, with decoded reads and aligned batch mutation |
|
|
202
|
-
| [`SplatEdit`](docs/SplatEdit.md) / [`SplatEditSdf`](docs/SplatEdit.md) | SDF-region RGBA editing objects |
|
|
203
|
-
| [`SplatAccumulator`](docs/SplatAccumulator.md) | A low-level generation buffer used by the renderer; normally internal |
|
|
204
|
-
| [`SplatFileType`](docs/SplatFileType.md) | File type enum containing `PLY` and `SPZ` |
|
|
205
|
-
| [`postDecode`](docs/PostDecode.md) | **`Experimental`** Serializable per-Splat expressions executed inside the decode worker |
|
|
206
|
-
|
|
207
|
-
## Large world coordinates / GIS / ECEF
|
|
208
|
-
|
|
209
|
-
The renderer keeps large translations separate from float32 local coordinates. Rendering subtracts the camera origin while values are still JavaScript double-precision numbers, and sorting stores one float64 world origin per `SplatMesh` alongside its float32 local centers. This happens automatically and does not move scene objects or change the world-coordinate behavior of `SplatMesh`, Raycaster, or SDF edits.
|
|
210
|
-
|
|
211
|
-
Source Splat centers should still remain local to their mesh wherever possible. Precision already lost by storing absolute ECEF coordinates in a float32 source cannot be recovered during rendering.
|
|
212
|
-
|
|
213
|
-
## Manual updates and animation
|
|
131
|
+
import { SogStreamScheduler } from "gaussian-splat-lite";
|
|
214
132
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
url: "/assets/model.spz",
|
|
220
|
-
onFrame: ({ mesh, time }) => {
|
|
221
|
-
mesh.rotation.y = time * 0.2;
|
|
222
|
-
},
|
|
133
|
+
const streaming = new SogStreamScheduler({
|
|
134
|
+
url: "/assets/scene/lod-meta.json",
|
|
135
|
+
splatBudget: 3_000_000,
|
|
136
|
+
fadeDurationMs: 200, // Smooth LOD transitions (default).
|
|
223
137
|
});
|
|
224
138
|
```
|
|
225
139
|
|
|
226
|
-
|
|
140
|
+
## Depth Rendering
|
|
227
141
|
|
|
228
|
-
|
|
229
|
-
const splatRenderer = new GaussianSplatRenderer({
|
|
230
|
-
renderer,
|
|
231
|
-
autoUpdate: false,
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
await splatRenderer.update({ scene, camera });
|
|
235
|
-
renderer.render(scene, camera);
|
|
236
|
-
```
|
|
142
|
+
**`renderDepth` adds a dedicated depth draw while keeping sorted color blending.** Both WebGPU and WebGL2 support it.
|
|
237
143
|
|
|
238
|
-
|
|
144
|
+
| Setting | Default | Purpose |
|
|
145
|
+
| --- | --- | --- |
|
|
146
|
+
| `renderDepth` | `false` | Adds Splat depth for geometry drawn later, including transparent meshes |
|
|
147
|
+
| `stochastic` | `false` | Forces sorting-free stochastic rendering with direct depth writes |
|
|
148
|
+
| `autoStochastic` | `false` | Uses stochastic rendering during motion and enables companion depth on sorted frames |
|
|
239
149
|
|
|
240
|
-
|
|
241
|
-
const captureRenderer = new GaussianSplatRenderer({
|
|
242
|
-
renderer,
|
|
243
|
-
target: {
|
|
244
|
-
width: 1920,
|
|
245
|
-
height: 1080,
|
|
246
|
-
superXY: 2,
|
|
247
|
-
},
|
|
248
|
-
});
|
|
249
|
-
scene.add(captureRenderer);
|
|
150
|
+
With default depth settings, the companion draw uses unsorted Splats on non-stochastic frames and samples alpha coverage so transparent edges do not become solid. Stochastic frames already write their own depth.
|
|
250
151
|
|
|
251
|
-
|
|
252
|
-
const rgba = await captureRenderer.renderReadTarget({ scene, camera });
|
|
253
|
-
// rgba is a 1920 * 1080 * 4 Uint8Array.
|
|
254
|
-
```
|
|
152
|
+
## Documentation
|
|
255
153
|
|
|
256
|
-
|
|
154
|
+
- [GaussianSplatRenderer](docs/GaussianSplatRenderer.md) — Rendering, sorting, depth, resolve, and XR.
|
|
155
|
+
- [SplatMesh](docs/SplatMesh.md) — Loading, transforms, animation, and raycasting.
|
|
156
|
+
- [SplatLoader](docs/SplatLoader.md) — File loading.
|
|
157
|
+
- [RadStreamScheduler](docs/RadStreamScheduler.md) — Spark RAD decoding, tree LOD and on-demand paging.
|
|
158
|
+
- [SogStreamScheduler](docs/SogStreamScheduler.md) — Streamed SOG, camera-driven LOD and caching.
|
|
159
|
+
- [Splats](docs/Splats.md) — Data access and updates.
|
|
160
|
+
- [SplatFileType](docs/SplatFileType.md) — PLY/SPZ/SOG/RAD formats.
|
|
161
|
+
- [SplatEdit / SplatEditSdf](docs/SplatEdit.md) — Color and opacity editing.
|
|
162
|
+
- [postDecode](docs/PostDecode.md) — Per-Splat transformations during decoding.
|
|
163
|
+
- [SplatAccumulator](docs/SplatAccumulator.md) — Low-level GPU buffers.
|
|
257
164
|
|
|
258
165
|
## Development
|
|
259
166
|
|
|
260
|
-
|
|
167
|
+
Requires Node.js 20.9+, Rust via `rustup`, and the `wasm32-unknown-unknown` target. `build:wasm` installs `wasm-pack` through Cargo if needed.
|
|
261
168
|
|
|
262
169
|
```sh
|
|
263
|
-
npm
|
|
170
|
+
npm ci
|
|
264
171
|
npm run build:wasm
|
|
265
|
-
npm run build
|
|
266
|
-
npm test
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
Start the local PLY/SPZ viewer with:
|
|
270
|
-
|
|
271
|
-
```sh
|
|
272
172
|
npm run dev
|
|
273
173
|
```
|
|
274
174
|
|
|
275
|
-
Open the
|
|
175
|
+
Open the URL printed by Vite (normally `http://localhost:8080/`) and drop a `.ply`, `.spz`, `.sog`, or `.rad` file into the viewer, choose a local file, or load one from an HTTP(S) URL. For split SOG, select or drop `meta.json` together with its `.webp` images; for split RAD, include the header and its `.radc` pages. Files are decoded locally. Choose **WebGL2 / WebGPU / WebGPU · WebGL2** in the viewer to compare backends; disable automatic stochastic mode to expose the **Force Splat depth** control.
|
|
276
176
|
|
|
277
|
-
|
|
177
|
+
See [Contributing](CONTRIBUTING.md#validation) for validation and release commands. `npm run build` emits ESM, CommonJS, TypeScript declarations, and source maps in `dist/`.
|
|
278
178
|
|
|
279
|
-
|
|
280
|
-
npm run build:watch
|
|
281
|
-
npm run check
|
|
282
|
-
npm run lint
|
|
283
|
-
npm run format
|
|
284
|
-
npm run release:check
|
|
285
|
-
```
|
|
179
|
+
## Acknowledgements
|
|
286
180
|
|
|
287
|
-
The
|
|
181
|
+
The overall architecture of Gaussian Splat Lite draws on [Spark](https://github.com/sparkjsdev/spark) and [SuperSplat](https://github.com/playcanvas/supersplat).
|
|
288
182
|
|
|
289
183
|
## License
|
|
290
184
|
|
|
291
|
-
|
|
185
|
+
Licensed under [Apache 2.0](LICENSE). See [NOTICE](NOTICE) and [third-party licenses](THIRD_PARTY_LICENSES.md) for attribution.
|