@babylonjs/loaders 9.26.1 → 9.26.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.
Files changed (58) hide show
  1. package/SPLAT/gaussianSplattingStream.d.ts +79 -25
  2. package/SPLAT/gaussianSplattingStream.js +320 -95
  3. package/SPLAT/gaussianSplattingStream.js.map +1 -1
  4. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.d.ts +110 -3
  5. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js +468 -74
  6. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js.map +1 -1
  7. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock.d.ts +47 -0
  8. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock.js +68 -0
  9. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphEventReferenceBlock.js.map +1 -0
  10. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.d.ts +2 -2
  11. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js +1 -1
  12. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js.map +1 -1
  13. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock.d.ts +24 -0
  14. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock.js +38 -0
  15. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphObjectReferenceBlock.js.map +1 -0
  16. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock.d.ts +41 -0
  17. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock.js +63 -0
  18. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphUnsupportedInteractivityBlock.js.map +1 -0
  19. package/glTF/2.0/Extensions/KHR_interactivity/index.d.ts +5 -0
  20. package/glTF/2.0/Extensions/KHR_interactivity/index.js +5 -0
  21. package/glTF/2.0/Extensions/KHR_interactivity/index.js.map +1 -1
  22. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel.d.ts +112 -0
  23. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel.js +773 -0
  24. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphModel.js.map +1 -0
  25. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.d.ts +18 -10
  26. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js +299 -54
  27. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js.map +1 -1
  28. package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.d.ts +2 -1
  29. package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.js +7 -2
  30. package/glTF/2.0/Extensions/KHR_interactivity/interactivityHostResolver.js.map +1 -1
  31. package/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState.d.ts +24 -0
  32. package/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState.js +89 -0
  33. package/glTF/2.0/Extensions/KHR_interactivity/interactivityNodeState.js.map +1 -0
  34. package/glTF/2.0/Extensions/KHR_interactivity/pure.d.ts +5 -0
  35. package/glTF/2.0/Extensions/KHR_interactivity/pure.js +5 -0
  36. package/glTF/2.0/Extensions/KHR_interactivity/pure.js.map +1 -1
  37. package/glTF/2.0/Extensions/KHR_interactivity.pure.d.ts +55 -1
  38. package/glTF/2.0/Extensions/KHR_interactivity.pure.js +124 -76
  39. package/glTF/2.0/Extensions/KHR_interactivity.pure.js.map +1 -1
  40. package/glTF/2.0/Extensions/KHR_interactivity.types.d.ts +18 -1
  41. package/glTF/2.0/Extensions/KHR_interactivity.types.js.map +1 -1
  42. package/glTF/2.0/Extensions/KHR_node_hoverability.pure.d.ts +2 -0
  43. package/glTF/2.0/Extensions/KHR_node_hoverability.pure.js +114 -56
  44. package/glTF/2.0/Extensions/KHR_node_hoverability.pure.js.map +1 -1
  45. package/glTF/2.0/Extensions/KHR_node_selectability.pure.d.ts +2 -0
  46. package/glTF/2.0/Extensions/KHR_node_selectability.pure.js +80 -35
  47. package/glTF/2.0/Extensions/KHR_node_selectability.pure.js.map +1 -1
  48. package/glTF/2.0/Extensions/interactivityRefPathToObjectConverter.js +3 -2
  49. package/glTF/2.0/Extensions/interactivityRefPathToObjectConverter.js.map +1 -1
  50. package/glTF/2.0/Extensions/objectModelMapping.d.ts +4 -2
  51. package/glTF/2.0/Extensions/objectModelMapping.js +33 -4
  52. package/glTF/2.0/Extensions/objectModelMapping.js.map +1 -1
  53. package/glTF/2.0/glTFLoader.pure.d.ts +1 -1
  54. package/glTF/2.0/glTFLoader.pure.js +9 -4
  55. package/glTF/2.0/glTFLoader.pure.js.map +1 -1
  56. package/glTF/2.0/glTFLoaderExtension.d.ts +2 -1
  57. package/glTF/2.0/glTFLoaderExtension.js.map +1 -1
  58. package/package.json +3 -3
