babylonjs-loaders 9.6.2 → 9.7.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.bvhFileLoader.js +2 -0
- package/babylon.bvhFileLoader.js.map +1 -0
- package/babylon.glTF1FileLoader.js +2 -0
- package/babylon.glTF1FileLoader.js.map +1 -0
- package/babylon.glTF2FileLoader.js +2 -0
- package/babylon.glTF2FileLoader.js.map +1 -0
- package/babylon.glTF2FileLoader.min.js +1 -1
- package/babylon.glTF2FileLoader.min.js.map +1 -1
- package/babylon.glTFFileLoader.js +2 -0
- package/babylon.glTFFileLoader.js.map +1 -0
- package/babylon.glTFFileLoader.min.js +1 -1
- package/babylon.glTFFileLoader.min.js.map +1 -1
- package/babylon.objFileLoader.js +2 -0
- package/babylon.objFileLoader.js.map +1 -0
- package/babylon.stlFileLoader.js +2 -0
- package/babylon.stlFileLoader.js.map +1 -0
- package/babylonjs.loaders.d.ts +69 -3
- 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 +138 -6
- package/package.json +3 -3
package/babylonjs.loaders.d.ts
CHANGED
|
@@ -628,6 +628,7 @@ declare namespace BABYLON.GLTF2 {
|
|
|
628
628
|
*/
|
|
629
629
|
export class PBRMaterialLoadingAdapter implements BABYLON.GLTF2.IMaterialLoadingAdapter {
|
|
630
630
|
private _material;
|
|
631
|
+
private _specWorkflow;
|
|
631
632
|
/**
|
|
632
633
|
* Creates a new instance of the PBRMaterialLoadingAdapter.
|
|
633
634
|
* @param material - The PBR material to adapt.
|
|
@@ -769,6 +770,10 @@ declare namespace BABYLON.GLTF2 {
|
|
|
769
770
|
* @param enableEdgeColor Whether to enable OpenPBR BRDF models for edge color support
|
|
770
771
|
*/
|
|
771
772
|
enableSpecularEdgeColor(enableEdgeColor?: boolean): void;
|
|
773
|
+
/**
|
|
774
|
+
* Enable the specular/glossiness workflow and disable metallic/roughness.
|
|
775
|
+
*/
|
|
776
|
+
configureSpecularGlossiness(): void;
|
|
772
777
|
/**
|
|
773
778
|
* Sets the specular weight (mapped to PBR metallicF0Factor).
|
|
774
779
|
* @param value The specular weight value
|
|
@@ -842,6 +847,16 @@ declare namespace BABYLON.GLTF2 {
|
|
|
842
847
|
* @returns The IOR value
|
|
843
848
|
*/
|
|
844
849
|
get specularIor(): number;
|
|
850
|
+
/**
|
|
851
|
+
* Sets/gets the glossiness (inverted roughness)
|
|
852
|
+
* ONLY used for specular/glossiness workflow; has no effect when metallic/roughness workflow is active
|
|
853
|
+
*/
|
|
854
|
+
get glossiness(): number;
|
|
855
|
+
/**
|
|
856
|
+
* Sets/gets the glossiness (inverted roughness)
|
|
857
|
+
* ONLY used for specular/glossiness workflow; has no effect when metallic/roughness workflow is active
|
|
858
|
+
*/
|
|
859
|
+
set glossiness(value: number);
|
|
845
860
|
/**
|
|
846
861
|
* Sets the emission color (mapped to PBR emissiveColor).
|
|
847
862
|
* @param value The emission color as a Color3
|
|
@@ -1075,6 +1090,9 @@ declare namespace BABYLON.GLTF2 {
|
|
|
1075
1090
|
* Sets up the material for proper thin-surface transmission behavior.
|
|
1076
1091
|
*/
|
|
1077
1092
|
configureTransmission(): void;
|
|
1093
|
+
/**
|
|
1094
|
+
* Configures volume properties for PBR material. Nothing to do for PBRMaterial.
|
|
1095
|
+
*/
|
|
1078
1096
|
configureVolume(): void;
|
|
1079
1097
|
/**
|
|
1080
1098
|
* Sets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
@@ -1340,6 +1358,7 @@ declare namespace BABYLON.GLTF2 {
|
|
|
1340
1358
|
*/
|
|
1341
1359
|
export class OpenPBRMaterialLoadingAdapter implements BABYLON.GLTF2.IMaterialLoadingAdapter {
|
|
1342
1360
|
private _material;
|
|
1361
|
+
private _specWorkflow;
|
|
1343
1362
|
/**
|
|
1344
1363
|
* Creates a new instance of the OpenPBRMaterialLoadingAdapter.
|
|
1345
1364
|
* @param material - The OpenPBR material to adapt.
|
|
@@ -1482,6 +1501,7 @@ declare namespace BABYLON.GLTF2 {
|
|
|
1482
1501
|
* @param _enableEdgeColor Whether to enable edge color support (ignored for OpenPBR)
|
|
1483
1502
|
*/
|
|
1484
1503
|
enableSpecularEdgeColor(_enableEdgeColor?: boolean): void;
|
|
1504
|
+
configureSpecularGlossiness(): void;
|
|
1485
1505
|
/**
|
|
1486
1506
|
* Sets the specular weight of the OpenPBR material.
|
|
1487
1507
|
* @param value The specular weight value (0-1)
|
|
@@ -1554,6 +1574,11 @@ declare namespace BABYLON.GLTF2 {
|
|
|
1554
1574
|
* @returns The IOR value
|
|
1555
1575
|
*/
|
|
1556
1576
|
get specularIor(): number;
|
|
1577
|
+
/**
|
|
1578
|
+
* Sets the glossiness (inverted roughness) of the OpenPBR material.
|
|
1579
|
+
*/
|
|
1580
|
+
set glossiness(value: number);
|
|
1581
|
+
get glossiness(): number;
|
|
1557
1582
|
/**
|
|
1558
1583
|
* Sets the emission color of the OpenPBR material.
|
|
1559
1584
|
* @param value The emission color as a Color3
|
|
@@ -1634,6 +1659,10 @@ declare namespace BABYLON.GLTF2 {
|
|
|
1634
1659
|
* @param value The coat color as a Color3
|
|
1635
1660
|
*/
|
|
1636
1661
|
set coatColor(value: Color3);
|
|
1662
|
+
/**
|
|
1663
|
+
* Gets the coat color of the OpenPBR material.
|
|
1664
|
+
*/
|
|
1665
|
+
get coatColor(): Color3;
|
|
1637
1666
|
/**
|
|
1638
1667
|
* Sets the coat color texture of the OpenPBR material.
|
|
1639
1668
|
* @param value The coat color texture or null
|
|
@@ -1663,11 +1692,13 @@ declare namespace BABYLON.GLTF2 {
|
|
|
1663
1692
|
* Sets the coat index of refraction (IOR) of the OpenPBR material.
|
|
1664
1693
|
*/
|
|
1665
1694
|
set coatIor(value: number);
|
|
1695
|
+
get coatIor(): number;
|
|
1666
1696
|
/**
|
|
1667
1697
|
* Sets the coat darkening value of the OpenPBR material.
|
|
1668
1698
|
* @param value The coat darkening value
|
|
1669
1699
|
*/
|
|
1670
1700
|
set coatDarkening(value: number);
|
|
1701
|
+
get coatDarkening(): number;
|
|
1671
1702
|
/**
|
|
1672
1703
|
* Sets the coat darkening texture (OpenPBR: coatDarkeningTexture, no PBR equivalent)
|
|
1673
1704
|
*/
|
|
@@ -1716,6 +1747,7 @@ declare namespace BABYLON.GLTF2 {
|
|
|
1716
1747
|
* @param value The transmission weight texture or null
|
|
1717
1748
|
*/
|
|
1718
1749
|
set transmissionWeightTexture(value: Nullable<BaseTexture>);
|
|
1750
|
+
get transmissionWeightTexture(): Nullable<BaseTexture>;
|
|
1719
1751
|
/**
|
|
1720
1752
|
* Gets the transmission weight.
|
|
1721
1753
|
* @returns Currently returns 0 as transmission is not yet available
|
|
@@ -1784,6 +1816,9 @@ declare namespace BABYLON.GLTF2 {
|
|
|
1784
1816
|
* @param value The refraction background texture or null
|
|
1785
1817
|
*/
|
|
1786
1818
|
set refractionBackgroundTexture(value: Nullable<BaseTexture>);
|
|
1819
|
+
/**
|
|
1820
|
+
* Configures volume properties for OpenPBR material.
|
|
1821
|
+
*/
|
|
1787
1822
|
configureVolume(): void;
|
|
1788
1823
|
/**
|
|
1789
1824
|
* Sets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
@@ -1816,6 +1851,7 @@ declare namespace BABYLON.GLTF2 {
|
|
|
1816
1851
|
* Sets the subsurface weight texture
|
|
1817
1852
|
*/
|
|
1818
1853
|
set subsurfaceWeightTexture(value: Nullable<BaseTexture>);
|
|
1854
|
+
get subsurfaceWeightTexture(): Nullable<BaseTexture>;
|
|
1819
1855
|
/**
|
|
1820
1856
|
* Sets the subsurface color.
|
|
1821
1857
|
* @param value The subsurface tint color as a Color3
|
|
@@ -2015,7 +2051,13 @@ declare namespace BABYLON.GLTF2 {
|
|
|
2015
2051
|
* @param value The scale value for the coat normal texture
|
|
2016
2052
|
*/
|
|
2017
2053
|
set geometryCoatNormalTextureScale(value: number);
|
|
2018
|
-
|
|
2054
|
+
/**
|
|
2055
|
+
* Finalizes material properties after all loading is complete.
|
|
2056
|
+
* @param signal An AbortSignal that fires when the loader is disposed. Intermediate
|
|
2057
|
+
* textures are disposed and the method returns early when aborted.
|
|
2058
|
+
*/
|
|
2059
|
+
finalizeAsync(signal: AbortSignal): Promise<void>;
|
|
2060
|
+
private copySurfaceToCoatAsync;
|
|
2019
2061
|
}
|
|
2020
2062
|
|
|
2021
2063
|
|
|
@@ -2035,10 +2077,20 @@ declare namespace BABYLON.GLTF2 {
|
|
|
2035
2077
|
* Gets the underlying material
|
|
2036
2078
|
*/
|
|
2037
2079
|
readonly material: Material;
|
|
2080
|
+
/** @deprecated Use finalizeAsync instead. */
|
|
2081
|
+
finalize?(): void;
|
|
2038
2082
|
/**
|
|
2039
|
-
* Finalizes material properties after loading is complete.
|
|
2083
|
+
* Finalizes material properties after all loading is complete.
|
|
2084
|
+
* May return a Promise for async work (e.g. GPU texture processing). Any returned
|
|
2085
|
+
* Promise is tracked by the loader and awaited before the COMPLETE state is reached,
|
|
2086
|
+
* so callers can rely on onCompleteObservable for fully processed materials.
|
|
2087
|
+
*
|
|
2088
|
+
* The loader passes an AbortSignal that is aborted when the loader is disposed.
|
|
2089
|
+
* Implementations should check `signal.aborted` after each await point and, if
|
|
2090
|
+
* aborted, release any intermediate resources and return early.
|
|
2091
|
+
* @param signal An AbortSignal that fires when the loader is disposed mid-flight.
|
|
2040
2092
|
*/
|
|
2041
|
-
|
|
2093
|
+
finalizeAsync?(signal: AbortSignal): Promise<void> | void;
|
|
2042
2094
|
/**
|
|
2043
2095
|
* Whether the material should be treated as unlit
|
|
2044
2096
|
*/
|
|
@@ -2100,6 +2152,10 @@ declare namespace BABYLON.GLTF2 {
|
|
|
2100
2152
|
* @param enableEdgeColor - Whether to enable edge color support
|
|
2101
2153
|
*/
|
|
2102
2154
|
enableSpecularEdgeColor(enableEdgeColor?: boolean): void;
|
|
2155
|
+
/**
|
|
2156
|
+
* Enable the specular/glossiness workflow and disable metallic/roughness.
|
|
2157
|
+
*/
|
|
2158
|
+
configureSpecularGlossiness(): void;
|
|
2103
2159
|
/**
|
|
2104
2160
|
* Sets/gets the specular weight
|
|
2105
2161
|
*/
|
|
@@ -2128,6 +2184,11 @@ declare namespace BABYLON.GLTF2 {
|
|
|
2128
2184
|
* Sets/gets the specular IOR
|
|
2129
2185
|
*/
|
|
2130
2186
|
specularIor: number;
|
|
2187
|
+
/**
|
|
2188
|
+
* Sets/gets the glossiness (inverted roughness)
|
|
2189
|
+
* ONLY used for specular/glossiness workflow; has no effect when metallic/roughness workflow is active
|
|
2190
|
+
*/
|
|
2191
|
+
glossiness: number;
|
|
2131
2192
|
/**
|
|
2132
2193
|
* Sets/gets the emissive color
|
|
2133
2194
|
*/
|
|
@@ -2244,6 +2305,9 @@ declare namespace BABYLON.GLTF2 {
|
|
|
2244
2305
|
* Configures transmission for thin-surface transmission (KHR_materials_transmission)
|
|
2245
2306
|
*/
|
|
2246
2307
|
configureTransmission(): void;
|
|
2308
|
+
/**
|
|
2309
|
+
* Configures volume properties for volumetric transmission (KHR_materials_volume)
|
|
2310
|
+
*/
|
|
2247
2311
|
configureVolume(): void;
|
|
2248
2312
|
/**
|
|
2249
2313
|
* Sets whether the material is thin-walled (i.e. non-volumetric) or not.
|
|
@@ -2961,6 +3025,8 @@ declare namespace BABYLON.GLTF2 {
|
|
|
2961
3025
|
export class GLTFLoader implements IGLTFLoader {
|
|
2962
3026
|
/** @internal */
|
|
2963
3027
|
readonly _completePromises: Promise<unknown>[];
|
|
3028
|
+
/** AbortController used to cancel in-flight finalizeAsync() calls when dispose() is called. */
|
|
3029
|
+
private _finalizeController;
|
|
2964
3030
|
/** @internal */
|
|
2965
3031
|
_assetContainer: Nullable<AssetContainer>;
|
|
2966
3032
|
/** Storage */
|