@onerjs/loaders 8.56.1 → 8.56.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 (42) hide show
  1. package/SPLAT/gaussianSplattingStream.d.ts +31 -0
  2. package/SPLAT/gaussianSplattingStream.js +49 -0
  3. package/SPLAT/gaussianSplattingStream.js.map +1 -1
  4. package/USD/index.d.ts +2 -0
  5. package/USD/index.js +4 -0
  6. package/USD/index.js.map +1 -0
  7. package/USD/pure.d.ts +3 -0
  8. package/USD/pure.js +5 -0
  9. package/USD/pure.js.map +1 -0
  10. package/USD/usdCommandProtocol.d.ts +83 -0
  11. package/USD/usdCommandProtocol.js +173 -0
  12. package/USD/usdCommandProtocol.js.map +1 -0
  13. package/USD/usdFileLoader.d.ts +6 -0
  14. package/USD/usdFileLoader.js +9 -0
  15. package/USD/usdFileLoader.js.map +1 -0
  16. package/USD/usdFileLoader.metadata.d.ts +20 -0
  17. package/USD/usdFileLoader.metadata.js +18 -0
  18. package/USD/usdFileLoader.metadata.js.map +1 -0
  19. package/USD/usdFileLoader.pure.d.ts +102 -0
  20. package/USD/usdFileLoader.pure.js +341 -0
  21. package/USD/usdFileLoader.pure.js.map +1 -0
  22. package/USD/usdFileLoader.types.d.ts +11 -0
  23. package/USD/usdFileLoader.types.js +2 -0
  24. package/USD/usdFileLoader.types.js.map +1 -0
  25. package/USD/usdLoadingOptions.d.ts +123 -0
  26. package/USD/usdLoadingOptions.js +3 -0
  27. package/USD/usdLoadingOptions.js.map +1 -0
  28. package/USD/usdSceneMaterializer.d.ts +9 -0
  29. package/USD/usdSceneMaterializer.js +982 -0
  30. package/USD/usdSceneMaterializer.js.map +1 -0
  31. package/USD/usdWorkerMessages.d.ts +57 -0
  32. package/USD/usdWorkerMessages.js +3 -0
  33. package/USD/usdWorkerMessages.js.map +1 -0
  34. package/dynamic.js +10 -0
  35. package/dynamic.js.map +1 -1
  36. package/index.d.ts +1 -0
  37. package/index.js +1 -0
  38. package/index.js.map +1 -1
  39. package/package.json +3 -3
  40. package/pure.d.ts +1 -0
  41. package/pure.js +1 -0
  42. package/pure.js.map +1 -1