@@ -129,17 +129,20 @@ export interface IGaussianSplattingStreamOptions {
129
129
  /** Number of times a failed file download is retried before giving up. PlayCanvas default `2`. */
130
130
  maxDownloadRetries?: number;
131
131
  /**
132
- * GPU memory budget (in megabytes) for resident splats. When set (and smaller than the full dataset),
133
- * LOD files are streamed through a fixed-size work buffer and unreferenced files are evicted to stay
134
- * within budget, allowing datasets larger than a single full-dataset buffer. Converted to a splat count
135
- * using the per-splat cost (core data plus any baked SH and rotation/scale textures). Combined with
136
- * {@link maxResidentSplats} by taking the smaller of the two.
132
+ * Initial GPU/CPU memory estimate (in megabytes) for resident splats. It is converted to a splat count
133
+ * using the per-splat cost (core data plus any baked SH and rotation/scale textures), combined with
134
+ * {@link maxResidentSplats} by taking the smaller limit, then raised when necessary to fit the complete
135
+ * coarse layer. The work buffer has a fixed lifetime capacity; construct a new stream to use another limit.
136
+ * Finite non-positive values leave this limit unset; non-finite values are rejected.
137
137
  */
138
138
  memoryBudgetMb?: number;
139
139
  /**
140
- * Maximum number of splats kept resident in the work buffer. When set (and smaller than the full
141
- * dataset), enables eviction-based streaming (see {@link memoryBudgetMb}). Default unset = size the work
142
- * buffer for the whole dataset (no eviction).
140
+ * Initial maximum number of splats kept resident in the fixed-size work buffer. It is raised when necessary
141
+ * to fit the complete coarse layer. When unset and the complete source size is known, streams retain the complete
142
+ * source. Streams that defer finer metadata use a bounded device-tiered default with coarse-derived refinement
143
+ * headroom.
144
+ * Finite non-positive values leave this limit unset; non-finite or unsafe positive counts are rejected.
145
+ * Positive fractional counts are floored to at least one splat before applying the coarse minimum.
143
146
  */
144
147
  maxResidentSplats?: number;
145
148
  /**
@@ -169,10 +172,10 @@ export interface IGaussianSplattingStreamOptions {
169
172
  /**
170
173
  * When true, higher-order spherical-harmonics carried by the SOG files (`shN`) are GPU-decoded into baked
171
174
  * packed-u32 SH textures so the streamed splats render with view-dependent lighting (matching the non-stream
172
- * `.spz`/`.sog` path) instead of flat DC-only color. The SH degree is the max `shN.bands` across the streamed
173
- * files (lower-band files neutral-fill). No effect when the files carry no `shN`. Defaults to `true`, matching
174
- * the non-stream path's always-decode-if-present behavior; set to `false` to force flat DC-only color even
175
- * when the data carries `shN` (e.g. to save the decode cost/texture memory).
175
+ * `.spz`/`.sog` path) instead of flat DC-only color. Streams with complete initial metadata use the maximum
176
+ * source SH degree. Streams that defer finer metadata reserve the supported degree-4 layout before it is known,
177
+ * even if the files ultimately carry no `shN`; lower-degree files neutral-fill the unused bands.
178
+ * Defaults to `true`; set to `false` to force flat DC-only color and avoid the SH decode cost/texture memory.
176
179
  */
177
180
  decodeSh?: boolean;
178
181
  /**
@@ -217,6 +220,7 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
217
220
  private _hostBudgetAllocation;
218
221
  private _frustumCulling;
219
222
  private readonly _frustumPlanes;
223
+ private readonly _cullCameraViewProj;
220
224
  private readonly _cullViewProj;
221
225
  private readonly _frustumScratch;
222
226
  private _workBuffer;
@@ -230,6 +234,7 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
230
234
  private _residency;
231
235
  private readonly _fileCounts;
232
236
  private readonly _fileMeta;
237
+ private readonly _baseFileIds;
233
238
  private readonly _decodedFiles;
234
239
  private readonly _loadingFiles;
235
240
  private readonly _decodeQueue;
@@ -237,6 +242,7 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
237
242
  private readonly _cancelledDecodes;
238
243
  private _evictionEnabled;
239
244
  private _residentBudget;
245
+ private _minimumResidentSplats;
240
246
  private _maxResidentSplats;
241
247
  private _memoryBudgetMb;
242
248
  private _evictionCooldownFrames;
@@ -248,6 +254,7 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
248
254
  private _environmentFiles;
249
255
  private _lodObserver;
250
256
  private _baseLayerReady;
257
+ private _metadataReady;
251
258
  private _framesSinceLodUpdate;
252
259
  private readonly _lastLodCamPositions;
253
260
  private _lastLodSignature;
@@ -370,10 +377,19 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
370
377
  /**
371
378
  * The resolved maximum number of splats kept resident in the work buffer. This combines
372
379
  * {@link IGaussianSplattingStreamOptions.maxResidentSplats} and {@link IGaussianSplattingStreamOptions.memoryBudgetMb},
373
- * taking the smaller limit when both are configured. `0` means the resident budget is disabled.
380
+ * taking the smaller positive limit and raising it to {@link minimumResidentSplats}. With neither limit set,
381
+ * the complete source size is retained when known; otherwise a bounded device-tiered default is used.
382
+ * The fixed capacity is capped at the device texture limit. `0` means initial capacity has not been resolved.
374
383
  * @experimental
375
384
  */
376
385
  get residentSplatBudget(): number;
386
+ /**
387
+ * Minimum fixed work-buffer capacity required for the complete coarse representation: one invisible padding
388
+ * splat, the included environment, and every unique whole coarse source file. It is `0` until the required
389
+ * coarse metadata has resolved. Initial residency options below this value are raised to it.
390
+ * @experimental
391
+ */
392
+ get minimumResidentSplats(): number;
377
393
  /**
378
394
  * The total number of splats represented by valid level-0 leaf entries. This remains pending while source
379
395
  * metadata is loading and is unavailable when no applicable level-0 entries exist or required metadata fails.
@@ -448,14 +464,14 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
448
464
  set debugLodSource(value: GaussianSplattingStreamDebugLodSource);
449
465
  dispose(doNotRecurse?: boolean): void;
450
466
  /**
451
- * Disposes this stream (which tombstones its region) and then compacts the host once to actually reclaim the
452
- * reserved rows. Used on a definitive load failure / empty result — a discrete, one-off reclaim, versus a bare
467
+ * Disposes this stream and, when hosted, compacts the host once to reclaim its tombstoned region's reserved
468
+ * rows. Used on a definitive load failure / empty result — a discrete, one-off reclaim, versus a bare
453
469
  * {@link dispose} that only tombstones so tearing down several parts doesn't rebuild the atlas repeatedly.
454
470
  */
455
471
  private _disposeAndReclaim;
456
472
  /**
457
473
  * The world matrix that actually places this stream's splats, used to map the camera into the space the
458
- * node bounds live in (for LOD distance) and to build per-node world AABBs (for frustum culling). Standalone:
474
+ * node bounds live in (for LOD distance) and to build camera-local frusta (for frustum culling). Standalone:
459
475
  * this controller mesh carries the transform. Hosted: this controller is a hidden, unplaced node — the splats
460
476
  * are placed by the reserved part's proxy (SOG up-axis basis composed with the host's placement), so LOD and
461
477
  * culling MUST use the proxy's world matrix or they compute distances/frustum tests in the wrong space
@@ -523,9 +539,9 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
523
539
  */
524
540
  private _collectLodEntries;
525
541
  /**
526
- * Streams the scene: learns every source file's splat count, allocates one unified GPU work buffer
527
- * sized for all LOD files, decodes the environment and the coarsest LOD of every node as a permanent
528
- * base layer, then installs the per-frame loop that streams finer LODs on demand.
542
+ * Streams the scene. Large streams fetch only required coarse metadata before allocating and decoding the
543
+ * complete coarse layer; finer metadata starts afterwards so it cannot occupy the download queue ahead of
544
+ * visible geometry. Small streams and streams containing only coarse files retain an exact all-file capacity upper bound.
529
545
  */
530
546
  private _streamAllAsync;
531
547
  /**
@@ -538,26 +554,47 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
538
554
  */
539
555
  private _waitForCanBackupAsync;
540
556
  /**
541
- * Resolves the resident-splat budget from the raw options, sizing a memory (MB) budget with the actual per-splat
542
- * GPU+CPU cost — core data plus the baked SH textures and rotation/scale textures when enabled — so SH/rotation
543
- * assets don't silently consume up to double the configured budget. Requires the SH degree (from the metadata
544
- * pre-pass) to be known. The smaller of the splat-count and memory budgets wins.
557
+ * Resolves the fixed initial work-buffer capacity. Explicit count/MB limits are combined by taking the smaller
558
+ * and then raised to the complete coarse minimum. Without an explicit limit, a known complete source retains
559
+ * legacy full residency. When finer metadata is deferred and the complete size is unknown, the device-tiered
560
+ * memory estimate is given at least one largest-coarse-file of headroom so one replacement file can refine
561
+ * while all coarse fallback files remain pinned.
562
+ * @param fullCapacity exact complete source capacity, or null when unavailable
563
+ * @param largestBaseFileCount largest whole coarse source file, used as modest replacement headroom
564
+ * @returns the fixed initial work-buffer capacity
545
565
  */
546
566
  private _resolveResidentBudget;
567
+ /**
568
+ * Returns the estimated combined GPU/CPU bytes occupied by one resident splat.
569
+ * @returns estimated bytes per resident splat
570
+ */
571
+ private _bytesPerResidentSplat;
547
572
  /**
548
573
  * Collects the unique set of source file indices referenced by any LOD of any leaf, sorted ascending.
549
574
  * @returns sorted unique file indices
550
575
  */
551
576
  private _collectAllFileIds;
577
+ /**
578
+ * Collects unique whole source files required by the coarsest entry of every valid leaf.
579
+ * @returns sorted unique coarse file indices
580
+ */
581
+ private _collectBaseFileIds;
582
+ /**
583
+ * Resolves the immutable minimum initial capacity from padding, environment, and unique whole coarse files.
584
+ * @param baseFileIds unique coarse source file indices
585
+ * @param environmentCount included environment splat count
586
+ */
587
+ private _resolveMinimumResidentSplats;
552
588
  /**
553
589
  * Settles the level-0 diagnostic from normalized renderable leaf entries after their source metadata resolves.
554
590
  * A file may back several leaf ranges, so its source count is deliberately not used in the total.
555
591
  */
556
592
  private _resolveLod0SplatCount;
557
593
  /**
558
- * Fetches the environment bundle and every referenced file's metadata to learn splat counts, caching
559
- * each file's parsed metadata for the later on-demand decode. Metadata fetches run in parallel.
594
+ * Fetches the environment bundle and the supplied referenced files' metadata to learn splat counts, caching
595
+ * each file's parsed metadata for the later on-demand decode. File metadata fetches run in parallel.
560
596
  * @param fileIds file indices to fetch metadata for
597
+ * @param includeEnvironment whether to fetch the optional environment bundle in this phase
561
598
  * @returns the environment splat count (0 when there is no environment)
562
599
  */
563
600
  private _gatherCountsAsync;
@@ -625,6 +662,7 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
625
662
  * Concurrent or repeat requests for the same file are ignored. If the file is cancelled mid-flight
626
663
  * (because every node that wanted it retargeted), the decode bails cooperatively at the next checkpoint.
627
664
  * @param fileId file index to decode
665
+ * @returns whether the file was decoded and published successfully
628
666
  */
629
667
  private _decodeFileAsync;
630
668
  /**
@@ -789,6 +827,22 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
789
827
  * @returns whether any node's in-frustum state changed
790
828
  */
791
829
  private _updateNodeFrustum;
830
+ /**
831
+ * Normalizes an initial residency option, preserving finite non-positive values as an unset limit.
832
+ * @param value option value
833
+ * @param name option name used in errors
834
+ * @param integer whether the normalized value must be an integer splat count
835
+ * @returns normalized value
836
+ */
837
+ private static _NormalizeResidentLimit;
838
+ /**
839
+ * Adds trusted non-negative integer counts without allowing unsafe capacity arithmetic.
840
+ * @param left first count
841
+ * @param right second count
842
+ * @param label capacity name used in errors
843
+ * @returns the safe integer sum
844
+ */
845
+ private static _SafeAddCounts;
792
846
  /**
793
847
  * Reads the splat count from SOG metadata, coerced to a finite non-negative integer (metadata is untrusted, so
794
848
  * `count` / `shape[0]` may be a string or malformed — a non-numeric value must not leak into count arithmetic).