babylonjs-loaders 9.1.0 → 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 +118 -41
- 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 +238 -85
- package/package.json +3 -3
|
@@ -700,14 +700,12 @@ import { Material } from "babylonjs/Materials/material";
|
|
|
700
700
|
import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
|
|
701
701
|
import { Nullable } from "babylonjs/types";
|
|
702
702
|
import { Color3 } from "babylonjs/Maths/math.color";
|
|
703
|
-
import { Vector3 } from "babylonjs/Maths/math.vector";
|
|
704
703
|
import { IMaterialLoadingAdapter } from "babylonjs-loaders/glTF/2.0/materialLoadingAdapter";
|
|
705
704
|
/**
|
|
706
705
|
* Material Loading Adapter for PBR materials that provides a unified OpenPBR-like interface.
|
|
707
706
|
*/
|
|
708
707
|
export class PBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
709
708
|
private _material;
|
|
710
|
-
private _extinctionCoefficient;
|
|
711
709
|
/**
|
|
712
710
|
* Creates a new instance of the PBRMaterialLoadingAdapter.
|
|
713
711
|
* @param material - The PBR material to adapt.
|
|
@@ -1124,6 +1122,7 @@ export class PBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
|
1124
1122
|
* @returns The scatter coefficient as a Color3
|
|
1125
1123
|
*/
|
|
1126
1124
|
get transmissionScatter(): Color3;
|
|
1125
|
+
set transmissionScatterTexture(value: Nullable<BaseTexture>);
|
|
1127
1126
|
/**
|
|
1128
1127
|
* Sets the transmission scattering anisotropy.
|
|
1129
1128
|
* @param value The anisotropy intensity value (-1 to 1)
|
|
@@ -1154,6 +1153,15 @@ export class PBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
|
1154
1153
|
* Sets up the material for proper thin-surface transmission behavior.
|
|
1155
1154
|
*/
|
|
1156
1155
|
configureTransmission(): void;
|
|
1156
|
+
configureVolume(): void;
|
|
1157
|
+
/**
|
|
1158
|
+
* Sets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
1159
|
+
*/
|
|
1160
|
+
set geometryThinWalled(value: boolean);
|
|
1161
|
+
/**
|
|
1162
|
+
* Gets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
1163
|
+
*/
|
|
1164
|
+
get geometryThinWalled(): boolean;
|
|
1157
1165
|
/**
|
|
1158
1166
|
* Sets the thickness texture (mapped to PBR subSurface.thicknessTexture).
|
|
1159
1167
|
* Automatically enables refraction.
|
|
@@ -1170,15 +1178,6 @@ export class PBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
|
1170
1178
|
* Configures subsurface properties for PBR material
|
|
1171
1179
|
*/
|
|
1172
1180
|
configureSubsurface(): void;
|
|
1173
|
-
/**
|
|
1174
|
-
* Sets the extinction coefficient of the volume.
|
|
1175
|
-
* @param value The extinction coefficient as a Vector3
|
|
1176
|
-
*/
|
|
1177
|
-
set extinctionCoefficient(value: Vector3);
|
|
1178
|
-
/**
|
|
1179
|
-
* Gets the extinction coefficient of the volume.
|
|
1180
|
-
*/
|
|
1181
|
-
get extinctionCoefficient(): Vector3;
|
|
1182
1181
|
/**
|
|
1183
1182
|
* Sets the subsurface weight
|
|
1184
1183
|
*/
|
|
@@ -1205,17 +1204,17 @@ export class PBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
|
1205
1204
|
/**
|
|
1206
1205
|
* Sets the surface tint of the material (when using subsurface scattering)
|
|
1207
1206
|
*/
|
|
1208
|
-
set
|
|
1207
|
+
set diffuseTransmissionTint(value: Color3);
|
|
1209
1208
|
/**
|
|
1210
1209
|
* Gets the subsurface constant tint (when using subsurface scattering)
|
|
1211
1210
|
* @returns The subsurface constant tint as a Color3
|
|
1212
1211
|
*/
|
|
1213
|
-
get
|
|
1212
|
+
get diffuseTransmissionTint(): Color3;
|
|
1214
1213
|
/**
|
|
1215
1214
|
* Sets the subsurface constant tint texture (when using subsurface scattering)
|
|
1216
1215
|
* @param value The subsurface constant tint texture or null
|
|
1217
1216
|
*/
|
|
1218
|
-
set
|
|
1217
|
+
set diffuseTransmissionTintTexture(value: Nullable<BaseTexture>);
|
|
1219
1218
|
/**
|
|
1220
1219
|
* Gets the subsurface radius (used for subsurface scattering)
|
|
1221
1220
|
* subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
|
|
@@ -1246,6 +1245,11 @@ export class PBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
|
1246
1245
|
* @param value The anisotropy intensity value (ignored for PBR)
|
|
1247
1246
|
*/
|
|
1248
1247
|
set subsurfaceScatterAnisotropy(value: number);
|
|
1248
|
+
/**
|
|
1249
|
+
* Does this material have a translucent surface (i.e. either transmission or subsurface)?
|
|
1250
|
+
* @returns True if the material is translucent, false otherwise
|
|
1251
|
+
*/
|
|
1252
|
+
isTranslucent(): boolean;
|
|
1249
1253
|
/**
|
|
1250
1254
|
* Configures sheen for PBR material.
|
|
1251
1255
|
* Enables sheen and sets up proper configuration.
|
|
@@ -1409,13 +1413,11 @@ import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
|
|
|
1409
1413
|
import { Nullable } from "babylonjs/types";
|
|
1410
1414
|
import { Color3 } from "babylonjs/Maths/math.color";
|
|
1411
1415
|
import { IMaterialLoadingAdapter } from "babylonjs-loaders/glTF/2.0/materialLoadingAdapter";
|
|
1412
|
-
import { Vector3 } from "babylonjs/Maths/math.vector";
|
|
1413
1416
|
/**
|
|
1414
1417
|
* Material Loading Adapter for OpenPBR materials that provides a unified OpenPBR-like interface.
|
|
1415
1418
|
*/
|
|
1416
1419
|
export class OpenPBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
1417
1420
|
private _material;
|
|
1418
|
-
private _extinctionCoefficient;
|
|
1419
1421
|
/**
|
|
1420
1422
|
* Creates a new instance of the OpenPBRMaterialLoadingAdapter.
|
|
1421
1423
|
* @param material - The OpenPBR material to adapt.
|
|
@@ -1807,7 +1809,15 @@ export class OpenPBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
|
1807
1809
|
* @returns The scatter coefficient as a Vector3
|
|
1808
1810
|
*/
|
|
1809
1811
|
get transmissionScatter(): Color3;
|
|
1812
|
+
/**
|
|
1813
|
+
* Sets the transmission scatter texture.
|
|
1814
|
+
* @param value The transmission scatter texture or null
|
|
1815
|
+
*/
|
|
1810
1816
|
set transmissionScatterTexture(value: Nullable<BaseTexture>);
|
|
1817
|
+
/**
|
|
1818
|
+
* Gets the transmission scatter texture.
|
|
1819
|
+
* @returns The transmission scatter texture or null
|
|
1820
|
+
*/
|
|
1811
1821
|
get transmissionScatterTexture(): Nullable<BaseTexture>;
|
|
1812
1822
|
/**
|
|
1813
1823
|
* Sets the transmission scattering anisotropy.
|
|
@@ -1852,6 +1862,15 @@ export class OpenPBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
|
1852
1862
|
* @param value The refraction background texture or null
|
|
1853
1863
|
*/
|
|
1854
1864
|
set refractionBackgroundTexture(value: Nullable<BaseTexture>);
|
|
1865
|
+
configureVolume(): void;
|
|
1866
|
+
/**
|
|
1867
|
+
* Sets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
1868
|
+
*/
|
|
1869
|
+
set geometryThinWalled(value: boolean);
|
|
1870
|
+
/**
|
|
1871
|
+
* Gets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
1872
|
+
*/
|
|
1873
|
+
get geometryThinWalled(): boolean;
|
|
1855
1874
|
/**
|
|
1856
1875
|
* Sets the thickness texture.
|
|
1857
1876
|
* @param value The thickness texture or null
|
|
@@ -1866,15 +1885,6 @@ export class OpenPBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
|
1866
1885
|
* Configures subsurface properties for PBR material
|
|
1867
1886
|
*/
|
|
1868
1887
|
configureSubsurface(): void;
|
|
1869
|
-
/**
|
|
1870
|
-
* Sets the extinction coefficient of the volume.
|
|
1871
|
-
* @param value The extinction coefficient as a Vector3
|
|
1872
|
-
*/
|
|
1873
|
-
set extinctionCoefficient(value: Vector3);
|
|
1874
|
-
/**
|
|
1875
|
-
* Gets the extinction coefficient of the volume.
|
|
1876
|
-
*/
|
|
1877
|
-
get extinctionCoefficient(): Vector3;
|
|
1878
1888
|
/**
|
|
1879
1889
|
* Sets the subsurface weight
|
|
1880
1890
|
*/
|
|
@@ -1894,18 +1904,20 @@ export class OpenPBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
|
1894
1904
|
* @param value The subsurface tint texture or null
|
|
1895
1905
|
*/
|
|
1896
1906
|
set subsurfaceColorTexture(value: Nullable<BaseTexture>);
|
|
1907
|
+
private _diffuseTransmissionTint;
|
|
1908
|
+
private _diffuseTransmissionTintTexture;
|
|
1897
1909
|
/**
|
|
1898
|
-
* Sets the
|
|
1910
|
+
* Sets the diffuse transmission tint of the material
|
|
1899
1911
|
*/
|
|
1900
|
-
set
|
|
1912
|
+
set diffuseTransmissionTint(value: Color3);
|
|
1901
1913
|
/**
|
|
1902
|
-
* Gets the
|
|
1914
|
+
* Gets the diffuse transmission tint of the material
|
|
1903
1915
|
*/
|
|
1904
|
-
get
|
|
1916
|
+
get diffuseTransmissionTint(): Color3;
|
|
1905
1917
|
/**
|
|
1906
|
-
* Sets the
|
|
1918
|
+
* Sets the diffuse transmission tint texture of the material
|
|
1907
1919
|
*/
|
|
1908
|
-
set
|
|
1920
|
+
set diffuseTransmissionTintTexture(value: Nullable<BaseTexture>);
|
|
1909
1921
|
/**
|
|
1910
1922
|
* Gets the subsurface radius for subsurface scattering.
|
|
1911
1923
|
* subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
|
|
@@ -1933,6 +1945,11 @@ export class OpenPBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
|
1933
1945
|
* @param value The anisotropy intensity value
|
|
1934
1946
|
*/
|
|
1935
1947
|
set subsurfaceScatterAnisotropy(value: number);
|
|
1948
|
+
/**
|
|
1949
|
+
* Does this material have a translucent surface (i.e. either transmission or subsurface)?
|
|
1950
|
+
* @returns True if the material is translucent, false otherwise
|
|
1951
|
+
*/
|
|
1952
|
+
isTranslucent(): boolean;
|
|
1936
1953
|
/**
|
|
1937
1954
|
* Configures fuzz for OpenPBR.
|
|
1938
1955
|
* Enables fuzz and sets up proper configuration.
|
|
@@ -2076,6 +2093,7 @@ export class OpenPBRMaterialLoadingAdapter implements IMaterialLoadingAdapter {
|
|
|
2076
2093
|
* @param value The scale value for the coat normal texture
|
|
2077
2094
|
*/
|
|
2078
2095
|
set geometryCoatNormalTextureScale(value: number);
|
|
2096
|
+
finalize(): void;
|
|
2079
2097
|
}
|
|
2080
2098
|
|
|
2081
2099
|
}
|
|
@@ -2084,7 +2102,6 @@ import { Material } from "babylonjs/Materials/material";
|
|
|
2084
2102
|
import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
|
|
2085
2103
|
import { Nullable } from "babylonjs/types";
|
|
2086
2104
|
import { Color3 } from "babylonjs/Maths/math.color";
|
|
2087
|
-
import { Vector3 } from "babylonjs/Maths/math.vector";
|
|
2088
2105
|
/**
|
|
2089
2106
|
* Interface for material loading adapters that provides a unified OpenPBR-like interface
|
|
2090
2107
|
* for both OpenPBR and PBR materials, eliminating conditional branches in extensions.
|
|
@@ -2094,6 +2111,10 @@ export interface IMaterialLoadingAdapter {
|
|
|
2094
2111
|
* Gets the underlying material
|
|
2095
2112
|
*/
|
|
2096
2113
|
readonly material: Material;
|
|
2114
|
+
/**
|
|
2115
|
+
* Finalizes material properties after loading is complete.
|
|
2116
|
+
*/
|
|
2117
|
+
finalize?(): void;
|
|
2097
2118
|
/**
|
|
2098
2119
|
* Whether the material should be treated as unlit
|
|
2099
2120
|
*/
|
|
@@ -2275,6 +2296,10 @@ export interface IMaterialLoadingAdapter {
|
|
|
2275
2296
|
* Sets the scattering coefficient
|
|
2276
2297
|
*/
|
|
2277
2298
|
transmissionScatter: Color3;
|
|
2299
|
+
/**
|
|
2300
|
+
* Sets the transmission scatter texture
|
|
2301
|
+
*/
|
|
2302
|
+
transmissionScatterTexture: Nullable<BaseTexture>;
|
|
2278
2303
|
/**
|
|
2279
2304
|
* Sets the scattering anisotropy (-1 to 1)
|
|
2280
2305
|
*/
|
|
@@ -2295,6 +2320,11 @@ export interface IMaterialLoadingAdapter {
|
|
|
2295
2320
|
* Configures transmission for thin-surface transmission (KHR_materials_transmission)
|
|
2296
2321
|
*/
|
|
2297
2322
|
configureTransmission(): void;
|
|
2323
|
+
configureVolume(): void;
|
|
2324
|
+
/**
|
|
2325
|
+
* Sets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
2326
|
+
*/
|
|
2327
|
+
geometryThinWalled: boolean;
|
|
2298
2328
|
/**
|
|
2299
2329
|
* Sets the thickness texture
|
|
2300
2330
|
*/
|
|
@@ -2307,11 +2337,6 @@ export interface IMaterialLoadingAdapter {
|
|
|
2307
2337
|
* Configures subsurface properties
|
|
2308
2338
|
*/
|
|
2309
2339
|
configureSubsurface(): void;
|
|
2310
|
-
/**
|
|
2311
|
-
* @internal
|
|
2312
|
-
* Sets/gets the extinction coefficient
|
|
2313
|
-
*/
|
|
2314
|
-
extinctionCoefficient: Vector3;
|
|
2315
2340
|
/**
|
|
2316
2341
|
* Sets/gets the subsurface weight
|
|
2317
2342
|
*/
|
|
@@ -2329,13 +2354,13 @@ export interface IMaterialLoadingAdapter {
|
|
|
2329
2354
|
*/
|
|
2330
2355
|
subsurfaceColorTexture: Nullable<BaseTexture>;
|
|
2331
2356
|
/**
|
|
2332
|
-
* Sets/gets the
|
|
2357
|
+
* Sets/gets the diffuse transmission tint of the material
|
|
2333
2358
|
*/
|
|
2334
|
-
|
|
2359
|
+
diffuseTransmissionTint: Color3;
|
|
2335
2360
|
/**
|
|
2336
|
-
* Sets/gets the
|
|
2361
|
+
* Sets/gets the diffuse transmission tint texture of the material
|
|
2337
2362
|
*/
|
|
2338
|
-
|
|
2363
|
+
diffuseTransmissionTintTexture: Nullable<BaseTexture>;
|
|
2339
2364
|
/**
|
|
2340
2365
|
* Sets/gets the subsurface radius (used for subsurface scattering)
|
|
2341
2366
|
*/
|
|
@@ -2348,6 +2373,10 @@ export interface IMaterialLoadingAdapter {
|
|
|
2348
2373
|
* Sets/gets the subsurface scattering anisotropy
|
|
2349
2374
|
*/
|
|
2350
2375
|
subsurfaceScatterAnisotropy: number;
|
|
2376
|
+
/**
|
|
2377
|
+
* Does this material have a translucent surface (i.e. either transmission or subsurface)?
|
|
2378
|
+
*/
|
|
2379
|
+
isTranslucent(): boolean;
|
|
2351
2380
|
/**
|
|
2352
2381
|
* Configures initial settings for fuzz for material.
|
|
2353
2382
|
*/
|
|
@@ -3061,6 +3090,7 @@ export class GLTFLoader implements IGLTFLoader {
|
|
|
3061
3090
|
private _defaultBabylonMaterialData;
|
|
3062
3091
|
private readonly _postSceneLoadActions;
|
|
3063
3092
|
private readonly _materialAdapterCache;
|
|
3093
|
+
private readonly _materialAdapters;
|
|
3064
3094
|
/** @internal */
|
|
3065
3095
|
_pbrMaterialImpl: Nullable<Readonly<PBRMaterialImplementation>> | false;
|
|
3066
3096
|
/**
|
|
@@ -6989,16 +7019,50 @@ export * from "babylonjs-loaders/STL/stlFileLoader";
|
|
|
6989
7019
|
}
|
|
6990
7020
|
declare module "babylonjs-loaders/SPLAT/spz" {
|
|
6991
7021
|
import { Scene } from "babylonjs/scene";
|
|
7022
|
+
import { Coroutine } from "babylonjs/Misc/coroutine";
|
|
6992
7023
|
import { SPLATLoadingOptions } from "babylonjs-loaders/SPLAT/splatLoadingOptions";
|
|
6993
7024
|
import { IParsedSplat } from "babylonjs-loaders/SPLAT/splatDefs";
|
|
7025
|
+
|
|
6994
7026
|
/**
|
|
6995
|
-
* Parses SPZ data and returns a promise resolving to an
|
|
7027
|
+
* Parses SPZ data and returns a promise resolving to an IParsedSplat object.
|
|
6996
7028
|
* @param data The ArrayBuffer containing SPZ data.
|
|
6997
7029
|
* @param scene The Babylon.js scene.
|
|
6998
|
-
* @param
|
|
7030
|
+
* @param _loadingOptions Options for loading Gaussian Splatting files.
|
|
6999
7031
|
* @returns A promise resolving to the parsed SPZ data.
|
|
7000
7032
|
*/
|
|
7001
|
-
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>;
|
|
7002
7066
|
|
|
7003
7067
|
}
|
|
7004
7068
|
declare module "babylonjs-loaders/SPLAT/splatLoadingOptions" {
|
|
@@ -7034,6 +7098,17 @@ export type SPLATLoadingOptions = {
|
|
|
7034
7098
|
* Mesh that will be used to load data instead of creating a new one
|
|
7035
7099
|
*/
|
|
7036
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;
|
|
7037
7112
|
};
|
|
7038
7113
|
|
|
7039
7114
|
}
|
|
@@ -7182,6 +7257,7 @@ export interface IParsedSplat {
|
|
|
7182
7257
|
faces?: number[];
|
|
7183
7258
|
hasVertexColors?: boolean;
|
|
7184
7259
|
sh?: Uint8Array[];
|
|
7260
|
+
shDegree?: number;
|
|
7185
7261
|
trainedWithAntialiasing?: boolean;
|
|
7186
7262
|
compressed?: boolean;
|
|
7187
7263
|
rawSplat?: boolean;
|
|
@@ -8460,7 +8536,6 @@ declare namespace BABYLON.GLTF2 {
|
|
|
8460
8536
|
*/
|
|
8461
8537
|
export class PBRMaterialLoadingAdapter implements BABYLON.GLTF2.IMaterialLoadingAdapter {
|
|
8462
8538
|
private _material;
|
|
8463
|
-
private _extinctionCoefficient;
|
|
8464
8539
|
/**
|
|
8465
8540
|
* Creates a new instance of the PBRMaterialLoadingAdapter.
|
|
8466
8541
|
* @param material - The PBR material to adapt.
|
|
@@ -8877,6 +8952,7 @@ declare namespace BABYLON.GLTF2 {
|
|
|
8877
8952
|
* @returns The scatter coefficient as a Color3
|
|
8878
8953
|
*/
|
|
8879
8954
|
get transmissionScatter(): Color3;
|
|
8955
|
+
set transmissionScatterTexture(value: Nullable<BaseTexture>);
|
|
8880
8956
|
/**
|
|
8881
8957
|
* Sets the transmission scattering anisotropy.
|
|
8882
8958
|
* @param value The anisotropy intensity value (-1 to 1)
|
|
@@ -8907,6 +8983,15 @@ declare namespace BABYLON.GLTF2 {
|
|
|
8907
8983
|
* Sets up the material for proper thin-surface transmission behavior.
|
|
8908
8984
|
*/
|
|
8909
8985
|
configureTransmission(): void;
|
|
8986
|
+
configureVolume(): void;
|
|
8987
|
+
/**
|
|
8988
|
+
* Sets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
8989
|
+
*/
|
|
8990
|
+
set geometryThinWalled(value: boolean);
|
|
8991
|
+
/**
|
|
8992
|
+
* Gets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
8993
|
+
*/
|
|
8994
|
+
get geometryThinWalled(): boolean;
|
|
8910
8995
|
/**
|
|
8911
8996
|
* Sets the thickness texture (mapped to PBR subSurface.thicknessTexture).
|
|
8912
8997
|
* Automatically enables refraction.
|
|
@@ -8923,15 +9008,6 @@ declare namespace BABYLON.GLTF2 {
|
|
|
8923
9008
|
* Configures subsurface properties for PBR material
|
|
8924
9009
|
*/
|
|
8925
9010
|
configureSubsurface(): void;
|
|
8926
|
-
/**
|
|
8927
|
-
* Sets the extinction coefficient of the volume.
|
|
8928
|
-
* @param value The extinction coefficient as a Vector3
|
|
8929
|
-
*/
|
|
8930
|
-
set extinctionCoefficient(value: Vector3);
|
|
8931
|
-
/**
|
|
8932
|
-
* Gets the extinction coefficient of the volume.
|
|
8933
|
-
*/
|
|
8934
|
-
get extinctionCoefficient(): Vector3;
|
|
8935
9011
|
/**
|
|
8936
9012
|
* Sets the subsurface weight
|
|
8937
9013
|
*/
|
|
@@ -8958,17 +9034,17 @@ declare namespace BABYLON.GLTF2 {
|
|
|
8958
9034
|
/**
|
|
8959
9035
|
* Sets the surface tint of the material (when using subsurface scattering)
|
|
8960
9036
|
*/
|
|
8961
|
-
set
|
|
9037
|
+
set diffuseTransmissionTint(value: Color3);
|
|
8962
9038
|
/**
|
|
8963
9039
|
* Gets the subsurface constant tint (when using subsurface scattering)
|
|
8964
9040
|
* @returns The subsurface constant tint as a Color3
|
|
8965
9041
|
*/
|
|
8966
|
-
get
|
|
9042
|
+
get diffuseTransmissionTint(): Color3;
|
|
8967
9043
|
/**
|
|
8968
9044
|
* Sets the subsurface constant tint texture (when using subsurface scattering)
|
|
8969
9045
|
* @param value The subsurface constant tint texture or null
|
|
8970
9046
|
*/
|
|
8971
|
-
set
|
|
9047
|
+
set diffuseTransmissionTintTexture(value: Nullable<BaseTexture>);
|
|
8972
9048
|
/**
|
|
8973
9049
|
* Gets the subsurface radius (used for subsurface scattering)
|
|
8974
9050
|
* subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
|
|
@@ -8999,6 +9075,11 @@ declare namespace BABYLON.GLTF2 {
|
|
|
8999
9075
|
* @param value The anisotropy intensity value (ignored for PBR)
|
|
9000
9076
|
*/
|
|
9001
9077
|
set subsurfaceScatterAnisotropy(value: number);
|
|
9078
|
+
/**
|
|
9079
|
+
* Does this material have a translucent surface (i.e. either transmission or subsurface)?
|
|
9080
|
+
* @returns True if the material is translucent, false otherwise
|
|
9081
|
+
*/
|
|
9082
|
+
isTranslucent(): boolean;
|
|
9002
9083
|
/**
|
|
9003
9084
|
* Configures sheen for PBR material.
|
|
9004
9085
|
* Enables sheen and sets up proper configuration.
|
|
@@ -9167,7 +9248,6 @@ declare namespace BABYLON.GLTF2 {
|
|
|
9167
9248
|
*/
|
|
9168
9249
|
export class OpenPBRMaterialLoadingAdapter implements BABYLON.GLTF2.IMaterialLoadingAdapter {
|
|
9169
9250
|
private _material;
|
|
9170
|
-
private _extinctionCoefficient;
|
|
9171
9251
|
/**
|
|
9172
9252
|
* Creates a new instance of the OpenPBRMaterialLoadingAdapter.
|
|
9173
9253
|
* @param material - The OpenPBR material to adapt.
|
|
@@ -9559,7 +9639,15 @@ declare namespace BABYLON.GLTF2 {
|
|
|
9559
9639
|
* @returns The scatter coefficient as a Vector3
|
|
9560
9640
|
*/
|
|
9561
9641
|
get transmissionScatter(): Color3;
|
|
9642
|
+
/**
|
|
9643
|
+
* Sets the transmission scatter texture.
|
|
9644
|
+
* @param value The transmission scatter texture or null
|
|
9645
|
+
*/
|
|
9562
9646
|
set transmissionScatterTexture(value: Nullable<BaseTexture>);
|
|
9647
|
+
/**
|
|
9648
|
+
* Gets the transmission scatter texture.
|
|
9649
|
+
* @returns The transmission scatter texture or null
|
|
9650
|
+
*/
|
|
9563
9651
|
get transmissionScatterTexture(): Nullable<BaseTexture>;
|
|
9564
9652
|
/**
|
|
9565
9653
|
* Sets the transmission scattering anisotropy.
|
|
@@ -9604,6 +9692,15 @@ declare namespace BABYLON.GLTF2 {
|
|
|
9604
9692
|
* @param value The refraction background texture or null
|
|
9605
9693
|
*/
|
|
9606
9694
|
set refractionBackgroundTexture(value: Nullable<BaseTexture>);
|
|
9695
|
+
configureVolume(): void;
|
|
9696
|
+
/**
|
|
9697
|
+
* Sets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
9698
|
+
*/
|
|
9699
|
+
set geometryThinWalled(value: boolean);
|
|
9700
|
+
/**
|
|
9701
|
+
* Gets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
9702
|
+
*/
|
|
9703
|
+
get geometryThinWalled(): boolean;
|
|
9607
9704
|
/**
|
|
9608
9705
|
* Sets the thickness texture.
|
|
9609
9706
|
* @param value The thickness texture or null
|
|
@@ -9618,15 +9715,6 @@ declare namespace BABYLON.GLTF2 {
|
|
|
9618
9715
|
* Configures subsurface properties for PBR material
|
|
9619
9716
|
*/
|
|
9620
9717
|
configureSubsurface(): void;
|
|
9621
|
-
/**
|
|
9622
|
-
* Sets the extinction coefficient of the volume.
|
|
9623
|
-
* @param value The extinction coefficient as a Vector3
|
|
9624
|
-
*/
|
|
9625
|
-
set extinctionCoefficient(value: Vector3);
|
|
9626
|
-
/**
|
|
9627
|
-
* Gets the extinction coefficient of the volume.
|
|
9628
|
-
*/
|
|
9629
|
-
get extinctionCoefficient(): Vector3;
|
|
9630
9718
|
/**
|
|
9631
9719
|
* Sets the subsurface weight
|
|
9632
9720
|
*/
|
|
@@ -9646,18 +9734,20 @@ declare namespace BABYLON.GLTF2 {
|
|
|
9646
9734
|
* @param value The subsurface tint texture or null
|
|
9647
9735
|
*/
|
|
9648
9736
|
set subsurfaceColorTexture(value: Nullable<BaseTexture>);
|
|
9737
|
+
private _diffuseTransmissionTint;
|
|
9738
|
+
private _diffuseTransmissionTintTexture;
|
|
9649
9739
|
/**
|
|
9650
|
-
* Sets the
|
|
9740
|
+
* Sets the diffuse transmission tint of the material
|
|
9651
9741
|
*/
|
|
9652
|
-
set
|
|
9742
|
+
set diffuseTransmissionTint(value: Color3);
|
|
9653
9743
|
/**
|
|
9654
|
-
* Gets the
|
|
9744
|
+
* Gets the diffuse transmission tint of the material
|
|
9655
9745
|
*/
|
|
9656
|
-
get
|
|
9746
|
+
get diffuseTransmissionTint(): Color3;
|
|
9657
9747
|
/**
|
|
9658
|
-
* Sets the
|
|
9748
|
+
* Sets the diffuse transmission tint texture of the material
|
|
9659
9749
|
*/
|
|
9660
|
-
set
|
|
9750
|
+
set diffuseTransmissionTintTexture(value: Nullable<BaseTexture>);
|
|
9661
9751
|
/**
|
|
9662
9752
|
* Gets the subsurface radius for subsurface scattering.
|
|
9663
9753
|
* subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
|
|
@@ -9685,6 +9775,11 @@ declare namespace BABYLON.GLTF2 {
|
|
|
9685
9775
|
* @param value The anisotropy intensity value
|
|
9686
9776
|
*/
|
|
9687
9777
|
set subsurfaceScatterAnisotropy(value: number);
|
|
9778
|
+
/**
|
|
9779
|
+
* Does this material have a translucent surface (i.e. either transmission or subsurface)?
|
|
9780
|
+
* @returns True if the material is translucent, false otherwise
|
|
9781
|
+
*/
|
|
9782
|
+
isTranslucent(): boolean;
|
|
9688
9783
|
/**
|
|
9689
9784
|
* Configures fuzz for OpenPBR.
|
|
9690
9785
|
* Enables fuzz and sets up proper configuration.
|
|
@@ -9828,6 +9923,7 @@ declare namespace BABYLON.GLTF2 {
|
|
|
9828
9923
|
* @param value The scale value for the coat normal texture
|
|
9829
9924
|
*/
|
|
9830
9925
|
set geometryCoatNormalTextureScale(value: number);
|
|
9926
|
+
finalize(): void;
|
|
9831
9927
|
}
|
|
9832
9928
|
|
|
9833
9929
|
|
|
@@ -9847,6 +9943,10 @@ declare namespace BABYLON.GLTF2 {
|
|
|
9847
9943
|
* Gets the underlying material
|
|
9848
9944
|
*/
|
|
9849
9945
|
readonly material: Material;
|
|
9946
|
+
/**
|
|
9947
|
+
* Finalizes material properties after loading is complete.
|
|
9948
|
+
*/
|
|
9949
|
+
finalize?(): void;
|
|
9850
9950
|
/**
|
|
9851
9951
|
* Whether the material should be treated as unlit
|
|
9852
9952
|
*/
|
|
@@ -10028,6 +10128,10 @@ declare namespace BABYLON.GLTF2 {
|
|
|
10028
10128
|
* Sets the scattering coefficient
|
|
10029
10129
|
*/
|
|
10030
10130
|
transmissionScatter: Color3;
|
|
10131
|
+
/**
|
|
10132
|
+
* Sets the transmission scatter texture
|
|
10133
|
+
*/
|
|
10134
|
+
transmissionScatterTexture: Nullable<BaseTexture>;
|
|
10031
10135
|
/**
|
|
10032
10136
|
* Sets the scattering anisotropy (-1 to 1)
|
|
10033
10137
|
*/
|
|
@@ -10048,6 +10152,11 @@ declare namespace BABYLON.GLTF2 {
|
|
|
10048
10152
|
* Configures transmission for thin-surface transmission (KHR_materials_transmission)
|
|
10049
10153
|
*/
|
|
10050
10154
|
configureTransmission(): void;
|
|
10155
|
+
configureVolume(): void;
|
|
10156
|
+
/**
|
|
10157
|
+
* Sets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
10158
|
+
*/
|
|
10159
|
+
geometryThinWalled: boolean;
|
|
10051
10160
|
/**
|
|
10052
10161
|
* Sets the thickness texture
|
|
10053
10162
|
*/
|
|
@@ -10060,11 +10169,6 @@ declare namespace BABYLON.GLTF2 {
|
|
|
10060
10169
|
* Configures subsurface properties
|
|
10061
10170
|
*/
|
|
10062
10171
|
configureSubsurface(): void;
|
|
10063
|
-
/**
|
|
10064
|
-
* @internal
|
|
10065
|
-
* Sets/gets the extinction coefficient
|
|
10066
|
-
*/
|
|
10067
|
-
extinctionCoefficient: Vector3;
|
|
10068
10172
|
/**
|
|
10069
10173
|
* Sets/gets the subsurface weight
|
|
10070
10174
|
*/
|
|
@@ -10082,13 +10186,13 @@ declare namespace BABYLON.GLTF2 {
|
|
|
10082
10186
|
*/
|
|
10083
10187
|
subsurfaceColorTexture: Nullable<BaseTexture>;
|
|
10084
10188
|
/**
|
|
10085
|
-
* Sets/gets the
|
|
10189
|
+
* Sets/gets the diffuse transmission tint of the material
|
|
10086
10190
|
*/
|
|
10087
|
-
|
|
10191
|
+
diffuseTransmissionTint: Color3;
|
|
10088
10192
|
/**
|
|
10089
|
-
* Sets/gets the
|
|
10193
|
+
* Sets/gets the diffuse transmission tint texture of the material
|
|
10090
10194
|
*/
|
|
10091
|
-
|
|
10195
|
+
diffuseTransmissionTintTexture: Nullable<BaseTexture>;
|
|
10092
10196
|
/**
|
|
10093
10197
|
* Sets/gets the subsurface radius (used for subsurface scattering)
|
|
10094
10198
|
*/
|
|
@@ -10101,6 +10205,10 @@ declare namespace BABYLON.GLTF2 {
|
|
|
10101
10205
|
* Sets/gets the subsurface scattering anisotropy
|
|
10102
10206
|
*/
|
|
10103
10207
|
subsurfaceScatterAnisotropy: number;
|
|
10208
|
+
/**
|
|
10209
|
+
* Does this material have a translucent surface (i.e. either transmission or subsurface)?
|
|
10210
|
+
*/
|
|
10211
|
+
isTranslucent(): boolean;
|
|
10104
10212
|
/**
|
|
10105
10213
|
* Configures initial settings for fuzz for material.
|
|
10106
10214
|
*/
|
|
@@ -10784,6 +10892,7 @@ declare namespace BABYLON.GLTF2 {
|
|
|
10784
10892
|
private _defaultBabylonMaterialData;
|
|
10785
10893
|
private readonly _postSceneLoadActions;
|
|
10786
10894
|
private readonly _materialAdapterCache;
|
|
10895
|
+
private readonly _materialAdapters;
|
|
10787
10896
|
/** @internal */
|
|
10788
10897
|
_pbrMaterialImpl: Nullable<Readonly<PBRMaterialImplementation>> | false;
|
|
10789
10898
|
/**
|
|
@@ -14590,13 +14699,45 @@ declare namespace BABYLON {
|
|
|
14590
14699
|
|
|
14591
14700
|
|
|
14592
14701
|
/**
|
|
14593
|
-
* Parses SPZ data and returns a promise resolving to an
|
|
14702
|
+
* Parses SPZ data and returns a promise resolving to an IParsedSplat object.
|
|
14594
14703
|
* @param data The ArrayBuffer containing SPZ data.
|
|
14595
14704
|
* @param scene The Babylon.js scene.
|
|
14596
|
-
* @param
|
|
14705
|
+
* @param _loadingOptions Options for loading Gaussian Splatting files.
|
|
14597
14706
|
* @returns A promise resolving to the parsed SPZ data.
|
|
14598
14707
|
*/
|
|
14599
|
-
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>;
|
|
14600
14741
|
|
|
14601
14742
|
|
|
14602
14743
|
/**
|
|
@@ -14630,6 +14771,17 @@ declare namespace BABYLON {
|
|
|
14630
14771
|
* Mesh that will be used to load data instead of creating a new one
|
|
14631
14772
|
*/
|
|
14632
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;
|
|
14633
14785
|
};
|
|
14634
14786
|
|
|
14635
14787
|
|
|
@@ -14768,6 +14920,7 @@ declare namespace BABYLON {
|
|
|
14768
14920
|
faces?: number[];
|
|
14769
14921
|
hasVertexColors?: boolean;
|
|
14770
14922
|
sh?: Uint8Array[];
|
|
14923
|
+
shDegree?: number;
|
|
14771
14924
|
trainedWithAntialiasing?: boolean;
|
|
14772
14925
|
compressed?: boolean;
|
|
14773
14926
|
rawSplat?: boolean;
|