babylonjs-loaders 9.2.1 → 9.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babylon.glTF2FileLoader.js +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.min.js +1 -1
- package/babylon.glTFFileLoader.min.js.map +1 -1
- package/babylon.objFileLoader.js +1 -1
- package/babylon.objFileLoader.min.js +1 -1
- package/babylon.objFileLoader.min.js.map +1 -1
- package/babylonjs.loaders.d.ts +47 -3
- package/babylonjs.loaders.js +1 -1
- package/babylonjs.loaders.min.js +1 -1
- package/babylonjs.loaders.min.js.map +1 -1
- package/babylonjs.loaders.module.d.ts +96 -6
- package/package.json +3 -3
|
@@ -7019,16 +7019,50 @@ export * from "babylonjs-loaders/STL/stlFileLoader";
|
|
|
7019
7019
|
}
|
|
7020
7020
|
declare module "babylonjs-loaders/SPLAT/spz" {
|
|
7021
7021
|
import { Scene } from "babylonjs/scene";
|
|
7022
|
+
import { Coroutine } from "babylonjs/Misc/coroutine";
|
|
7022
7023
|
import { SPLATLoadingOptions } from "babylonjs-loaders/SPLAT/splatLoadingOptions";
|
|
7023
7024
|
import { IParsedSplat } from "babylonjs-loaders/SPLAT/splatDefs";
|
|
7025
|
+
|
|
7024
7026
|
/**
|
|
7025
|
-
* Parses SPZ data and returns a promise resolving to an
|
|
7027
|
+
* Parses SPZ data and returns a promise resolving to an IParsedSplat object.
|
|
7026
7028
|
* @param data The ArrayBuffer containing SPZ data.
|
|
7027
7029
|
* @param scene The Babylon.js scene.
|
|
7028
|
-
* @param
|
|
7030
|
+
* @param _loadingOptions Options for loading Gaussian Splatting files.
|
|
7029
7031
|
* @returns A promise resolving to the parsed SPZ data.
|
|
7030
7032
|
*/
|
|
7031
|
-
export function ParseSpz(data: ArrayBuffer, scene: Scene,
|
|
7033
|
+
export function ParseSpz(data: ArrayBuffer, scene: Scene, _loadingOptions: SPLATLoadingOptions): Promise<IParsedSplat>;
|
|
7034
|
+
/**
|
|
7035
|
+
* Returns the initialized spz WASM module loaded from the given URL, loading it on first call.
|
|
7036
|
+
* @param url URL to the spz WASM ES module (its default export should be a factory function)
|
|
7037
|
+
* @returns A promise resolving to the initialized spz WASM module
|
|
7038
|
+
*/
|
|
7039
|
+
export function GetSpzModule(url: string): Promise<SpzModule>;
|
|
7040
|
+
/**
|
|
7041
|
+
* Converts a GaussianCloud object (from the spz WASM module) into the packed 32-byte-per-splat
|
|
7042
|
+
* ArrayBuffer and SH texture arrays expected by GaussianSplattingMeshBase.updateData.
|
|
7043
|
+
*
|
|
7044
|
+
* Packed layout per splat (32 bytes):
|
|
7045
|
+
* [0-11] position xyz (float32 x3)
|
|
7046
|
+
* [12-23] scale xyz (float32 x3)
|
|
7047
|
+
* [24-27] color RGBA (uint8 x4, colors in [0,255], alpha in [0,255])
|
|
7048
|
+
* [28-31] quaternion wxyz (uint8 x4, encoded as q * 127.5 + 127.5)
|
|
7049
|
+
*
|
|
7050
|
+
* SH coefficients from the cloud (Float32, range ~[-1,1]) are encoded to bytes
|
|
7051
|
+
* using the SPZ convention (load-spz.cc unquantizeSH): byte = coeff * 128 + 128.
|
|
7052
|
+
*
|
|
7053
|
+
* @param cloud The GaussianCloud returned by spz.loadSpzFromBuffer
|
|
7054
|
+
* @param scene The Babylon.js scene (used to query maxTextureSize for SH textures)
|
|
7055
|
+
* @param useCoroutine If true, yields periodically to avoid blocking the main thread
|
|
7056
|
+
* @returns A coroutine returning an IParsedSplat ready to be passed to updateData
|
|
7057
|
+
*/
|
|
7058
|
+
export function ConvertSpzToSplat(cloud: GaussianCloud, scene: Scene, useCoroutine?: boolean): Coroutine<IParsedSplat>;
|
|
7059
|
+
/**
|
|
7060
|
+
* Async version of ConvertSpzToSplat that yields periodically to avoid blocking the main thread.
|
|
7061
|
+
* @param cloud The GaussianCloud returned by spz.loadSpzFromBuffer
|
|
7062
|
+
* @param scene The Babylon.js scene
|
|
7063
|
+
* @returns A promise resolving to an IParsedSplat
|
|
7064
|
+
*/
|
|
7065
|
+
export function ConvertSpzToSplatAsync(cloud: any, scene: Scene): Promise<IParsedSplat>;
|
|
7032
7066
|
|
|
7033
7067
|
}
|
|
7034
7068
|
declare module "babylonjs-loaders/SPLAT/splatLoadingOptions" {
|
|
@@ -7064,6 +7098,17 @@ export type SPLATLoadingOptions = {
|
|
|
7064
7098
|
* Mesh that will be used to load data instead of creating a new one
|
|
7065
7099
|
*/
|
|
7066
7100
|
gaussianSplattingMesh?: GaussianSplattingMesh;
|
|
7101
|
+
/**
|
|
7102
|
+
* URL to load the spz WASM ES module from (e.g. the \@adobe/spz package).
|
|
7103
|
+
* When provided, the WASM-based SPZ loader is used, which supports extra features
|
|
7104
|
+
* such as antialiasing metadata, and vendor-specific extensions such as safe-orbit
|
|
7105
|
+
* camera limits.
|
|
7106
|
+
* Defaults to the \@adobe/spz unpkg URL when WebAssembly is supported, and undefined otherwise.
|
|
7107
|
+
* Set to undefined to force the built-in manual SPZ parser regardless of WebAssembly support.
|
|
7108
|
+
* @example Setting the URL directly on the loader options
|
|
7109
|
+
* spzLibraryUrl: "https://unpkg.com/\@adobe/spz\@0.2.0/dist/spz.js"
|
|
7110
|
+
*/
|
|
7111
|
+
spzLibraryUrl?: string;
|
|
7067
7112
|
};
|
|
7068
7113
|
|
|
7069
7114
|
}
|
|
@@ -7212,6 +7257,7 @@ export interface IParsedSplat {
|
|
|
7212
7257
|
faces?: number[];
|
|
7213
7258
|
hasVertexColors?: boolean;
|
|
7214
7259
|
sh?: Uint8Array[];
|
|
7260
|
+
shDegree?: number;
|
|
7215
7261
|
trainedWithAntialiasing?: boolean;
|
|
7216
7262
|
compressed?: boolean;
|
|
7217
7263
|
rawSplat?: boolean;
|
|
@@ -14653,13 +14699,45 @@ declare namespace BABYLON {
|
|
|
14653
14699
|
|
|
14654
14700
|
|
|
14655
14701
|
/**
|
|
14656
|
-
* Parses SPZ data and returns a promise resolving to an
|
|
14702
|
+
* Parses SPZ data and returns a promise resolving to an IParsedSplat object.
|
|
14657
14703
|
* @param data The ArrayBuffer containing SPZ data.
|
|
14658
14704
|
* @param scene The Babylon.js scene.
|
|
14659
|
-
* @param
|
|
14705
|
+
* @param _loadingOptions Options for loading Gaussian Splatting files.
|
|
14660
14706
|
* @returns A promise resolving to the parsed SPZ data.
|
|
14661
14707
|
*/
|
|
14662
|
-
export function ParseSpz(data: ArrayBuffer, scene: Scene,
|
|
14708
|
+
export function ParseSpz(data: ArrayBuffer, scene: Scene, _loadingOptions: SPLATLoadingOptions): Promise<IParsedSplat>;
|
|
14709
|
+
/**
|
|
14710
|
+
* Returns the initialized spz WASM module loaded from the given URL, loading it on first call.
|
|
14711
|
+
* @param url URL to the spz WASM ES module (its default export should be a factory function)
|
|
14712
|
+
* @returns A promise resolving to the initialized spz WASM module
|
|
14713
|
+
*/
|
|
14714
|
+
export function GetSpzModule(url: string): Promise<SpzModule>;
|
|
14715
|
+
/**
|
|
14716
|
+
* Converts a GaussianCloud object (from the spz WASM module) into the packed 32-byte-per-splat
|
|
14717
|
+
* ArrayBuffer and SH texture arrays expected by GaussianSplattingMeshBase.updateData.
|
|
14718
|
+
*
|
|
14719
|
+
* Packed layout per splat (32 bytes):
|
|
14720
|
+
* [0-11] position xyz (float32 x3)
|
|
14721
|
+
* [12-23] scale xyz (float32 x3)
|
|
14722
|
+
* [24-27] color RGBA (uint8 x4, colors in [0,255], alpha in [0,255])
|
|
14723
|
+
* [28-31] quaternion wxyz (uint8 x4, encoded as q * 127.5 + 127.5)
|
|
14724
|
+
*
|
|
14725
|
+
* SH coefficients from the cloud (Float32, range ~[-1,1]) are encoded to bytes
|
|
14726
|
+
* using the SPZ convention (load-spz.cc unquantizeSH): byte = coeff * 128 + 128.
|
|
14727
|
+
*
|
|
14728
|
+
* @param cloud The GaussianCloud returned by spz.loadSpzFromBuffer
|
|
14729
|
+
* @param scene The Babylon.js scene (used to query maxTextureSize for SH textures)
|
|
14730
|
+
* @param useCoroutine If true, yields periodically to avoid blocking the main thread
|
|
14731
|
+
* @returns A coroutine returning an IParsedSplat ready to be passed to updateData
|
|
14732
|
+
*/
|
|
14733
|
+
export function ConvertSpzToSplat(cloud: GaussianCloud, scene: Scene, useCoroutine?: boolean): Coroutine<IParsedSplat>;
|
|
14734
|
+
/**
|
|
14735
|
+
* Async version of ConvertSpzToSplat that yields periodically to avoid blocking the main thread.
|
|
14736
|
+
* @param cloud The GaussianCloud returned by spz.loadSpzFromBuffer
|
|
14737
|
+
* @param scene The Babylon.js scene
|
|
14738
|
+
* @returns A promise resolving to an IParsedSplat
|
|
14739
|
+
*/
|
|
14740
|
+
export function ConvertSpzToSplatAsync(cloud: any, scene: Scene): Promise<IParsedSplat>;
|
|
14663
14741
|
|
|
14664
14742
|
|
|
14665
14743
|
/**
|
|
@@ -14693,6 +14771,17 @@ declare namespace BABYLON {
|
|
|
14693
14771
|
* Mesh that will be used to load data instead of creating a new one
|
|
14694
14772
|
*/
|
|
14695
14773
|
gaussianSplattingMesh?: GaussianSplattingMesh;
|
|
14774
|
+
/**
|
|
14775
|
+
* URL to load the spz WASM ES module from (e.g. the \@adobe/spz package).
|
|
14776
|
+
* When provided, the WASM-based SPZ loader is used, which supports extra features
|
|
14777
|
+
* such as antialiasing metadata, and vendor-specific extensions such as safe-orbit
|
|
14778
|
+
* camera limits.
|
|
14779
|
+
* Defaults to the \@adobe/spz unpkg URL when WebAssembly is supported, and undefined otherwise.
|
|
14780
|
+
* Set to undefined to force the built-in manual SPZ parser regardless of WebAssembly support.
|
|
14781
|
+
* @example Setting the URL directly on the loader options
|
|
14782
|
+
* spzLibraryUrl: "https://unpkg.com/\@adobe/spz\@0.2.0/dist/spz.js"
|
|
14783
|
+
*/
|
|
14784
|
+
spzLibraryUrl?: string;
|
|
14696
14785
|
};
|
|
14697
14786
|
|
|
14698
14787
|
|
|
@@ -14831,6 +14920,7 @@ declare namespace BABYLON {
|
|
|
14831
14920
|
faces?: number[];
|
|
14832
14921
|
hasVertexColors?: boolean;
|
|
14833
14922
|
sh?: Uint8Array[];
|
|
14923
|
+
shDegree?: number;
|
|
14834
14924
|
trainedWithAntialiasing?: boolean;
|
|
14835
14925
|
compressed?: boolean;
|
|
14836
14926
|
rawSplat?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babylonjs-loaders",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.2",
|
|
4
4
|
"main": "babylonjs.loaders.min.js",
|
|
5
5
|
"types": "babylonjs.loaders.module.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"test:escheck": "es-check es6 ./babylonjs.loaders.js"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"babylonjs": "9.2.
|
|
19
|
-
"babylonjs-gltf2interface": "9.2.
|
|
18
|
+
"babylonjs": "9.2.2",
|
|
19
|
+
"babylonjs-gltf2interface": "9.2.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@dev/build-tools": "1.0.0",
|