gaussian-splat-lite 1.4.2 → 1.4.3

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.
Files changed (48) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/bin/build-lod.js +17 -2
  3. package/bin/rad/parallel.js +7 -6
  4. package/bin/rad/splats.js +27 -10
  5. package/dist/gaussian-splat-lite.cjs +104 -70
  6. package/dist/gaussian-splat-lite.cjs.map +1 -1
  7. package/dist/gaussian-splat-lite.min.cjs +51 -51
  8. package/dist/gaussian-splat-lite.min.cjs.map +1 -1
  9. package/dist/gaussian-splat-lite.module.js +104 -70
  10. package/dist/gaussian-splat-lite.module.js.map +1 -1
  11. package/dist/gaussian-splat-lite.module.min.js +563 -544
  12. package/dist/gaussian-splat-lite.module.min.js.map +1 -1
  13. package/dist/types/data/IndexedSplats.d.cts +1 -4
  14. package/dist/types/data/IndexedSplats.d.ts +1 -4
  15. package/dist/types/data/Splats.d.cts +2 -6
  16. package/dist/types/data/Splats.d.ts +2 -6
  17. package/dist/types/data/defines.d.cts +3 -4
  18. package/dist/types/data/defines.d.ts +3 -4
  19. package/dist/types/data/splatData.d.cts +1 -1
  20. package/dist/types/data/splatData.d.ts +1 -1
  21. package/dist/types/data/splatRange.d.cts +1 -1
  22. package/dist/types/data/splatRange.d.ts +1 -1
  23. package/dist/types/loaders/morton.d.cts +6 -3
  24. package/dist/types/loaders/morton.d.ts +6 -3
  25. package/dist/types/loaders/postDecode/protocol.d.cts +1 -0
  26. package/dist/types/loaders/postDecode/protocol.d.ts +1 -0
  27. package/dist/types/loaders/rad.d.cts +5 -5
  28. package/dist/types/loaders/rad.d.ts +5 -5
  29. package/dist/types/loaders/stream/rad-stream/RadStreamScheduler.d.cts +0 -2
  30. package/dist/types/loaders/stream/rad-stream/RadStreamScheduler.d.ts +0 -2
  31. package/dist/types/loaders/stream/sog-stream/SogStreamLoader.d.cts +1 -1
  32. package/dist/types/loaders/stream/sog-stream/SogStreamLoader.d.ts +1 -1
  33. package/dist/types/loaders/stream/sog-stream/SogStreamScheduler.d.cts +16 -2
  34. package/dist/types/loaders/stream/sog-stream/SogStreamScheduler.d.ts +16 -2
  35. package/dist/types/loaders/stream/sog-stream/sogLod.d.cts +8 -9
  36. package/dist/types/loaders/stream/sog-stream/sogLod.d.ts +8 -9
  37. package/dist/types/loaders/stream/sog-stream/sogVisibility.d.cts +13 -7
  38. package/dist/types/loaders/stream/sog-stream/sogVisibility.d.ts +13 -7
  39. package/dist/types/loaders/stream/streamOptions.d.cts +1 -1
  40. package/dist/types/loaders/stream/streamOptions.d.ts +1 -1
  41. package/dist/types/scene/SplatMesh.d.cts +0 -2
  42. package/dist/types/scene/SplatMesh.d.ts +0 -2
  43. package/docs/BuildRad.md +1 -0
  44. package/docs/RadStreamScheduler.md +4 -4
  45. package/docs/SogStreamScheduler.md +14 -4
  46. package/docs/SplatMesh.md +2 -2
  47. package/docs/Splats.md +1 -3
  48. package/package.json +1 -1
@@ -53,7 +53,6 @@ export declare abstract class IndexedSplats extends Splats {
53
53
  allocation: number,
54
54
  ): void;
55
55
  private getStorageIndex;
56
- getSourceIndex(index: number): number;
57
56
  private checkVisibleRange;
58
57
  getNumSh(): 0 | 1 | 2 | 3 | 4;
59
58
  /** Estimated GPU storage for packed records, render indices and opacity tables. */
@@ -84,9 +83,7 @@ export declare abstract class IndexedSplats extends Splats {
84
83
  callback: (index: number, x: number, y: number, z: number) => void,
85
84
  ): void;
86
85
  forEachSplat(callback: Parameters<Splats["forEachSplat"]>[0]): void;
87
- takeData(): SplatResult & {
88
- sourceIds: Uint32Array;
89
- };
86
+ takeData(): SplatResult;
90
87
  setTextureUniforms(uniforms: Record<string, THREE.IUniform>): void;
91
88
  dispose(): void;
92
89
  }
