gaussian-splat-lite 1.2.2 → 1.3.0
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 +32 -2
- package/CONTRIBUTING.md +4 -2
- package/README.md +4 -3
- package/dist/gaussian-splat-lite.cjs +6379 -1441
- package/dist/gaussian-splat-lite.cjs.map +1 -1
- package/dist/gaussian-splat-lite.min.cjs +978 -11
- package/dist/gaussian-splat-lite.min.cjs.map +1 -1
- package/dist/gaussian-splat-lite.module.js +5920 -982
- package/dist/gaussian-splat-lite.module.js.map +1 -1
- package/dist/gaussian-splat-lite.module.min.js +7882 -3373
- package/dist/gaussian-splat-lite.module.min.js.map +1 -1
- package/dist/types/addons/NeuralDenoiseNode.d.cts +72 -0
- package/dist/types/addons/NeuralDenoiseNode.d.ts +72 -0
- package/dist/types/addons/NeuralDenoisePass.d.cts +34 -0
- package/dist/types/addons/NeuralDenoisePass.d.ts +34 -0
- package/dist/types/addons/TAANode.d.cts +46 -33
- package/dist/types/addons/TAANode.d.ts +46 -33
- package/dist/types/addons/TAAPass.d.cts +47 -32
- package/dist/types/addons/TAAPass.d.ts +47 -32
- package/dist/types/addons/neuralDenoiseGL.d.cts +25 -0
- package/dist/types/addons/neuralDenoiseGL.d.ts +25 -0
- package/dist/types/addons/neuralDenoiseGLSL.d.cts +8 -0
- package/dist/types/addons/neuralDenoiseGLSL.d.ts +8 -0
- package/dist/types/addons/neuralDenoisePasses.d.cts +26 -0
- package/dist/types/addons/neuralDenoisePasses.d.ts +26 -0
- package/dist/types/addons/neuralDenoiseShaders.d.cts +38 -0
- package/dist/types/addons/neuralDenoiseShaders.d.ts +38 -0
- package/dist/types/addons/neuralDenoiseWeights.d.cts +118 -0
- package/dist/types/addons/neuralDenoiseWeights.d.ts +118 -0
- package/dist/types/addons/stochasticCoverage.d.cts +14 -0
- package/dist/types/addons/stochasticCoverage.d.ts +14 -0
- package/dist/types/addons/taaShared.d.cts +58 -39
- package/dist/types/addons/taaShared.d.ts +58 -39
- package/dist/types/capture/SplatCapture.d.cts +54 -53
- package/dist/types/capture/SplatCapture.d.ts +54 -53
- package/dist/types/capture/WebGLCapture.d.cts +10 -10
- package/dist/types/capture/WebGLCapture.d.ts +10 -10
- package/dist/types/capture/WebGPUCapture.d.cts +14 -14
- package/dist/types/capture/WebGPUCapture.d.ts +14 -14
- package/dist/types/capture/pixels.d.cts +15 -4
- package/dist/types/capture/pixels.d.ts +15 -4
- package/dist/types/capture/rendererState.d.cts +5 -2
- package/dist/types/capture/rendererState.d.ts +5 -2
- package/dist/types/data/IndexedSplats.d.cts +76 -58
- package/dist/types/data/IndexedSplats.d.ts +76 -58
- package/dist/types/data/RadPagedSplats.d.cts +65 -61
- package/dist/types/data/RadPagedSplats.d.ts +65 -61
- package/dist/types/data/SogRegionSplats.d.cts +25 -19
- package/dist/types/data/SogRegionSplats.d.ts +25 -19
- package/dist/types/data/SplatOpacityTable.d.cts +29 -29
- package/dist/types/data/SplatOpacityTable.d.ts +29 -29
- package/dist/types/data/Splats.d.cts +99 -69
- package/dist/types/data/Splats.d.ts +99 -69
- package/dist/types/data/defines.d.cts +24 -24
- package/dist/types/data/defines.d.ts +24 -24
- package/dist/types/data/raycast.d.cts +13 -9
- package/dist/types/data/raycast.d.ts +13 -9
- package/dist/types/data/splatCodec.d.cts +29 -5
- package/dist/types/data/splatCodec.d.ts +29 -5
- package/dist/types/data/splatData.d.cts +18 -11
- package/dist/types/data/splatData.d.ts +18 -11
- package/dist/types/data/splatRange.d.cts +6 -2
- package/dist/types/data/splatRange.d.ts +6 -2
- package/dist/types/data/textureLayout.d.cts +9 -6
- package/dist/types/data/textureLayout.d.ts +9 -6
- package/dist/types/data/unpack.d.cts +16 -9
- package/dist/types/data/unpack.d.ts +16 -9
- package/dist/types/index.d.cts +65 -19
- package/dist/types/index.d.ts +65 -19
- package/dist/types/loaders/SplatLoader.d.cts +27 -14
- package/dist/types/loaders/SplatLoader.d.ts +27 -14
- package/dist/types/loaders/loadSplatData.d.cts +35 -17
- package/dist/types/loaders/loadSplatData.d.ts +35 -17
- package/dist/types/loaders/loadTypes.d.cts +46 -40
- package/dist/types/loaders/loadTypes.d.ts +46 -40
- package/dist/types/loaders/morton.d.cts +9 -3
- package/dist/types/loaders/morton.d.ts +9 -3
- package/dist/types/loaders/postDecode/builder.d.cts +222 -127
- package/dist/types/loaders/postDecode/builder.d.ts +222 -127
- package/dist/types/loaders/postDecode/compiler.d.cts +25 -11
- package/dist/types/loaders/postDecode/compiler.d.ts +25 -11
- package/dist/types/loaders/postDecode/operations.d.cts +22 -3
- package/dist/types/loaders/postDecode/operations.d.ts +22 -3
- package/dist/types/loaders/postDecode/optimizer.d.cts +5 -2
- package/dist/types/loaders/postDecode/optimizer.d.ts +5 -2
- package/dist/types/loaders/postDecode/program.d.cts +13 -6
- package/dist/types/loaders/postDecode/program.d.ts +13 -6
- package/dist/types/loaders/postDecode/protocol.d.cts +136 -111
- package/dist/types/loaders/postDecode/protocol.d.ts +136 -111
- package/dist/types/loaders/postDecode/registers.d.cts +12 -7
- package/dist/types/loaders/postDecode/registers.d.ts +12 -7
- package/dist/types/loaders/postDecode/runtime.d.cts +9 -2
- package/dist/types/loaders/postDecode/runtime.d.ts +9 -2
- package/dist/types/loaders/rad/RadSource.d.cts +81 -66
- package/dist/types/loaders/rad/RadSource.d.ts +81 -66
- package/dist/types/loaders/rad/radFormat.d.cts +41 -36
- package/dist/types/loaders/rad/radFormat.d.ts +41 -36
- package/dist/types/loaders/rad.d.cts +4 -4
- package/dist/types/loaders/rad.d.ts +4 -4
- package/dist/types/loaders/sog/SogSource.d.cts +14 -4
- package/dist/types/loaders/sog/SogSource.d.ts +14 -4
- package/dist/types/loaders/sog/sogZip.d.cts +12 -12
- package/dist/types/loaders/sog/sogZip.d.ts +12 -12
- package/dist/types/loaders/sog.d.cts +3 -3
- package/dist/types/loaders/sog.d.ts +3 -3
- package/dist/types/loaders/source.d.cts +43 -15
- package/dist/types/loaders/source.d.ts +43 -15
- package/dist/types/loaders/stream/StreamByteBudget.d.cts +4 -4
- package/dist/types/loaders/stream/StreamByteBudget.d.ts +4 -4
- package/dist/types/loaders/stream/StreamCameras.d.cts +27 -18
- package/dist/types/loaders/stream/StreamCameras.d.ts +27 -18
- package/dist/types/loaders/stream/StreamWorkerPool.d.cts +37 -34
- package/dist/types/loaders/stream/StreamWorkerPool.d.ts +37 -34
- package/dist/types/loaders/stream/rad-stream/RadSelectionState.d.cts +15 -11
- package/dist/types/loaders/stream/rad-stream/RadSelectionState.d.ts +15 -11
- package/dist/types/loaders/stream/rad-stream/RadStreamBatch.d.cts +13 -9
- package/dist/types/loaders/stream/rad-stream/RadStreamBatch.d.ts +13 -9
- package/dist/types/loaders/stream/rad-stream/RadStreamLoader.d.cts +64 -49
- package/dist/types/loaders/stream/rad-stream/RadStreamLoader.d.ts +64 -49
- package/dist/types/loaders/stream/rad-stream/RadStreamScheduler.d.cts +110 -102
- package/dist/types/loaders/stream/rad-stream/RadStreamScheduler.d.ts +110 -102
- package/dist/types/loaders/stream/rad-stream/RadStreamWorker.d.cts +3 -3
- package/dist/types/loaders/stream/rad-stream/RadStreamWorker.d.ts +3 -3
- package/dist/types/loaders/stream/rad-stream/prepareRadSelection.d.cts +27 -15
- package/dist/types/loaders/stream/rad-stream/prepareRadSelection.d.ts +27 -15
- package/dist/types/loaders/stream/rad-stream/radFade.d.cts +13 -8
- package/dist/types/loaders/stream/rad-stream/radFade.d.ts +13 -8
- package/dist/types/loaders/stream/rad-stream/radLod.d.cts +26 -26
- package/dist/types/loaders/stream/rad-stream/radLod.d.ts +26 -26
- package/dist/types/loaders/stream/rad-stream/worker.d.cts +3 -59
- package/dist/types/loaders/stream/rad-stream/worker.d.ts +3 -59
- package/dist/types/loaders/stream/rad-stream/workerHandlers.d.cts +85 -59
- package/dist/types/loaders/stream/rad-stream/workerHandlers.d.ts +85 -59
- package/dist/types/loaders/stream/sog-stream/SogStreamBatch.d.cts +17 -12
- package/dist/types/loaders/stream/sog-stream/SogStreamBatch.d.ts +17 -12
- package/dist/types/loaders/stream/sog-stream/SogStreamLoader.d.cts +56 -41
- package/dist/types/loaders/stream/sog-stream/SogStreamLoader.d.ts +56 -41
- package/dist/types/loaders/stream/sog-stream/SogStreamScheduler.d.cts +82 -81
- package/dist/types/loaders/stream/sog-stream/SogStreamScheduler.d.ts +82 -81
- package/dist/types/loaders/stream/sog-stream/SogStreamWorker.d.cts +3 -3
- package/dist/types/loaders/stream/sog-stream/SogStreamWorker.d.ts +3 -3
- package/dist/types/loaders/stream/sog-stream/sogLod.d.cts +59 -44
- package/dist/types/loaders/stream/sog-stream/sogLod.d.ts +59 -44
- package/dist/types/loaders/stream/sog-stream/sogVisibility.d.cts +30 -22
- package/dist/types/loaders/stream/sog-stream/sogVisibility.d.ts +30 -22
- package/dist/types/loaders/stream/sog-stream/worker.d.cts +7 -40
- package/dist/types/loaders/stream/sog-stream/worker.d.ts +7 -40
- package/dist/types/loaders/stream/sog-stream/workerHandlers.d.cts +69 -44
- package/dist/types/loaders/stream/sog-stream/workerHandlers.d.ts +69 -44
- package/dist/types/loaders/stream/streamOptions.d.cts +41 -32
- package/dist/types/loaders/stream/streamOptions.d.ts +41 -32
- package/dist/types/loaders/workerDecode.d.cts +30 -12
- package/dist/types/loaders/workerDecode.d.ts +30 -12
- package/dist/types/patches/threeR186.d.cts +3 -0
- package/dist/types/patches/threeR186.d.ts +3 -0
- package/dist/types/rendering/GaussianSplatRenderer.d.cts +393 -376
- package/dist/types/rendering/GaussianSplatRenderer.d.ts +393 -376
- package/dist/types/rendering/MaterialState.d.cts +9 -0
- package/dist/types/rendering/MaterialState.d.ts +9 -0
- package/dist/types/rendering/SortCenterCache.d.cts +17 -17
- package/dist/types/rendering/SortCenterCache.d.ts +17 -17
- package/dist/types/rendering/SplatAccumulator.d.cts +93 -77
- package/dist/types/rendering/SplatAccumulator.d.ts +93 -77
- package/dist/types/rendering/SplatGeometry.d.cts +2 -2
- package/dist/types/rendering/SplatGeometry.d.ts +2 -2
- package/dist/types/rendering/StochasticSplatMaterial.d.cts +14 -0
- package/dist/types/rendering/StochasticSplatMaterial.d.ts +14 -0
- package/dist/types/rendering/backend.d.cts +30 -18
- package/dist/types/rendering/backend.d.ts +30 -18
- package/dist/types/rendering/blueNoise.d.cts +1 -1
- package/dist/types/rendering/blueNoise.d.ts +1 -1
- package/dist/types/rendering/rendererUtils.d.cts +25 -10
- package/dist/types/rendering/rendererUtils.d.ts +25 -10
- package/dist/types/rendering/tsl/GenerateProgram.d.cts +19 -17
- package/dist/types/rendering/tsl/GenerateProgram.d.ts +19 -17
- package/dist/types/rendering/tsl/ProjectionProgram.d.cts +38 -33
- package/dist/types/rendering/tsl/ProjectionProgram.d.ts +38 -33
- package/dist/types/rendering/tsl/SplatBackend.d.cts +22 -10
- package/dist/types/rendering/tsl/SplatBackend.d.ts +22 -10
- package/dist/types/rendering/tsl/SplatMaterial.d.cts +38 -25
- package/dist/types/rendering/tsl/SplatMaterial.d.ts +38 -25
- package/dist/types/rendering/tsl/shaderUtils.d.cts +55 -17
- package/dist/types/rendering/tsl/shaderUtils.d.ts +55 -17
- package/dist/types/rendering/tsl/stochasticCoverage.d.cts +7 -0
- package/dist/types/rendering/tsl/stochasticCoverage.d.ts +7 -0
- package/dist/types/rendering/tsl/viewUniforms.d.cts +19 -9
- package/dist/types/rendering/tsl/viewUniforms.d.ts +19 -9
- package/dist/types/rendering/uniforms.d.cts +83 -83
- package/dist/types/rendering/uniforms.d.ts +83 -83
- package/dist/types/rendering/webgl/AccumulatorGenerator.d.cts +28 -12
- package/dist/types/rendering/webgl/AccumulatorGenerator.d.ts +28 -12
- package/dist/types/rendering/webgl/OrderingTexture.d.cts +10 -7
- package/dist/types/rendering/webgl/OrderingTexture.d.ts +10 -7
- package/dist/types/rendering/webgl/SplatBackend.d.cts +20 -15
- package/dist/types/rendering/webgl/SplatBackend.d.ts +20 -15
- package/dist/types/rendering/webgl/SplatMaterial.d.cts +9 -4
- package/dist/types/rendering/webgl/SplatMaterial.d.ts +9 -4
- package/dist/types/rendering/webgl/textureUtils.d.cts +10 -3
- package/dist/types/rendering/webgl/textureUtils.d.ts +10 -3
- package/dist/types/rendering/webgl-fallback/AccumulatorGenerator.d.cts +8 -10
- package/dist/types/rendering/webgl-fallback/AccumulatorGenerator.d.ts +8 -10
- package/dist/types/rendering/webgl-fallback/SplatBackend.d.cts +18 -14
- package/dist/types/rendering/webgl-fallback/SplatBackend.d.ts +18 -14
- package/dist/types/rendering/webgpu/ProjectedSplats.d.cts +76 -66
- package/dist/types/rendering/webgpu/ProjectedSplats.d.ts +76 -66
- package/dist/types/rendering/webgpu/ProjectionCache.d.cts +43 -28
- package/dist/types/rendering/webgpu/ProjectionCache.d.ts +43 -28
- package/dist/types/rendering/webgpu/ProjectionKernel.d.cts +22 -0
- package/dist/types/rendering/webgpu/ProjectionKernel.d.ts +22 -0
- package/dist/types/rendering/webgpu/RadixSort.d.cts +44 -40
- package/dist/types/rendering/webgpu/RadixSort.d.ts +44 -40
- package/dist/types/rendering/webgpu/SplatBackend.d.cts +14 -12
- package/dist/types/rendering/webgpu/SplatBackend.d.ts +14 -12
- package/dist/types/runtime/SplatWorker.d.cts +17 -13
- package/dist/types/runtime/SplatWorker.d.ts +17 -13
- package/dist/types/runtime/WorkerRpc.d.cts +26 -20
- package/dist/types/runtime/WorkerRpc.d.ts +26 -20
- package/dist/types/runtime/abort.d.cts +10 -5
- package/dist/types/runtime/abort.d.ts +10 -5
- package/dist/types/runtime/retry.d.cts +6 -6
- package/dist/types/runtime/retry.d.ts +6 -6
- package/dist/types/runtime/wasmCall.d.cts +3 -3
- package/dist/types/runtime/wasmCall.d.ts +3 -3
- package/dist/types/runtime/worker.d.cts +44 -24
- package/dist/types/runtime/worker.d.ts +44 -24
- package/dist/types/runtime/workerServer.d.cts +3 -1
- package/dist/types/runtime/workerServer.d.ts +3 -1
- package/dist/types/scene/SplatEdit.d.cts +74 -67
- package/dist/types/scene/SplatEdit.d.ts +74 -67
- package/dist/types/scene/SplatMesh.d.cts +92 -70
- package/dist/types/scene/SplatMesh.d.ts +92 -70
- package/dist/types/utils/index.d.cts +15 -7
- package/dist/types/utils/index.d.ts +15 -7
- package/dist/types/utils/three.d.cts +3 -3
- package/dist/types/utils/three.d.ts +3 -3
- package/dist/types/utils/transforms.d.cts +10 -3
- package/dist/types/utils/transforms.d.ts +10 -3
- package/docs/GaussianSplatRenderer.md +3 -1
- package/docs/NeuralDenoiseNode.md +148 -0
- package/docs/SplatMesh.md +1 -1
- package/docs/StochasticRendering.md +36 -10
- package/docs/TAAPass.md +20 -3
- package/package.json +9 -11
- package/dist/types/capture/sceneView.d.cts +0 -3
- package/dist/types/capture/sceneView.d.ts +0 -3
- package/dist/types/rendering/tsl/tslCompat.d.cts +0 -68
- package/dist/types/rendering/tsl/tslCompat.d.ts +0 -68
- package/docs/Architecture.md +0 -200
package/docs/Architecture.md
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
# Architecture
|
|
2
|
-
|
|
3
|
-
[Back to documentation](../README.md#documentation)
|
|
4
|
-
|
|
5
|
-
This guide is for contributors. It describes internal module boundaries, backend differences, and resource lifetimes. To use the library, start from the [README](../README.md#quick-start) and the API pages it lists; those pages describe behavior, and this one explains how it is implemented.
|
|
6
|
-
|
|
7
|
-
[`src/index.ts`](../src/index.ts) defines the public exports. Applications use `SplatMesh` for models and one `GaussianSplatRenderer` for the scene.
|
|
8
|
-
|
|
9
|
-
## Source layout
|
|
10
|
-
|
|
11
|
-
| Directory | Responsibility |
|
|
12
|
-
| --- | --- |
|
|
13
|
-
| `src/data/` | Packed Splat data, codecs, texture layouts, and CPU reads |
|
|
14
|
-
| `src/scene/` | Scene objects, transforms, raycasting, and SDF edits |
|
|
15
|
-
| `src/loaders/` | File loading, decode requests, and load-time transforms |
|
|
16
|
-
| `src/loaders/postDecode/` | Expression building, compilation, register allocation, and execution |
|
|
17
|
-
| `src/loaders/rad/` | RAD source reads and container types |
|
|
18
|
-
| `src/loaders/sog/` | SOG source reads and ZIP access |
|
|
19
|
-
| `src/loaders/stream/` | Shared worker pools, budgets, options, and statistics |
|
|
20
|
-
| `src/loaders/stream/rad-stream/` | RAD loading, tree selection, fades, and page pools |
|
|
21
|
-
| `src/loaders/stream/sog-stream/` | SOG loading, visibility, chunk caches, and regions |
|
|
22
|
-
| `rust/gaussian-splat-lib/src/` | Platform-independent decoders and packed codecs |
|
|
23
|
-
| `rust/gaussian-splat-rs/src/` | WASM bridges, typed-array output, LOD selection, sorting, and raycasting |
|
|
24
|
-
| `src/runtime/` | Worker RPC, pooling, transferables, and WASM initialization |
|
|
25
|
-
| `src/utils/` | Numeric conversion, spatial transforms, and Three.js helpers |
|
|
26
|
-
| `src/rendering/` | Shared updates, sorting handoffs, backend selection, and stochastic blue noise |
|
|
27
|
-
| `src/rendering/tsl/` | Shared TSL generation, projection, drawing, and view uniforms |
|
|
28
|
-
| `src/rendering/webgpu/` | Compute projection, projected caches, GPU sorting, and indirect drawing |
|
|
29
|
-
| `src/rendering/webgl/` | GLSL materials, texture generation, and CPU ordering uploads |
|
|
30
|
-
| `src/rendering/webgl-fallback/` | WebGPURenderer WebGL2 raster generation and ordering uploads |
|
|
31
|
-
| `src/capture/` | Optional offscreen targets, readback, cube captures, and PMREM filtering |
|
|
32
|
-
| `src/addons/` | Temporal anti-aliasing: `TAAPass` for WebGLRenderer, `TAANode` for WebGPURenderer, and their shared state |
|
|
33
|
-
|
|
34
|
-
## Rendering boundaries
|
|
35
|
-
|
|
36
|
-
The renderer combines visible models using Three.js transforms, visibility, and layers. Initialize `WebGPURenderer` before creating `GaussianSplatRenderer`: the renderer type selects the material API, while its actual backend selects compute/storage or raster/textures.
|
|
37
|
-
|
|
38
|
-
| Owner | Responsibility |
|
|
39
|
-
| --- | --- |
|
|
40
|
-
| `GaussianSplatRenderer` | Scene updates, accumulator handoff, and sorting |
|
|
41
|
-
| `SplatCapture` | Independent capture Splat state, offscreen targets, readback, and PMREM |
|
|
42
|
-
| `SplatAccumulator` | Scene mappings, versions, camera-relative origin, and WebGL texture generation |
|
|
43
|
-
| WebGPU backend | Compute projection, caches, GPU sorting, and indirect drawing |
|
|
44
|
-
| WebGL backend | GLSL materials, ordering textures, and texture generation |
|
|
45
|
-
| WebGL fallback backend | Raster generation and CPU-sorted ordering textures |
|
|
46
|
-
| Shared TSL code | Generation and projection math, materials, and color conversion |
|
|
47
|
-
|
|
48
|
-
For sorted rendering, native WebGPU keeps ordering and visible counts on the GPU and sorts before drawing; its accumulator carries mappings and edit metadata without generating combined textures. Both WebGL backends use asynchronous Worker/WASM sorting and retain the previous display until a matching order is ready.
|
|
49
|
-
|
|
50
|
-
In `webgpu/`, `ProjectedSplats.ts` coordinates projection and sorting, `ProjectionCache.ts` owns projected storage, and `RadixSort.ts` owns sort passes. WebXR uses the eyes' mean pose for generation and sorting, with separate projections for each eye. Both WebGL backends share `webgl/OrderingTexture.ts` for allocation and disposal, while keeping their own upload and binding paths.
|
|
51
|
-
|
|
52
|
-
`backend.ts` selects the backend from the renderer type and its public `coordinateSystem`, which distinguishes native WebGPU from WebGL fallback. It chooses the blend space for each output: the working color space by default, `renderer.outputColorSpace` when WebGLRenderer draws to the canvas, and the target texture's color space when it draws to an XR-style target.
|
|
53
|
-
|
|
54
|
-
Projected Splat support is capped at the viewport's short side, in projection space scaled by `focalAdjustment`, in both the TSL projection program and the GLSL vertex shader. The quad and its UV extent shrink by the same ratio, preserving the Gaussian profile.
|
|
55
|
-
|
|
56
|
-
A kernel still above `minAlpha` where its support ends is faded there instead of cut off. The fragment stage rescales it about its peak, `(alpha + fade) * kernel - fade`, so it reaches `minAlpha` at the support edge. The quad is never enlarged.
|
|
57
|
-
|
|
58
|
-
- **Gaussians.** Only `maxStdDev` can end a Gaussian early, so its fade follows from its alpha and the per-draw `edgeFade` uniform, a scale and offset derived from `maxStdDev` and `minAlpha`. It needs no per-Splat data, and a Gaussian that `minAlpha` already ends is drawn exactly as before.
|
|
59
|
-
- **Wide kernels.** The edge value depends on the kernel power, so the projection computes the fade and stores it as a half in the low 16 bits of the squared support radius. That radius is first rounded down to its high 16 bits, at most 0.6% of the radius, which keeps the fragment stage's radius test exact. The squared radius therefore passes to the fragment stage bit for bit, and native WebGPU caches it in place of the radius.
|
|
60
|
-
|
|
61
|
-
Errors from automatic updates are caught and logged once per message; a draw whose preparation fails is skipped. Explicit `update()` calls rethrow to the caller. `frameCallbacks` is an internal flag for a second renderer on the same scene, so each `SplatMesh.onFrame` runs once per frame.
|
|
62
|
-
|
|
63
|
-
Resource rules:
|
|
64
|
-
|
|
65
|
-
- Wait for outstanding GPU compilation before disposing the sorter; preserve compute nodes when resizing resources or changing source meshes.
|
|
66
|
-
- Keep color conversion and XR output handling with the backend that owns them.
|
|
67
|
-
|
|
68
|
-
### Stochastic rendering
|
|
69
|
-
|
|
70
|
-
Sorted and stochastic draws compile separate shaders without mode branches. A mode change takes effect at the next update boundary, after the current draw; both WebGL backends also wait for the matching accumulator and sort, and `stochasticActive` reports the mode being drawn. Stochastic draws use the opaque list with depth testing and writing.
|
|
71
|
-
|
|
72
|
-
Coverage uses a tileable 32-frame spatiotemporal blue-noise atlas (`blueNoise.ts`, generated by `scripts/generate-blue-noise.js`) on all backends. Each Splat keeps its own spatial offset and temporal phase, so consecutive samples follow the atlas's time axis instead of choosing unrelated offsets. The temporal sequence is optimized for exponential history accumulation and wraps after 32 samples. `stochasticSample` advances once per scene render, and every view in that render shares it.
|
|
73
|
-
|
|
74
|
-
Seeds exist only for stochastic draws: WebGL accumulators omit the seed layer in sorted rendering, and native WebGPU allocates its seed buffer on demand. Front-to-back stochastic ordering uses 16-bit keys. With unsorted stochastic rendering, `shrinkResources()` releases the sort worker and ordering.
|
|
75
|
-
|
|
76
|
-
## Capture boundaries
|
|
77
|
-
|
|
78
|
-
[SplatCapture](SplatCapture.md) is optional; the core renderer allocates no capture resources.
|
|
79
|
-
|
|
80
|
-
- **Independent Splat state.** The helper owns an internal `GaussianSplatRenderer` with `autoUpdate` and stochastic rendering off, sharing the display renderer's timer, loaded Splat data, and model-owned SDF edit textures. Its accumulators, sorting, and projection resources are separate, so display ordering and camera state are untouched. Global and model-local edits apply to captures and follow their latest values. `frameCallbacks` is off, leaving `onFrame` to the display renderer.
|
|
81
|
-
- **Stencil captures.** 2D and cube targets follow the Three.js renderer's stencil setting, with no separate capture option; a 2D target without a depth buffer gets no stencil, since Three.js attaches stencil only with depth. The intermediate target uses a depth-stencil attachment when stencil is enabled. With stencil, native depth is 32-bit float only for a reversed depth buffer or a float output depth texture, and only when the device has `depth32float-stencil8`; otherwise it is 24-bit. The scene's stencil masking applies before copying its color and depth to the output.
|
|
82
|
-
- **Options.** Quality, sorting, and material options are copied from the supplied renderer at the start of each capture. The active Splat material's stencil comparison and write settings are copied as well. Cube captures force radial sorting. The internal renderer takes the capture camera's layer mask.
|
|
83
|
-
- **Two phases.** Preparation awaits `update()` on a filtered scene view (`sceneView.ts`), which excludes hidden models from traversal without changing visibility and collects edits with the original scene's visibility. If the display updates shared models during a pending sort, preparation runs again; appearance-only changes reuse the ordering. The draw is synchronous: other Splat renderers' layer masks are cleared, `hideObjects` are hidden, and the internal renderer joins the scene. `withCaptureState()` saves and restores the render target, cube face, mip level, XR setting, automatic clearing, and MRT. Nothing stays changed across an `await`, and everything is restored when drawing throws.
|
|
84
|
-
- **Ordering.** Captures on one helper are queued and run in call order. The camera or `worldCenter` is copied when the call is made. `renderReadTarget()` and `renderEnvMap()` read or filter inside the same queued task, before a later capture can redraw the target.
|
|
85
|
-
- **Cube captures.** Splat data is prepared at `worldCenter` with a 90° camera, then six faces render with automatic updates off. Both WebGL backends share one radial CPU sort across the faces; native WebGPU projects, compacts, and sorts for each face while drawing. Every capture runs `update()`, whose version checks reuse valid data and ordering, so 1.1.8's `update` option is not offered. Mipmaps are generated after the sixth face. Filtered and unfiltered cubes use separate targets, reallocated when size, clipping planes, or the renderer's stencil setting change.
|
|
86
|
-
- **Color.** `WebGLCapture` renders into an intermediate flagged as an XR-style target, 8-bit unless the output is float, so materials convert to the output color space before blending as on the canvas; a full-screen pass then converts to the target's storage space and copies depth. `WebGPUCapture` renders in the working color space, then applies the renderer's output transform and converts to storage space. On both, float outputs keep their type so values stay unclamped, and the intermediate takes the output's sample count, so multisampling applies to the scene and not to the final pass.
|
|
87
|
-
- **Readback.** `pixels.ts` returns packed RGBA8 with the bottom row first on every backend, removing native WebGPU's 256-byte row padding and flipping its top-left origin. Supersampled targets are box-filtered on the CPU. Cube faces are normalized to the WebGL cube render target layout: native WebGPU stores +X and −X swapped and reads each face rotated 180°.
|
|
88
|
-
- **Ownership.** `dispose()` releases the internal renderer, 2D and cube targets, readback buffers, and the PMREM generator. Each texture from `renderEnvMap()` belongs to the caller; disposing it also releases its PMREM render target.
|
|
89
|
-
|
|
90
|
-
## Temporal anti-aliasing boundaries
|
|
91
|
-
|
|
92
|
-
[TAAPass and TAANode](TAAPass.md) are derived from Three.js TRAA, without a velocity attachment: reprojection uses scene depth and camera motion only, so object motion is not tracked.
|
|
93
|
-
|
|
94
|
-
- `taaShared.ts` owns the state both share: a 32-entry Halton(2, 3) jitter sequence, jittered and unjittered projections, previous-frame matrices, the history index, sizing, and reset. It supports custom projections, scaled rigs, reversed depth, and logarithmic depth.
|
|
95
|
-
- Each implementation captures the scene itself into a half-float target with a depth texture and resolves between two history targets, with no history copies. The resolve applies depth rejection away from edges, neighborhood clipping, and luminance-aware blending.
|
|
96
|
-
- The capture target takes a stencil buffer when the Three.js renderer has one; the history targets never do, since the resolve writes only color and depth. Depth stays 32-bit float, except in `TAANode` on the WebGL2 fallback or on a device without `depth32float-stencil8`, where it is 24-bit.
|
|
97
|
-
- The camera's projection is jittered only during capture. Native Splat projection reads the unjittered matrix through `getTAAProjection()`, so projection and sorting results are reused while only the jitter changes.
|
|
98
|
-
- `TAAPass` flags its capture target as an XR-style target, so Three.js converts materials to `renderer.outputColorSpace` before blending, matching canvas blending. Tone mapping is disabled during capture. The final copy decodes the sRGB transfer into the composer's working-space buffer, the inverse of `OutputPass`, so the two round-trip at any alpha; as the last pass it presents the output-space image unchanged. An output color space change resets history.
|
|
99
|
-
- `TAANode` is a TSL node updated once per render. It captures and accumulates in `ColorManagement.workingColorSpace`, leaving tone mapping and output conversion to `RenderPipeline`. A working color space change resets history.
|
|
100
|
-
|
|
101
|
-
## Decoder boundaries
|
|
102
|
-
|
|
103
|
-
PLY, SPZ, SOG, and RAD decode in `gaussian-splat-lib` and publish through `SplatReceiver`. This core library has no JavaScript or WASM dependency. `gaussian-splat-rs` adapts browser inputs and writes the output into JS typed arrays through `SplatsData`.
|
|
104
|
-
|
|
105
|
-
- PLY/SPZ consume byte streams through `ChunkReceiver`.
|
|
106
|
-
- SOG decodes property-image groups into bounded batches. Metadata, ZIP validation, images, and SH palettes belong to the core decoder; `SogDecodeSession` bridges that API to JavaScript.
|
|
107
|
-
- RAD retains dataset codebooks between page requests and returns packed records with separate tree metadata.
|
|
108
|
-
|
|
109
|
-
[`loadSplatData`](../src/loaders/loadSplatData.ts) coordinates decoding, resolvers, cancellation, progress, and loading-manager callbacks, returning packed `SplatResult` data without importing scene classes. `Splats` uses it for initialization; `SplatLoader` adapts it to the Three.js loader API. Completion callbacks run before the loading manager ends the item.
|
|
110
|
-
|
|
111
|
-
`RadSource` and `SogSource` share reads, request settings, and cancellation through `loaders/source.ts`. Companion-file resolvers run on the calling thread, and caller-owned buffers are copied before transfer. See [SplatLoader](SplatLoader.md) for the public loading API.
|
|
112
|
-
|
|
113
|
-
## Post-decode boundaries
|
|
114
|
-
|
|
115
|
-
The [postDecode](PostDecode.md) API builds expressions on the calling thread and executes them in decode workers:
|
|
116
|
-
|
|
117
|
-
| Module | Responsibility |
|
|
118
|
-
| --- | --- |
|
|
119
|
-
| `program.ts` / `builder.ts` | Public API, program identity, typed expressions, and patch validation |
|
|
120
|
-
| `protocol.ts` | Opcodes, packed layouts, and shared types without builder or runtime dependencies |
|
|
121
|
-
| `optimizer.ts` | Fusion of single-use arithmetic intermediates before compilation |
|
|
122
|
-
| `compiler.ts` | Conditional flow, dependencies, packed instructions, and attribute snapshots |
|
|
123
|
-
| `registers.ts` | Runtime register allocation and values carried between condition stages |
|
|
124
|
-
| `operations.ts` / `runtime.ts` | Packed input reads, block execution, conditions, and output writes |
|
|
125
|
-
|
|
126
|
-
Decode workers import runtime and protocol modules directly, keeping expression construction and compilation outside their dependency graph.
|
|
127
|
-
|
|
128
|
-
## Shared streaming boundaries
|
|
129
|
-
|
|
130
|
-
Loaders own transport and parsing; schedulers own selection, fades, publication, and retirement.
|
|
131
|
-
|
|
132
|
-
- `StreamWorkerPool.run()` queues worker leases, assigns task IDs, links cancellation, counts downloads, and balances loading-manager notifications. Each loader has its own pool; format-specific callbacks retain SOG caches or release RAD decoder slots.
|
|
133
|
-
- `IndexedSplats` shares texture storage and selected-index reads between `RadPagedSplats` and `SogRegionSplats`. Slot assignment and scene attachment remain with the format-specific scheduler and batch classes.
|
|
134
|
-
- `StreamCameras.ts` owns the registered cameras and their resolutions, and expands a WebXR `ArrayCamera` into its eye views once they have a projection and viewport.
|
|
135
|
-
- `streamOptions.ts` owns shared defaults, validation, retry classification, and statistics. `StreamByteBudget` bounds pending copies separately from active loads; ready data has no per-update byte allowance.
|
|
136
|
-
|
|
137
|
-
`splatBudget` controls selected detail, not total memory. Resident-byte estimates exclude pending copies and WASM memory, which are reported separately; resident storage has no byte cap. Pending copies allow 8 MiB per concurrent load (32 MiB by default), enlarged for an indivisible RAD page; one oversized item can proceed alone. This bounds the waiting queue, not the bytes published or uploaded per frame.
|
|
138
|
-
|
|
139
|
-
Applications must keep calling `update()` while waiting for `firstRenderable` and while loading, fades, retries, or retirement need to advance. `onChange` requests redraws; it does not drive scheduler updates. Schedulers update ordinary camera matrices, but read a WebXR camera's eye matrices directly and select detail for each eye. Streaming updates before rendering may use the previous frame's XR pose.
|
|
140
|
-
|
|
141
|
-
## Streamed SOG boundaries
|
|
142
|
-
|
|
143
|
-
[SogStreamScheduler](SogStreamScheduler.md) loads `lod-meta.json` scenes. Ordinary `.sog` files and `meta.json` use the regular model loader.
|
|
144
|
-
|
|
145
|
-
- `sogLod.ts` parses manifests and selects LOD targets using `splatBudget`. `SogVisibility` keeps the spatial tree and distance-based priorities in the LOD worker.
|
|
146
|
-
- `SogStreamLoader` owns the LOD worker, decoding pool, and cached chunk sources.
|
|
147
|
-
- `SogStreamBatch` owns occupied slots and mesh attachment; `SogRegionSplats` owns indexed region data.
|
|
148
|
-
- `SogStreamScheduler` owns per-region targets, pending extractions, current/outgoing regions, fades, and retirement. It reuses cached detail and refines large gaps gradually. Each region finishes its current crossfade before admitting another LOD.
|
|
149
|
-
|
|
150
|
-
SOG retains resources per chunk and region:
|
|
151
|
-
|
|
152
|
-
| State | Owned resources and release point |
|
|
153
|
-
| --- | --- |
|
|
154
|
-
| Chunk load | Abort controller and loading slot remain until the request settles; successful decoding retains a worker cache handle |
|
|
155
|
-
| Cached chunk | Decoded worker data and its worker lease remain while wanted, loading, or needed by visible/fading regions or pending extractions; otherwise they release after `cooldownMs` milliseconds |
|
|
156
|
-
| Pending extraction | Target range, chunk reference, and reserved bytes remain until extraction settles; stale results are discarded |
|
|
157
|
-
| Ready region | Copied records and pending bytes remain until upload writes them into a batch slot or a target change discards them |
|
|
158
|
-
| Current region | Batch slot and opacity state remain while visible or fading; a hidden region releases after cooldown once no outgoing region remains |
|
|
159
|
-
| Outgoing region | Previous LOD slot remains until its fade-out finishes, then releases immediately |
|
|
160
|
-
| Batch storage | A chunk's shared mesh and source storage remain while any region slots are occupied; releasing the last slot disposes both |
|
|
161
|
-
|
|
162
|
-
Pending extractions keep their chunk cache referenced, even if the target changes before the reply arrives. Replies are accepted only while the scheduler is alive and the pending region still matches the target. Disposal stops workers, releases chunk caches and region slots, and clears pending state.
|
|
163
|
-
|
|
164
|
-
## RAD boundaries
|
|
165
|
-
|
|
166
|
-
[RadStreamScheduler](RadStreamScheduler.md) loads RAD scenes with a LOD tree. Ordinary RAD loading validates the full tree and extracts leaves before applying `postDecode`.
|
|
167
|
-
|
|
168
|
-
- `RadSource` owns bounded reads, HTTP Range consistency, companion-page resolution, and cancellation.
|
|
169
|
-
- `RadStreamLoader` owns a dedicated LOD worker and a bounded decoding pool. Packed geometry transfers to the calling thread; tree arrays transfer to the LOD worker. Decoder slots release after decoding, while pending-byte reservations remain until tree registration and publication can complete.
|
|
170
|
-
- `rad_lod.rs` selects a camera-dependent tree cut using file-global node indices. Children replace parents only as complete groups. `radFade.ts` compares selections and prepares transitions in the LOD worker.
|
|
171
|
-
- The LOD worker retains each chunk's inverse Morton order and block bounds until chunk release. `prepareRadSelection.ts` builds render indices and merges current/post-fade bounds together; publication and fade completion switch indices and bounds together on the calling thread.
|
|
172
|
-
- `RadStreamScheduler` owns page requests, slot occupancy, publication, fades, retries, and retirement. `RadPagedSplats` and `RadStreamBatch` own page storage and selected-index data. Shared nodes render once, and at most two selections overlap during a fade.
|
|
173
|
-
|
|
174
|
-
The scheduler retains resources through these stages:
|
|
175
|
-
|
|
176
|
-
| State | Owned resources and release point |
|
|
177
|
-
| --- | --- |
|
|
178
|
-
| Page load | Abort controller, phase, and reserved bytes remain until the load settles, including after cancellation |
|
|
179
|
-
| Decoded page | Packed buffers and an optional reserved pool slot remain until writing creates resident storage and drops the buffers |
|
|
180
|
-
| Resident page | Pool and slot remain allocated until retirement clears both the page allocation and slot entry |
|
|
181
|
-
| Traversal | Snapshot page pins, previous cut, and requested budget remain until traversal settles |
|
|
182
|
-
| Ready cut | Selection and page pins are consumed on publication or released on invalidation |
|
|
183
|
-
| Preparation | Pool snapshots, page pins, and pending bytes remain until the result is consumed or discarded; cancellation prevents publication |
|
|
184
|
-
| Displayed cut | Selection, protected pages, and fade state are replaced together on publication or cleared when hidden |
|
|
185
|
-
|
|
186
|
-
Page pins prevent retirement while traversal, preparation, or display still needs the data. They do not renew cooldowns. Unused pages retire during cleanup after fade-out and `cooldownMs` milliseconds; empty pools release their storage. Root and traversal ancestors remain available for coarsening. Decode generations prevent stale cancellation from releasing replacement pages.
|
|
187
|
-
|
|
188
|
-
Budget changes invalidate pending selections while preserving the displayed cut. Hiding clears the displayed cut and wanted pages. Disposal terminates workers before dropping their snapshots and page pools.
|
|
189
|
-
|
|
190
|
-
Both schedulers defer expired-cache retirement while a new LOD decision is pending, preserving the original expiry times. Each accepted decision updates wanted data before cleanup, allowing cache reuse after an update pause and regular retirement during continuous camera movement. SOG also protects newly selected regions before their opacity recovers. Hidden scenes can continue cleanup without waiting for a new selection; existing resource pins still apply.
|
|
191
|
-
|
|
192
|
-
`SplatOpacityTable` separates source-block group IDs from opacity coefficients. SOG regions fade independently; RAD uses stable, incoming, and outgoing groups. Fade ticks change coefficients without rewriting source records or picking opacity.
|
|
193
|
-
|
|
194
|
-
## Imports and extensions
|
|
195
|
-
|
|
196
|
-
- Applications import from `gaussian-splat-lite`, including `utils` and `defines`; source paths are internal.
|
|
197
|
-
- Internal modules import helpers from their owner. `utils/index.ts` is the public entry point.
|
|
198
|
-
- Keep scene updates and sorting handoffs in shared rendering code, with backend-specific storage and output handling in each backend.
|
|
199
|
-
- Keep options and types beside their owner. Shared uniform defaults must not import backends; native projected-cache layouts belong in `webgpu/`, separately from packed source layouts in `data/`.
|
|
200
|
-
- Keep numeric codecs separate from Three.js object unpacking so decode workers avoid scene dependencies.
|