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
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# NeuralDenoiseNode and NeuralDenoisePass (Experimental)
|
|
2
|
+
|
|
3
|
+
[Back to documentation](../README.md#documentation)
|
|
4
|
+
|
|
5
|
+
The experimental neural denoiser smooths [stochastic rendering](StochasticRendering.md). Use `NeuralDenoiseNode` with `WebGPURenderer`, including its WebGL2 fallback, or `NeuralDenoisePass` with `WebGLRenderer`. The trained models are included; no extra downloads are needed.
|
|
6
|
+
|
|
7
|
+
## Choose between TAA and neural denoising
|
|
8
|
+
|
|
9
|
+
| | `TAANode` / `TAAPass` | `NeuralDenoiseNode` / `NeuralDenoisePass` |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| Moving objects | May leave a faint trail | Helps reduce trails; moving detail can still look soft or grainy |
|
|
12
|
+
| Camera movement | Some grain returns | Smooths noise during movement; fast turns can look softer |
|
|
13
|
+
| Cost | Lower | Depends on mode; Quality uses more GPU time and memory |
|
|
14
|
+
|
|
15
|
+
With neural denoising, newly exposed backgrounds need time to settle. Results vary by scene and motion.
|
|
16
|
+
|
|
17
|
+
## Choose a mode
|
|
18
|
+
|
|
19
|
+
The third constructor argument, `mode`, selects the balance of image quality and cost. Start with the default, then compare detail, noise and flicker in your scenes.
|
|
20
|
+
|
|
21
|
+
| Mode | What you get |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| `"quality"` (default) | Prioritizes noise suppression and detail retention, with higher GPU and memory use |
|
|
24
|
+
| `"performance"` | Prioritizes lower GPU and memory use |
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
const denoise = new NeuralDenoiseNode(scene, camera, "performance");
|
|
28
|
+
// NeuralDenoisePass accepts the same arguments.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
To change modes, dispose the node or pass and create another.
|
|
32
|
+
|
|
33
|
+
For existing code, replace `"profile2"` with `"quality"`, `profile` with `mode`, and `NeuralDenoiseProfile` with `NeuralDenoiseMode`. `"profile1"` is no longer supported.
|
|
34
|
+
|
|
35
|
+
## MSAA
|
|
36
|
+
|
|
37
|
+
The fourth constructor argument, `msaa`, enables or disables 4× MSAA in either mode:
|
|
38
|
+
|
|
39
|
+
| MSAA | What you get |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `false` (default) | Lower GPU and memory use |
|
|
42
|
+
| `true` | Less noise during motion, with higher GPU and memory use |
|
|
43
|
+
|
|
44
|
+
For example, `new NeuralDenoiseNode(scene, camera, "performance", true)` enables MSAA. `NeuralDenoisePass` accepts the same arguments. To change MSAA, dispose the node or pass and create another.
|
|
45
|
+
|
|
46
|
+
With MSAA off, stabilization is stronger to reduce flicker, which can add some trailing or softness during motion.
|
|
47
|
+
|
|
48
|
+
## Before you start
|
|
49
|
+
|
|
50
|
+
- **WebGL2 requirements.** Both WebGL2 paths require `EXT_color_buffer_float`. MSAA also requires `OES_sample_variables`; check `renderer.getContext().getExtension("OES_sample_variables")` before enabling MSAA. If it is unavailable, leave MSAA disabled. Unsupported configurations throw an error.
|
|
51
|
+
- **One camera.** Use a `PerspectiveCamera` or `OrthographicCamera`. WebXR is not supported.
|
|
52
|
+
- **Stencil masks.** Create the Three.js renderer with `stencil: true` to use them.
|
|
53
|
+
- **Reset after a jump.** Call `denoise.reset()` after a camera cut or scene replacement. Resizing resets automatically; normal object movement needs no reset.
|
|
54
|
+
- **On-demand rendering.** Keep rendering after each change so the image can settle.
|
|
55
|
+
|
|
56
|
+
## WebGPURenderer: NeuralDenoiseNode
|
|
57
|
+
|
|
58
|
+
After `await renderer.init()`, with an existing `renderer`, `scene`, `camera`, and `splatRenderer`:
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
import { NeuralDenoiseNode } from "gaussian-splat-lite";
|
|
62
|
+
import { RenderPipeline } from "three/webgpu";
|
|
63
|
+
|
|
64
|
+
splatRenderer.stochastic = true;
|
|
65
|
+
|
|
66
|
+
const denoise = new NeuralDenoiseNode(scene, camera);
|
|
67
|
+
const pipeline = new RenderPipeline(renderer, denoise);
|
|
68
|
+
|
|
69
|
+
renderer.setAnimationLoop(() => {
|
|
70
|
+
// Update controls / animation here.
|
|
71
|
+
pipeline.render();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
// On a camera cut or scene replacement: denoise.reset().
|
|
75
|
+
// On cleanup: stop the animation loop, then dispose the pipeline and denoise.
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
The node renders the scene and follows the renderer's size automatically.
|
|
79
|
+
|
|
80
|
+
Chain effects from the node or from `denoise.getTextureNode()`. For Bloom, create the pipeline like this instead:
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
import { bloom } from "three/addons/tsl/display/BloomNode.js";
|
|
84
|
+
|
|
85
|
+
const color = denoise.getTextureNode();
|
|
86
|
+
const pipeline = new RenderPipeline(renderer, color.add(bloom(color, 0.6, 0.4, 0.8)));
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## WebGLRenderer: NeuralDenoisePass
|
|
90
|
+
|
|
91
|
+
Use the pass in place of `RenderPass` or `TAAPass`:
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
import { NeuralDenoisePass } from "gaussian-splat-lite";
|
|
95
|
+
import { EffectComposer } from "three/addons/postprocessing/EffectComposer.js";
|
|
96
|
+
import { OutputPass } from "three/addons/postprocessing/OutputPass.js";
|
|
97
|
+
|
|
98
|
+
splatRenderer.stochastic = true;
|
|
99
|
+
|
|
100
|
+
const denoise = new NeuralDenoisePass(scene, camera);
|
|
101
|
+
const composer = new EffectComposer(renderer);
|
|
102
|
+
composer.addPass(denoise);
|
|
103
|
+
// Insert Bloom or other effects here.
|
|
104
|
+
composer.addPass(new OutputPass());
|
|
105
|
+
|
|
106
|
+
renderer.setAnimationLoop(() => {
|
|
107
|
+
// Update controls / animation here.
|
|
108
|
+
composer.render();
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// On resize: update the renderer size and camera projection,
|
|
112
|
+
// then call composer.setSize(width, height) in CSS pixels.
|
|
113
|
+
// On a camera cut or scene replacement: denoise.reset().
|
|
114
|
+
// On cleanup: stop the animation loop, then dispose the composer and each pass.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Color
|
|
118
|
+
|
|
119
|
+
`RenderPipeline`, or the composer's `OutputPass`, applies tone mapping and the output color space at the end.
|
|
120
|
+
|
|
121
|
+
With `NeuralDenoiseNode` in a linear working color space, enabling MSAA can make partly transparent Splats look brighter. This does not occur with `NeuralDenoisePass` or with `NeuralDenoiseNode` in an sRGB working color space. MSAA results can also differ at edges between WebGPU and WebGL2.
|
|
122
|
+
|
|
123
|
+
## Properties
|
|
124
|
+
|
|
125
|
+
| Property | Default | Description |
|
|
126
|
+
| --- | --- | --- |
|
|
127
|
+
| `scene` | Constructor scene | Scene to render; call `reset()` when replacing it |
|
|
128
|
+
| `camera` | Constructor camera | Camera to render with; call `reset()` when replacing it |
|
|
129
|
+
| `mode` | `"quality"` | Read-only. `"performance"` or `"quality"` |
|
|
130
|
+
| `msaa` | `false` | Read-only. Whether 4× MSAA is enabled |
|
|
131
|
+
| `depthTexture` | Read-only | Scene depth of the current frame |
|
|
132
|
+
| `projectionMatrix` | Read-only | Projection that matches `depthTexture` |
|
|
133
|
+
| `stabilize` | `true` | Reduces flicker in both modes; disabling it can make the image less steady |
|
|
134
|
+
|
|
135
|
+
Read `depthTexture` when setting up a depth-based effect; it updates each frame after that. Use the matching `projectionMatrix` for depth conversion, rather than `camera.projectionMatrix`. The depth is not smoothed.
|
|
136
|
+
|
|
137
|
+
## Methods
|
|
138
|
+
|
|
139
|
+
| Method | Description |
|
|
140
|
+
| --- | --- |
|
|
141
|
+
| `reset()` | Discard earlier frames and start smoothing again |
|
|
142
|
+
| `dispose()` | Release the resources it holds. The scene is not disposed |
|
|
143
|
+
| `setSize(width, height)` | Resize in physical pixels. Called for you; a size change resets |
|
|
144
|
+
| `getTextureNode()` | Node only: the smoothed image, for chaining effects |
|
|
145
|
+
|
|
146
|
+
## Background
|
|
147
|
+
|
|
148
|
+
Based on Hu et al., [Ultra-fast Neural Inference for Stochastic Gaussian Splatting Denoising](https://arxiv.org/abs/2609.25604), adapted for this library.
|
package/docs/SplatMesh.md
CHANGED
|
@@ -46,7 +46,7 @@ For large streamed scenes, use [RadStreamScheduler](RadStreamScheduler.md) or [S
|
|
|
46
46
|
| `onFrame` | `({ mesh, time, deltaTime }) => void` | `undefined` | Called before each update of the model; use it for animation |
|
|
47
47
|
| `editable` | `boolean` | `true` | Allow [SDF edits](SplatEdit.md) to affect this model |
|
|
48
48
|
| `raycastable` | `boolean` | `true` | Include this model in Three.js raycasting |
|
|
49
|
-
| `minRaycastOpacity` | `number` | `0.
|
|
49
|
+
| `minRaycastOpacity` | `number` | `0.1` | Ignore more transparent areas when picking; higher values narrow the area that can be hit |
|
|
50
50
|
|
|
51
51
|
Choose at most one of `url`, `file`, `fileBytes`, or `splats`; combining them throws.
|
|
52
52
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[Back to documentation](../README.md#documentation)
|
|
4
4
|
|
|
5
|
-
Stochastic rendering is an optional way for `GaussianSplatRenderer` to draw transparency. It produces visible noise, so pair it with temporal anti-aliasing (TAA) to get a smooth image. Sorted alpha blending remains the default.
|
|
5
|
+
Stochastic rendering is an optional way for `GaussianSplatRenderer` to draw transparency. It produces visible noise, so pair it with temporal anti-aliasing (TAA) or the experimental neural denoiser to get a smooth image. Sorted alpha blending remains the default.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Stochastic rendering works on WebGPU, WebGL2, and `WebGPURenderer`'s WebGL2 fallback, including WebXR. The smoothing options below do not support WebXR.
|
|
8
8
|
|
|
9
9
|
## Turn it on
|
|
10
10
|
|
|
@@ -24,7 +24,7 @@ Both can be changed at any time. While stochastic rendering is active, Splats ar
|
|
|
24
24
|
|
|
25
25
|
## Smooth the noise
|
|
26
26
|
|
|
27
|
-
Use [`TAANode`](TAAPass.md#taanode-webgpurenderer) with `WebGPURenderer`, or [`TAAPass`](TAAPass.md#taapass-webglrenderer) with `WebGLRenderer`. The library does not turn
|
|
27
|
+
Use [`TAANode`](TAAPass.md#taanode-webgpurenderer) with `WebGPURenderer`, or [`TAAPass`](TAAPass.md#taapass-webglrenderer) with `WebGLRenderer`. The [experimental neural denoiser](NeuralDenoiseNode.md) is an alternative for scenes with moving objects on all three backends. The library does not turn any of them on for you. The examples assume an existing `renderer`, `scene`, `camera`, and `splatRenderer`, with one camera outside WebXR.
|
|
28
28
|
|
|
29
29
|
### WebGPURenderer: TAANode
|
|
30
30
|
|
|
@@ -46,6 +46,19 @@ renderer.setAnimationLoop(() => {
|
|
|
46
46
|
});
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
### WebGPURenderer: NeuralDenoiseNode
|
|
50
|
+
|
|
51
|
+
To help reduce trails behind moving objects, replace `TAANode` in the setup above with `NeuralDenoiseNode`:
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
import { NeuralDenoiseNode } from "gaussian-splat-lite";
|
|
55
|
+
|
|
56
|
+
const denoise = new NeuralDenoiseNode(scene, camera);
|
|
57
|
+
const pipeline = new RenderPipeline(renderer, denoise);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
It also supports the WebGL2 fallback. See [Neural denoising](NeuralDenoiseNode.md) for modes, MSAA and WebGL2 requirements.
|
|
61
|
+
|
|
49
62
|
### WebGLRenderer: TAAPass
|
|
50
63
|
|
|
51
64
|
```js
|
|
@@ -69,16 +82,29 @@ renderer.setAnimationLoop(() => {
|
|
|
69
82
|
|
|
70
83
|
`TAAPass` takes the place of `RenderPass`. On resize, call `composer.setSize(width, height)` along with the renderer.
|
|
71
84
|
|
|
72
|
-
###
|
|
85
|
+
### WebGLRenderer: NeuralDenoisePass
|
|
86
|
+
|
|
87
|
+
Replace `TAAPass` in the composer setup above with `NeuralDenoisePass`, keeping `OutputPass` after it:
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
import { NeuralDenoisePass } from "gaussian-splat-lite";
|
|
91
|
+
|
|
92
|
+
const denoise = new NeuralDenoisePass(scene, camera);
|
|
93
|
+
composer.addPass(denoise);
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
It has the same options and requirements as `NeuralDenoiseNode` on WebGL2.
|
|
97
|
+
|
|
98
|
+
### With any of these
|
|
73
99
|
|
|
74
|
-
- Call `
|
|
75
|
-
- With on-demand rendering, keep rendering for several frames after the camera, a model, or streamed content changes, and after the Splat renderer's `onDirty` callback, so the noise can settle.
|
|
100
|
+
- Call `reset()` after a camera cut or a scene replacement. With TAA, also call it after an abrupt change to an object: TAA follows camera movement, not moving objects.
|
|
101
|
+
- With on-demand rendering, keep rendering for several frames after the camera, a model, or streamed content changes, and after the Splat renderer's `onDirty` callback, so the noise can settle.
|
|
76
102
|
|
|
77
|
-
See [TAAPass and TAANode](TAAPass.md) for effects, depth, color, and cleanup.
|
|
103
|
+
See [TAAPass and TAANode](TAAPass.md) and [Neural denoising](NeuralDenoiseNode.md) for effects, depth, color, and cleanup.
|
|
78
104
|
|
|
79
105
|
## Control the noise pattern
|
|
80
106
|
|
|
81
|
-
The noise pattern changes on every render
|
|
107
|
+
The noise pattern changes on every render so TAA or neural denoising can smooth it over time. To keep it fixed, or to control it from your own render loop:
|
|
82
108
|
|
|
83
109
|
```js
|
|
84
110
|
splatRenderer.autoAdvanceStochasticSample = false;
|
|
@@ -93,11 +119,11 @@ When you advance it yourself, increase it by one for each render of the scene. T
|
|
|
93
119
|
splatRenderer.stochastic = false;
|
|
94
120
|
```
|
|
95
121
|
|
|
96
|
-
The switch, in either direction, takes effect on a later frame rather than immediately. `stochasticActive` tells you which mode is being drawn; keep TAA running until it is `false`. With `autoUpdate = false`, update before drawing:
|
|
122
|
+
The switch, in either direction, takes effect on a later frame rather than immediately. `stochasticActive` tells you which mode is being drawn; keep your TAA or neural denoiser running until it is `false`. With `autoUpdate = false`, update before drawing:
|
|
97
123
|
|
|
98
124
|
```js
|
|
99
125
|
await splatRenderer.update({ scene, camera });
|
|
100
126
|
renderer.render(scene, camera);
|
|
101
127
|
```
|
|
102
128
|
|
|
103
|
-
If you keep TAA running with sorted rendering, set `splatRenderer.depthWrite = true` so
|
|
129
|
+
If you keep TAA or neural denoising running with sorted rendering, set `splatRenderer.depthWrite = true` so it can use the Splats' depth.
|
package/docs/TAAPass.md
CHANGED
|
@@ -11,13 +11,27 @@ Temporal anti-aliasing (TAA) blends each frame with the ones before it. It smoot
|
|
|
11
11
|
|
|
12
12
|
Both render the scene themselves and need no velocity buffer or other scene setup.
|
|
13
13
|
|
|
14
|
+
## MSAA
|
|
15
|
+
|
|
16
|
+
The third constructor argument, `msaa`, enables 4× MSAA with `true` or disables it with `false` (default):
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
const taa = new TAANode(scene, camera, true);
|
|
20
|
+
// With WebGLRenderer: new TAAPass(scene, camera, true).
|
|
21
|
+
// MSAA is disabled when the argument is omitted or false.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Four samples use the same stochastic coverage as the [experimental neural denoiser](NeuralDenoiseNode.md): one scene render into a 4× MSAA target, followed by the usual TAA accumulation. This reduces input noise with higher GPU time and memory use. History targets remain single-sampled, and moving objects are still not tracked.
|
|
25
|
+
|
|
26
|
+
On WebGL2, including the WebGL fallback, MSAA requires `OES_sample_variables`. Check `renderer.getContext().getExtension("OES_sample_variables")` before enabling MSAA; leave it disabled when the extension is unavailable. Unsupported configurations throw an error. The MSAA setting is fixed for the node or pass's lifetime; dispose it and create another to change it.
|
|
27
|
+
|
|
14
28
|
## Before you start
|
|
15
29
|
|
|
16
30
|
- **One camera.** A `PerspectiveCamera` or `OrthographicCamera`, including custom projections, scaled camera rigs, reversed depth, and logarithmic depth. WebXR is not supported.
|
|
17
|
-
- **Camera movement only.** Moving objects and changes to individual Splats are not tracked, and may leave a faint trail.
|
|
31
|
+
- **Camera movement only.** Moving objects and changes to individual Splats are not tracked, and may leave a faint trail. Try the [experimental neural denoiser](NeuralDenoiseNode.md) to help reduce these trails.
|
|
18
32
|
- **Stencil follows your renderer.** Create the Three.js renderer with `stencil: true` and stencil masks work as they do without TAA, including the stencil settings on your Splat renderer's `material`.
|
|
19
33
|
- **Reset after a jump.** Call `taa.reset()` after a camera cut or after replacing the scene. Resizing resets automatically.
|
|
20
|
-
- **Keep rendering while the image settles.** With on-demand rendering, render several more frames after each change.
|
|
34
|
+
- **Keep rendering while the image settles.** With on-demand rendering, render several more frames after each change.
|
|
21
35
|
|
|
22
36
|
## TAAPass (WebGLRenderer)
|
|
23
37
|
|
|
@@ -49,7 +63,7 @@ renderer.setAnimationLoop(() => {
|
|
|
49
63
|
// taa.dispose();
|
|
50
64
|
```
|
|
51
65
|
|
|
52
|
-
Dispose the passes as well as the composer when you are done.
|
|
66
|
+
Dispose the passes as well as the composer when you are done.
|
|
53
67
|
|
|
54
68
|
### Add effects
|
|
55
69
|
|
|
@@ -129,6 +143,8 @@ const pipeline = new RenderPipeline(renderer, color.add(bloom(color, 0.6, 0.4, 0
|
|
|
129
143
|
|
|
130
144
|
`TAANode` has the same `depthTexture`, `projectionMatrix`, and tuning properties as `TAAPass`.
|
|
131
145
|
|
|
146
|
+
With four samples on native WebGPU, `depthTexture` is multisampled. Read it with TSL `texture(taa.depthTexture).load(pixel)` to select sample 0, as TAA does internally; filtered depth sampling is not supported. Both WebGL paths expose resolved, single-sampled depth.
|
|
147
|
+
|
|
132
148
|
## Color and tone mapping
|
|
133
149
|
|
|
134
150
|
**`TAAPass`** shows Splats with the same colors as `WebGLRenderer` drawing straight to the canvas.
|
|
@@ -147,6 +163,7 @@ Both keep colors brighter than white, so effects such as Bloom work as expected.
|
|
|
147
163
|
| --- | --- | --- |
|
|
148
164
|
| `scene` | Constructor scene | Scene to render; call `reset()` when replacing it |
|
|
149
165
|
| `camera` | Constructor camera | Camera to render with; call `reset()` when replacing it |
|
|
166
|
+
| `msaa` | `false` | Read-only. Whether 4× MSAA is enabled, selected in the constructor |
|
|
150
167
|
| `depthTexture` | Read-only | Scene depth of the current frame |
|
|
151
168
|
| `projectionMatrix` | Read-only | Projection that matches `depthTexture` |
|
|
152
169
|
| `depthThreshold` | `0.0005` | Depth change above which a pixel's earlier frames are discarded |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gaussian-splat-lite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Three.js Gaussian Splatting renderer with WebGPU/WebGL2, GPU sorting, streaming LOD, and high-precision GIS/ECEF support. Supports PLY, SPZ, SOG and RAD.",
|
|
5
5
|
"author": "William Liu <lyz15972107087@gmail.com>",
|
|
6
6
|
"type": "module",
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
|
-
"build": "
|
|
25
|
-
"build:dev": "vite build --mode dev-es && vite build --mode dev-cjs",
|
|
26
|
-
"build:production": "vite build --mode production-es && vite build --mode production-cjs",
|
|
27
|
-
"build:site": "vite build --config vite.site.config.
|
|
28
|
-
"build:types
|
|
24
|
+
"build": "vite build --mode production-es && vite build --mode production-cjs && vite build --mode dev-es && vite build --mode dev-cjs && npm run build:types",
|
|
25
|
+
"build:dev": "vite build --mode dev-es && vite build --mode dev-cjs && npm run build:types",
|
|
26
|
+
"build:production": "vite build --mode production-es && vite build --mode production-cjs && npm run build:types",
|
|
27
|
+
"build:site": "vite build --config vite.site.config.js",
|
|
28
|
+
"build:types": "node scripts/check-declarations.js && node scripts/build-types.js",
|
|
29
29
|
"build:wasm": "node rust/build_wasm.js",
|
|
30
|
-
"check": "tsc --noEmit",
|
|
30
|
+
"check": "node scripts/check-js.js && tsc --noEmit && node scripts/check-declarations.js",
|
|
31
31
|
"check:rust": "cargo fmt --manifest-path rust/Cargo.toml --all -- --check",
|
|
32
32
|
"clean": "rm -rf dist/ node_modules/ rust/target/ rust/gaussian-splat-rs/pkg/",
|
|
33
|
-
"dev": "vite --config vite.site.config.
|
|
33
|
+
"dev": "vite --config vite.site.config.js --host",
|
|
34
34
|
"format": "biome format .",
|
|
35
35
|
"format:fix": "biome format . --fix",
|
|
36
36
|
"lint": "biome check .",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"release:check": "npm run build:wasm && npm run build:site && npm run pack:check",
|
|
41
41
|
"start": "npm run dev",
|
|
42
42
|
"test": "npm run test:js && npm run test:rust",
|
|
43
|
-
"test:js": "node --
|
|
43
|
+
"test:js": "node --test test/*.test.js",
|
|
44
44
|
"test:rust": "cargo test --manifest-path rust/Cargo.toml --workspace --locked"
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
@@ -75,11 +75,9 @@
|
|
|
75
75
|
"gaussian-splat-rs": "file:rust/gaussian-splat-rs/pkg",
|
|
76
76
|
"publint": "0.3.24",
|
|
77
77
|
"three": "0.186.0",
|
|
78
|
-
"ts-node": "10.9.2",
|
|
79
78
|
"typescript": "^5.7.3",
|
|
80
79
|
"vite": "^6.0.11",
|
|
81
80
|
"vite-plugin-arraybuffer": "^0.1.4",
|
|
82
|
-
"vite-plugin-dts": "^4.5.4",
|
|
83
81
|
"vite-plugin-glsl": "^1.3.1"
|
|
84
82
|
},
|
|
85
83
|
"peerDependencies": {
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Camera, Texture } from 'three';
|
|
2
|
-
import { ComputeNode, IndirectStorageBufferAttribute, Node, NodeBuilder, StorageBufferAttribute, StorageBufferNode, TextureNode, WorkgroupInfoNode } from 'three/webgpu';
|
|
3
|
-
import * as TSL from "three/tsl";
|
|
4
|
-
declare module "three/src/nodes/core/Node.js" {
|
|
5
|
-
interface IntegerExtensions<TInteger> {
|
|
6
|
-
min(value: Node<TInteger> | number): Node<TInteger>;
|
|
7
|
-
max(value: Node<TInteger> | number): Node<TInteger>;
|
|
8
|
-
}
|
|
9
|
-
interface IntOrVecExtensions<TNodeType> {
|
|
10
|
-
shiftRight(value: Node<TNodeType> | number): Node<TNodeType>;
|
|
11
|
-
clamp(low: Node<TNodeType>, high: Node<TNodeType>): Node<TNodeType>;
|
|
12
|
-
}
|
|
13
|
-
interface NumOrBoolVec4Extensions<TNumOrBool> {
|
|
14
|
-
element(index: Node<"int"> | Node<"uint"> | number): Node<TNumOrBool>;
|
|
15
|
-
}
|
|
16
|
-
interface Mat4Extensions {
|
|
17
|
-
element(index: Node<"int"> | Node<"uint"> | number): Node<"vec4">;
|
|
18
|
-
}
|
|
19
|
-
interface FloatOrVecExtensions<TNodeType> {
|
|
20
|
-
negateAssign(): Node<TNodeType>;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
type FloatToUint = {
|
|
24
|
-
float: "uint";
|
|
25
|
-
vec2: "uvec2";
|
|
26
|
-
vec3: "uvec3";
|
|
27
|
-
vec4: "uvec4";
|
|
28
|
-
};
|
|
29
|
-
type UintToFloat = {
|
|
30
|
-
uint: "float";
|
|
31
|
-
uvec2: "vec2";
|
|
32
|
-
uvec3: "vec3";
|
|
33
|
-
uvec4: "vec4";
|
|
34
|
-
};
|
|
35
|
-
type UintWorkgroup = WorkgroupInfoNode & {
|
|
36
|
-
element(index: Node<"uint"> | Node<"int"> | number): Node<"uint">;
|
|
37
|
-
setName(name: string): UintWorkgroup;
|
|
38
|
-
};
|
|
39
|
-
type Compatibility = {
|
|
40
|
-
convertColorSpace(value: Node<"vec4">, source: string, target: string): Node<"vec4">;
|
|
41
|
-
floatBitsToUint<T extends keyof FloatToUint>(value: Node<T>): Node<FloatToUint[T]>;
|
|
42
|
-
uintBitsToFloat<T extends keyof UintToFloat>(value: Node<T>): Node<UintToFloat[T]>;
|
|
43
|
-
packHalf2x16(value: Node<"vec2">): Node<"uint">;
|
|
44
|
-
unpackHalf2x16(value: Node<"uint">): Node<"vec2">;
|
|
45
|
-
packSnorm2x16(value: Node<"vec2">): Node<"uint">;
|
|
46
|
-
unpackSnorm2x16(value: Node<"uint">): Node<"vec2">;
|
|
47
|
-
storage(value: StorageBufferAttribute, type: "uint", count?: number): StorageBufferNode<"uint">;
|
|
48
|
-
workgroupArray(type: "uint", count: number): UintWorkgroup;
|
|
49
|
-
builtin(name: "gl_ViewID_OVR"): Node<"uint">;
|
|
50
|
-
countOneBits(value: Node<"uint">): Node<"uint">;
|
|
51
|
-
ivec2: typeof TSL.ivec2 & ((x: Node<"uint">, y: Node<"uint">) => Node<"ivec2">);
|
|
52
|
-
ivec3: typeof TSL.ivec3 & ((x: Node<"uint">, y: Node<"uint">, z: Node<"uint">) => Node<"ivec3">);
|
|
53
|
-
Loop: typeof TSL.Loop & (<Name extends string, Type extends "int" | "uint">(params: {
|
|
54
|
-
name: Name;
|
|
55
|
-
type: Type;
|
|
56
|
-
start: Node<Type>;
|
|
57
|
-
end: Node<Type>;
|
|
58
|
-
condition: string;
|
|
59
|
-
}, callback: (inputs: Record<Name, Node<Type>>) => void) => ReturnType<typeof TSL.Loop>);
|
|
60
|
-
};
|
|
61
|
-
export declare const N: Omit<typeof TSL, keyof Compatibility> & Compatibility;
|
|
62
|
-
/** Packed integer texture loads are incorrectly declared as vec4 upstream. */
|
|
63
|
-
export declare function uintTexture(texture: Texture): TextureNode<"uvec4">;
|
|
64
|
-
/** NodeBuilder.camera is present when building a material shader. */
|
|
65
|
-
export declare function materialCamera(builder: NodeBuilder): Camera;
|
|
66
|
-
/** r186 supports an indirect attribute, but its declaration lists only counts. */
|
|
67
|
-
export declare function setIndirectDispatch(node: ComputeNode, dispatch: IndirectStorageBufferAttribute): void;
|
|
68
|
-
export {};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Camera, Texture } from 'three';
|
|
2
|
-
import { ComputeNode, IndirectStorageBufferAttribute, Node, NodeBuilder, StorageBufferAttribute, StorageBufferNode, TextureNode, WorkgroupInfoNode } from 'three/webgpu';
|
|
3
|
-
import * as TSL from "three/tsl";
|
|
4
|
-
declare module "three/src/nodes/core/Node.js" {
|
|
5
|
-
interface IntegerExtensions<TInteger> {
|
|
6
|
-
min(value: Node<TInteger> | number): Node<TInteger>;
|
|
7
|
-
max(value: Node<TInteger> | number): Node<TInteger>;
|
|
8
|
-
}
|
|
9
|
-
interface IntOrVecExtensions<TNodeType> {
|
|
10
|
-
shiftRight(value: Node<TNodeType> | number): Node<TNodeType>;
|
|
11
|
-
clamp(low: Node<TNodeType>, high: Node<TNodeType>): Node<TNodeType>;
|
|
12
|
-
}
|
|
13
|
-
interface NumOrBoolVec4Extensions<TNumOrBool> {
|
|
14
|
-
element(index: Node<"int"> | Node<"uint"> | number): Node<TNumOrBool>;
|
|
15
|
-
}
|
|
16
|
-
interface Mat4Extensions {
|
|
17
|
-
element(index: Node<"int"> | Node<"uint"> | number): Node<"vec4">;
|
|
18
|
-
}
|
|
19
|
-
interface FloatOrVecExtensions<TNodeType> {
|
|
20
|
-
negateAssign(): Node<TNodeType>;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
type FloatToUint = {
|
|
24
|
-
float: "uint";
|
|
25
|
-
vec2: "uvec2";
|
|
26
|
-
vec3: "uvec3";
|
|
27
|
-
vec4: "uvec4";
|
|
28
|
-
};
|
|
29
|
-
type UintToFloat = {
|
|
30
|
-
uint: "float";
|
|
31
|
-
uvec2: "vec2";
|
|
32
|
-
uvec3: "vec3";
|
|
33
|
-
uvec4: "vec4";
|
|
34
|
-
};
|
|
35
|
-
type UintWorkgroup = WorkgroupInfoNode & {
|
|
36
|
-
element(index: Node<"uint"> | Node<"int"> | number): Node<"uint">;
|
|
37
|
-
setName(name: string): UintWorkgroup;
|
|
38
|
-
};
|
|
39
|
-
type Compatibility = {
|
|
40
|
-
convertColorSpace(value: Node<"vec4">, source: string, target: string): Node<"vec4">;
|
|
41
|
-
floatBitsToUint<T extends keyof FloatToUint>(value: Node<T>): Node<FloatToUint[T]>;
|
|
42
|
-
uintBitsToFloat<T extends keyof UintToFloat>(value: Node<T>): Node<UintToFloat[T]>;
|
|
43
|
-
packHalf2x16(value: Node<"vec2">): Node<"uint">;
|
|
44
|
-
unpackHalf2x16(value: Node<"uint">): Node<"vec2">;
|
|
45
|
-
packSnorm2x16(value: Node<"vec2">): Node<"uint">;
|
|
46
|
-
unpackSnorm2x16(value: Node<"uint">): Node<"vec2">;
|
|
47
|
-
storage(value: StorageBufferAttribute, type: "uint", count?: number): StorageBufferNode<"uint">;
|
|
48
|
-
workgroupArray(type: "uint", count: number): UintWorkgroup;
|
|
49
|
-
builtin(name: "gl_ViewID_OVR"): Node<"uint">;
|
|
50
|
-
countOneBits(value: Node<"uint">): Node<"uint">;
|
|
51
|
-
ivec2: typeof TSL.ivec2 & ((x: Node<"uint">, y: Node<"uint">) => Node<"ivec2">);
|
|
52
|
-
ivec3: typeof TSL.ivec3 & ((x: Node<"uint">, y: Node<"uint">, z: Node<"uint">) => Node<"ivec3">);
|
|
53
|
-
Loop: typeof TSL.Loop & (<Name extends string, Type extends "int" | "uint">(params: {
|
|
54
|
-
name: Name;
|
|
55
|
-
type: Type;
|
|
56
|
-
start: Node<Type>;
|
|
57
|
-
end: Node<Type>;
|
|
58
|
-
condition: string;
|
|
59
|
-
}, callback: (inputs: Record<Name, Node<Type>>) => void) => ReturnType<typeof TSL.Loop>);
|
|
60
|
-
};
|
|
61
|
-
export declare const N: Omit<typeof TSL, keyof Compatibility> & Compatibility;
|
|
62
|
-
/** Packed integer texture loads are incorrectly declared as vec4 upstream. */
|
|
63
|
-
export declare function uintTexture(texture: Texture): TextureNode<"uvec4">;
|
|
64
|
-
/** NodeBuilder.camera is present when building a material shader. */
|
|
65
|
-
export declare function materialCamera(builder: NodeBuilder): Camera;
|
|
66
|
-
/** r186 supports an indirect attribute, but its declaration lists only counts. */
|
|
67
|
-
export declare function setIndirectDispatch(node: ComputeNode, dispatch: IndirectStorageBufferAttribute): void;
|
|
68
|
-
export {};
|