@@ -53,7 +53,6 @@ export declare abstract class IndexedSplats extends Splats {
53
53
  allocation: number,
54
54
  ): void;
55
55
  private getStorageIndex;
56
- getSourceIndex(index: number): number;
57
56
  private checkVisibleRange;
58
57
  getNumSh(): 0 | 1 | 2 | 3 | 4;
59
58
  /** Estimated GPU storage for packed records, render indices and opacity tables. */
@@ -84,9 +83,7 @@ export declare abstract class IndexedSplats extends Splats {
84
83
  callback: (index: number, x: number, y: number, z: number) => void,
85
84
  ): void;
86
85
  forEachSplat(callback: Parameters<Splats["forEachSplat"]>[0]): void;
87
- takeData(): SplatResult & {
88
- sourceIds: Uint32Array;
89
- };
86
+ takeData(): SplatResult;
90
87
  setTextureUniforms(uniforms: Record<string, THREE.IUniform>): void;
91
88
  dispose(): void;
92
89
  }
@@ -33,7 +33,7 @@ export declare class Splats {
33
33
  numSplats: number;
34
34
  private splatArrays;
35
35
  private sortCenters?;
36
- protected sourceIds: Uint32Array;
36
+ private storageOrder?;
37
37
  protected centerOnlyBounds: Float32Array;
38
38
  protected bounds: Float32Array;
39
39
  private spatialBounds;
@@ -59,11 +59,7 @@ export declare class Splats {
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. */
62
- takeData(): SplatResult & {
63
- sourceIds: Uint32Array;
64
- };
65
- /** Original source ID, retained across reordering and range extraction. */
66
- getSourceIndex(index: number): number;
62
+ takeData(): SplatResult;
67
63
  getSplat(index: number): DecodedSplatWithSh;
68
64
  getSplat(index: number, includeSh: true): DecodedSplatWithSh;
69
65
  getSplat(index: number, includeSh: false): DecodedSplat;
@@ -33,7 +33,7 @@ export declare class Splats {
33
33
  numSplats: number;
34
34
  private splatArrays;
35
35
  private sortCenters?;
36
- protected sourceIds: Uint32Array;
36
+ private storageOrder?;
37
37
  protected centerOnlyBounds: Float32Array;
38
38
  protected bounds: Float32Array;
39
39
  private spatialBounds;
@@ -59,11 +59,7 @@ export declare class Splats {
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. */
62
- takeData(): SplatResult & {
63
- sourceIds: Uint32Array;
64
- };
65
- /** Original source ID, retained across reordering and range extraction. */
66
- getSourceIndex(index: number): number;
62
+ takeData(): SplatResult;
67
63
  getSplat(index: number): DecodedSplatWithSh;
68
64
  getSplat(index: number, includeSh: true): DecodedSplatWithSh;
69
65
  getSplat(index: number, includeSh: false): DecodedSplat;
@@ -25,8 +25,8 @@ export type SplatResult = {
25
25
  numSplats: number;
26
26
  splatArrays: [Uint32Array, Uint32Array];
27
27
  sortCenters?: Float32Array;
28
- /** Storage index to original source index; absent for identity order. */
29
- sourceIds?: Uint32Array;
28
+ /** Internal permutation for restoring custom SOG chunks to decoded record order. */
29
+ storageOrder?: Uint32Array;
30
30
  /** Local finite center bounds: min XYZ followed by max XYZ. */
31
31
  centerOnlyBoundingBox?: Float32Array;
32
32
  /** Local scale/rotation bounds at source alpha 0.01, including kernel shape. */
@@ -35,9 +35,8 @@ export type SplatResult = {
35
35
  spatialBounds?: Float32Array;
36
36
  extra: SplatExtra;
37
37
  };
38
- /** Spatially reordered records with source IDs and cached local bounds. */
38
+ /** Spatially reordered records with cached local bounds. */
39
39
  export type ReorderedSplatResult = SplatResult & {
40
- sourceIds: Uint32Array;
41
40
  centerOnlyBoundingBox: Float32Array;
42
41
  boundingBox: Float32Array;
43
42
  spatialBounds: Float32Array;
@@ -25,8 +25,8 @@ export type SplatResult = {
25
25
  numSplats: number;
26
26
  splatArrays: [Uint32Array, Uint32Array];
27
27
  sortCenters?: Float32Array;
28
- /** Storage index to original source index; absent for identity order. */
29
- sourceIds?: Uint32Array;
28
+ /** Internal permutation for restoring custom SOG chunks to decoded record order. */
29
+ storageOrder?: Uint32Array;
30
30
  /** Local finite center bounds: min XYZ followed by max XYZ. */
31
31
  centerOnlyBoundingBox?: Float32Array;
32
32
  /** Local scale/rotation bounds at source alpha 0.01, including kernel shape. */
@@ -35,9 +35,8 @@ export type SplatResult = {
35
35
  spatialBounds?: Float32Array;
36
36
  extra: SplatExtra;
37
37
  };
38
- /** Spatially reordered records with source IDs and cached local bounds. */
38
+ /** Spatially reordered records with cached local bounds. */
39
39
  export type ReorderedSplatResult = SplatResult & {
40
- sourceIds: Uint32Array;
41
40
  centerOnlyBoundingBox: Float32Array;
42
41
  boundingBox: Float32Array;
43
42
  spatialBounds: Float32Array;
@@ -25,7 +25,7 @@ export declare function getSplatTextureBytes(
25
25
  export declare function getSplatByteLength(data: {
26
26
  splatArrays: readonly Uint32Array[];
27
27
  sortCenters?: Float32Array;
28
- sourceIds?: Uint32Array;
28
+ storageOrder?: Uint32Array;
29
29
  centerOnlyBoundingBox?: Float32Array;
30
30
  boundingBox?: Float32Array;
31
31
  spatialBounds?: Float32Array;
@@ -25,7 +25,7 @@ export declare function getSplatTextureBytes(
25
25
  export declare function getSplatByteLength(data: {
26
26
  splatArrays: readonly Uint32Array[];
27
27
  sortCenters?: Float32Array;
28
- sourceIds?: Uint32Array;
28
+ storageOrder?: Uint32Array;
29
29
  centerOnlyBoundingBox?: Float32Array;
30
30
  boundingBox?: Float32Array;
31
31
  spatialBounds?: Float32Array;
@@ -1,5 +1,5 @@
1
1
  import type { SplatResult } from "./defines.cjs";
2
- /** Copy file-order records; the caller assigns source IDs after reordering. */
2
+ /** Copy a contiguous range of file-order records before spatial reordering. */
3
3
  export declare function extractSplatRange(
4
4
  source: SplatResult,
5
5
  start: number,
@@ -1,5 +1,5 @@
1
1
  import type { SplatResult } from "./defines.js";
2
- /** Copy file-order records; the caller assigns source IDs after reordering. */
2
+ /** Copy a contiguous range of file-order records before spatial reordering. */
3
3
  export declare function extractSplatRange(
4
4
  source: SplatResult,
5
5
  start: number,
@@ -1,9 +1,12 @@
1
1
  import type { ReorderedSplatResult, SplatResult } from "../data/defines.cjs";
2
- /** Reorder packed attributes together and retain their original source indices. */
2
+ /** Reorder packed attributes and bounds, optionally writing the storage permutation. */
3
3
  export declare function reorderSplats(
4
4
  data: SplatResult,
5
- boundsBlocks?: Float32Array,
6
- onProgress?: (loaded: number, total: number) => void,
5
+ options?: {
6
+ boundsBlocks?: Float32Array;
7
+ storageOrder?: Uint32Array;
8
+ onProgress?: (loaded: number, total: number) => void;
9
+ },
7
10
  ): asserts data is ReorderedSplatResult;
8
11
  /** Restore packed chunk file order bit for bit; discard unused sort centers. */
9
12
  export declare function restoreSplatOrder(data: SplatResult): void;
@@ -1,9 +1,12 @@
1
1
  import type { ReorderedSplatResult, SplatResult } from "../data/defines.js";
2
- /** Reorder packed attributes together and retain their original source indices. */
2
+ /** Reorder packed attributes and bounds, optionally writing the storage permutation. */
3
3
  export declare function reorderSplats(
4
4
  data: SplatResult,
5
- boundsBlocks?: Float32Array,
6
- onProgress?: (loaded: number, total: number) => void,
5
+ options?: {
6
+ boundsBlocks?: Float32Array;
7
+ storageOrder?: Uint32Array;
8
+ onProgress?: (loaded: number, total: number) => void;
9
+ },
7
10
  ): asserts data is ReorderedSplatResult;
8
11
  /** Restore packed chunk file order bit for bit; discard unused sort centers. */
9
12
  export declare function restoreSplatOrder(data: SplatResult): void;
@@ -183,6 +183,7 @@ export type PostDecodeSplatData = {
183
183
  splat0: Uint32Array;
184
184
  splat1: Uint32Array;
185
185
  sortCenters: Float32Array;
186
+ /** Original RAD node indices for attributes after non-leaf records are omitted. */
186
187
  sourceIds?: Uint32Array;
187
188
  shBlock0?: Uint32Array;
188
189
  shBlock1?: Uint32Array;
@@ -183,6 +183,7 @@ export type PostDecodeSplatData = {
183
183
  splat0: Uint32Array;
184
184
  splat1: Uint32Array;
185
185
  sortCenters: Float32Array;
186
+ /** Original RAD node indices for attributes after non-leaf records are omitted. */
186
187
  sourceIds?: Uint32Array;
187
188
  shBlock0?: Uint32Array;
188
189
  shBlock1?: Uint32Array;
@@ -1,8 +1,8 @@
1
- import type { SplatSourceArgs as LoadRadArgs } from "./loadTypes.cjs";
1
+ import type { SplatLoadArgs, SplatSourceArgs } from "./loadTypes.cjs";
2
2
  import type { PostDecodeSplatData } from "./postDecode/protocol.cjs";
3
3
  export { isRadPrefix } from "./rad/radFormat.cjs";
4
- type RadOutput = PostDecodeSplatData & {
5
- sourceIds: Uint32Array;
6
- };
4
+ type LoadRadArgs = SplatSourceArgs & Pick<SplatLoadArgs, "postDecode">;
7
5
  /** Complete-file RAD decode with validated chunk coverage and LOD trees. */
8
- export declare function loadRad(args: LoadRadArgs): Promise<RadOutput>;
6
+ export declare function loadRad(
7
+ args: LoadRadArgs,
8
+ ): Promise<PostDecodeSplatData>;
@@ -1,8 +1,8 @@
1
- import type { SplatSourceArgs as LoadRadArgs } from "./loadTypes.js";
1
+ import type { SplatLoadArgs, SplatSourceArgs } from "./loadTypes.js";
2
2
  import type { PostDecodeSplatData } from "./postDecode/protocol.js";
3
3
  export { isRadPrefix } from "./rad/radFormat.js";
4
- type RadOutput = PostDecodeSplatData & {
5
- sourceIds: Uint32Array;
6
- };
4
+ type LoadRadArgs = SplatSourceArgs & Pick<SplatLoadArgs, "postDecode">;
7
5
  /** Complete-file RAD decode with validated chunk coverage and LOD trees. */
8
- export declare function loadRad(args: LoadRadArgs): Promise<RadOutput>;
6
+ export declare function loadRad(
7
+ args: LoadRadArgs,
8
+ ): Promise<PostDecodeSplatData>;
@@ -119,8 +119,6 @@ export declare class RadStreamScheduler {
119
119
  private releasePage;
120
120
  private isPageRequired;
121
121
  private releaseUnused;
122
- /** Map a raycast hit's rendered index back to its stable file index. */
123
- getGlobalIndex(mesh: THREE.Object3D, renderedIndex: number): number;
124
122
  private changed;
125
123
  private failed;
126
124
  private stopRefinement;
@@ -119,8 +119,6 @@ export declare class RadStreamScheduler {
119
119
  private releasePage;
120
120
  private isPageRequired;
121
121
  private releaseUnused;
122
- /** Map a raycast hit's rendered index back to its stable file index. */
123
- getGlobalIndex(mesh: THREE.Object3D, renderedIndex: number): number;
124
122
  private changed;
125
123
  private failed;
126
124
  private stopRefinement;
@@ -6,7 +6,7 @@ import type { SogLodRequest } from "./sogVisibility.cjs";
6
6
  import type { SogChunkInfo } from "./workerHandlers.cjs";
7
7
  export type SogStreamLoaderOptions = StreamRequestOptions & {
8
8
  url: string;
9
- /** Returns owned data in file order, or with a complete source ID map. */
9
+ /** Returns owned Splats; the loader restores their decoded record order before slicing. */
10
10
  loadChunk?: (url: string, signal: AbortSignal) => Promise<Splats>;
11
11
  };
12
12
  /** A retained worker cache; extraction transfers owned packed arrays to the caller. */
@@ -6,7 +6,7 @@ import type { SogLodRequest } from "./sogVisibility.js";
6
6
  import type { SogChunkInfo } from "./workerHandlers.js";
7
7
  export type SogStreamLoaderOptions = StreamRequestOptions & {
8
8
  url: string;
9
- /** Returns owned data in file order, or with a complete source ID map. */
9
+ /** Returns owned Splats; the loader restores their decoded record order before slicing. */
10
10
  loadChunk?: (url: string, signal: AbortSignal) => Promise<Splats>;
11
11
  };
12
12
  /** A retained worker cache; extraction transfers owned packed arrays to the caller. */
@@ -10,6 +10,10 @@ export type SogStreamSchedulerOptions = SogStreamLoaderOptions &
10
10
  lodBaseDistance?: number;
11
11
  /** Distance multiplier between LOD levels in both modes; defaults to 2. Must be finite and at least 1. */
12
12
  lodMultiplier?: number;
13
+ /** Effective distance multiplier directly behind a camera; defaults to 4. Must be finite and at least 1. */
14
+ lodBehindPenalty?: number;
15
+ /** Shrinks oversized regions toward their median size for LOD distance only; defaults to 0.75. Must be between 0 and 1. */
16
+ lodDistanceShrink?: number;
13
17
  };
14
18
  export type SogStreamStats = StreamStats & {
15
19
  visibleRegions: number;
@@ -26,6 +30,8 @@ export declare class SogStreamScheduler {
26
30
  private _splatBudgetMode;
27
31
  private _lodBaseDistance;
28
32
  private _lodMultiplier;
33
+ private _lodBehindPenalty;
34
+ private _lodDistanceShrink;
29
35
  private readonly options;
30
36
  private readonly loader;
31
37
  private readonly abort;
@@ -35,6 +41,7 @@ export declare class SogStreamScheduler {
35
41
  private view?;
36
42
  private lastRequestedKey;
37
43
  private selecting;
44
+ private refinementStopped;
38
45
  private selection;
39
46
  private chunks;
40
47
  /** Chunks with a batch, cached source or in-flight load. */
@@ -60,6 +67,12 @@ export declare class SogStreamScheduler {
60
67
  /** Distance multiplier between LOD levels; affects both budget modes. */
61
68
  get lodMultiplier(): number;
62
69
  set lodMultiplier(value: number);
70
+ /** Effective distance multiplier directly behind a camera; 1 disables it. */
71
+ get lodBehindPenalty(): number;
72
+ set lodBehindPenalty(value: number);
73
+ /** Fraction of excess region size removed when measuring LOD distance. */
74
+ get lodDistanceShrink(): number;
75
+ set lodDistanceShrink(value: number);
63
76
  get stats(): SogStreamStats;
64
77
  /** Group-local bounds from the index; available after initialized resolves. */
65
78
  getBoundingBox(): THREE.Box3;
@@ -70,7 +83,7 @@ export declare class SogStreamScheduler {
70
83
  /**
71
84
  * Select detail for this camera on each update. Detail follows distance,
72
85
  * so it needs no resolution. For WebXR register renderer.xr.getCamera(): it
73
- * selects the greatest detail needed by any eye that sees the region. Returns whether the camera was
86
+ * selects the greatest detail needed by any eye. Returns whether the camera was
74
87
  * newly added.
75
88
  */
76
89
  setCamera(camera: THREE.Camera): boolean;
@@ -78,7 +91,7 @@ export declare class SogStreamScheduler {
78
91
  deleteCamera(camera: THREE.Camera): boolean;
79
92
  /**
80
93
  * Call before rendering. Returns whether the displayed data changed. Each
81
- * leaf uses the distance of the nearest registered camera that sees it.
94
+ * leaf uses the smallest effective distance across registered cameras.
82
95
  */
83
96
  update(): boolean;
84
97
  private requestSelection;
@@ -103,5 +116,6 @@ export declare class SogStreamScheduler {
103
116
  private failed;
104
117
  private readonly retryTimer;
105
118
  private rejectFirstIfUnavailable;
119
+ private stopRefinement;
106
120
  dispose(): void;
107
121
  }
@@ -10,6 +10,10 @@ export type SogStreamSchedulerOptions = SogStreamLoaderOptions &
10
10
  lodBaseDistance?: number;
11
11
  /** Distance multiplier between LOD levels in both modes; defaults to 2. Must be finite and at least 1. */
12
12
  lodMultiplier?: number;
13
+ /** Effective distance multiplier directly behind a camera; defaults to 4. Must be finite and at least 1. */
14
+ lodBehindPenalty?: number;
15
+ /** Shrinks oversized regions toward their median size for LOD distance only; defaults to 0.75. Must be between 0 and 1. */
16
+ lodDistanceShrink?: number;
13
17
  };
14
18
  export type SogStreamStats = StreamStats & {
15
19
  visibleRegions: number;
@@ -26,6 +30,8 @@ export declare class SogStreamScheduler {
26
30
  private _splatBudgetMode;
27
31
  private _lodBaseDistance;
28
32
  private _lodMultiplier;
33
+ private _lodBehindPenalty;
34
+ private _lodDistanceShrink;
29
35
  private readonly options;
30
36
  private readonly loader;
31
37
  private readonly abort;
@@ -35,6 +41,7 @@ export declare class SogStreamScheduler {
35
41
  private view?;
36
42
  private lastRequestedKey;
37
43
  private selecting;
44
+ private refinementStopped;
38
45
  private selection;
39
46
  private chunks;
40
47
  /** Chunks with a batch, cached source or in-flight load. */
@@ -60,6 +67,12 @@ export declare class SogStreamScheduler {
60
67
  /** Distance multiplier between LOD levels; affects both budget modes. */
61
68
  get lodMultiplier(): number;
62
69
  set lodMultiplier(value: number);
70
+ /** Effective distance multiplier directly behind a camera; 1 disables it. */
71
+ get lodBehindPenalty(): number;
72
+ set lodBehindPenalty(value: number);
73
+ /** Fraction of excess region size removed when measuring LOD distance. */
74
+ get lodDistanceShrink(): number;
75
+ set lodDistanceShrink(value: number);
63
76
  get stats(): SogStreamStats;
64
77
  /** Group-local bounds from the index; available after initialized resolves. */
65
78
  getBoundingBox(): THREE.Box3;
@@ -70,7 +83,7 @@ export declare class SogStreamScheduler {
70
83
  /**
71
84
  * Select detail for this camera on each update. Detail follows distance,
72
85
  * so it needs no resolution. For WebXR register renderer.xr.getCamera(): it
73
- * selects the greatest detail needed by any eye that sees the region. Returns whether the camera was
86
+ * selects the greatest detail needed by any eye. Returns whether the camera was
74
87
  * newly added.
75
88
  */
76
89
  setCamera(camera: THREE.Camera): boolean;
@@ -78,7 +91,7 @@ export declare class SogStreamScheduler {
78
91
  deleteCamera(camera: THREE.Camera): boolean;
79
92
  /**
80
93
  * Call before rendering. Returns whether the displayed data changed. Each
81
- * leaf uses the distance of the nearest registered camera that sees it.
94
+ * leaf uses the smallest effective distance across registered cameras.
82
95
  */
83
96
  update(): boolean;
84
97
  private requestSelection;
@@ -103,5 +116,6 @@ export declare class SogStreamScheduler {
103
116
  private failed;
104
117
  private readonly retryTimer;
105
118
  private rejectFirstIfUnavailable;
119
+ private stopRefinement;
106
120
  dispose(): void;
107
121
  }
@@ -32,8 +32,10 @@ export type SogLodManifest = {
32
32
  export declare const SOG_LOD_STRIDE = 4;
33
33
  /** Packed worker index. Float64 preserves source bounds and safe-integer counts. */
34
34
  export type SogLodIndex = {
35
- /** Preorder nodes: min XYZ, max XYZ, next index after the subtree, leaf ID (-1 for interiors). */
36
- nodes: Float64Array;
35
+ /** Root min XYZ and max XYZ. */
36
+ bounds: Float64Array;
37
+ /** Per leaf ID: min XYZ and max XYZ. */
38
+ leafBounds: Float64Array;
37
39
  leafOffsets: Uint32Array;
38
40
  /** Per level: level, file, offset, count. */
39
41
  lods: Float64Array;
@@ -42,12 +44,9 @@ export type SogLodIndex = {
42
44
  counts: Float64Array;
43
45
  environment?: string;
44
46
  };
45
- /** Scheduler metadata; the complete spatial tree stays in the LOD worker. */
46
- export type SogLodMetadata = Omit<SogLodIndex, "nodes" | "lodLevels"> & {
47
- /** Root min XYZ and max XYZ. */
48
- bounds: Float64Array;
49
- };
50
- /** Flatten the tree and ranges into transferable typed arrays. */
47
+ /** Scheduler metadata; per-region bounds stay in the LOD worker. */
48
+ export type SogLodMetadata = Omit<SogLodIndex, "leafBounds" | "lodLevels">;
49
+ /** Pack region bounds and ranges into transferable typed arrays. */
51
50
  export declare function packSogLodIndex(manifest: SogLodManifest): SogLodIndex;
52
51
  /** Materialize only leaves visited by the camera, preserving stable range identities. */
53
52
  export declare function readSogLodLeaf(
@@ -61,7 +60,7 @@ export declare function parseSogLodManifest(
61
60
  ): SogLodManifest;
62
61
  export type SogVisibleLeaf = {
63
62
  leaf: SogLodLeaf;
64
- /** World-space distance to the region, compensated for the camera's field of view. */
63
+ /** Distance to the corrected region bounds, including camera direction and field of view. */
65
64
  distance: number;
66
65
  };
67
66
  export type SogBudgetMode = "target" | "limit";
@@ -32,8 +32,10 @@ export type SogLodManifest = {
32
32
  export declare const SOG_LOD_STRIDE = 4;
33
33
  /** Packed worker index. Float64 preserves source bounds and safe-integer counts. */
34
34
  export type SogLodIndex = {
35
- /** Preorder nodes: min XYZ, max XYZ, next index after the subtree, leaf ID (-1 for interiors). */
36
- nodes: Float64Array;
35
+ /** Root min XYZ and max XYZ. */
36
+ bounds: Float64Array;
37
+ /** Per leaf ID: min XYZ and max XYZ. */
38
+ leafBounds: Float64Array;
37
39
  leafOffsets: Uint32Array;
38
40
  /** Per level: level, file, offset, count. */
39
41
  lods: Float64Array;
@@ -42,12 +44,9 @@ export type SogLodIndex = {
42
44
  counts: Float64Array;
43
45
  environment?: string;
44
46
  };
45
- /** Scheduler metadata; the complete spatial tree stays in the LOD worker. */
46
- export type SogLodMetadata = Omit<SogLodIndex, "nodes" | "lodLevels"> & {
47
- /** Root min XYZ and max XYZ. */
48
- bounds: Float64Array;
49
- };
50
- /** Flatten the tree and ranges into transferable typed arrays. */
47
+ /** Scheduler metadata; per-region bounds stay in the LOD worker. */
48
+ export type SogLodMetadata = Omit<SogLodIndex, "leafBounds" | "lodLevels">;
49
+ /** Pack region bounds and ranges into transferable typed arrays. */
51
50
  export declare function packSogLodIndex(manifest: SogLodManifest): SogLodIndex;
52
51
  /** Materialize only leaves visited by the camera, preserving stable range identities. */
53
52
  export declare function readSogLodLeaf(
@@ -61,7 +60,7 @@ export declare function parseSogLodManifest(
61
60
  ): SogLodManifest;
62
61
  export type SogVisibleLeaf = {
63
62
  leaf: SogLodLeaf;
64
- /** World-space distance to the region, compensated for the camera's field of view. */
63
+ /** Distance to the corrected region bounds, including camera direction and field of view. */
65
64
  distance: number;
66
65
  };
67
66
  export type SogBudgetMode = "target" | "limit";
@@ -2,19 +2,21 @@ import type * as THREE from "three";
2
2
  import type { SogLodIndex, SogLodOptions } from "./sogLod.cjs";
3
3
  export type SogCamera = {
4
4
  modelView: number[];
5
- projection: number[];
6
- coordinateSystem: THREE.CoordinateSystem;
7
- reversedDepth: boolean;
5
+ fovScale: number;
8
6
  };
9
7
  export type SogView = {
10
8
  /** The registered cameras that see the group; selection serves all of them. */
11
9
  cameras: SogCamera[];
12
10
  shown: boolean;
13
11
  };
14
- export type SogLodRequest = SogLodOptions & { view: SogView };
12
+ export type SogLodRequest = SogLodOptions & {
13
+ view: SogView;
14
+ lodBehindPenalty: number;
15
+ lodDistanceShrink: number;
16
+ };
15
17
  /**
16
18
  * Capture the cameras that see the group without traversing the manifest or
17
- * reducing matrix precision. WebXR selects detail from each eye's current pose and frustum.
19
+ * reducing matrix precision. WebXR selects detail from each eye's current pose.
18
20
  */
19
21
  export declare function captureSogView(
20
22
  cameras: readonly THREE.Camera[],
@@ -27,12 +29,16 @@ export declare class SogVisibility {
27
29
  private readonly manifest;
28
30
  private readonly leaves;
29
31
  private readonly cameras;
30
- private readonly clip;
31
32
  private readonly bound;
33
+ private readonly typicalHalfSize;
34
+ private readonly shrink;
32
35
  private readonly closest;
33
36
  private readonly inverseModelView;
34
37
  constructor(
35
- manifest: Pick<SogLodIndex, "nodes" | "leafOffsets" | "lods" | "lodLevels">,
38
+ manifest: Pick<
39
+ SogLodIndex,
40
+ "leafBounds" | "leafOffsets" | "lods" | "lodLevels"
41
+ >,
36
42
  );
37
43
  private prepareCameras;
38
44
  private collect;
@@ -2,19 +2,21 @@ import type * as THREE from "three";
2
2
  import type { SogLodIndex, SogLodOptions } from "./sogLod.js";
3
3
  export type SogCamera = {
4
4
  modelView: number[];
5
- projection: number[];
6
- coordinateSystem: THREE.CoordinateSystem;
7
- reversedDepth: boolean;
5
+ fovScale: number;
8
6
  };
9
7
  export type SogView = {
10
8
  /** The registered cameras that see the group; selection serves all of them. */
11
9
  cameras: SogCamera[];
12
10
  shown: boolean;
13
11
  };
14
- export type SogLodRequest = SogLodOptions & { view: SogView };
12
+ export type SogLodRequest = SogLodOptions & {
13
+ view: SogView;
14
+ lodBehindPenalty: number;
15
+ lodDistanceShrink: number;
16
+ };
15
17
  /**
16
18
  * Capture the cameras that see the group without traversing the manifest or
17
- * reducing matrix precision. WebXR selects detail from each eye's current pose and frustum.
19
+ * reducing matrix precision. WebXR selects detail from each eye's current pose.
18
20
  */
19
21
  export declare function captureSogView(
20
22
  cameras: readonly THREE.Camera[],
@@ -27,12 +29,16 @@ export declare class SogVisibility {
27
29
  private readonly manifest;
28
30
  private readonly leaves;
29
31
  private readonly cameras;
30
- private readonly clip;
31
32
  private readonly bound;
33
+ private readonly typicalHalfSize;
34
+ private readonly shrink;
32
35
  private readonly closest;
33
36
  private readonly inverseModelView;
34
37
  constructor(
35
- manifest: Pick<SogLodIndex, "nodes" | "leafOffsets" | "lods" | "lodLevels">,
38
+ manifest: Pick<
39
+ SogLodIndex,
40
+ "leafBounds" | "leafOffsets" | "lods" | "lodLevels"
41
+ >,
36
42
  );
37
43
  private prepareCameras;
38
44
  private collect;
@@ -21,7 +21,7 @@ export type StreamStats = {
21
21
  residentMeshes: number;
22
22
  /** Decoded chunks, including cached chunks that are not currently drawn. */
23
23
  residentChunks: number;
24
- /** Retained CPU data, excluding pending copies and WASM memory. */
24
+ /** Estimated CPU cache, excluding pending copies and worker heap overhead. */
25
25
  residentCpuBytes: number;
26
26
  /** Estimated GPU storage for resident streaming data; excludes renderer buffers. */
27
27
  residentGpuBytes: number;
@@ -21,7 +21,7 @@ export type StreamStats = {
21
21
  residentMeshes: number;
22
22
  /** Decoded chunks, including cached chunks that are not currently drawn. */
23
23
  residentChunks: number;
24
- /** Retained CPU data, excluding pending copies and WASM memory. */
24
+ /** Estimated CPU cache, excluding pending copies and worker heap overhead. */
25
25
  residentCpuBytes: number;
26
26
  /** Estimated GPU storage for resident streaming data; excludes renderer buffers. */
27
27
  residentGpuBytes: number;
@@ -38,8 +38,6 @@ export type SplatMeshFrameContext = {
38
38
  export type SplatIntersection = THREE.Intersection<SplatMesh> & {
39
39
  /** Current readable index in this mesh's Splats. */
40
40
  index: number;
41
- /** Original file index; for streamed SOG, relative to this batch's chunk. */
42
- sourceIndex: number;
43
41
  };
44
42
  /** A scene object backed by a fixed encoded splat source and RGBA SDF edits. */
45
43
  export declare class SplatMesh extends THREE.Object3D {
@@ -38,8 +38,6 @@ export type SplatMeshFrameContext = {
38
38
  export type SplatIntersection = THREE.Intersection<SplatMesh> & {
39
39
  /** Current readable index in this mesh's Splats. */
40
40
  index: number;
41
- /** Original file index; for streamed SOG, relative to this batch's chunk. */
42
- sourceIndex: number;
43
41
  };
44
42
  /** A scene object backed by a fixed encoded splat source and RGBA SDF edits. */
45
43
  export declare class SplatMesh extends THREE.Object3D {
package/docs/BuildRad.md CHANGED
@@ -84,6 +84,7 @@ See [RadStreamScheduler](RadStreamScheduler.md) for the complete loading and dis
84
84
  | --- | --- | --- |
85
85
  | `--lod-base <base>` | `1.75` | LOD spacing, from `1.1` to `16`; smaller values retain more detail levels. |
86
86
  | `--max-sh <0..3>` | `3` | Highest SH degree to keep, limited by the input. |
87
+ | `--within-dist <x,y,z,radius>` | Disabled | Keep splat centers inside or on a sphere before building LOD, in input coordinates. |
87
88
  | `--memory-budget <GiB>` | `4` | Target memory use in GiB, at least `1`; for example `16`. |
88
89
  | `--temp-dir <path>` | System temp directory | Location for temporary files; created if needed. |
89
90
  | `--rad-chunked` | Disabled | Write a header and separate `.radc` files. |