babylonjs-loaders 9.23.0 → 9.26.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/babylon.glTF1FileLoader.js +1 -1
- package/babylon.glTF1FileLoader.js.map +1 -1
- package/babylon.glTF1FileLoader.min.js +1 -1
- package/babylon.glTF1FileLoader.min.js.map +1 -1
- package/babylon.glTF2FileLoader.js +1 -1
- package/babylon.glTF2FileLoader.js.map +1 -1
- package/babylon.glTF2FileLoader.min.js +1 -1
- package/babylon.glTF2FileLoader.min.js.map +1 -1
- package/babylon.glTFFileLoader.js +1 -1
- package/babylon.glTFFileLoader.js.map +1 -1
- package/babylon.glTFFileLoader.min.js +1 -1
- package/babylon.glTFFileLoader.min.js.map +1 -1
- package/babylonjs.loaders.d.ts +509 -4
- package/babylonjs.loaders.es5.js +4330 -3703
- package/babylonjs.loaders.js +1 -1
- package/babylonjs.loaders.js.map +1 -1
- package/babylonjs.loaders.min.js +1 -1
- package/babylonjs.loaders.min.js.map +1 -1
- package/babylonjs.loaders.module.d.ts +1049 -25
- package/package.json +3 -3
|
@@ -7,6 +7,7 @@ export * from "babylonjs-loaders/glTF/pure";
|
|
|
7
7
|
export * from "babylonjs-loaders/OBJ/pure";
|
|
8
8
|
export * from "babylonjs-loaders/STL/pure";
|
|
9
9
|
export * from "babylonjs-loaders/SPLAT/pure";
|
|
10
|
+
export * from "babylonjs-loaders/USD/pure";
|
|
10
11
|
export * from "babylonjs-loaders/dynamic";
|
|
11
12
|
|
|
12
13
|
}
|
|
@@ -17,6 +18,7 @@ export * from "babylonjs-loaders/glTF/index";
|
|
|
17
18
|
export * from "babylonjs-loaders/OBJ/index";
|
|
18
19
|
export * from "babylonjs-loaders/STL/index";
|
|
19
20
|
export * from "babylonjs-loaders/SPLAT/index";
|
|
21
|
+
export * from "babylonjs-loaders/USD/index";
|
|
20
22
|
export * from "babylonjs-loaders/dynamic";
|
|
21
23
|
|
|
22
24
|
}
|
|
@@ -448,11 +450,13 @@ abstract class GLTFLoaderOptions extends GLTFLoaderBaseOptions {
|
|
|
448
450
|
*/
|
|
449
451
|
abstract onValidated?: (results: GLTF2.IGLTFValidationResults) => void;
|
|
450
452
|
/**
|
|
451
|
-
* Function called before loading a
|
|
452
|
-
*
|
|
453
|
-
* @
|
|
453
|
+
* Function called before loading a URL referenced by the asset.
|
|
454
|
+
* Setting this function allows parent-relative asset URIs and makes the callback responsible for URI safety.
|
|
455
|
+
* @param url The URL referenced by the asset
|
|
456
|
+
* @param rootUrl The root URL of the asset, if available
|
|
457
|
+
* @returns A promise that resolves to the URL to load
|
|
454
458
|
*/
|
|
455
|
-
preprocessUrlAsync: (url: string) => Promise<string>;
|
|
459
|
+
preprocessUrlAsync: (url: string, rootUrl?: string) => Promise<string>;
|
|
456
460
|
}
|
|
457
461
|
/**
|
|
458
462
|
* File loader for loading glTF files into a scene.
|
|
@@ -467,6 +471,8 @@ export class GLTFFileLoader extends GLTFLoaderOptions implements IDisposable, IS
|
|
|
467
471
|
* @param options The options for the loader
|
|
468
472
|
*/
|
|
469
473
|
constructor(options?: Partial<Readonly<GLTFLoaderOptions>>);
|
|
474
|
+
/** @internal */
|
|
475
|
+
get _isPreprocessUrlAsyncSet(): boolean;
|
|
470
476
|
/**
|
|
471
477
|
* Raised when the asset has been parsed
|
|
472
478
|
*/
|
|
@@ -3141,7 +3147,7 @@ import { IndicesArray, Nullable } from "babylonjs/types";
|
|
|
3141
3147
|
import { Camera } from "babylonjs/Cameras/camera.pure";
|
|
3142
3148
|
import { Animation } from "babylonjs/Animations/animation";
|
|
3143
3149
|
import { IAnimatable } from "babylonjs/Animations/animatable.interface";
|
|
3144
|
-
import { AnimationGroup } from "babylonjs/Animations/animationGroup";
|
|
3150
|
+
import { AnimationGroup } from "babylonjs/Animations/animationGroup.pure";
|
|
3145
3151
|
import { Material } from "babylonjs/Materials/material";
|
|
3146
3152
|
import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
|
|
3147
3153
|
import { TransformNode } from "babylonjs/Meshes/transformNode.pure";
|
|
@@ -3830,6 +3836,7 @@ export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_node_selectability.pure
|
|
|
3830
3836
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_node_hoverability.pure";
|
|
3831
3837
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/ExtrasAsMetadata.pure";
|
|
3832
3838
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_interactivity/pure";
|
|
3839
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer.data.pure";
|
|
3833
3840
|
|
|
3834
3841
|
}
|
|
3835
3842
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/objectModelMapping" {
|
|
@@ -6850,9 +6857,17 @@ export class KHR_animation_pointer implements IGLTFLoaderExtension {
|
|
|
6850
6857
|
*/
|
|
6851
6858
|
export function RegisterKHR_animation_pointer(): void;
|
|
6852
6859
|
|
|
6860
|
+
}
|
|
6861
|
+
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer.data.pure" {
|
|
6862
|
+
/**
|
|
6863
|
+
* Registers the KHR_animation_pointer interpolation mappings.
|
|
6864
|
+
* @internal
|
|
6865
|
+
*/
|
|
6866
|
+
export function _RegisterKHRAnimationPointerData(): void;
|
|
6867
|
+
|
|
6853
6868
|
}
|
|
6854
6869
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer.data" {
|
|
6855
|
-
export
|
|
6870
|
+
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer.data.pure";
|
|
6856
6871
|
|
|
6857
6872
|
}
|
|
6858
6873
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer" {
|
|
@@ -6862,7 +6877,6 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer" {
|
|
|
6862
6877
|
*/
|
|
6863
6878
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer.types";
|
|
6864
6879
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer.pure";
|
|
6865
|
-
import "babylonjs-loaders/glTF/2.0/Extensions/KHR_animation_pointer.data";
|
|
6866
6880
|
|
|
6867
6881
|
}
|
|
6868
6882
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/ExtrasAsMetadata.types" {
|
|
@@ -7994,8 +8008,11 @@ export {};
|
|
|
7994
8008
|
}
|
|
7995
8009
|
declare module "babylonjs-loaders/glTF/1.0/pure" {
|
|
7996
8010
|
/** Pure barrel — re-exports only side-effect-free modules */
|
|
8011
|
+
export * from "babylonjs-loaders/glTF/1.0/glTFBinaryExtension.pure";
|
|
8012
|
+
export * from "babylonjs-loaders/glTF/1.0/glTFLoader.pure";
|
|
7997
8013
|
export * from "babylonjs-loaders/glTF/1.0/glTFLoaderInterfaces";
|
|
7998
8014
|
export * from "babylonjs-loaders/glTF/1.0/glTFLoaderUtils";
|
|
8015
|
+
export * from "babylonjs-loaders/glTF/1.0/glTFMaterialsCommonExtension.pure";
|
|
7999
8016
|
|
|
8000
8017
|
}
|
|
8001
8018
|
declare module "babylonjs-loaders/glTF/1.0/index" {
|
|
@@ -8006,10 +8023,10 @@ export * from "babylonjs-loaders/glTF/1.0/glTFLoaderUtils";
|
|
|
8006
8023
|
export * from "babylonjs-loaders/glTF/1.0/glTFMaterialsCommonExtension";
|
|
8007
8024
|
|
|
8008
8025
|
}
|
|
8009
|
-
declare module "babylonjs-loaders/glTF/1.0/glTFMaterialsCommonExtension" {
|
|
8010
|
-
import { GLTFLoaderExtension } from "babylonjs-loaders/glTF/1.0/glTFLoader";
|
|
8026
|
+
declare module "babylonjs-loaders/glTF/1.0/glTFMaterialsCommonExtension.pure" {
|
|
8027
|
+
import { GLTFLoaderExtension } from "babylonjs-loaders/glTF/1.0/glTFLoader.pure";
|
|
8011
8028
|
import { IGLTFRuntime } from "babylonjs-loaders/glTF/1.0/glTFLoaderInterfaces";
|
|
8012
|
-
import { Material } from "babylonjs/Materials/material";
|
|
8029
|
+
import { Material } from "babylonjs/Materials/material.pure";
|
|
8013
8030
|
/**
|
|
8014
8031
|
* @internal
|
|
8015
8032
|
* @deprecated
|
|
@@ -8020,12 +8037,26 @@ export class GLTFMaterialsCommonExtension extends GLTFLoaderExtension {
|
|
|
8020
8037
|
loadMaterialAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
|
|
8021
8038
|
private _loadTexture;
|
|
8022
8039
|
}
|
|
8040
|
+
/**
|
|
8041
|
+
* Registers the KHR_materials_common extension.
|
|
8042
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
8043
|
+
*/
|
|
8044
|
+
export function RegisterGLTFMaterialsCommonExtension(): void;
|
|
8045
|
+
|
|
8046
|
+
}
|
|
8047
|
+
declare module "babylonjs-loaders/glTF/1.0/glTFMaterialsCommonExtension" {
|
|
8048
|
+
/**
|
|
8049
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
8050
|
+
* Import "./glTFMaterialsCommonExtension.pure" for tree-shakeable, side-effect-free usage.
|
|
8051
|
+
*/
|
|
8052
|
+
export * from "babylonjs-loaders/glTF/1.0/glTFMaterialsCommonExtension.pure";
|
|
8053
|
+
import "babylonjs-loaders/glTF/1.0/glTFLoader";
|
|
8023
8054
|
|
|
8024
8055
|
}
|
|
8025
8056
|
declare module "babylonjs-loaders/glTF/1.0/glTFLoaderUtils" {
|
|
8026
8057
|
import { IGLTFTechniqueParameter, IGLTFAccessor, IGLTFRuntime, IGLTFBufferView, EComponentType } from "babylonjs-loaders/glTF/1.0/glTFLoaderInterfaces";
|
|
8027
|
-
import { Effect } from "babylonjs/Materials/effect";
|
|
8028
|
-
import { ShaderMaterial } from "babylonjs/Materials/shaderMaterial";
|
|
8058
|
+
import { Effect } from "babylonjs/Materials/effect.pure";
|
|
8059
|
+
import { ShaderMaterial } from "babylonjs/Materials/shaderMaterial.pure";
|
|
8029
8060
|
import { Node } from "babylonjs/node";
|
|
8030
8061
|
import { Scene } from "babylonjs/scene";
|
|
8031
8062
|
/**
|
|
@@ -8510,14 +8541,14 @@ export interface IJointNode {
|
|
|
8510
8541
|
}
|
|
8511
8542
|
|
|
8512
8543
|
}
|
|
8513
|
-
declare module "babylonjs-loaders/glTF/1.0/glTFLoader" {
|
|
8544
|
+
declare module "babylonjs-loaders/glTF/1.0/glTFLoader.pure" {
|
|
8514
8545
|
import { IGLTFRuntime } from "babylonjs-loaders/glTF/1.0/glTFLoaderInterfaces";
|
|
8515
8546
|
import { Nullable } from "babylonjs/types";
|
|
8516
|
-
import { Material } from "babylonjs/Materials/material";
|
|
8517
|
-
import { Texture } from "babylonjs/Materials/Textures/texture";
|
|
8547
|
+
import { Material } from "babylonjs/Materials/material.pure";
|
|
8548
|
+
import { Texture } from "babylonjs/Materials/Textures/texture.pure";
|
|
8518
8549
|
import { ISceneLoaderAsyncResult, ISceneLoaderProgressEvent } from "babylonjs/Loading/sceneLoader";
|
|
8519
|
-
import { Scene } from "babylonjs/scene";
|
|
8520
|
-
import { IGLTFLoader, IGLTFLoaderData } from "babylonjs-loaders/glTF/glTFFileLoader";
|
|
8550
|
+
import { Scene } from "babylonjs/scene.pure";
|
|
8551
|
+
import { IGLTFLoader, IGLTFLoaderData } from "babylonjs-loaders/glTF/glTFFileLoader.pure";
|
|
8521
8552
|
import { AssetContainer } from "babylonjs/assetContainer";
|
|
8522
8553
|
/**
|
|
8523
8554
|
* Implementation of the base glTF spec
|
|
@@ -8655,12 +8686,25 @@ export abstract class GLTFLoaderExtension {
|
|
|
8655
8686
|
private static _CreateTextureAsync;
|
|
8656
8687
|
private static _ApplyExtensions;
|
|
8657
8688
|
}
|
|
8689
|
+
/**
|
|
8690
|
+
* Registers the glTF 1.0 loader factory.
|
|
8691
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
8692
|
+
*/
|
|
8693
|
+
export function RegisterGLTF1Loader(): void;
|
|
8658
8694
|
|
|
8659
8695
|
}
|
|
8660
|
-
declare module "babylonjs-loaders/glTF/1.0/
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8696
|
+
declare module "babylonjs-loaders/glTF/1.0/glTFLoader" {
|
|
8697
|
+
/**
|
|
8698
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
8699
|
+
* Import "./glTFLoader.pure" for tree-shakeable, side-effect-free usage.
|
|
8700
|
+
*/
|
|
8701
|
+
export * from "babylonjs-loaders/glTF/1.0/glTFLoader.pure";
|
|
8702
|
+
|
|
8703
|
+
}
|
|
8704
|
+
declare module "babylonjs-loaders/glTF/1.0/glTFBinaryExtension.pure" {
|
|
8705
|
+
import { GLTFLoaderExtension } from "babylonjs-loaders/glTF/1.0/glTFLoader.pure";
|
|
8706
|
+
import { Scene } from "babylonjs/scene.pure";
|
|
8707
|
+
import { IGLTFLoaderData } from "babylonjs-loaders/glTF/glTFFileLoader.pure";
|
|
8664
8708
|
import { IGLTFRuntime } from "babylonjs-loaders/glTF/1.0/glTFLoaderInterfaces";
|
|
8665
8709
|
/**
|
|
8666
8710
|
* @internal
|
|
@@ -8674,6 +8718,450 @@ export class GLTFBinaryExtension extends GLTFLoaderExtension {
|
|
|
8674
8718
|
loadTextureBufferAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void): boolean;
|
|
8675
8719
|
loadShaderStringAsync(gltfRuntime: IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void): boolean;
|
|
8676
8720
|
}
|
|
8721
|
+
/**
|
|
8722
|
+
* Registers the KHR_binary_glTF extension.
|
|
8723
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
8724
|
+
*/
|
|
8725
|
+
export function RegisterGLTFBinaryExtension(): void;
|
|
8726
|
+
|
|
8727
|
+
}
|
|
8728
|
+
declare module "babylonjs-loaders/glTF/1.0/glTFBinaryExtension" {
|
|
8729
|
+
/**
|
|
8730
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
8731
|
+
* Import "./glTFBinaryExtension.pure" for tree-shakeable, side-effect-free usage.
|
|
8732
|
+
*/
|
|
8733
|
+
export * from "babylonjs-loaders/glTF/1.0/glTFBinaryExtension.pure";
|
|
8734
|
+
import "babylonjs-loaders/glTF/1.0/glTFLoader";
|
|
8735
|
+
|
|
8736
|
+
}
|
|
8737
|
+
declare module "babylonjs-loaders/USD/usdWorkerMessages" {
|
|
8738
|
+
import { USDLoadProgress } from "babylonjs-loaders/USD/usdLoadingOptions";
|
|
8739
|
+
export interface WorkerAsset {
|
|
8740
|
+
bytes: Uint8Array;
|
|
8741
|
+
fileName: string;
|
|
8742
|
+
files?: Record<string, Uint8Array>;
|
|
8743
|
+
resolveByFileName: boolean;
|
|
8744
|
+
glueUrl?: string;
|
|
8745
|
+
wasmUrl?: string;
|
|
8746
|
+
dataUrl?: string;
|
|
8747
|
+
}
|
|
8748
|
+
export interface ExtractRequest {
|
|
8749
|
+
type: "extract";
|
|
8750
|
+
requestId: number;
|
|
8751
|
+
asset: WorkerAsset;
|
|
8752
|
+
}
|
|
8753
|
+
export interface WorkerTimings {
|
|
8754
|
+
totalMs: number;
|
|
8755
|
+
stageOpenMs: number;
|
|
8756
|
+
stageReadMs: number;
|
|
8757
|
+
preparationMs: number;
|
|
8758
|
+
packingMs: number;
|
|
8759
|
+
heapCopyMs: number;
|
|
8760
|
+
}
|
|
8761
|
+
export interface WorkerStatistics {
|
|
8762
|
+
nodes: number;
|
|
8763
|
+
meshes: number;
|
|
8764
|
+
analyticPrimitives: number;
|
|
8765
|
+
instances: number;
|
|
8766
|
+
materials: number;
|
|
8767
|
+
vertices: number;
|
|
8768
|
+
triangles: number;
|
|
8769
|
+
commandBytes: number;
|
|
8770
|
+
dataBytes: number;
|
|
8771
|
+
}
|
|
8772
|
+
export type WorkerResponse = {
|
|
8773
|
+
type: "progress";
|
|
8774
|
+
requestId: number;
|
|
8775
|
+
progress: USDLoadProgress;
|
|
8776
|
+
} | {
|
|
8777
|
+
type: "log";
|
|
8778
|
+
requestId: number;
|
|
8779
|
+
level: number;
|
|
8780
|
+
message: string;
|
|
8781
|
+
} | {
|
|
8782
|
+
type: "result";
|
|
8783
|
+
requestId: number;
|
|
8784
|
+
commands: ArrayBuffer;
|
|
8785
|
+
data: ArrayBuffer;
|
|
8786
|
+
timings: WorkerTimings;
|
|
8787
|
+
statistics: WorkerStatistics;
|
|
8788
|
+
missingAssets: string[];
|
|
8789
|
+
} | {
|
|
8790
|
+
type: "error";
|
|
8791
|
+
requestId: number;
|
|
8792
|
+
message: string;
|
|
8793
|
+
stack?: string;
|
|
8794
|
+
};
|
|
8795
|
+
|
|
8796
|
+
}
|
|
8797
|
+
declare module "babylonjs-loaders/USD/usdSceneMaterializer" {
|
|
8798
|
+
import { AbstractAssetContainer } from "babylonjs/assetContainer";
|
|
8799
|
+
import { Scene } from "babylonjs/scene.pure";
|
|
8800
|
+
export interface MaterializationResult {
|
|
8801
|
+
container: AbstractAssetContainer & {
|
|
8802
|
+
dispose(): void;
|
|
8803
|
+
};
|
|
8804
|
+
materializeMs: number;
|
|
8805
|
+
}
|
|
8806
|
+
export function materializeCommandBuffers(scene: Scene, commandBuffer: ArrayBuffer, dataBuffer: ArrayBuffer, addToScene: boolean, signal?: AbortSignal): Promise<MaterializationResult>;
|
|
8807
|
+
|
|
8808
|
+
}
|
|
8809
|
+
declare module "babylonjs-loaders/USD/usdLoadingOptions" {
|
|
8810
|
+
/**
|
|
8811
|
+
* Binary input accepted for supporting USD layers and assets.
|
|
8812
|
+
*/
|
|
8813
|
+
export type USDBinaryInput = ArrayBuffer | ArrayBufferView;
|
|
8814
|
+
/**
|
|
8815
|
+
* Virtual files supplied alongside the root USD layer, keyed by their path relative to the
|
|
8816
|
+
* root layer.
|
|
8817
|
+
*/
|
|
8818
|
+
export type USDVirtualFiles = Readonly<Record<string, USDBinaryInput>>;
|
|
8819
|
+
/**
|
|
8820
|
+
* Progress phases reported by the USD worker and Babylon materializer.
|
|
8821
|
+
*/
|
|
8822
|
+
export interface USDLoadProgress {
|
|
8823
|
+
/**
|
|
8824
|
+
* Current importer phase.
|
|
8825
|
+
*/
|
|
8826
|
+
phase: "initializing" | "staging" | "extracting" | "materializing";
|
|
8827
|
+
/**
|
|
8828
|
+
* Human-readable phase description.
|
|
8829
|
+
*/
|
|
8830
|
+
message: string;
|
|
8831
|
+
}
|
|
8832
|
+
/**
|
|
8833
|
+
* Options for the OpenUSD scene loader.
|
|
8834
|
+
*/
|
|
8835
|
+
export interface USDFileLoaderOptions {
|
|
8836
|
+
/**
|
|
8837
|
+
* Virtual path used to stage the root layer. Set this when supporting files need
|
|
8838
|
+
* to resolve relative to a directory hierarchy.
|
|
8839
|
+
*/
|
|
8840
|
+
rootFileName?: string;
|
|
8841
|
+
/**
|
|
8842
|
+
* Supporting layers, payloads, and textures keyed by virtual path in the same
|
|
8843
|
+
* virtual file system as `rootFileName`.
|
|
8844
|
+
*/
|
|
8845
|
+
files?: USDVirtualFiles;
|
|
8846
|
+
/**
|
|
8847
|
+
* Enables conservative file-name fallback for unresolved absolute references.
|
|
8848
|
+
* Defaults to true.
|
|
8849
|
+
*/
|
|
8850
|
+
resolveByFileName?: boolean;
|
|
8851
|
+
/**
|
|
8852
|
+
* URL of the module worker. Defaults to the protocol-versioned worker hosted on the Babylon.js CDN.
|
|
8853
|
+
*/
|
|
8854
|
+
workerUrl?: string | URL;
|
|
8855
|
+
/**
|
|
8856
|
+
* URL of the generated Emscripten JavaScript module.
|
|
8857
|
+
*/
|
|
8858
|
+
glueUrl?: string;
|
|
8859
|
+
/**
|
|
8860
|
+
* URL of the OpenUSD WebAssembly binary.
|
|
8861
|
+
*/
|
|
8862
|
+
wasmUrl?: string;
|
|
8863
|
+
/**
|
|
8864
|
+
* URL of the OpenUSD preloaded resource bundle.
|
|
8865
|
+
*/
|
|
8866
|
+
dataUrl?: string;
|
|
8867
|
+
/**
|
|
8868
|
+
* Called when the importer moves to a new processing phase.
|
|
8869
|
+
*/
|
|
8870
|
+
onProgress?: (progress: USDLoadProgress) => void;
|
|
8871
|
+
/**
|
|
8872
|
+
* Called for OpenUSD diagnostic messages.
|
|
8873
|
+
*/
|
|
8874
|
+
onLog?: (level: "info" | "warning" | "error", message: string) => void;
|
|
8875
|
+
/**
|
|
8876
|
+
* Called after extraction and Babylon.js object creation complete.
|
|
8877
|
+
*/
|
|
8878
|
+
onComplete?: (diagnostics: USDImportDiagnostics) => void;
|
|
8879
|
+
}
|
|
8880
|
+
/**
|
|
8881
|
+
* Timing data measured by the OpenUSD worker and Babylon materializer.
|
|
8882
|
+
*/
|
|
8883
|
+
export interface USDImportTimings {
|
|
8884
|
+
/** Total extraction time, including the final Wasm heap copy. */
|
|
8885
|
+
totalMs: number;
|
|
8886
|
+
/** Time spent opening and composing the USD stage. */
|
|
8887
|
+
stageOpenMs: number;
|
|
8888
|
+
/** Time spent traversing the composed stage. */
|
|
8889
|
+
stageReadMs: number;
|
|
8890
|
+
/** Time spent preparing renderable vertex streams. */
|
|
8891
|
+
preparationMs: number;
|
|
8892
|
+
/** Time spent packing the command and raw-data buffers. */
|
|
8893
|
+
packingMs: number;
|
|
8894
|
+
/** Time spent copying command and data buffers from the Wasm heap. */
|
|
8895
|
+
heapCopyMs: number;
|
|
8896
|
+
/** Time spent creating Babylon.js objects. */
|
|
8897
|
+
materializeMs: number;
|
|
8898
|
+
}
|
|
8899
|
+
/**
|
|
8900
|
+
* Statistics reported for an imported USD stage.
|
|
8901
|
+
*/
|
|
8902
|
+
export interface USDImportStatistics {
|
|
8903
|
+
/** Number of transform nodes extracted from the composed stage. */
|
|
8904
|
+
nodes: number;
|
|
8905
|
+
/** Number of polygonal `UsdGeomMesh` sources. */
|
|
8906
|
+
meshes: number;
|
|
8907
|
+
/** Number of analytic cube, sphere, cylinder, and cone sources. */
|
|
8908
|
+
analyticPrimitives: number;
|
|
8909
|
+
/** Number of native Babylon instances created from shared USD geometry. */
|
|
8910
|
+
instances: number;
|
|
8911
|
+
/** Number of authored USD materials translated. */
|
|
8912
|
+
materials: number;
|
|
8913
|
+
/** Number of unique vertices in polygonal source meshes. */
|
|
8914
|
+
vertices: number;
|
|
8915
|
+
/** Number of unique triangles in polygonal source meshes. */
|
|
8916
|
+
triangles: number;
|
|
8917
|
+
/** Size of the command buffer in bytes. */
|
|
8918
|
+
commandBytes: number;
|
|
8919
|
+
/** Size of the raw-data buffer in bytes. */
|
|
8920
|
+
dataBytes: number;
|
|
8921
|
+
}
|
|
8922
|
+
/**
|
|
8923
|
+
* Diagnostics reported after a USD import completes.
|
|
8924
|
+
*/
|
|
8925
|
+
export interface USDImportDiagnostics {
|
|
8926
|
+
/** Timing data for extraction and Babylon.js object creation. */
|
|
8927
|
+
timings: USDImportTimings;
|
|
8928
|
+
/** Counts and buffer sizes reported by the OpenUSD extractor. */
|
|
8929
|
+
statistics: USDImportStatistics;
|
|
8930
|
+
/** Asset references OpenUSD could not resolve from the supplied virtual files. */
|
|
8931
|
+
missingAssets: readonly string[];
|
|
8932
|
+
}
|
|
8933
|
+
|
|
8934
|
+
}
|
|
8935
|
+
declare module "babylonjs-loaders/USD/usdFileLoader.types" {
|
|
8936
|
+
export {};
|
|
8937
|
+
import { USDFileLoaderMetadata } from "babylonjs-loaders/USD/usdFileLoader.metadata";
|
|
8938
|
+
import { USDFileLoaderOptions } from "babylonjs-loaders/USD/usdLoadingOptions";
|
|
8939
|
+
module "babylonjs/Loading/sceneLoader" {
|
|
8940
|
+
interface SceneLoaderPluginOptions {
|
|
8941
|
+
/**
|
|
8942
|
+
* Defines options for the USD loader.
|
|
8943
|
+
*/
|
|
8944
|
+
[USDFileLoaderMetadata.name]: Partial<USDFileLoaderOptions>;
|
|
8945
|
+
}
|
|
8946
|
+
}
|
|
8947
|
+
|
|
8948
|
+
}
|
|
8949
|
+
declare module "babylonjs-loaders/USD/usdFileLoader.pure" {
|
|
8950
|
+
/** This file must only contain pure code and pure imports */
|
|
8951
|
+
import { AssetContainer } from "babylonjs/assetContainer";
|
|
8952
|
+
import { ISceneLoaderAsyncResult, ISceneLoaderPluginAsync, ISceneLoaderPluginFactory, ISceneLoaderProgressEvent, SceneLoaderPluginOptions } from "babylonjs/Loading/sceneLoader";
|
|
8953
|
+
import { Scene } from "babylonjs/scene.pure";
|
|
8954
|
+
import { USDFileLoaderOptions } from "babylonjs-loaders/USD/usdLoadingOptions";
|
|
8955
|
+
/**
|
|
8956
|
+
* OpenUSD scene loader backed by a WebAssembly command-buffer extractor.
|
|
8957
|
+
*/
|
|
8958
|
+
export class USDFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
|
|
8959
|
+
/**
|
|
8960
|
+
* Default URLs for the prebuilt OpenUSD importer assets.
|
|
8961
|
+
*/
|
|
8962
|
+
static DefaultConfiguration: {
|
|
8963
|
+
glueUrl: string;
|
|
8964
|
+
wasmUrl: string;
|
|
8965
|
+
dataUrl: string;
|
|
8966
|
+
workerUrl: string;
|
|
8967
|
+
};
|
|
8968
|
+
/**
|
|
8969
|
+
* Defines the name of the plugin.
|
|
8970
|
+
*/
|
|
8971
|
+
readonly name: "usd";
|
|
8972
|
+
/**
|
|
8973
|
+
* Defines the extensions the plugin can load.
|
|
8974
|
+
*/
|
|
8975
|
+
readonly extensions: {
|
|
8976
|
+
readonly ".usd": {
|
|
8977
|
+
readonly isBinary: true;
|
|
8978
|
+
};
|
|
8979
|
+
readonly ".usda": {
|
|
8980
|
+
readonly isBinary: true;
|
|
8981
|
+
};
|
|
8982
|
+
readonly ".usdc": {
|
|
8983
|
+
readonly isBinary: true;
|
|
8984
|
+
};
|
|
8985
|
+
readonly ".usdz": {
|
|
8986
|
+
readonly isBinary: true;
|
|
8987
|
+
};
|
|
8988
|
+
};
|
|
8989
|
+
private readonly _options;
|
|
8990
|
+
private _worker;
|
|
8991
|
+
private _workerUrl;
|
|
8992
|
+
private _workerBlobUrl;
|
|
8993
|
+
private _nextRequestId;
|
|
8994
|
+
private readonly _pending;
|
|
8995
|
+
private readonly _activeLoads;
|
|
8996
|
+
/**
|
|
8997
|
+
* Creates a USD loader.
|
|
8998
|
+
* @param options Options controlling worker assets, supporting files, and diagnostics.
|
|
8999
|
+
*/
|
|
9000
|
+
constructor(options?: Partial<USDFileLoaderOptions>);
|
|
9001
|
+
/**
|
|
9002
|
+
* Creates a configured plugin instance for a SceneLoader operation.
|
|
9003
|
+
* @param options SceneLoader plugin options.
|
|
9004
|
+
* @returns The configured USD loader.
|
|
9005
|
+
*/
|
|
9006
|
+
createPlugin(options: SceneLoaderPluginOptions): ISceneLoaderPluginAsync;
|
|
9007
|
+
/**
|
|
9008
|
+
* Imports all objects from a USD stage into a scene.
|
|
9009
|
+
* @param _meshesNames Mesh name filtering is not currently supported.
|
|
9010
|
+
* @param scene The scene receiving the imported objects.
|
|
9011
|
+
* @param data The USD, USDA, USDC, or USDZ bytes.
|
|
9012
|
+
* @param rootUrl The source root URL.
|
|
9013
|
+
* @param onProgress SceneLoader progress callback.
|
|
9014
|
+
* @param fileName Name of the root USD layer.
|
|
9015
|
+
* @returns The imported Babylon.js objects.
|
|
9016
|
+
*/
|
|
9017
|
+
importMeshAsync(_meshesNames: string | readonly string[] | null | undefined, scene: Scene, data: unknown, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
|
|
9018
|
+
/**
|
|
9019
|
+
* Loads a USD stage into a scene.
|
|
9020
|
+
* @param scene The scene receiving the imported objects.
|
|
9021
|
+
* @param data The USD, USDA, USDC, or USDZ bytes.
|
|
9022
|
+
* @param rootUrl The source root URL.
|
|
9023
|
+
* @param onProgress SceneLoader progress callback.
|
|
9024
|
+
* @param fileName Name of the root USD layer.
|
|
9025
|
+
*/
|
|
9026
|
+
loadAsync(scene: Scene, data: unknown, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
|
|
9027
|
+
/**
|
|
9028
|
+
* Loads a USD stage into an asset container.
|
|
9029
|
+
* @param scene The scene used to create imported objects.
|
|
9030
|
+
* @param data The USD, USDA, USDC, or USDZ bytes.
|
|
9031
|
+
* @param rootUrl The source root URL.
|
|
9032
|
+
* @param onProgress SceneLoader progress callback.
|
|
9033
|
+
* @param fileName Name of the root USD layer.
|
|
9034
|
+
* @returns The populated asset container.
|
|
9035
|
+
*/
|
|
9036
|
+
loadAssetContainerAsync(scene: Scene, data: unknown, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
|
|
9037
|
+
/**
|
|
9038
|
+
* Releases the worker and rejects pending loads.
|
|
9039
|
+
*/
|
|
9040
|
+
dispose(): void;
|
|
9041
|
+
private _loadAsync;
|
|
9042
|
+
private _getWorker;
|
|
9043
|
+
private _terminateWorker;
|
|
9044
|
+
}
|
|
9045
|
+
/** @internal */
|
|
9046
|
+
export function _RegisterUSDLoaderDependencies(): void;
|
|
9047
|
+
/**
|
|
9048
|
+
* Registers the USD scene loader plugin and its Babylon.js runtime dependencies.
|
|
9049
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
9050
|
+
*/
|
|
9051
|
+
export function RegisterUSDFileLoader(): void;
|
|
9052
|
+
|
|
9053
|
+
}
|
|
9054
|
+
declare module "babylonjs-loaders/USD/usdFileLoader.metadata" {
|
|
9055
|
+
/**
|
|
9056
|
+
* Defines the USD loader plugin metadata.
|
|
9057
|
+
*/
|
|
9058
|
+
export const USDFileLoaderMetadata: {
|
|
9059
|
+
readonly name: "usd";
|
|
9060
|
+
readonly extensions: {
|
|
9061
|
+
readonly ".usd": {
|
|
9062
|
+
readonly isBinary: true;
|
|
9063
|
+
};
|
|
9064
|
+
readonly ".usda": {
|
|
9065
|
+
readonly isBinary: true;
|
|
9066
|
+
};
|
|
9067
|
+
readonly ".usdc": {
|
|
9068
|
+
readonly isBinary: true;
|
|
9069
|
+
};
|
|
9070
|
+
readonly ".usdz": {
|
|
9071
|
+
readonly isBinary: true;
|
|
9072
|
+
};
|
|
9073
|
+
};
|
|
9074
|
+
};
|
|
9075
|
+
|
|
9076
|
+
}
|
|
9077
|
+
declare module "babylonjs-loaders/USD/usdFileLoader" {
|
|
9078
|
+
/**
|
|
9079
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
9080
|
+
* Import "./usdFileLoader.pure" for tree-shakeable, side-effect-free usage.
|
|
9081
|
+
*/
|
|
9082
|
+
export * from "babylonjs-loaders/USD/usdFileLoader.types";
|
|
9083
|
+
export * from "babylonjs-loaders/USD/usdFileLoader.pure";
|
|
9084
|
+
|
|
9085
|
+
}
|
|
9086
|
+
declare module "babylonjs-loaders/USD/usdCommandProtocol" {
|
|
9087
|
+
export const COMMAND_MAGIC = 1111774037;
|
|
9088
|
+
export const PROTOCOL_VERSION = 4;
|
|
9089
|
+
export const MISSING_OFFSET = 4294967295;
|
|
9090
|
+
export enum Command {
|
|
9091
|
+
Scene = 1,
|
|
9092
|
+
Texture = 2,
|
|
9093
|
+
Material = 3,
|
|
9094
|
+
TransformNode = 4,
|
|
9095
|
+
Skeleton = 5,
|
|
9096
|
+
Geometry = 6,
|
|
9097
|
+
Mesh = 7,
|
|
9098
|
+
Instance = 8,
|
|
9099
|
+
Animation = 9,
|
|
9100
|
+
AnalyticPrimitive = 10
|
|
9101
|
+
}
|
|
9102
|
+
export enum AnalyticPrimitiveType {
|
|
9103
|
+
Cube = 0,
|
|
9104
|
+
Sphere = 1,
|
|
9105
|
+
Cylinder = 2,
|
|
9106
|
+
Cone = 3
|
|
9107
|
+
}
|
|
9108
|
+
export enum PrimitiveAxis {
|
|
9109
|
+
X = 0,
|
|
9110
|
+
Y = 1,
|
|
9111
|
+
Z = 2
|
|
9112
|
+
}
|
|
9113
|
+
export enum AnimationTarget {
|
|
9114
|
+
Node = 0,
|
|
9115
|
+
Bone = 1
|
|
9116
|
+
}
|
|
9117
|
+
export enum AnimationProperty {
|
|
9118
|
+
Position = 0,
|
|
9119
|
+
RotationQuaternion = 1,
|
|
9120
|
+
Scaling = 2,
|
|
9121
|
+
Matrix = 3
|
|
9122
|
+
}
|
|
9123
|
+
export enum MaterialFlags {
|
|
9124
|
+
DoubleSided = 1,
|
|
9125
|
+
Unlit = 2,
|
|
9126
|
+
AlphaBlend = 4
|
|
9127
|
+
}
|
|
9128
|
+
export enum MeshFlags {
|
|
9129
|
+
DoubleSided = 1,
|
|
9130
|
+
LeftHanded = 2
|
|
9131
|
+
}
|
|
9132
|
+
export enum GeometryFlags {
|
|
9133
|
+
Normals = 1,
|
|
9134
|
+
Tangents = 2,
|
|
9135
|
+
Uv0 = 4,
|
|
9136
|
+
Colors = 8,
|
|
9137
|
+
Skin0 = 16,
|
|
9138
|
+
Skin1 = 32
|
|
9139
|
+
}
|
|
9140
|
+
export interface CommandRecord {
|
|
9141
|
+
opcode: Command;
|
|
9142
|
+
flags: number;
|
|
9143
|
+
payloadOffset: number;
|
|
9144
|
+
payloadLength: number;
|
|
9145
|
+
}
|
|
9146
|
+
export function readCommands(buffer: ArrayBuffer): CommandRecord[];
|
|
9147
|
+
export class PayloadReader {
|
|
9148
|
+
#private;
|
|
9149
|
+
offset: number;
|
|
9150
|
+
constructor(buffer: ArrayBuffer, offset: number, length: number);
|
|
9151
|
+
u32(): number;
|
|
9152
|
+
f32(): number;
|
|
9153
|
+
}
|
|
9154
|
+
|
|
9155
|
+
}
|
|
9156
|
+
declare module "babylonjs-loaders/USD/pure" {
|
|
9157
|
+
/** Pure barrel — re-exports only side-effect-free modules */
|
|
9158
|
+
export * from "babylonjs-loaders/USD/usdFileLoader.pure";
|
|
9159
|
+
export * from "babylonjs-loaders/USD/usdLoadingOptions";
|
|
9160
|
+
|
|
9161
|
+
}
|
|
9162
|
+
declare module "babylonjs-loaders/USD/index" {
|
|
9163
|
+
export * from "babylonjs-loaders/USD/usdFileLoader";
|
|
9164
|
+
export * from "babylonjs-loaders/USD/usdLoadingOptions";
|
|
8677
9165
|
|
|
8678
9166
|
}
|
|
8679
9167
|
declare module "babylonjs-loaders/STL/stlFileLoader.types" {
|
|
@@ -9720,6 +10208,18 @@ export interface ISOGLODMetadata {
|
|
|
9720
10208
|
* Selects which LOD value drives the {@link GaussianSplattingStream} debug wireframe colors.
|
|
9721
10209
|
*/
|
|
9722
10210
|
export type GaussianSplattingStreamDebugLodSource = "optimal" | "current";
|
|
10211
|
+
/**
|
|
10212
|
+
* Immutable metadata-resolution state for a stream's total number of finest-LOD splats.
|
|
10213
|
+
* @experimental
|
|
10214
|
+
*/
|
|
10215
|
+
export type GaussianSplattingStreamLod0SplatCount = Readonly<{
|
|
10216
|
+
status: "pending";
|
|
10217
|
+
}> | Readonly<{
|
|
10218
|
+
status: "available";
|
|
10219
|
+
count: number;
|
|
10220
|
+
}> | Readonly<{
|
|
10221
|
+
status: "unavailable";
|
|
10222
|
+
}>;
|
|
9723
10223
|
/**
|
|
9724
10224
|
* Options for {@link GaussianSplattingStream}.
|
|
9725
10225
|
*/
|
|
@@ -9839,6 +10339,7 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
9839
10339
|
private readonly _rootUrl;
|
|
9840
10340
|
private readonly _streamOptions;
|
|
9841
10341
|
private readonly _leafNodes;
|
|
10342
|
+
private _lod0SplatCount;
|
|
9842
10343
|
private _lodBaseDistance;
|
|
9843
10344
|
private _lodMultiplier;
|
|
9844
10345
|
private _lodBehindPenalty;
|
|
@@ -10003,6 +10504,19 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10003
10504
|
* @experimental
|
|
10004
10505
|
*/
|
|
10005
10506
|
get effectiveSplatBudget(): number;
|
|
10507
|
+
/**
|
|
10508
|
+
* The resolved maximum number of splats kept resident in the work buffer. This combines
|
|
10509
|
+
* {@link IGaussianSplattingStreamOptions.maxResidentSplats} and {@link IGaussianSplattingStreamOptions.memoryBudgetMb},
|
|
10510
|
+
* taking the smaller limit when both are configured. `0` means the resident budget is disabled.
|
|
10511
|
+
* @experimental
|
|
10512
|
+
*/
|
|
10513
|
+
get residentSplatBudget(): number;
|
|
10514
|
+
/**
|
|
10515
|
+
* The total number of splats represented by valid level-0 leaf entries. This remains pending while source
|
|
10516
|
+
* metadata is loading and is unavailable when no applicable level-0 entries exist or required metadata fails.
|
|
10517
|
+
* @experimental
|
|
10518
|
+
*/
|
|
10519
|
+
get lod0SplatCount(): GaussianSplattingStreamLod0SplatCount;
|
|
10006
10520
|
/**
|
|
10007
10521
|
* Resolves the raw {@link splatBudget} option to a concrete cap: `undefined` ⇒ 0 (disabled), `"auto"` ⇒ a
|
|
10008
10522
|
* device-tiered default, a positive number ⇒ itself (floored).
|
|
@@ -10172,6 +10686,11 @@ export class GaussianSplattingStream extends GaussianSplattingMesh implements IG
|
|
|
10172
10686
|
* @returns sorted unique file indices
|
|
10173
10687
|
*/
|
|
10174
10688
|
private _collectAllFileIds;
|
|
10689
|
+
/**
|
|
10690
|
+
* Settles the level-0 diagnostic from normalized renderable leaf entries after their source metadata resolves.
|
|
10691
|
+
* A file may back several leaf ranges, so its source count is deliberately not used in the total.
|
|
10692
|
+
*/
|
|
10693
|
+
private _resolveLod0SplatCount;
|
|
10175
10694
|
/**
|
|
10176
10695
|
* Fetches the environment bundle and every referenced file's metadata to learn splat counts, caching
|
|
10177
10696
|
* each file's parsed metadata for the later on-demand decode. Metadata fetches run in parallel.
|
|
@@ -12914,11 +13433,13 @@ declare namespace BABYLON {
|
|
|
12914
13433
|
*/
|
|
12915
13434
|
abstract onValidated?: (results: GLTF2.IGLTFValidationResults) => void;
|
|
12916
13435
|
/**
|
|
12917
|
-
* Function called before loading a
|
|
12918
|
-
*
|
|
12919
|
-
* @
|
|
13436
|
+
* Function called before loading a URL referenced by the asset.
|
|
13437
|
+
* Setting this function allows parent-relative asset URIs and makes the callback responsible for URI safety.
|
|
13438
|
+
* @param url The URL referenced by the asset
|
|
13439
|
+
* @param rootUrl The root URL of the asset, if available
|
|
13440
|
+
* @returns A promise that resolves to the URL to load
|
|
12920
13441
|
*/
|
|
12921
|
-
preprocessUrlAsync: (url: string) => Promise<string>;
|
|
13442
|
+
preprocessUrlAsync: (url: string, rootUrl?: string) => Promise<string>;
|
|
12922
13443
|
}
|
|
12923
13444
|
/**
|
|
12924
13445
|
* File loader for loading glTF files into a scene.
|
|
@@ -12933,6 +13454,8 @@ declare namespace BABYLON {
|
|
|
12933
13454
|
* @param options The options for the loader
|
|
12934
13455
|
*/
|
|
12935
13456
|
constructor(options?: Partial<Readonly<GLTFLoaderOptions>>);
|
|
13457
|
+
/** @internal */
|
|
13458
|
+
get _isPreprocessUrlAsyncSet(): boolean;
|
|
12936
13459
|
/**
|
|
12937
13460
|
* Raised when the asset has been parsed
|
|
12938
13461
|
*/
|
|
@@ -19456,6 +19979,20 @@ declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
|
19456
19979
|
|
|
19457
19980
|
|
|
19458
19981
|
|
|
19982
|
+
}
|
|
19983
|
+
declare namespace BABYLON {
|
|
19984
|
+
|
|
19985
|
+
|
|
19986
|
+
}
|
|
19987
|
+
declare namespace BABYLON.GLTF2.Loader.Extensions {
|
|
19988
|
+
/**
|
|
19989
|
+
* Registers the KHR_animation_pointer interpolation mappings.
|
|
19990
|
+
* @internal
|
|
19991
|
+
*/
|
|
19992
|
+
export function _RegisterKHRAnimationPointerData(): void;
|
|
19993
|
+
|
|
19994
|
+
|
|
19995
|
+
|
|
19459
19996
|
}
|
|
19460
19997
|
declare namespace BABYLON {
|
|
19461
19998
|
|
|
@@ -20703,6 +21240,24 @@ declare namespace BABYLON.GLTF1 {
|
|
|
20703
21240
|
loadMaterialAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, id: string, onSuccess: (material: Material) => void, onError: (message: string) => void): boolean;
|
|
20704
21241
|
private _loadTexture;
|
|
20705
21242
|
}
|
|
21243
|
+
/**
|
|
21244
|
+
* Registers the KHR_materials_common extension.
|
|
21245
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
21246
|
+
*/
|
|
21247
|
+
export function RegisterGLTFMaterialsCommonExtension(): void;
|
|
21248
|
+
|
|
21249
|
+
|
|
21250
|
+
|
|
21251
|
+
}
|
|
21252
|
+
declare namespace BABYLON {
|
|
21253
|
+
|
|
21254
|
+
|
|
21255
|
+
}
|
|
21256
|
+
declare namespace BABYLON.GLTF1 {
|
|
21257
|
+
/**
|
|
21258
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
21259
|
+
* Import "./glTFMaterialsCommonExtension.pure" for tree-shakeable, side-effect-free usage.
|
|
21260
|
+
*/
|
|
20706
21261
|
|
|
20707
21262
|
|
|
20708
21263
|
|
|
@@ -21336,6 +21891,24 @@ declare namespace BABYLON.GLTF1 {
|
|
|
21336
21891
|
private static _CreateTextureAsync;
|
|
21337
21892
|
private static _ApplyExtensions;
|
|
21338
21893
|
}
|
|
21894
|
+
/**
|
|
21895
|
+
* Registers the glTF 1.0 loader factory.
|
|
21896
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
21897
|
+
*/
|
|
21898
|
+
export function RegisterGLTF1Loader(): void;
|
|
21899
|
+
|
|
21900
|
+
|
|
21901
|
+
|
|
21902
|
+
}
|
|
21903
|
+
declare namespace BABYLON {
|
|
21904
|
+
|
|
21905
|
+
|
|
21906
|
+
}
|
|
21907
|
+
declare namespace BABYLON.GLTF1 {
|
|
21908
|
+
/**
|
|
21909
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
21910
|
+
* Import "./glTFLoader.pure" for tree-shakeable, side-effect-free usage.
|
|
21911
|
+
*/
|
|
21339
21912
|
|
|
21340
21913
|
|
|
21341
21914
|
|
|
@@ -21357,12 +21930,432 @@ declare namespace BABYLON.GLTF1 {
|
|
|
21357
21930
|
loadTextureBufferAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, id: string, onSuccess: (buffer: ArrayBufferView) => void): boolean;
|
|
21358
21931
|
loadShaderStringAsync(gltfRuntime: BABYLON.GLTF1.IGLTFRuntime, id: string, onSuccess: (shaderString: string) => void): boolean;
|
|
21359
21932
|
}
|
|
21933
|
+
/**
|
|
21934
|
+
* Registers the KHR_binary_glTF extension.
|
|
21935
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
21936
|
+
*/
|
|
21937
|
+
export function RegisterGLTFBinaryExtension(): void;
|
|
21360
21938
|
|
|
21361
21939
|
|
|
21362
21940
|
|
|
21363
21941
|
}
|
|
21364
21942
|
declare namespace BABYLON {
|
|
21365
21943
|
|
|
21944
|
+
|
|
21945
|
+
}
|
|
21946
|
+
declare namespace BABYLON.GLTF1 {
|
|
21947
|
+
/**
|
|
21948
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
21949
|
+
* Import "./glTFBinaryExtension.pure" for tree-shakeable, side-effect-free usage.
|
|
21950
|
+
*/
|
|
21951
|
+
|
|
21952
|
+
|
|
21953
|
+
|
|
21954
|
+
}
|
|
21955
|
+
declare namespace BABYLON {
|
|
21956
|
+
|
|
21957
|
+
export interface WorkerAsset {
|
|
21958
|
+
bytes: Uint8Array;
|
|
21959
|
+
fileName: string;
|
|
21960
|
+
files?: Record<string, Uint8Array>;
|
|
21961
|
+
resolveByFileName: boolean;
|
|
21962
|
+
glueUrl?: string;
|
|
21963
|
+
wasmUrl?: string;
|
|
21964
|
+
dataUrl?: string;
|
|
21965
|
+
}
|
|
21966
|
+
export interface ExtractRequest {
|
|
21967
|
+
type: "extract";
|
|
21968
|
+
requestId: number;
|
|
21969
|
+
asset: WorkerAsset;
|
|
21970
|
+
}
|
|
21971
|
+
export interface WorkerTimings {
|
|
21972
|
+
totalMs: number;
|
|
21973
|
+
stageOpenMs: number;
|
|
21974
|
+
stageReadMs: number;
|
|
21975
|
+
preparationMs: number;
|
|
21976
|
+
packingMs: number;
|
|
21977
|
+
heapCopyMs: number;
|
|
21978
|
+
}
|
|
21979
|
+
export interface WorkerStatistics {
|
|
21980
|
+
nodes: number;
|
|
21981
|
+
meshes: number;
|
|
21982
|
+
analyticPrimitives: number;
|
|
21983
|
+
instances: number;
|
|
21984
|
+
materials: number;
|
|
21985
|
+
vertices: number;
|
|
21986
|
+
triangles: number;
|
|
21987
|
+
commandBytes: number;
|
|
21988
|
+
dataBytes: number;
|
|
21989
|
+
}
|
|
21990
|
+
export type WorkerResponse = {
|
|
21991
|
+
type: "progress";
|
|
21992
|
+
requestId: number;
|
|
21993
|
+
progress: USDLoadProgress;
|
|
21994
|
+
} | {
|
|
21995
|
+
type: "log";
|
|
21996
|
+
requestId: number;
|
|
21997
|
+
level: number;
|
|
21998
|
+
message: string;
|
|
21999
|
+
} | {
|
|
22000
|
+
type: "result";
|
|
22001
|
+
requestId: number;
|
|
22002
|
+
commands: ArrayBuffer;
|
|
22003
|
+
data: ArrayBuffer;
|
|
22004
|
+
timings: WorkerTimings;
|
|
22005
|
+
statistics: WorkerStatistics;
|
|
22006
|
+
missingAssets: string[];
|
|
22007
|
+
} | {
|
|
22008
|
+
type: "error";
|
|
22009
|
+
requestId: number;
|
|
22010
|
+
message: string;
|
|
22011
|
+
stack?: string;
|
|
22012
|
+
};
|
|
22013
|
+
|
|
22014
|
+
|
|
22015
|
+
export interface MaterializationResult {
|
|
22016
|
+
container: AbstractAssetContainer & {
|
|
22017
|
+
dispose(): void;
|
|
22018
|
+
};
|
|
22019
|
+
materializeMs: number;
|
|
22020
|
+
}
|
|
22021
|
+
export function materializeCommandBuffers(scene: Scene, commandBuffer: ArrayBuffer, dataBuffer: ArrayBuffer, addToScene: boolean, signal?: AbortSignal): Promise<MaterializationResult>;
|
|
22022
|
+
|
|
22023
|
+
|
|
22024
|
+
/**
|
|
22025
|
+
* Binary input accepted for supporting USD layers and assets.
|
|
22026
|
+
*/
|
|
22027
|
+
export type USDBinaryInput = ArrayBuffer | ArrayBufferView;
|
|
22028
|
+
/**
|
|
22029
|
+
* Virtual files supplied alongside the root USD layer, keyed by their path relative to the
|
|
22030
|
+
* root layer.
|
|
22031
|
+
*/
|
|
22032
|
+
export type USDVirtualFiles = Readonly<Record<string, USDBinaryInput>>;
|
|
22033
|
+
/**
|
|
22034
|
+
* Progress phases reported by the USD worker and Babylon materializer.
|
|
22035
|
+
*/
|
|
22036
|
+
export interface USDLoadProgress {
|
|
22037
|
+
/**
|
|
22038
|
+
* Current importer phase.
|
|
22039
|
+
*/
|
|
22040
|
+
phase: "initializing" | "staging" | "extracting" | "materializing";
|
|
22041
|
+
/**
|
|
22042
|
+
* Human-readable phase description.
|
|
22043
|
+
*/
|
|
22044
|
+
message: string;
|
|
22045
|
+
}
|
|
22046
|
+
/**
|
|
22047
|
+
* Options for the OpenUSD scene loader.
|
|
22048
|
+
*/
|
|
22049
|
+
export interface USDFileLoaderOptions {
|
|
22050
|
+
/**
|
|
22051
|
+
* Virtual path used to stage the root layer. Set this when supporting files need
|
|
22052
|
+
* to resolve relative to a directory hierarchy.
|
|
22053
|
+
*/
|
|
22054
|
+
rootFileName?: string;
|
|
22055
|
+
/**
|
|
22056
|
+
* Supporting layers, payloads, and textures keyed by virtual path in the same
|
|
22057
|
+
* virtual file system as `rootFileName`.
|
|
22058
|
+
*/
|
|
22059
|
+
files?: USDVirtualFiles;
|
|
22060
|
+
/**
|
|
22061
|
+
* Enables conservative file-name fallback for unresolved absolute references.
|
|
22062
|
+
* Defaults to true.
|
|
22063
|
+
*/
|
|
22064
|
+
resolveByFileName?: boolean;
|
|
22065
|
+
/**
|
|
22066
|
+
* URL of the module worker. Defaults to the protocol-versioned worker hosted on the Babylon.js CDN.
|
|
22067
|
+
*/
|
|
22068
|
+
workerUrl?: string | URL;
|
|
22069
|
+
/**
|
|
22070
|
+
* URL of the generated Emscripten JavaScript module.
|
|
22071
|
+
*/
|
|
22072
|
+
glueUrl?: string;
|
|
22073
|
+
/**
|
|
22074
|
+
* URL of the OpenUSD WebAssembly binary.
|
|
22075
|
+
*/
|
|
22076
|
+
wasmUrl?: string;
|
|
22077
|
+
/**
|
|
22078
|
+
* URL of the OpenUSD preloaded resource bundle.
|
|
22079
|
+
*/
|
|
22080
|
+
dataUrl?: string;
|
|
22081
|
+
/**
|
|
22082
|
+
* Called when the importer moves to a new processing phase.
|
|
22083
|
+
*/
|
|
22084
|
+
onProgress?: (progress: USDLoadProgress) => void;
|
|
22085
|
+
/**
|
|
22086
|
+
* Called for OpenUSD diagnostic messages.
|
|
22087
|
+
*/
|
|
22088
|
+
onLog?: (level: "info" | "warning" | "error", message: string) => void;
|
|
22089
|
+
/**
|
|
22090
|
+
* Called after extraction and Babylon.js object creation complete.
|
|
22091
|
+
*/
|
|
22092
|
+
onComplete?: (diagnostics: USDImportDiagnostics) => void;
|
|
22093
|
+
}
|
|
22094
|
+
/**
|
|
22095
|
+
* Timing data measured by the OpenUSD worker and Babylon materializer.
|
|
22096
|
+
*/
|
|
22097
|
+
export interface USDImportTimings {
|
|
22098
|
+
/** Total extraction time, including the final Wasm heap copy. */
|
|
22099
|
+
totalMs: number;
|
|
22100
|
+
/** Time spent opening and composing the USD stage. */
|
|
22101
|
+
stageOpenMs: number;
|
|
22102
|
+
/** Time spent traversing the composed stage. */
|
|
22103
|
+
stageReadMs: number;
|
|
22104
|
+
/** Time spent preparing renderable vertex streams. */
|
|
22105
|
+
preparationMs: number;
|
|
22106
|
+
/** Time spent packing the command and raw-data buffers. */
|
|
22107
|
+
packingMs: number;
|
|
22108
|
+
/** Time spent copying command and data buffers from the Wasm heap. */
|
|
22109
|
+
heapCopyMs: number;
|
|
22110
|
+
/** Time spent creating Babylon.js objects. */
|
|
22111
|
+
materializeMs: number;
|
|
22112
|
+
}
|
|
22113
|
+
/**
|
|
22114
|
+
* Statistics reported for an imported USD stage.
|
|
22115
|
+
*/
|
|
22116
|
+
export interface USDImportStatistics {
|
|
22117
|
+
/** Number of transform nodes extracted from the composed stage. */
|
|
22118
|
+
nodes: number;
|
|
22119
|
+
/** Number of polygonal `UsdGeomMesh` sources. */
|
|
22120
|
+
meshes: number;
|
|
22121
|
+
/** Number of analytic cube, sphere, cylinder, and cone sources. */
|
|
22122
|
+
analyticPrimitives: number;
|
|
22123
|
+
/** Number of native Babylon instances created from shared USD geometry. */
|
|
22124
|
+
instances: number;
|
|
22125
|
+
/** Number of authored USD materials translated. */
|
|
22126
|
+
materials: number;
|
|
22127
|
+
/** Number of unique vertices in polygonal source meshes. */
|
|
22128
|
+
vertices: number;
|
|
22129
|
+
/** Number of unique triangles in polygonal source meshes. */
|
|
22130
|
+
triangles: number;
|
|
22131
|
+
/** Size of the command buffer in bytes. */
|
|
22132
|
+
commandBytes: number;
|
|
22133
|
+
/** Size of the raw-data buffer in bytes. */
|
|
22134
|
+
dataBytes: number;
|
|
22135
|
+
}
|
|
22136
|
+
/**
|
|
22137
|
+
* Diagnostics reported after a USD import completes.
|
|
22138
|
+
*/
|
|
22139
|
+
export interface USDImportDiagnostics {
|
|
22140
|
+
/** Timing data for extraction and Babylon.js object creation. */
|
|
22141
|
+
timings: USDImportTimings;
|
|
22142
|
+
/** Counts and buffer sizes reported by the OpenUSD extractor. */
|
|
22143
|
+
statistics: USDImportStatistics;
|
|
22144
|
+
/** Asset references OpenUSD could not resolve from the supplied virtual files. */
|
|
22145
|
+
missingAssets: readonly string[];
|
|
22146
|
+
}
|
|
22147
|
+
|
|
22148
|
+
|
|
22149
|
+
interface SceneLoaderPluginOptions {
|
|
22150
|
+
/**
|
|
22151
|
+
* Defines options for the USD loader.
|
|
22152
|
+
*/
|
|
22153
|
+
[USDFileLoaderMetadata.name]: Partial<USDFileLoaderOptions>;
|
|
22154
|
+
}
|
|
22155
|
+
|
|
22156
|
+
|
|
22157
|
+
/** This file must only contain pure code and pure imports */
|
|
22158
|
+
/**
|
|
22159
|
+
* OpenUSD scene loader backed by a WebAssembly command-buffer extractor.
|
|
22160
|
+
*/
|
|
22161
|
+
export class USDFileLoader implements ISceneLoaderPluginAsync, ISceneLoaderPluginFactory {
|
|
22162
|
+
/**
|
|
22163
|
+
* Default URLs for the prebuilt OpenUSD importer assets.
|
|
22164
|
+
*/
|
|
22165
|
+
static DefaultConfiguration: {
|
|
22166
|
+
glueUrl: string;
|
|
22167
|
+
wasmUrl: string;
|
|
22168
|
+
dataUrl: string;
|
|
22169
|
+
workerUrl: string;
|
|
22170
|
+
};
|
|
22171
|
+
/**
|
|
22172
|
+
* Defines the name of the plugin.
|
|
22173
|
+
*/
|
|
22174
|
+
readonly name: "usd";
|
|
22175
|
+
/**
|
|
22176
|
+
* Defines the extensions the plugin can load.
|
|
22177
|
+
*/
|
|
22178
|
+
readonly extensions: {
|
|
22179
|
+
readonly ".usd": {
|
|
22180
|
+
readonly isBinary: true;
|
|
22181
|
+
};
|
|
22182
|
+
readonly ".usda": {
|
|
22183
|
+
readonly isBinary: true;
|
|
22184
|
+
};
|
|
22185
|
+
readonly ".usdc": {
|
|
22186
|
+
readonly isBinary: true;
|
|
22187
|
+
};
|
|
22188
|
+
readonly ".usdz": {
|
|
22189
|
+
readonly isBinary: true;
|
|
22190
|
+
};
|
|
22191
|
+
};
|
|
22192
|
+
private readonly _options;
|
|
22193
|
+
private _worker;
|
|
22194
|
+
private _workerUrl;
|
|
22195
|
+
private _workerBlobUrl;
|
|
22196
|
+
private _nextRequestId;
|
|
22197
|
+
private readonly _pending;
|
|
22198
|
+
private readonly _activeLoads;
|
|
22199
|
+
/**
|
|
22200
|
+
* Creates a USD loader.
|
|
22201
|
+
* @param options Options controlling worker assets, supporting files, and diagnostics.
|
|
22202
|
+
*/
|
|
22203
|
+
constructor(options?: Partial<USDFileLoaderOptions>);
|
|
22204
|
+
/**
|
|
22205
|
+
* Creates a configured plugin instance for a SceneLoader operation.
|
|
22206
|
+
* @param options SceneLoader plugin options.
|
|
22207
|
+
* @returns The configured USD loader.
|
|
22208
|
+
*/
|
|
22209
|
+
createPlugin(options: SceneLoaderPluginOptions): ISceneLoaderPluginAsync;
|
|
22210
|
+
/**
|
|
22211
|
+
* Imports all objects from a USD stage into a scene.
|
|
22212
|
+
* @param _meshesNames Mesh name filtering is not currently supported.
|
|
22213
|
+
* @param scene The scene receiving the imported objects.
|
|
22214
|
+
* @param data The USD, USDA, USDC, or USDZ bytes.
|
|
22215
|
+
* @param rootUrl The source root URL.
|
|
22216
|
+
* @param onProgress SceneLoader progress callback.
|
|
22217
|
+
* @param fileName Name of the root USD layer.
|
|
22218
|
+
* @returns The imported Babylon.js objects.
|
|
22219
|
+
*/
|
|
22220
|
+
importMeshAsync(_meshesNames: string | readonly string[] | null | undefined, scene: Scene, data: unknown, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<ISceneLoaderAsyncResult>;
|
|
22221
|
+
/**
|
|
22222
|
+
* Loads a USD stage into a scene.
|
|
22223
|
+
* @param scene The scene receiving the imported objects.
|
|
22224
|
+
* @param data The USD, USDA, USDC, or USDZ bytes.
|
|
22225
|
+
* @param rootUrl The source root URL.
|
|
22226
|
+
* @param onProgress SceneLoader progress callback.
|
|
22227
|
+
* @param fileName Name of the root USD layer.
|
|
22228
|
+
*/
|
|
22229
|
+
loadAsync(scene: Scene, data: unknown, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
|
|
22230
|
+
/**
|
|
22231
|
+
* Loads a USD stage into an asset container.
|
|
22232
|
+
* @param scene The scene used to create imported objects.
|
|
22233
|
+
* @param data The USD, USDA, USDC, or USDZ bytes.
|
|
22234
|
+
* @param rootUrl The source root URL.
|
|
22235
|
+
* @param onProgress SceneLoader progress callback.
|
|
22236
|
+
* @param fileName Name of the root USD layer.
|
|
22237
|
+
* @returns The populated asset container.
|
|
22238
|
+
*/
|
|
22239
|
+
loadAssetContainerAsync(scene: Scene, data: unknown, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
|
|
22240
|
+
/**
|
|
22241
|
+
* Releases the worker and rejects pending loads.
|
|
22242
|
+
*/
|
|
22243
|
+
dispose(): void;
|
|
22244
|
+
private _loadAsync;
|
|
22245
|
+
private _getWorker;
|
|
22246
|
+
private _terminateWorker;
|
|
22247
|
+
}
|
|
22248
|
+
/** @internal */
|
|
22249
|
+
export function _RegisterUSDLoaderDependencies(): void;
|
|
22250
|
+
/**
|
|
22251
|
+
* Registers the USD scene loader plugin and its Babylon.js runtime dependencies.
|
|
22252
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
22253
|
+
*/
|
|
22254
|
+
export function RegisterUSDFileLoader(): void;
|
|
22255
|
+
|
|
22256
|
+
|
|
22257
|
+
/**
|
|
22258
|
+
* Defines the USD loader plugin metadata.
|
|
22259
|
+
*/
|
|
22260
|
+
export var USDFileLoaderMetadata: {
|
|
22261
|
+
readonly name: "usd";
|
|
22262
|
+
readonly extensions: {
|
|
22263
|
+
readonly ".usd": {
|
|
22264
|
+
readonly isBinary: true;
|
|
22265
|
+
};
|
|
22266
|
+
readonly ".usda": {
|
|
22267
|
+
readonly isBinary: true;
|
|
22268
|
+
};
|
|
22269
|
+
readonly ".usdc": {
|
|
22270
|
+
readonly isBinary: true;
|
|
22271
|
+
};
|
|
22272
|
+
readonly ".usdz": {
|
|
22273
|
+
readonly isBinary: true;
|
|
22274
|
+
};
|
|
22275
|
+
};
|
|
22276
|
+
};
|
|
22277
|
+
|
|
22278
|
+
|
|
22279
|
+
/**
|
|
22280
|
+
* Re-exports the pure implementation and applies the runtime registration side effect.
|
|
22281
|
+
* Import "./usdFileLoader.pure" for tree-shakeable, side-effect-free usage.
|
|
22282
|
+
*/
|
|
22283
|
+
|
|
22284
|
+
|
|
22285
|
+
export const COMMAND_MAGIC = 1111774037;
|
|
22286
|
+
export const PROTOCOL_VERSION = 4;
|
|
22287
|
+
export const MISSING_OFFSET = 4294967295;
|
|
22288
|
+
export enum Command {
|
|
22289
|
+
Scene = 1,
|
|
22290
|
+
Texture = 2,
|
|
22291
|
+
Material = 3,
|
|
22292
|
+
TransformNode = 4,
|
|
22293
|
+
Skeleton = 5,
|
|
22294
|
+
Geometry = 6,
|
|
22295
|
+
Mesh = 7,
|
|
22296
|
+
Instance = 8,
|
|
22297
|
+
Animation = 9,
|
|
22298
|
+
AnalyticPrimitive = 10
|
|
22299
|
+
}
|
|
22300
|
+
export enum AnalyticPrimitiveType {
|
|
22301
|
+
Cube = 0,
|
|
22302
|
+
Sphere = 1,
|
|
22303
|
+
Cylinder = 2,
|
|
22304
|
+
Cone = 3
|
|
22305
|
+
}
|
|
22306
|
+
export enum PrimitiveAxis {
|
|
22307
|
+
X = 0,
|
|
22308
|
+
Y = 1,
|
|
22309
|
+
Z = 2
|
|
22310
|
+
}
|
|
22311
|
+
export enum AnimationTarget {
|
|
22312
|
+
Node = 0,
|
|
22313
|
+
Bone = 1
|
|
22314
|
+
}
|
|
22315
|
+
export enum AnimationProperty {
|
|
22316
|
+
Position = 0,
|
|
22317
|
+
RotationQuaternion = 1,
|
|
22318
|
+
Scaling = 2,
|
|
22319
|
+
Matrix = 3
|
|
22320
|
+
}
|
|
22321
|
+
export enum MaterialFlags {
|
|
22322
|
+
DoubleSided = 1,
|
|
22323
|
+
Unlit = 2,
|
|
22324
|
+
AlphaBlend = 4
|
|
22325
|
+
}
|
|
22326
|
+
export enum MeshFlags {
|
|
22327
|
+
DoubleSided = 1,
|
|
22328
|
+
LeftHanded = 2
|
|
22329
|
+
}
|
|
22330
|
+
export enum GeometryFlags {
|
|
22331
|
+
Normals = 1,
|
|
22332
|
+
Tangents = 2,
|
|
22333
|
+
Uv0 = 4,
|
|
22334
|
+
Colors = 8,
|
|
22335
|
+
Skin0 = 16,
|
|
22336
|
+
Skin1 = 32
|
|
22337
|
+
}
|
|
22338
|
+
export interface CommandRecord {
|
|
22339
|
+
opcode: Command;
|
|
22340
|
+
flags: number;
|
|
22341
|
+
payloadOffset: number;
|
|
22342
|
+
payloadLength: number;
|
|
22343
|
+
}
|
|
22344
|
+
export function readCommands(buffer: ArrayBuffer): CommandRecord[];
|
|
22345
|
+
export class PayloadReader {
|
|
22346
|
+
#private;
|
|
22347
|
+
offset: number;
|
|
22348
|
+
constructor(buffer: ArrayBuffer, offset: number, length: number);
|
|
22349
|
+
u32(): number;
|
|
22350
|
+
f32(): number;
|
|
22351
|
+
}
|
|
22352
|
+
|
|
22353
|
+
|
|
22354
|
+
/** Pure barrel — re-exports only side-effect-free modules */
|
|
22355
|
+
|
|
22356
|
+
|
|
22357
|
+
|
|
22358
|
+
|
|
21366
22359
|
interface SceneLoaderPluginOptions {
|
|
21367
22360
|
/**
|
|
21368
22361
|
* Defines options for the stl loader.
|
|
@@ -22331,6 +23324,18 @@ declare namespace BABYLON {
|
|
|
22331
23324
|
* Selects which LOD value drives the {@link GaussianSplattingStream} debug wireframe colors.
|
|
22332
23325
|
*/
|
|
22333
23326
|
export type GaussianSplattingStreamDebugLodSource = "optimal" | "current";
|
|
23327
|
+
/**
|
|
23328
|
+
* Immutable metadata-resolution state for a stream's total number of finest-LOD splats.
|
|
23329
|
+
* @experimental
|
|
23330
|
+
*/
|
|
23331
|
+
export type GaussianSplattingStreamLod0SplatCount = Readonly<{
|
|
23332
|
+
status: "pending";
|
|
23333
|
+
}> | Readonly<{
|
|
23334
|
+
status: "available";
|
|
23335
|
+
count: number;
|
|
23336
|
+
}> | Readonly<{
|
|
23337
|
+
status: "unavailable";
|
|
23338
|
+
}>;
|
|
22334
23339
|
/**
|
|
22335
23340
|
* Options for {@link GaussianSplattingStream}.
|
|
22336
23341
|
*/
|
|
@@ -22450,6 +23455,7 @@ declare namespace BABYLON {
|
|
|
22450
23455
|
private readonly _rootUrl;
|
|
22451
23456
|
private readonly _streamOptions;
|
|
22452
23457
|
private readonly _leafNodes;
|
|
23458
|
+
private _lod0SplatCount;
|
|
22453
23459
|
private _lodBaseDistance;
|
|
22454
23460
|
private _lodMultiplier;
|
|
22455
23461
|
private _lodBehindPenalty;
|
|
@@ -22614,6 +23620,19 @@ declare namespace BABYLON {
|
|
|
22614
23620
|
* @experimental
|
|
22615
23621
|
*/
|
|
22616
23622
|
get effectiveSplatBudget(): number;
|
|
23623
|
+
/**
|
|
23624
|
+
* The resolved maximum number of splats kept resident in the work buffer. This combines
|
|
23625
|
+
* {@link IGaussianSplattingStreamOptions.maxResidentSplats} and {@link IGaussianSplattingStreamOptions.memoryBudgetMb},
|
|
23626
|
+
* taking the smaller limit when both are configured. `0` means the resident budget is disabled.
|
|
23627
|
+
* @experimental
|
|
23628
|
+
*/
|
|
23629
|
+
get residentSplatBudget(): number;
|
|
23630
|
+
/**
|
|
23631
|
+
* The total number of splats represented by valid level-0 leaf entries. This remains pending while source
|
|
23632
|
+
* metadata is loading and is unavailable when no applicable level-0 entries exist or required metadata fails.
|
|
23633
|
+
* @experimental
|
|
23634
|
+
*/
|
|
23635
|
+
get lod0SplatCount(): GaussianSplattingStreamLod0SplatCount;
|
|
22617
23636
|
/**
|
|
22618
23637
|
* Resolves the raw {@link splatBudget} option to a concrete cap: `undefined` ⇒ 0 (disabled), `"auto"` ⇒ a
|
|
22619
23638
|
* device-tiered default, a positive number ⇒ itself (floored).
|
|
@@ -22783,6 +23802,11 @@ declare namespace BABYLON {
|
|
|
22783
23802
|
* @returns sorted unique file indices
|
|
22784
23803
|
*/
|
|
22785
23804
|
private _collectAllFileIds;
|
|
23805
|
+
/**
|
|
23806
|
+
* Settles the level-0 diagnostic from normalized renderable leaf entries after their source metadata resolves.
|
|
23807
|
+
* A file may back several leaf ranges, so its source count is deliberately not used in the total.
|
|
23808
|
+
*/
|
|
23809
|
+
private _resolveLod0SplatCount;
|
|
22786
23810
|
/**
|
|
22787
23811
|
* Fetches the environment bundle and every referenced file's metadata to learn splat counts, caching
|
|
22788
23812
|
* each file's parsed metadata for the later on-demand decode. Metadata fetches run in parallel.
|