gaussian-splat-lite 1.3.0 → 1.3.2
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 +44 -1
- package/dist/gaussian-splat-lite.cjs +498 -268
- package/dist/gaussian-splat-lite.cjs.map +1 -1
- package/dist/gaussian-splat-lite.min.cjs +169 -131
- package/dist/gaussian-splat-lite.min.cjs.map +1 -1
- package/dist/gaussian-splat-lite.module.js +498 -268
- package/dist/gaussian-splat-lite.module.js.map +1 -1
- package/dist/gaussian-splat-lite.module.min.js +2428 -2241
- package/dist/gaussian-splat-lite.module.min.js.map +1 -1
- package/dist/types/data/IndexedSplats.d.cts +12 -5
- package/dist/types/data/IndexedSplats.d.ts +12 -5
- package/dist/types/data/RadPagedSplats.d.cts +1 -0
- package/dist/types/data/RadPagedSplats.d.ts +1 -0
- package/dist/types/data/SplatOpacityTable.d.cts +9 -2
- package/dist/types/data/SplatOpacityTable.d.ts +9 -2
- package/dist/types/data/Splats.d.cts +1 -1
- package/dist/types/data/Splats.d.ts +1 -1
- package/dist/types/data/defines.d.cts +6 -4
- package/dist/types/data/defines.d.ts +6 -4
- package/dist/types/data/splatData.d.cts +10 -3
- package/dist/types/data/splatData.d.ts +10 -3
- package/dist/types/loaders/postDecode/builder.d.cts +1 -1
- package/dist/types/loaders/postDecode/builder.d.ts +1 -1
- package/dist/types/loaders/postDecode/protocol.d.cts +7 -5
- package/dist/types/loaders/postDecode/protocol.d.ts +7 -5
- package/dist/types/loaders/stream/StreamWorkerPool.d.cts +1 -4
- package/dist/types/loaders/stream/StreamWorkerPool.d.ts +1 -4
- package/dist/types/loaders/stream/rad-stream/RadSelectionState.d.cts +7 -4
- package/dist/types/loaders/stream/rad-stream/RadSelectionState.d.ts +7 -4
- package/dist/types/loaders/stream/rad-stream/RadStreamLoader.d.cts +20 -17
- package/dist/types/loaders/stream/rad-stream/RadStreamLoader.d.ts +20 -17
- package/dist/types/loaders/stream/rad-stream/RadStreamScheduler.d.cts +18 -2
- package/dist/types/loaders/stream/rad-stream/RadStreamScheduler.d.ts +18 -2
- package/dist/types/loaders/stream/rad-stream/RadStreamWorker.d.cts +1 -1
- package/dist/types/loaders/stream/rad-stream/RadStreamWorker.d.ts +1 -1
- package/dist/types/loaders/stream/rad-stream/prepareRadSelection.d.cts +7 -16
- package/dist/types/loaders/stream/rad-stream/prepareRadSelection.d.ts +7 -16
- package/dist/types/loaders/stream/rad-stream/radLod.d.cts +4 -2
- package/dist/types/loaders/stream/rad-stream/radLod.d.ts +4 -2
- package/dist/types/loaders/stream/rad-stream/workerHandlers.d.cts +29 -58
- package/dist/types/loaders/stream/rad-stream/workerHandlers.d.ts +29 -58
- package/dist/types/loaders/stream/sog-stream/SogStreamBatch.d.cts +0 -1
- package/dist/types/loaders/stream/sog-stream/SogStreamBatch.d.ts +0 -1
- package/dist/types/loaders/stream/sog-stream/SogStreamLoader.d.cts +2 -2
- package/dist/types/loaders/stream/sog-stream/SogStreamLoader.d.ts +2 -2
- package/dist/types/loaders/stream/sog-stream/SogStreamScheduler.d.cts +22 -2
- package/dist/types/loaders/stream/sog-stream/SogStreamScheduler.d.ts +22 -2
- package/dist/types/loaders/stream/sog-stream/sogLod.d.cts +16 -10
- package/dist/types/loaders/stream/sog-stream/sogLod.d.ts +16 -10
- package/dist/types/loaders/stream/sog-stream/sogVisibility.d.cts +4 -6
- package/dist/types/loaders/stream/sog-stream/sogVisibility.d.ts +4 -6
- package/dist/types/loaders/stream/sog-stream/workerHandlers.d.cts +2 -8
- package/dist/types/loaders/stream/sog-stream/workerHandlers.d.ts +2 -8
- package/dist/types/loaders/stream/streamOptions.d.cts +9 -8
- package/dist/types/loaders/stream/streamOptions.d.ts +9 -8
- package/docs/PostDecode.md +2 -2
- package/docs/RadStreamScheduler.md +14 -5
- package/docs/SogStreamScheduler.md +8 -6
- package/docs/SplatFileType.md +2 -0
- package/docs/SplatMesh.md +1 -1
- package/docs/Splats.md +1 -1
- package/package.json +1 -1
- package/dist/types/loaders/stream/StreamByteBudget.d.cts +0 -7
- package/dist/types/loaders/stream/StreamByteBudget.d.ts +0 -7
|
@@ -9,6 +9,7 @@ type IndexedSplatsOptions = {
|
|
|
9
9
|
layerSize: number;
|
|
10
10
|
numSh: number;
|
|
11
11
|
blockBits: number;
|
|
12
|
+
packedOpacityGroups?: boolean;
|
|
12
13
|
};
|
|
13
14
|
type DecodedSplat = ReturnType<typeof decodeSplat>;
|
|
14
15
|
type DecodedSplatWithSh = DecodedSplat & {
|
|
@@ -18,7 +19,7 @@ type DecodedSplatWithSh = DecodedSplat & {
|
|
|
18
19
|
* Fades affect display only: records returned to picking retain their source opacity. */
|
|
19
20
|
export declare abstract class IndexedSplats extends Splats {
|
|
20
21
|
readonly layerSize: number;
|
|
21
|
-
readonly numSh: 0 | 1 | 2 | 3;
|
|
22
|
+
readonly numSh: 0 | 1 | 2 | 3 | 4;
|
|
22
23
|
protected readonly opacities: SplatOpacityTable;
|
|
23
24
|
protected sourceIndices: Uint32Array<ArrayBuffer>;
|
|
24
25
|
protected visibleIndices: Uint32Array;
|
|
@@ -30,7 +31,13 @@ export declare abstract class IndexedSplats extends Splats {
|
|
|
30
31
|
private disposed;
|
|
31
32
|
private readonly spatialChunks;
|
|
32
33
|
private spatialBoundsBytes;
|
|
33
|
-
constructor({
|
|
34
|
+
constructor({
|
|
35
|
+
capacity,
|
|
36
|
+
layerSize,
|
|
37
|
+
numSh,
|
|
38
|
+
blockBits,
|
|
39
|
+
packedOpacityGroups,
|
|
40
|
+
}: IndexedSplatsOptions);
|
|
34
41
|
protected assertLive(): void;
|
|
35
42
|
initialize(options?: SplatsOptions): Promise<Splats>;
|
|
36
43
|
/** Range-based sources can materialize their visible map lazily. */
|
|
@@ -48,10 +55,10 @@ export declare abstract class IndexedSplats extends Splats {
|
|
|
48
55
|
private getStorageIndex;
|
|
49
56
|
getSourceIndex(index: number): number;
|
|
50
57
|
private checkVisibleRange;
|
|
51
|
-
getNumSh(): 0 |
|
|
52
|
-
|
|
58
|
+
getNumSh(): 0 | 1 | 2 | 3 | 4;
|
|
59
|
+
/** Estimated GPU storage for packed records, render indices and opacity tables. */
|
|
60
|
+
get textureByteLength(): number;
|
|
53
61
|
getByteLength(): number;
|
|
54
|
-
get residentBytes(): number;
|
|
55
62
|
private center;
|
|
56
63
|
copySortCenters(
|
|
57
64
|
target: Float32Array,
|
|
@@ -9,6 +9,7 @@ type IndexedSplatsOptions = {
|
|
|
9
9
|
layerSize: number;
|
|
10
10
|
numSh: number;
|
|
11
11
|
blockBits: number;
|
|
12
|
+
packedOpacityGroups?: boolean;
|
|
12
13
|
};
|
|
13
14
|
type DecodedSplat = ReturnType<typeof decodeSplat>;
|
|
14
15
|
type DecodedSplatWithSh = DecodedSplat & {
|
|
@@ -18,7 +19,7 @@ type DecodedSplatWithSh = DecodedSplat & {
|
|
|
18
19
|
* Fades affect display only: records returned to picking retain their source opacity. */
|
|
19
20
|
export declare abstract class IndexedSplats extends Splats {
|
|
20
21
|
readonly layerSize: number;
|
|
21
|
-
readonly numSh: 0 | 1 | 2 | 3;
|
|
22
|
+
readonly numSh: 0 | 1 | 2 | 3 | 4;
|
|
22
23
|
protected readonly opacities: SplatOpacityTable;
|
|
23
24
|
protected sourceIndices: Uint32Array<ArrayBuffer>;
|
|
24
25
|
protected visibleIndices: Uint32Array;
|
|
@@ -30,7 +31,13 @@ export declare abstract class IndexedSplats extends Splats {
|
|
|
30
31
|
private disposed;
|
|
31
32
|
private readonly spatialChunks;
|
|
32
33
|
private spatialBoundsBytes;
|
|
33
|
-
constructor({
|
|
34
|
+
constructor({
|
|
35
|
+
capacity,
|
|
36
|
+
layerSize,
|
|
37
|
+
numSh,
|
|
38
|
+
blockBits,
|
|
39
|
+
packedOpacityGroups,
|
|
40
|
+
}: IndexedSplatsOptions);
|
|
34
41
|
protected assertLive(): void;
|
|
35
42
|
initialize(options?: SplatsOptions): Promise<Splats>;
|
|
36
43
|
/** Range-based sources can materialize their visible map lazily. */
|
|
@@ -48,10 +55,10 @@ export declare abstract class IndexedSplats extends Splats {
|
|
|
48
55
|
private getStorageIndex;
|
|
49
56
|
getSourceIndex(index: number): number;
|
|
50
57
|
private checkVisibleRange;
|
|
51
|
-
getNumSh(): 0 |
|
|
52
|
-
|
|
58
|
+
getNumSh(): 0 | 1 | 2 | 3 | 4;
|
|
59
|
+
/** Estimated GPU storage for packed records, render indices and opacity tables. */
|
|
60
|
+
get textureByteLength(): number;
|
|
53
61
|
getByteLength(): number;
|
|
54
|
-
get residentBytes(): number;
|
|
55
62
|
private center;
|
|
56
63
|
copySortCenters(
|
|
57
64
|
target: Float32Array,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as THREE from "three";
|
|
2
2
|
/** Source blocks hold group IDs; a small float32 table holds their opacities. */
|
|
3
3
|
export declare class SplatOpacityTable {
|
|
4
|
+
/** Store sixteen two-bit fixed group IDs per word instead of one arbitrary ID. */
|
|
5
|
+
readonly packedGroups: boolean;
|
|
4
6
|
private blocks;
|
|
5
7
|
private readonly blockSize;
|
|
6
8
|
private readonly blocksPerLayer;
|
|
@@ -13,7 +15,12 @@ export declare class SplatOpacityTable {
|
|
|
13
15
|
private readonly ranges;
|
|
14
16
|
private readonly freeGroups;
|
|
15
17
|
private nextGroup;
|
|
16
|
-
constructor(
|
|
18
|
+
constructor(
|
|
19
|
+
capacity: number,
|
|
20
|
+
layerSize: number,
|
|
21
|
+
blockBits: number,
|
|
22
|
+
packedGroups?: boolean,
|
|
23
|
+
);
|
|
17
24
|
private createTexture;
|
|
18
25
|
private createValueTexture;
|
|
19
26
|
/** CPU arrays and GPU storage each occupy this many bytes. */
|
|
@@ -21,7 +28,7 @@ export declare class SplatOpacityTable {
|
|
|
21
28
|
getOpacity(source: number): number;
|
|
22
29
|
setGroupOpacity(group: number, opacity: number): boolean;
|
|
23
30
|
private releaseBlock;
|
|
24
|
-
/**
|
|
31
|
+
/** Unpacked ranges retain their group while only its coefficient changes. */
|
|
25
32
|
setOpacity(start: number, count: number, opacity: number): boolean;
|
|
26
33
|
copyBlocks(): Uint32Array<ArrayBuffer>;
|
|
27
34
|
/** Adopt a prepared RAD table, retaining any uploads still pending. */
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type * as THREE from "three";
|
|
2
2
|
/** Source blocks hold group IDs; a small float32 table holds their opacities. */
|
|
3
3
|
export declare class SplatOpacityTable {
|
|
4
|
+
/** Store sixteen two-bit fixed group IDs per word instead of one arbitrary ID. */
|
|
5
|
+
readonly packedGroups: boolean;
|
|
4
6
|
private blocks;
|
|
5
7
|
private readonly blockSize;
|
|
6
8
|
private readonly blocksPerLayer;
|
|
@@ -13,7 +15,12 @@ export declare class SplatOpacityTable {
|
|
|
13
15
|
private readonly ranges;
|
|
14
16
|
private readonly freeGroups;
|
|
15
17
|
private nextGroup;
|
|
16
|
-
constructor(
|
|
18
|
+
constructor(
|
|
19
|
+
capacity: number,
|
|
20
|
+
layerSize: number,
|
|
21
|
+
blockBits: number,
|
|
22
|
+
packedGroups?: boolean,
|
|
23
|
+
);
|
|
17
24
|
private createTexture;
|
|
18
25
|
private createValueTexture;
|
|
19
26
|
/** CPU arrays and GPU storage each occupy this many bytes. */
|
|
@@ -21,7 +28,7 @@ export declare class SplatOpacityTable {
|
|
|
21
28
|
getOpacity(source: number): number;
|
|
22
29
|
setGroupOpacity(group: number, opacity: number): boolean;
|
|
23
30
|
private releaseBlock;
|
|
24
|
-
/**
|
|
31
|
+
/** Unpacked ranges retain their group while only its coefficient changes. */
|
|
25
32
|
setOpacity(start: number, count: number, opacity: number): boolean;
|
|
26
33
|
copyBlocks(): Uint32Array<ArrayBuffer>;
|
|
27
34
|
/** Adopt a prepared RAD table, retaining any uploads still pending. */
|
|
@@ -55,7 +55,7 @@ export declare class Splats {
|
|
|
55
55
|
getNumSplats(): number;
|
|
56
56
|
/** @internal Copy cached local bounds into the target box. */
|
|
57
57
|
getBoundingBox(centersOnly?: boolean, target?: THREE.Box3): THREE.Box3;
|
|
58
|
-
getNumSh(): 1 | 2 |
|
|
58
|
+
getNumSh(): 0 | 1 | 2 | 3 | 4;
|
|
59
59
|
/** Current retained bytes for encoded Splat, sort-center, and SH arrays. */
|
|
60
60
|
getByteLength(): number;
|
|
61
61
|
/** @internal Consume owned arrays for transfer to a streaming worker. */
|
|
@@ -55,7 +55,7 @@ export declare class Splats {
|
|
|
55
55
|
getNumSplats(): number;
|
|
56
56
|
/** @internal Copy cached local bounds into the target box. */
|
|
57
57
|
getBoundingBox(centersOnly?: boolean, target?: THREE.Box3): THREE.Box3;
|
|
58
|
-
getNumSh(): 1 | 2 |
|
|
58
|
+
getNumSh(): 0 | 1 | 2 | 3 | 4;
|
|
59
59
|
/** Current retained bytes for encoded Splat, sort-center, and SH arrays. */
|
|
60
60
|
getByteLength(): number;
|
|
61
61
|
/** @internal Consume owned arrays for transfer to a streaming worker. */
|
|
@@ -12,10 +12,12 @@ export declare enum SplatFileType {
|
|
|
12
12
|
RAD = "rad",
|
|
13
13
|
}
|
|
14
14
|
export type SplatExtra = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
shBlock0?: Uint32Array;
|
|
16
|
+
shBlock1?: Uint32Array;
|
|
17
|
+
shBlock2?: Uint32Array;
|
|
18
|
+
shBlock3?: Uint32Array;
|
|
19
|
+
shBlock4?: Uint32Array;
|
|
20
|
+
shBlock5?: Uint32Array;
|
|
19
21
|
};
|
|
20
22
|
/** Morton storage records per cached spatial bounds block. */
|
|
21
23
|
export declare const SPLAT_BOUNDS_BLOCK_SIZE = 256;
|
|
@@ -12,10 +12,12 @@ export declare enum SplatFileType {
|
|
|
12
12
|
RAD = "rad",
|
|
13
13
|
}
|
|
14
14
|
export type SplatExtra = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
shBlock0?: Uint32Array;
|
|
16
|
+
shBlock1?: Uint32Array;
|
|
17
|
+
shBlock2?: Uint32Array;
|
|
18
|
+
shBlock3?: Uint32Array;
|
|
19
|
+
shBlock4?: Uint32Array;
|
|
20
|
+
shBlock5?: Uint32Array;
|
|
19
21
|
};
|
|
20
22
|
/** Morton storage records per cached spatial bounds block. */
|
|
21
23
|
export declare const SPLAT_BOUNDS_BLOCK_SIZE = 256;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { SplatExtra } from "./defines.cjs";
|
|
2
|
-
export declare const SH_KEYS: readonly [
|
|
3
|
-
|
|
2
|
+
export declare const SH_KEYS: readonly [
|
|
3
|
+
"shBlock0",
|
|
4
|
+
"shBlock1",
|
|
5
|
+
"shBlock2",
|
|
6
|
+
"shBlock3",
|
|
7
|
+
"shBlock4",
|
|
8
|
+
"shBlock5",
|
|
9
|
+
];
|
|
10
|
+
export declare const SH_ARRAY_COUNTS: readonly [0, 1, 2, 4, 6];
|
|
4
11
|
/** Merge cached min XYZ / max XYZ values without decoding records. */
|
|
5
12
|
export declare function unionSplatBounds(
|
|
6
13
|
target: Float32Array,
|
|
@@ -8,7 +15,7 @@ export declare function unionSplatBounds(
|
|
|
8
15
|
offset?: number,
|
|
9
16
|
): void;
|
|
10
17
|
export declare function resetSplatBounds(bounds: Float32Array): void;
|
|
11
|
-
export declare function getSplatShDegree(extra: SplatExtra): 1 | 2 |
|
|
18
|
+
export declare function getSplatShDegree(extra: SplatExtra): 0 | 1 | 2 | 3 | 4;
|
|
12
19
|
/** Packed texture storage; capacity includes padding, but excludes sort centers. */
|
|
13
20
|
export declare function getSplatTextureBytes(
|
|
14
21
|
capacity: number,
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import type { SplatExtra } from "./defines.js";
|
|
2
|
-
export declare const SH_KEYS: readonly [
|
|
3
|
-
|
|
2
|
+
export declare const SH_KEYS: readonly [
|
|
3
|
+
"shBlock0",
|
|
4
|
+
"shBlock1",
|
|
5
|
+
"shBlock2",
|
|
6
|
+
"shBlock3",
|
|
7
|
+
"shBlock4",
|
|
8
|
+
"shBlock5",
|
|
9
|
+
];
|
|
10
|
+
export declare const SH_ARRAY_COUNTS: readonly [0, 1, 2, 4, 6];
|
|
4
11
|
/** Merge cached min XYZ / max XYZ values without decoding records. */
|
|
5
12
|
export declare function unionSplatBounds(
|
|
6
13
|
target: Float32Array,
|
|
@@ -8,7 +15,7 @@ export declare function unionSplatBounds(
|
|
|
8
15
|
offset?: number,
|
|
9
16
|
): void;
|
|
10
17
|
export declare function resetSplatBounds(bounds: Float32Array): void;
|
|
11
|
-
export declare function getSplatShDegree(extra: SplatExtra): 1 | 2 |
|
|
18
|
+
export declare function getSplatShDegree(extra: SplatExtra): 0 | 1 | 2 | 3 | 4;
|
|
12
19
|
/** Packed texture storage; capacity includes padding, but excludes sort centers. */
|
|
13
20
|
export declare function getSplatTextureBytes(
|
|
14
21
|
capacity: number,
|
|
@@ -67,7 +67,7 @@ export declare const InputField: {
|
|
|
67
67
|
/** @internal */
|
|
68
68
|
export type InputField = (typeof InputField)[keyof typeof InputField];
|
|
69
69
|
/** @internal */
|
|
70
|
-
export declare const SH_COEFFICIENT_COUNT =
|
|
70
|
+
export declare const SH_COEFFICIENT_COUNT = 24;
|
|
71
71
|
/** @internal */
|
|
72
72
|
export type SplatPostDecodeValueType =
|
|
73
73
|
| "float"
|
|
@@ -184,8 +184,10 @@ export type PostDecodeSplatData = {
|
|
|
184
184
|
splat1: Uint32Array;
|
|
185
185
|
sortCenters: Float32Array;
|
|
186
186
|
sourceIds?: Uint32Array;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
shBlock0?: Uint32Array;
|
|
188
|
+
shBlock1?: Uint32Array;
|
|
189
|
+
shBlock2?: Uint32Array;
|
|
190
|
+
shBlock3?: Uint32Array;
|
|
191
|
+
shBlock4?: Uint32Array;
|
|
192
|
+
shBlock5?: Uint32Array;
|
|
191
193
|
};
|
|
@@ -67,7 +67,7 @@ export declare const InputField: {
|
|
|
67
67
|
/** @internal */
|
|
68
68
|
export type InputField = (typeof InputField)[keyof typeof InputField];
|
|
69
69
|
/** @internal */
|
|
70
|
-
export declare const SH_COEFFICIENT_COUNT =
|
|
70
|
+
export declare const SH_COEFFICIENT_COUNT = 24;
|
|
71
71
|
/** @internal */
|
|
72
72
|
export type SplatPostDecodeValueType =
|
|
73
73
|
| "float"
|
|
@@ -184,8 +184,10 @@ export type PostDecodeSplatData = {
|
|
|
184
184
|
splat1: Uint32Array;
|
|
185
185
|
sortCenters: Float32Array;
|
|
186
186
|
sourceIds?: Uint32Array;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
shBlock0?: Uint32Array;
|
|
188
|
+
shBlock1?: Uint32Array;
|
|
189
|
+
shBlock2?: Uint32Array;
|
|
190
|
+
shBlock3?: Uint32Array;
|
|
191
|
+
shBlock4?: Uint32Array;
|
|
192
|
+
shBlock5?: Uint32Array;
|
|
191
193
|
};
|
|
@@ -4,13 +4,10 @@ type StreamWorker = {
|
|
|
4
4
|
peakWasmMemoryBytes: number;
|
|
5
5
|
dispose(reason?: unknown): void;
|
|
6
6
|
};
|
|
7
|
-
type
|
|
7
|
+
type LoadTask<W> = {
|
|
8
8
|
worker: W;
|
|
9
9
|
/** The retained cache handle releases this reference once on disposal. */
|
|
10
10
|
retain: () => () => void;
|
|
11
|
-
release: () => void;
|
|
12
|
-
};
|
|
13
|
-
type LoadTask<W> = WorkerLease<W> & {
|
|
14
11
|
id: number;
|
|
15
12
|
signal: AbortSignal;
|
|
16
13
|
start: (url: string) => void;
|
|
@@ -4,13 +4,10 @@ type StreamWorker = {
|
|
|
4
4
|
peakWasmMemoryBytes: number;
|
|
5
5
|
dispose(reason?: unknown): void;
|
|
6
6
|
};
|
|
7
|
-
type
|
|
7
|
+
type LoadTask<W> = {
|
|
8
8
|
worker: W;
|
|
9
9
|
/** The retained cache handle releases this reference once on disposal. */
|
|
10
10
|
retain: () => () => void;
|
|
11
|
-
release: () => void;
|
|
12
|
-
};
|
|
13
|
-
type LoadTask<W> = WorkerLease<W> & {
|
|
14
11
|
id: number;
|
|
15
12
|
signal: AbortSignal;
|
|
16
13
|
start: (url: string) => void;
|
|
@@ -2,22 +2,25 @@ import type { RadMeta } from "../../rad/radFormat.cjs";
|
|
|
2
2
|
import type { RadStreamSelection } from "./radFade.cjs";
|
|
3
3
|
import type { RadLodRequest, RadLodSelection } from "./radLod.cjs";
|
|
4
4
|
export type RadSelectionRequest = RadLodRequest & {
|
|
5
|
-
/**
|
|
5
|
+
/** Fade baseline: the preparing cut, or the displayed cut when none is pending. */
|
|
6
6
|
previousId?: number;
|
|
7
|
+
/** Retain the displayed cut if preparation is cancelled. */
|
|
8
|
+
displayedId?: number;
|
|
9
|
+
/** Retain a waiting cut that may start preparation while traversal runs. */
|
|
7
10
|
readyId?: number;
|
|
8
11
|
fade?: boolean;
|
|
9
12
|
};
|
|
10
13
|
export type RadSelectionReply = RadStreamSelection & {
|
|
11
14
|
retainedBytes: number;
|
|
12
15
|
};
|
|
13
|
-
/** Worker-owned cuts. Requests pin the displayed and waiting cuts;
|
|
14
|
-
* those
|
|
16
|
+
/** Worker-owned cuts. Requests pin the baseline, displayed and waiting cuts;
|
|
17
|
+
* at most those three plus the new result survive. Replies copy cached buffers. */
|
|
15
18
|
export declare class RadSelectionState {
|
|
16
19
|
private readonly cuts;
|
|
17
20
|
private nextId;
|
|
18
21
|
prepare(
|
|
19
22
|
meta: RadMeta,
|
|
20
23
|
selected: RadLodSelection,
|
|
21
|
-
{ previousId, readyId, fade }: RadSelectionRequest,
|
|
24
|
+
{ previousId, displayedId, readyId, fade }: RadSelectionRequest,
|
|
22
25
|
): RadSelectionReply;
|
|
23
26
|
}
|
|
@@ -2,22 +2,25 @@ import type { RadMeta } from "../../rad/radFormat.js";
|
|
|
2
2
|
import type { RadStreamSelection } from "./radFade.js";
|
|
3
3
|
import type { RadLodRequest, RadLodSelection } from "./radLod.js";
|
|
4
4
|
export type RadSelectionRequest = RadLodRequest & {
|
|
5
|
-
/**
|
|
5
|
+
/** Fade baseline: the preparing cut, or the displayed cut when none is pending. */
|
|
6
6
|
previousId?: number;
|
|
7
|
+
/** Retain the displayed cut if preparation is cancelled. */
|
|
8
|
+
displayedId?: number;
|
|
9
|
+
/** Retain a waiting cut that may start preparation while traversal runs. */
|
|
7
10
|
readyId?: number;
|
|
8
11
|
fade?: boolean;
|
|
9
12
|
};
|
|
10
13
|
export type RadSelectionReply = RadStreamSelection & {
|
|
11
14
|
retainedBytes: number;
|
|
12
15
|
};
|
|
13
|
-
/** Worker-owned cuts. Requests pin the displayed and waiting cuts;
|
|
14
|
-
* those
|
|
16
|
+
/** Worker-owned cuts. Requests pin the baseline, displayed and waiting cuts;
|
|
17
|
+
* at most those three plus the new result survive. Replies copy cached buffers. */
|
|
15
18
|
export declare class RadSelectionState {
|
|
16
19
|
private readonly cuts;
|
|
17
20
|
private nextId;
|
|
18
21
|
prepare(
|
|
19
22
|
meta: RadMeta,
|
|
20
23
|
selected: RadLodSelection,
|
|
21
|
-
{ previousId, readyId, fade }: RadSelectionRequest,
|
|
24
|
+
{ previousId, displayedId, readyId, fade }: RadSelectionRequest,
|
|
22
25
|
): RadSelectionReply;
|
|
23
26
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { RadSource, RadSourceOptions } from "../../rad/RadSource.cjs";
|
|
2
2
|
import type { RadHeader, RadStreamChunk } from "../../rad/radFormat.cjs";
|
|
3
3
|
import type { RadSelectionRequest } from "./RadSelectionState.cjs";
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
RadSelectionPreparation,
|
|
6
|
+
prepareRadSelection,
|
|
7
|
+
} from "./prepareRadSelection.cjs";
|
|
5
8
|
import type { RadStreamSelection } from "./radFade.cjs";
|
|
6
9
|
export type RadStreamLoaderOptions = Pick<
|
|
7
10
|
RadSourceOptions,
|
|
@@ -13,11 +16,13 @@ export type RadStreamLoaderOptions = Pick<
|
|
|
13
16
|
| "requestHeader"
|
|
14
17
|
| "withCredentials"
|
|
15
18
|
>;
|
|
16
|
-
/**
|
|
19
|
+
/** Separate traversal and display preparation workers, plus bounded page decoders. */
|
|
17
20
|
export declare class RadStreamLoader {
|
|
18
21
|
private readonly options;
|
|
22
|
+
private readonly onRegistrationSettled;
|
|
19
23
|
readonly source: RadSource;
|
|
20
24
|
private readonly lodWorker;
|
|
25
|
+
private readonly preparationWorker;
|
|
21
26
|
private readonly pool;
|
|
22
27
|
private readonly decoderReady;
|
|
23
28
|
private readonly controller;
|
|
@@ -27,9 +32,15 @@ export declare class RadStreamLoader {
|
|
|
27
32
|
private initialRoot?;
|
|
28
33
|
private rootBytes?;
|
|
29
34
|
private pending;
|
|
35
|
+
readonly pendingRegistrationBytes: number;
|
|
30
36
|
private estimatedCodebookBytes;
|
|
31
37
|
private selectionBytes;
|
|
32
|
-
|
|
38
|
+
private preparationBytes;
|
|
39
|
+
constructor(
|
|
40
|
+
options: RadStreamLoaderOptions,
|
|
41
|
+
maxConcurrentLoads: number,
|
|
42
|
+
onRegistrationSettled: () => void,
|
|
43
|
+
);
|
|
33
44
|
get stats(): {
|
|
34
45
|
cachedBytes: number;
|
|
35
46
|
downloadedBytes: number;
|
|
@@ -38,31 +49,23 @@ export declare class RadStreamLoader {
|
|
|
38
49
|
bootstrapBytes: number;
|
|
39
50
|
selectionBytes: number;
|
|
40
51
|
};
|
|
41
|
-
|
|
52
|
+
/** Reserve the source cache and codebooks for all decoder workers. */
|
|
53
|
+
get residentCpuOverheadBytes(): number;
|
|
54
|
+
get selectionWorkerLost(): boolean;
|
|
42
55
|
private assertActive;
|
|
43
56
|
initialize(signal?: AbortSignal): Promise<RadHeader>;
|
|
44
57
|
loadChunk(
|
|
45
58
|
index: number,
|
|
46
59
|
signal?: AbortSignal,
|
|
47
|
-
|
|
48
|
-
): Promise<RadStreamChunk>;
|
|
60
|
+
): Promise<{ data: RadStreamChunk; registration: Promise<void> }>;
|
|
49
61
|
private loadChunkInternal;
|
|
50
62
|
private decode;
|
|
63
|
+
private registerChunk;
|
|
51
64
|
getChunkUrl(index: number): string;
|
|
52
65
|
selectLod(request: RadSelectionRequest): Promise<RadStreamSelection>;
|
|
53
66
|
prepareSelection(
|
|
54
67
|
request: Parameters<typeof prepareRadSelection>[0],
|
|
55
|
-
): Promise<
|
|
56
|
-
selection: {
|
|
57
|
-
indices: Uint32Array;
|
|
58
|
-
wantedChunks: Uint32Array;
|
|
59
|
-
touchedChunks: Uint32Array;
|
|
60
|
-
selectionId: number;
|
|
61
|
-
changedChunks: Uint32Array;
|
|
62
|
-
};
|
|
63
|
-
fade: boolean;
|
|
64
|
-
pools: import("../../../data/RadPagedSplats.cjs").RadPreparedSelection[];
|
|
65
|
-
}>;
|
|
68
|
+
): Promise<RadSelectionPreparation>;
|
|
66
69
|
releaseChunk(index: number, generation?: number): void;
|
|
67
70
|
dispose(): void;
|
|
68
71
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { RadSource, RadSourceOptions } from "../../rad/RadSource.js";
|
|
2
2
|
import type { RadHeader, RadStreamChunk } from "../../rad/radFormat.js";
|
|
3
3
|
import type { RadSelectionRequest } from "./RadSelectionState.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type {
|
|
5
|
+
RadSelectionPreparation,
|
|
6
|
+
prepareRadSelection,
|
|
7
|
+
} from "./prepareRadSelection.js";
|
|
5
8
|
import type { RadStreamSelection } from "./radFade.js";
|
|
6
9
|
export type RadStreamLoaderOptions = Pick<
|
|
7
10
|
RadSourceOptions,
|
|
@@ -13,11 +16,13 @@ export type RadStreamLoaderOptions = Pick<
|
|
|
13
16
|
| "requestHeader"
|
|
14
17
|
| "withCredentials"
|
|
15
18
|
>;
|
|
16
|
-
/**
|
|
19
|
+
/** Separate traversal and display preparation workers, plus bounded page decoders. */
|
|
17
20
|
export declare class RadStreamLoader {
|
|
18
21
|
private readonly options;
|
|
22
|
+
private readonly onRegistrationSettled;
|
|
19
23
|
readonly source: RadSource;
|
|
20
24
|
private readonly lodWorker;
|
|
25
|
+
private readonly preparationWorker;
|
|
21
26
|
private readonly pool;
|
|
22
27
|
private readonly decoderReady;
|
|
23
28
|
private readonly controller;
|
|
@@ -27,9 +32,15 @@ export declare class RadStreamLoader {
|
|
|
27
32
|
private initialRoot?;
|
|
28
33
|
private rootBytes?;
|
|
29
34
|
private pending;
|
|
35
|
+
readonly pendingRegistrationBytes: number;
|
|
30
36
|
private estimatedCodebookBytes;
|
|
31
37
|
private selectionBytes;
|
|
32
|
-
|
|
38
|
+
private preparationBytes;
|
|
39
|
+
constructor(
|
|
40
|
+
options: RadStreamLoaderOptions,
|
|
41
|
+
maxConcurrentLoads: number,
|
|
42
|
+
onRegistrationSettled: () => void,
|
|
43
|
+
);
|
|
33
44
|
get stats(): {
|
|
34
45
|
cachedBytes: number;
|
|
35
46
|
downloadedBytes: number;
|
|
@@ -38,31 +49,23 @@ export declare class RadStreamLoader {
|
|
|
38
49
|
bootstrapBytes: number;
|
|
39
50
|
selectionBytes: number;
|
|
40
51
|
};
|
|
41
|
-
|
|
52
|
+
/** Reserve the source cache and codebooks for all decoder workers. */
|
|
53
|
+
get residentCpuOverheadBytes(): number;
|
|
54
|
+
get selectionWorkerLost(): boolean;
|
|
42
55
|
private assertActive;
|
|
43
56
|
initialize(signal?: AbortSignal): Promise<RadHeader>;
|
|
44
57
|
loadChunk(
|
|
45
58
|
index: number,
|
|
46
59
|
signal?: AbortSignal,
|
|
47
|
-
|
|
48
|
-
): Promise<RadStreamChunk>;
|
|
60
|
+
): Promise<{ data: RadStreamChunk; registration: Promise<void> }>;
|
|
49
61
|
private loadChunkInternal;
|
|
50
62
|
private decode;
|
|
63
|
+
private registerChunk;
|
|
51
64
|
getChunkUrl(index: number): string;
|
|
52
65
|
selectLod(request: RadSelectionRequest): Promise<RadStreamSelection>;
|
|
53
66
|
prepareSelection(
|
|
54
67
|
request: Parameters<typeof prepareRadSelection>[0],
|
|
55
|
-
): Promise<
|
|
56
|
-
selection: {
|
|
57
|
-
indices: Uint32Array;
|
|
58
|
-
wantedChunks: Uint32Array;
|
|
59
|
-
touchedChunks: Uint32Array;
|
|
60
|
-
selectionId: number;
|
|
61
|
-
changedChunks: Uint32Array;
|
|
62
|
-
};
|
|
63
|
-
fade: boolean;
|
|
64
|
-
pools: import("../../../data/RadPagedSplats.js").RadPreparedSelection[];
|
|
65
|
-
}>;
|
|
68
|
+
): Promise<RadSelectionPreparation>;
|
|
66
69
|
releaseChunk(index: number, generation?: number): void;
|
|
67
70
|
dispose(): void;
|
|
68
71
|
}
|
|
@@ -3,8 +3,16 @@ import type { StreamResolutionSource } from "../StreamCameras.cjs";
|
|
|
3
3
|
import type { StreamSchedulerOptions, StreamStats } from "../streamOptions.cjs";
|
|
4
4
|
import type { RadStreamLoaderOptions } from "./RadStreamLoader.cjs";
|
|
5
5
|
export type RadStreamSchedulerOptions = RadStreamLoaderOptions &
|
|
6
|
-
StreamSchedulerOptions
|
|
6
|
+
StreamSchedulerOptions & {
|
|
7
|
+
/** Allowed fractional splat budget overshoot. Default: 0.1; 0 forbids overshoot. */
|
|
8
|
+
splatBudgetTolerance?: number;
|
|
9
|
+
/** Retained CPU byte budget, excluding pending copies and WASM. Default: 2 GiB. */
|
|
10
|
+
maxResidentCpuBytes?: number;
|
|
11
|
+
/** Estimated GPU byte budget for resident streaming data. Default: 1 GiB. */
|
|
12
|
+
maxResidentGpuBytes?: number;
|
|
13
|
+
};
|
|
7
14
|
export type RadStreamStats = StreamStats & {
|
|
15
|
+
/** Resident page limit derived from the smaller CPU/GPU allowance. */
|
|
8
16
|
pageBudget: number;
|
|
9
17
|
lodTimeMs: number;
|
|
10
18
|
};
|
|
@@ -17,7 +25,10 @@ export declare class RadStreamScheduler {
|
|
|
17
25
|
readonly cooldownMs: number;
|
|
18
26
|
readonly fadeDurationMs: number;
|
|
19
27
|
readonly maxConcurrentLoads: number;
|
|
28
|
+
readonly maxResidentCpuBytes: number;
|
|
29
|
+
readonly maxResidentGpuBytes: number;
|
|
20
30
|
private _splatBudget;
|
|
31
|
+
private _splatBudgetTolerance;
|
|
21
32
|
private readonly loader;
|
|
22
33
|
private readonly abort;
|
|
23
34
|
private readonly streamCameras;
|
|
@@ -46,9 +57,12 @@ export declare class RadStreamScheduler {
|
|
|
46
57
|
private resolveFirst;
|
|
47
58
|
private rejectFirst;
|
|
48
59
|
constructor(options: RadStreamSchedulerOptions);
|
|
49
|
-
/**
|
|
60
|
+
/** Target selected-node budget. Assigning a new value requests LOD selection. */
|
|
50
61
|
get splatBudget(): number;
|
|
51
62
|
set splatBudget(value: number);
|
|
63
|
+
/** Allowed fractional budget overshoot; zero forbids overshoot. */
|
|
64
|
+
get splatBudgetTolerance(): number;
|
|
65
|
+
set splatBudgetTolerance(value: number);
|
|
52
66
|
/** Cameras that select detail, in registration order. */
|
|
53
67
|
get cameras(): readonly THREE.Camera[];
|
|
54
68
|
hasCamera(camera: THREE.Camera): boolean;
|
|
@@ -84,6 +98,7 @@ export declare class RadStreamScheduler {
|
|
|
84
98
|
* detail any of them needs.
|
|
85
99
|
*/
|
|
86
100
|
update(): boolean;
|
|
101
|
+
private get selectionBaselineId();
|
|
87
102
|
private requestSelection;
|
|
88
103
|
private selectionPagesReady;
|
|
89
104
|
private prepareSelection;
|
|
@@ -102,6 +117,7 @@ export declare class RadStreamScheduler {
|
|
|
102
117
|
private reservePages;
|
|
103
118
|
private uploadPages;
|
|
104
119
|
private releasePage;
|
|
120
|
+
private isPageRequired;
|
|
105
121
|
private releaseUnused;
|
|
106
122
|
/** Map a raycast hit's rendered index back to its stable file index. */
|
|
107
123
|
getGlobalIndex(mesh: THREE.Object3D, renderedIndex: number): number;
|