@@ -71,6 +71,18 @@ export interface ISOGLODMetadata {
71
71
  * Selects which LOD value drives the {@link GaussianSplattingStream} debug wireframe colors.
72
72
  */
73
73
  export type GaussianSplattingStreamDebugLodSource = "optimal" | "current";
74
+ /**
75
+ * Immutable metadata-resolution state for a stream's total number of finest-LOD splats.
76
+ * @experimental
77
+ */
78
+ export type GaussianSplattingStreamLod0SplatCount = Readonly<{
79
+ status: "pending";
80
+ }> | Readonly<{
81
+ status: "available";
82
+ count: number;
83
+ }> | Readonly<{
84
+ status: "unavailable";
85
+ }>;
74
86
  /**
75
87
  * Options for {@link GaussianSplattingStream}.
76
88
  */
@@ -190,6 +202,7 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
190
202
  private readonly _rootUrl;
191
203
  private readonly _streamOptions;
192
204
  private readonly _leafNodes;
205
+ private _lod0SplatCount;
193
206
  private _lodBaseDistance;
194
207
  private _lodMultiplier;
195
208
  private _lodBehindPenalty;
@@ -354,6 +367,19 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
354
367
  * @experimental
355
368
  */
356
369
  get effectiveSplatBudget(): number;
370
+ /**
371
+ * The resolved maximum number of splats kept resident in the work buffer. This combines
372
+ * {@link IGaussianSplattingStreamOptions.maxResidentSplats} and {@link IGaussianSplattingStreamOptions.memoryBudgetMb},
373
+ * taking the smaller limit when both are configured. `0` means the resident budget is disabled.
374
+ * @experimental
375
+ */
376
+ get residentSplatBudget(): number;
377
+ /**
378
+ * The total number of splats represented by valid level-0 leaf entries. This remains pending while source
379
+ * metadata is loading and is unavailable when no applicable level-0 entries exist or required metadata fails.
380
+ * @experimental
381
+ */
382
+ get lod0SplatCount(): GaussianSplattingStreamLod0SplatCount;
357
383
  /**
358
384
  * Resolves the raw {@link splatBudget} option to a concrete cap: `undefined` ⇒ 0 (disabled), `"auto"` ⇒ a
359
385
  * device-tiered default, a positive number ⇒ itself (floored).
@@ -523,6 +549,11 @@ export declare class GaussianSplattingStream extends GaussianSplattingMesh imple
523
549
  * @returns sorted unique file indices
524
550
  */
525
551
  private _collectAllFileIds;
552
+ /**
553
+ * Settles the level-0 diagnostic from normalized renderable leaf entries after their source metadata resolves.
554
+ * A file may back several leaf ranges, so its source count is deliberately not used in the total.
555
+ */
556
+ private _resolveLod0SplatCount;
526
557
  /**
527
558
  * Fetches the environment bundle and every referenced file's metadata to learn splat counts, caching
528
559
  * each file's parsed metadata for the later on-demand decode. Metadata fetches run in parallel.
@@ -97,6 +97,7 @@ export class GaussianSplattingStream extends GaussianSplattingMesh {
97
97
  super(name, null, scene, false);
98
98
  // Flat list of leaf nodes that carry renderable LOD entries (used by the LOD heuristic and debug).
99
99
  this._leafNodes = [];
100
+ this._lod0SplatCount = Object.freeze({ status: "pending" });
100
101
  // LOD heuristic parameters (PlayCanvas-aligned defaults).
101
102
  this._lodBaseDistance = 5;
102
103
  this._lodMultiplier = 3;
@@ -344,6 +345,7 @@ export class GaussianSplattingStream extends GaussianSplattingMesh {
344
345
  this._disposeAndReclaim();
345
346
  }
346
347
  }, (e) => {
348
+ this._lod0SplatCount = Object.freeze({ status: "unavailable" });
347
349
  Logger.Error("GaussianSplattingStream: streaming failed: " + (e?.message ?? e));
348
350
  this._rejectPartReady("GaussianSplattingStream: streaming failed: " + (e?.message ?? e));
349
351
  if (this._hostCompound && !this._disposed) {
@@ -533,6 +535,23 @@ export class GaussianSplattingStream extends GaussianSplattingMesh {
533
535
  get effectiveSplatBudget() {
534
536
  return this._effectiveSplatBudget();
535
537
  }
538
+ /**
539
+ * The resolved maximum number of splats kept resident in the work buffer. This combines
540
+ * {@link IGaussianSplattingStreamOptions.maxResidentSplats} and {@link IGaussianSplattingStreamOptions.memoryBudgetMb},
541
+ * taking the smaller limit when both are configured. `0` means the resident budget is disabled.
542
+ * @experimental
543
+ */
544
+ get residentSplatBudget() {
545
+ return this._residentBudget;
546
+ }
547
+ /**
548
+ * The total number of splats represented by valid level-0 leaf entries. This remains pending while source
549
+ * metadata is loading and is unavailable when no applicable level-0 entries exist or required metadata fails.
550
+ * @experimental
551
+ */
552
+ get lod0SplatCount() {
553
+ return this._lod0SplatCount;
554
+ }
536
555
  /**
537
556
  * Resolves the raw {@link splatBudget} option to a concrete cap: `undefined` ⇒ 0 (disabled), `"auto"` ⇒ a
538
557
  * device-tiered default, a positive number ⇒ itself (floored).
@@ -1113,6 +1132,7 @@ export class GaussianSplattingStream extends GaussianSplattingMesh {
1113
1132
  // resolves the max SH degree, so the resident-splat budget can now be sized with the SH/rotation byte cost.
1114
1133
  const fileIds = this._collectAllFileIds();
1115
1134
  const envCount = await this._gatherCountsAsync(fileIds);
1135
+ this._resolveLod0SplatCount();
1116
1136
  if (this._disposed) {
1117
1137
  return;
1118
1138
  }
@@ -1335,6 +1355,35 @@ export class GaussianSplattingStream extends GaussianSplattingMesh {
1335
1355
  }
1336
1356
  return Array.from(ids).sort((a, b) => a - b);
1337
1357
  }
1358
+ /**
1359
+ * Settles the level-0 diagnostic from normalized renderable leaf entries after their source metadata resolves.
1360
+ * A file may back several leaf ranges, so its source count is deliberately not used in the total.
1361
+ */
1362
+ _resolveLod0SplatCount() {
1363
+ let total = 0;
1364
+ let hasLod0Entry = false;
1365
+ for (const node of this._leafNodes) {
1366
+ if (node.availableLevels?.[0] !== 0) {
1367
+ continue;
1368
+ }
1369
+ const entry = node.lods?.["0"];
1370
+ if (!entry) {
1371
+ this._lod0SplatCount = Object.freeze({ status: "unavailable" });
1372
+ return;
1373
+ }
1374
+ hasLod0Entry = true;
1375
+ if (!this._fileCounts.has(entry.file) || !this._fileMeta.has(entry.file)) {
1376
+ this._lod0SplatCount = Object.freeze({ status: "unavailable" });
1377
+ return;
1378
+ }
1379
+ total += entry.count;
1380
+ if (!Number.isSafeInteger(total)) {
1381
+ this._lod0SplatCount = Object.freeze({ status: "unavailable" });
1382
+ return;
1383
+ }
1384
+ }
1385
+ this._lod0SplatCount = hasLod0Entry ? Object.freeze({ status: "available", count: total }) : Object.freeze({ status: "unavailable" });
1386
+ }
1338
1387
  /**
1339
1388
  * Fetches the environment bundle and every referenced file's metadata to learn splat counts, caching
1340
1389
  * each file's parsed metadata for the later on-demand decode. Metadata fetches run in parallel.