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
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
|
+
AttributeBinding,
|
|
3
|
+
AttributeComponents,
|
|
4
|
+
InputField,
|
|
5
|
+
SplatPostDecodeAttributeFormat,
|
|
6
|
+
SplatPostDecodeInstruction,
|
|
7
|
+
SplatPostDecodeOutputs,
|
|
8
|
+
SplatPostDecodeValueType,
|
|
9
|
+
} from "./protocol.js";
|
|
2
10
|
type NumericValueType = "float" | "vec2" | "vec3" | "vec4";
|
|
3
11
|
type VectorValueType = "vec2" | "vec3" | "vec4";
|
|
4
12
|
declare class SplatPostDecodeValue<T extends SplatPostDecodeValueType> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/** @internal */
|
|
13
|
+
readonly type: T;
|
|
14
|
+
/** @internal */ readonly register: number;
|
|
15
|
+
/** @internal */ readonly owner: ProgramBuilder;
|
|
16
|
+
/** @internal */
|
|
17
|
+
constructor(
|
|
18
|
+
type: T,
|
|
19
|
+
/** @internal */ register: number,
|
|
20
|
+
/** @internal */ owner: ProgramBuilder,
|
|
21
|
+
);
|
|
12
22
|
}
|
|
13
23
|
type FloatValue = SplatPostDecodeValue<"float">;
|
|
14
24
|
type BoolValue = SplatPostDecodeValue<"bool">;
|
|
@@ -25,141 +35,226 @@ type Vec2Like = Vec2Literal | Vec2Value;
|
|
|
25
35
|
type Vec3Like = Vec3Literal | Vec3Value;
|
|
26
36
|
type Vec4Like = Vec4Literal | Vec4Value;
|
|
27
37
|
type QuaternionLike = Vec4Literal | QuaternionValue;
|
|
28
|
-
type LiteralFor<T extends SplatPostDecodeValueType> = T extends "float"
|
|
29
|
-
|
|
38
|
+
type LiteralFor<T extends SplatPostDecodeValueType> = T extends "float"
|
|
39
|
+
? number
|
|
40
|
+
: T extends "bool"
|
|
41
|
+
? boolean
|
|
42
|
+
: T extends "vec2"
|
|
43
|
+
? Vec2Literal
|
|
44
|
+
: T extends "vec3"
|
|
45
|
+
? Vec3Literal
|
|
46
|
+
: Vec4Literal;
|
|
47
|
+
type ValueLike<T extends SplatPostDecodeValueType> =
|
|
48
|
+
| LiteralFor<T>
|
|
49
|
+
| SplatPostDecodeValue<T>;
|
|
30
50
|
type BroadcastLike<T extends NumericValueType> = ValueLike<T> | FloatLike;
|
|
31
|
-
type SplatPostDecodeAttributeOptions<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
51
|
+
type SplatPostDecodeAttributeOptions<
|
|
52
|
+
Components extends AttributeComponents = 1,
|
|
53
|
+
> = {
|
|
54
|
+
data: ArrayBufferView;
|
|
55
|
+
format: SplatPostDecodeAttributeFormat;
|
|
56
|
+
count: number;
|
|
57
|
+
components?: Components;
|
|
58
|
+
/** Byte offset relative to the supplied data view. */
|
|
59
|
+
byteOffset?: number;
|
|
60
|
+
byteStride?: number;
|
|
39
61
|
};
|
|
40
|
-
type AttributeValue<Components extends AttributeComponents> =
|
|
62
|
+
type AttributeValue<Components extends AttributeComponents> =
|
|
63
|
+
Components extends 1
|
|
64
|
+
? FloatValue
|
|
65
|
+
: Components extends 2
|
|
66
|
+
? Vec2Value
|
|
67
|
+
: Components extends 3
|
|
68
|
+
? Vec3Value
|
|
69
|
+
: Vec4Value;
|
|
41
70
|
type SplatShCoefficientContext = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
71
|
+
index: number;
|
|
72
|
+
degree: 1 | 2 | 3;
|
|
73
|
+
order: number;
|
|
45
74
|
};
|
|
46
75
|
declare class SplatPostDecodeShPatch {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/** @internal */ owner: ProgramBuilder,
|
|
52
|
-
/** @internal */ coefficients: readonly Vec3Value[]
|
|
76
|
+
/** @internal */ readonly owner: ProgramBuilder;
|
|
77
|
+
/** @internal */ readonly coefficients: readonly Vec3Value[];
|
|
78
|
+
/** @internal */
|
|
79
|
+
constructor(
|
|
80
|
+
/** @internal */ owner: ProgramBuilder,
|
|
81
|
+
/** @internal */ coefficients: readonly Vec3Value[],
|
|
82
|
+
);
|
|
53
83
|
}
|
|
54
84
|
declare class SplatPostDecodeShValue {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
85
|
+
private readonly owner;
|
|
86
|
+
/** @internal */
|
|
87
|
+
constructor(owner: ProgramBuilder);
|
|
88
|
+
coefficient(index: number): Vec3Value;
|
|
89
|
+
map(
|
|
90
|
+
transform: (
|
|
91
|
+
coefficient: Vec3Value,
|
|
92
|
+
context: SplatShCoefficientContext,
|
|
93
|
+
) => Vec3Like,
|
|
94
|
+
): SplatPostDecodeShPatch;
|
|
60
95
|
}
|
|
61
96
|
type SplatPostDecodeInput = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
97
|
+
readonly position: Vec3Value;
|
|
98
|
+
readonly scale: Vec3Value;
|
|
99
|
+
readonly quaternion: QuaternionValue;
|
|
100
|
+
/** Semantic opacity in [0, exp(24/e)] (approximately 6830.182). */
|
|
101
|
+
readonly opacity: FloatValue;
|
|
102
|
+
/** Standard alpha in the [0, 1] range. */
|
|
103
|
+
readonly alpha: FloatValue;
|
|
104
|
+
readonly color: Vec3Value;
|
|
105
|
+
readonly sh: SplatPostDecodeShValue;
|
|
71
106
|
};
|
|
72
107
|
export type SplatPostDecodePatch = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
108
|
+
/** If false, this splat's packed values are left byte-for-byte unchanged. */
|
|
109
|
+
when?: BoolLike;
|
|
110
|
+
position?: Vec3Like;
|
|
111
|
+
scale?: Vec3Like;
|
|
112
|
+
quaternion?: QuaternionLike;
|
|
113
|
+
/** Semantic opacity, encoded within the renderer's shape range [0, 1]. */
|
|
114
|
+
opacity?: FloatLike;
|
|
115
|
+
/**
|
|
116
|
+
* Standard alpha, clamped to [0, 1] and independent from semantic opacity.
|
|
117
|
+
* Cannot be output with opacity in the same patch.
|
|
118
|
+
*/
|
|
119
|
+
alpha?: FloatLike;
|
|
120
|
+
color?: Vec3Like;
|
|
121
|
+
sh?: SplatPostDecodeShPatch;
|
|
87
122
|
};
|
|
88
|
-
type VariadicNumericOperation = <T extends NumericValueType>(
|
|
89
|
-
|
|
90
|
-
|
|
123
|
+
type VariadicNumericOperation = <T extends NumericValueType>(
|
|
124
|
+
first: ValueLike<T>,
|
|
125
|
+
...rest: BroadcastLike<T>[]
|
|
126
|
+
) => SplatPostDecodeValue<T>;
|
|
127
|
+
type BinaryNumericOperation = <T extends NumericValueType>(
|
|
128
|
+
left: ValueLike<T>,
|
|
129
|
+
right: BroadcastLike<T>,
|
|
130
|
+
) => SplatPostDecodeValue<T>;
|
|
131
|
+
type UnaryNumericOperation = <T extends NumericValueType>(
|
|
132
|
+
value: ValueLike<T>,
|
|
133
|
+
) => SplatPostDecodeValue<T>;
|
|
91
134
|
type SplatPostDecodeOperations = {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
add: VariadicNumericOperation;
|
|
136
|
+
sub: BinaryNumericOperation;
|
|
137
|
+
mul: VariadicNumericOperation;
|
|
138
|
+
div: BinaryNumericOperation;
|
|
139
|
+
min: BinaryNumericOperation;
|
|
140
|
+
max: BinaryNumericOperation;
|
|
141
|
+
pow: BinaryNumericOperation;
|
|
142
|
+
clamp<T extends NumericValueType>(
|
|
143
|
+
value: ValueLike<T>,
|
|
144
|
+
min: BroadcastLike<T>,
|
|
145
|
+
max: BroadcastLike<T>,
|
|
146
|
+
): SplatPostDecodeValue<T>;
|
|
147
|
+
mix<T extends NumericValueType>(
|
|
148
|
+
left: ValueLike<T>,
|
|
149
|
+
right: ValueLike<T>,
|
|
150
|
+
amount: BroadcastLike<T>,
|
|
151
|
+
): SplatPostDecodeValue<T>;
|
|
152
|
+
neg: UnaryNumericOperation;
|
|
153
|
+
abs: UnaryNumericOperation;
|
|
154
|
+
sqrt: UnaryNumericOperation;
|
|
155
|
+
log: UnaryNumericOperation;
|
|
156
|
+
exp: UnaryNumericOperation;
|
|
157
|
+
floor: UnaryNumericOperation;
|
|
158
|
+
ceil: UnaryNumericOperation;
|
|
159
|
+
round: UnaryNumericOperation;
|
|
160
|
+
sin: UnaryNumericOperation;
|
|
161
|
+
cos: UnaryNumericOperation;
|
|
162
|
+
acos: UnaryNumericOperation;
|
|
163
|
+
tan: UnaryNumericOperation;
|
|
164
|
+
asin: UnaryNumericOperation;
|
|
165
|
+
atan: UnaryNumericOperation;
|
|
166
|
+
atan2: BinaryNumericOperation;
|
|
167
|
+
normalize<T extends VectorValueType | "quaternion">(
|
|
168
|
+
value: ValueLike<T>,
|
|
169
|
+
): SplatPostDecodeValue<T>;
|
|
170
|
+
length(value: Vec2Like | Vec3Like | Vec4Like): FloatValue;
|
|
171
|
+
isFinite(
|
|
172
|
+
value: FloatLike | Vec2Like | Vec3Like | Vec4Like | QuaternionLike,
|
|
173
|
+
): BoolValue;
|
|
174
|
+
not(value: BoolLike): BoolValue;
|
|
175
|
+
eq<T extends SplatPostDecodeValueType>(
|
|
176
|
+
left: ValueLike<T>,
|
|
177
|
+
right: ValueLike<T>,
|
|
178
|
+
): BoolValue;
|
|
179
|
+
ne<T extends SplatPostDecodeValueType>(
|
|
180
|
+
left: ValueLike<T>,
|
|
181
|
+
right: ValueLike<T>,
|
|
182
|
+
): BoolValue;
|
|
183
|
+
lt(left: FloatLike, right: FloatLike): BoolValue;
|
|
184
|
+
lte(left: FloatLike, right: FloatLike): BoolValue;
|
|
185
|
+
gt(left: FloatLike, right: FloatLike): BoolValue;
|
|
186
|
+
gte(left: FloatLike, right: FloatLike): BoolValue;
|
|
187
|
+
and(first: BoolLike, ...rest: BoolLike[]): BoolValue;
|
|
188
|
+
or(first: BoolLike, ...rest: BoolLike[]): BoolValue;
|
|
189
|
+
select<T extends SplatPostDecodeValueType>(
|
|
190
|
+
condition: BoolLike,
|
|
191
|
+
whenTrue: ValueLike<T>,
|
|
192
|
+
whenFalse: ValueLike<T>,
|
|
193
|
+
): SplatPostDecodeValue<T>;
|
|
194
|
+
dot(
|
|
195
|
+
left: Vec2Like | Vec3Like | Vec4Like,
|
|
196
|
+
right: Vec2Like | Vec3Like | Vec4Like,
|
|
197
|
+
): FloatValue;
|
|
198
|
+
cross(left: Vec3Like, right: Vec3Like): Vec3Value;
|
|
199
|
+
vec2(x: FloatLike, y: FloatLike): Vec2Value;
|
|
200
|
+
vec3(x: FloatLike, y: FloatLike, z: FloatLike): Vec3Value;
|
|
201
|
+
vec4(x: FloatLike, y: FloatLike, z: FloatLike, w: FloatLike): Vec4Value;
|
|
202
|
+
quaternion(
|
|
203
|
+
x: FloatLike,
|
|
204
|
+
y: FloatLike,
|
|
205
|
+
z: FloatLike,
|
|
206
|
+
w: FloatLike,
|
|
207
|
+
): QuaternionValue;
|
|
208
|
+
component(
|
|
209
|
+
value: Vec2Like | Vec3Like | Vec4Like | QuaternionLike,
|
|
210
|
+
index: number,
|
|
211
|
+
): FloatValue;
|
|
212
|
+
maxComponentIndex(value: Vec2Like | Vec3Like | Vec4Like): FloatValue;
|
|
213
|
+
quatMul(left: QuaternionLike, right: QuaternionLike): QuaternionValue;
|
|
214
|
+
rotateVector(quaternion: QuaternionLike, vector: Vec3Like): Vec3Value;
|
|
139
215
|
};
|
|
140
216
|
export type SplatPostDecodeContext = {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
217
|
+
splat: SplatPostDecodeInput;
|
|
218
|
+
op: SplatPostDecodeOperations;
|
|
219
|
+
attribute<Components extends AttributeComponents = 1>(
|
|
220
|
+
options: SplatPostDecodeAttributeOptions<Components>,
|
|
221
|
+
): AttributeValue<Components>;
|
|
144
222
|
};
|
|
145
223
|
export declare class ProgramBuilder {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
224
|
+
readonly instructions: SplatPostDecodeInstruction[];
|
|
225
|
+
readonly constants: number[];
|
|
226
|
+
readonly attributes: AttributeBinding[];
|
|
227
|
+
readonly op: SplatPostDecodeOperations;
|
|
228
|
+
readonly splat: SplatPostDecodeInput;
|
|
229
|
+
readonly constantRegisters: Map<
|
|
230
|
+
string,
|
|
231
|
+
SplatPostDecodeValue<SplatPostDecodeValueType>
|
|
232
|
+
>;
|
|
233
|
+
readonly inputRegisters: Map<
|
|
234
|
+
number,
|
|
235
|
+
SplatPostDecodeValue<SplatPostDecodeValueType>
|
|
236
|
+
>;
|
|
237
|
+
constructor();
|
|
238
|
+
private instruction;
|
|
239
|
+
inputField<T extends SplatPostDecodeValueType>(
|
|
240
|
+
type: T,
|
|
241
|
+
field: InputField,
|
|
242
|
+
): SplatPostDecodeValue<T>;
|
|
243
|
+
attribute<Components extends AttributeComponents = 1>(
|
|
244
|
+
options: SplatPostDecodeAttributeOptions<Components>,
|
|
245
|
+
): AttributeValue<Components>;
|
|
246
|
+
coerce<T extends SplatPostDecodeValueType>(
|
|
247
|
+
value: ValueLike<T>,
|
|
248
|
+
expectedType?: T,
|
|
249
|
+
): SplatPostDecodeValue<T>;
|
|
250
|
+
private unary;
|
|
251
|
+
private binary;
|
|
252
|
+
private ternary;
|
|
253
|
+
private coerceForBinary;
|
|
254
|
+
private createOperations;
|
|
163
255
|
}
|
|
164
|
-
export declare function buildOutputs(
|
|
256
|
+
export declare function buildOutputs(
|
|
257
|
+
builder: ProgramBuilder,
|
|
258
|
+
patch: SplatPostDecodePatch,
|
|
259
|
+
): SplatPostDecodeOutputs;
|
|
165
260
|
export {};
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
|
+
AttributeBinding,
|
|
3
|
+
PostDecodeSource,
|
|
4
|
+
SerializedSplatPostDecodeAttribute,
|
|
5
|
+
SerializedSplatPostDecodeCondition,
|
|
6
|
+
SplatPostDecodeInstruction,
|
|
7
|
+
SplatPostDecodeOutputs,
|
|
8
|
+
} from "./protocol.cjs";
|
|
2
9
|
type CompiledProgram = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
instructions: SplatPostDecodeInstruction[];
|
|
11
|
+
constants: number[];
|
|
12
|
+
outputs: Omit<SplatPostDecodeOutputs, "when">;
|
|
13
|
+
condition?: SerializedSplatPostDecodeCondition;
|
|
14
|
+
attributes: AttributeBinding[];
|
|
8
15
|
};
|
|
9
|
-
export declare function compileProgram(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
export declare function compileProgram(
|
|
17
|
+
builder: PostDecodeSource,
|
|
18
|
+
sourceOutputs: SplatPostDecodeOutputs,
|
|
19
|
+
): CompiledProgram;
|
|
20
|
+
export declare function packInstructions(
|
|
21
|
+
instructions: readonly SplatPostDecodeInstruction[],
|
|
22
|
+
): Uint16Array;
|
|
23
|
+
export declare function snapshotAttributes(
|
|
24
|
+
bindings: readonly AttributeBinding[],
|
|
25
|
+
): {
|
|
26
|
+
data: Uint8Array<ArrayBuffer>;
|
|
27
|
+
attributes: SerializedSplatPostDecodeAttribute[];
|
|
14
28
|
};
|
|
15
29
|
export {};
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
|
+
AttributeBinding,
|
|
3
|
+
PostDecodeSource,
|
|
4
|
+
SerializedSplatPostDecodeAttribute,
|
|
5
|
+
SerializedSplatPostDecodeCondition,
|
|
6
|
+
SplatPostDecodeInstruction,
|
|
7
|
+
SplatPostDecodeOutputs,
|
|
8
|
+
} from "./protocol.js";
|
|
2
9
|
type CompiledProgram = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
instructions: SplatPostDecodeInstruction[];
|
|
11
|
+
constants: number[];
|
|
12
|
+
outputs: Omit<SplatPostDecodeOutputs, "when">;
|
|
13
|
+
condition?: SerializedSplatPostDecodeCondition;
|
|
14
|
+
attributes: AttributeBinding[];
|
|
8
15
|
};
|
|
9
|
-
export declare function compileProgram(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
export declare function compileProgram(
|
|
17
|
+
builder: PostDecodeSource,
|
|
18
|
+
sourceOutputs: SplatPostDecodeOutputs,
|
|
19
|
+
): CompiledProgram;
|
|
20
|
+
export declare function packInstructions(
|
|
21
|
+
instructions: readonly SplatPostDecodeInstruction[],
|
|
22
|
+
): Uint16Array;
|
|
23
|
+
export declare function snapshotAttributes(
|
|
24
|
+
bindings: readonly AttributeBinding[],
|
|
25
|
+
): {
|
|
26
|
+
data: Uint8Array<ArrayBuffer>;
|
|
27
|
+
attributes: SerializedSplatPostDecodeAttribute[];
|
|
14
28
|
};
|
|
15
29
|
export {};
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
PostDecodeSplatData,
|
|
3
|
+
SerializedSplatPostDecode,
|
|
4
|
+
} from "./protocol.cjs";
|
|
5
|
+
export declare function shWord(
|
|
6
|
+
data: PostDecodeSplatData,
|
|
7
|
+
coefficient: number,
|
|
8
|
+
): [Uint32Array, number] | undefined;
|
|
9
|
+
export declare function executeRange(
|
|
10
|
+
data: PostDecodeSplatData,
|
|
11
|
+
program: SerializedSplatPostDecode,
|
|
12
|
+
attributeData: DataView,
|
|
13
|
+
splat0Float: Float32Array,
|
|
14
|
+
registers: Float32Array,
|
|
15
|
+
registerBases: Uint32Array,
|
|
16
|
+
instructionStart: number,
|
|
17
|
+
instructionEnd: number,
|
|
18
|
+
blockStart: number,
|
|
19
|
+
blockCount: number,
|
|
20
|
+
blockSize: number,
|
|
21
|
+
sourceIndices?: Uint16Array,
|
|
22
|
+
): void;
|
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
PostDecodeSplatData,
|
|
3
|
+
SerializedSplatPostDecode,
|
|
4
|
+
} from "./protocol.js";
|
|
5
|
+
export declare function shWord(
|
|
6
|
+
data: PostDecodeSplatData,
|
|
7
|
+
coefficient: number,
|
|
8
|
+
): [Uint32Array, number] | undefined;
|
|
9
|
+
export declare function executeRange(
|
|
10
|
+
data: PostDecodeSplatData,
|
|
11
|
+
program: SerializedSplatPostDecode,
|
|
12
|
+
attributeData: DataView,
|
|
13
|
+
splat0Float: Float32Array,
|
|
14
|
+
registers: Float32Array,
|
|
15
|
+
registerBases: Uint32Array,
|
|
16
|
+
instructionStart: number,
|
|
17
|
+
instructionEnd: number,
|
|
18
|
+
blockStart: number,
|
|
19
|
+
blockCount: number,
|
|
20
|
+
blockSize: number,
|
|
21
|
+
sourceIndices?: Uint16Array,
|
|
22
|
+
): void;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { PostDecodeSource, SplatPostDecodeOutputs } from
|
|
1
|
+
import type { PostDecodeSource, SplatPostDecodeOutputs } from "./protocol.cjs";
|
|
2
2
|
/** Fuse only single-use intermediates; shared values must still run once. */
|
|
3
|
-
export declare function fuseArithmetic(
|
|
3
|
+
export declare function fuseArithmetic(
|
|
4
|
+
source: PostDecodeSource,
|
|
5
|
+
outputs: SplatPostDecodeOutputs,
|
|
6
|
+
): PostDecodeSource;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import { PostDecodeSource, SplatPostDecodeOutputs } from
|
|
1
|
+
import type { PostDecodeSource, SplatPostDecodeOutputs } from "./protocol.js";
|
|
2
2
|
/** Fuse only single-use intermediates; shared values must still run once. */
|
|
3
|
-
export declare function fuseArithmetic(
|
|
3
|
+
export declare function fuseArithmetic(
|
|
4
|
+
source: PostDecodeSource,
|
|
5
|
+
outputs: SplatPostDecodeOutputs,
|
|
6
|
+
): PostDecodeSource;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
SplatPostDecodeContext,
|
|
3
|
+
SplatPostDecodePatch,
|
|
4
|
+
} from "./builder.cjs";
|
|
5
|
+
import type { SerializedSplatPostDecode } from "./protocol.cjs";
|
|
3
6
|
declare const SPLAT_POST_DECODE_PROGRAM: unique symbol;
|
|
4
7
|
export type SplatPostDecodeProgram = {
|
|
5
|
-
|
|
8
|
+
readonly [SPLAT_POST_DECODE_PROGRAM]: true;
|
|
6
9
|
};
|
|
7
10
|
/** @internal */
|
|
8
|
-
export declare function serializeSplatPostDecode(
|
|
9
|
-
|
|
11
|
+
export declare function serializeSplatPostDecode(
|
|
12
|
+
program: SplatPostDecodeProgram,
|
|
13
|
+
): SerializedSplatPostDecode;
|
|
14
|
+
declare function defineSplatPostDecode(
|
|
15
|
+
build: (context: SplatPostDecodeContext) => SplatPostDecodePatch,
|
|
16
|
+
): SplatPostDecodeProgram;
|
|
10
17
|
export declare const postDecode: {
|
|
11
|
-
|
|
18
|
+
define: typeof defineSplatPostDecode;
|
|
12
19
|
};
|
|
13
20
|
export {};
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
SplatPostDecodeContext,
|
|
3
|
+
SplatPostDecodePatch,
|
|
4
|
+
} from "./builder.js";
|
|
5
|
+
import type { SerializedSplatPostDecode } from "./protocol.js";
|
|
3
6
|
declare const SPLAT_POST_DECODE_PROGRAM: unique symbol;
|
|
4
7
|
export type SplatPostDecodeProgram = {
|
|
5
|
-
|
|
8
|
+
readonly [SPLAT_POST_DECODE_PROGRAM]: true;
|
|
6
9
|
};
|
|
7
10
|
/** @internal */
|
|
8
|
-
export declare function serializeSplatPostDecode(
|
|
9
|
-
|
|
11
|
+
export declare function serializeSplatPostDecode(
|
|
12
|
+
program: SplatPostDecodeProgram,
|
|
13
|
+
): SerializedSplatPostDecode;
|
|
14
|
+
declare function defineSplatPostDecode(
|
|
15
|
+
build: (context: SplatPostDecodeContext) => SplatPostDecodePatch,
|
|
16
|
+
): SplatPostDecodeProgram;
|
|
10
17
|
export declare const postDecode: {
|
|
11
|
-
|
|
18
|
+
define: typeof defineSplatPostDecode;
|
|
12
19
|
};
|
|
13
20
|
export {};
|