babylonjs-loaders 8.47.0 → 8.47.1

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.
@@ -29,6 +29,11 @@ declare module BABYLON {
29
29
  */
30
30
  static Configuration: IGLTFValidationConfiguration;
31
31
  private static _LoadScriptPromise;
32
+ /**
33
+ * The most recent validation results.
34
+ * @internal - Used for back-compat in Sandbox with Inspector V2.
35
+ */
36
+ static _LastResults: Nullable<GLTF2.IGLTFValidationResults>;
32
37
  /**
33
38
  * Validate a glTF asset using the glTF-Validator.
34
39
  * @param data The JSON of a glTF or the array buffer of a binary glTF
@@ -602,6 +607,7 @@ declare module BABYLON.GLTF2 {
602
607
  */
603
608
  export class PBRMaterialLoadingAdapter implements BABYLON.GLTF2.IMaterialLoadingAdapter {
604
609
  private _material;
610
+ private _extinctionCoefficient;
605
611
  /**
606
612
  * Creates a new instance of the PBRMaterialLoadingAdapter.
607
613
  * @param material - The PBR material to adapt.
@@ -989,20 +995,60 @@ declare module BABYLON.GLTF2 {
989
995
  */
990
996
  set transmissionWeightTexture(value: Nullable<BaseTexture>);
991
997
  /**
992
- * Sets the attenuation distance for volume scattering.
998
+ * Sets the attenuation distance for volume.
993
999
  * @param value The attenuation distance value
994
1000
  */
995
1001
  set transmissionDepth(value: number);
1002
+ /**
1003
+ * Gets the attenuation distance for volume.
1004
+ * @returns The attenuation distance value
1005
+ */
1006
+ get transmissionDepth(): number;
996
1007
  /**
997
1008
  * Sets the attenuation color (mapped to PBR subSurface.tintColor).
998
1009
  * @param value The attenuation color as a Color3
999
1010
  */
1000
1011
  set transmissionColor(value: Color3);
1001
1012
  /**
1002
- * Gets the transmission dispersion Abbe number.
1013
+ * Sets the attenuation color (mapped to PBR subSurface.tintColor).
1014
+ * @returns The attenuation color as a Color3
1015
+ */
1016
+ get transmissionColor(): Color3;
1017
+ /**
1018
+ * Sets the transmission scatter coefficient.
1019
+ * @param value The scatter coefficient as a Color3
1020
+ */
1021
+ set transmissionScatter(value: Color3);
1022
+ /**
1023
+ * Sets the transmission scatter coefficient.
1024
+ * @returns The scatter coefficient as a Color3
1025
+ */
1026
+ get transmissionScatter(): Color3;
1027
+ /**
1028
+ * Sets the transmission scattering anisotropy.
1029
+ * @param value The anisotropy intensity value (-1 to 1)
1030
+ */
1031
+ set transmissionScatterAnisotropy(value: number);
1032
+ /**
1033
+ * Sets the transmission dispersion Abbe number.
1003
1034
  * @param value The Abbe number value
1004
1035
  */
1005
1036
  set transmissionDispersionAbbeNumber(value: number);
1037
+ /**
1038
+ * Sets the transmission dispersion scale.
1039
+ * @param value The dispersion scale value
1040
+ */
1041
+ set transmissionDispersionScale(value: number);
1042
+ /**
1043
+ * Gets the refraction background texture
1044
+ * @returns The refraction background texture or null
1045
+ */
1046
+ get refractionBackgroundTexture(): Nullable<BaseTexture>;
1047
+ /**
1048
+ * Sets the refraction background texture
1049
+ * @param value The refraction background texture or null
1050
+ */
1051
+ set refractionBackgroundTexture(value: Nullable<BaseTexture>);
1006
1052
  /**
1007
1053
  * Configures transmission for thin-surface transmission (KHR_materials_transmission).
1008
1054
  * Sets up the material for proper thin-surface transmission behavior.
@@ -1024,6 +1070,15 @@ declare module BABYLON.GLTF2 {
1024
1070
  * Configures subsurface properties for PBR material
1025
1071
  */
1026
1072
  configureSubsurface(): void;
1073
+ /**
1074
+ * Sets the extinction coefficient of the volume.
1075
+ * @param value The extinction coefficient as a Vector3
1076
+ */
1077
+ set extinctionCoefficient(value: Vector3);
1078
+ /**
1079
+ * Gets the extinction coefficient of the volume.
1080
+ */
1081
+ get extinctionCoefficient(): Vector3;
1027
1082
  /**
1028
1083
  * Sets the subsurface weight
1029
1084
  */
@@ -1047,6 +1102,50 @@ declare module BABYLON.GLTF2 {
1047
1102
  * @param value The subsurface tint texture or null
1048
1103
  */
1049
1104
  set subsurfaceColorTexture(value: Nullable<BaseTexture>);
1105
+ /**
1106
+ * Sets the surface tint of the material (when using subsurface scattering)
1107
+ */
1108
+ set subsurfaceConstantTint(value: Color3);
1109
+ /**
1110
+ * Gets the subsurface constant tint (when using subsurface scattering)
1111
+ * @returns The subsurface constant tint as a Color3
1112
+ */
1113
+ get subsurfaceConstantTint(): Color3;
1114
+ /**
1115
+ * Sets the subsurface constant tint texture (when using subsurface scattering)
1116
+ * @param value The subsurface constant tint texture or null
1117
+ */
1118
+ set subsurfaceConstantTintTexture(value: Nullable<BaseTexture>);
1119
+ /**
1120
+ * Gets the subsurface radius (used for subsurface scattering)
1121
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
1122
+ * @returns The subsurface radius as a Color3
1123
+ */
1124
+ get subsurfaceRadius(): number;
1125
+ /**
1126
+ * Sets the subsurface radius (used for subsurface scattering)
1127
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
1128
+ * @param value The subsurface radius as a number
1129
+ */
1130
+ set subsurfaceRadius(value: number);
1131
+ /**
1132
+ * Gets the subsurface radius scale (used for subsurface scattering)
1133
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
1134
+ * @returns The subsurface radius scale as a Color3
1135
+ */
1136
+ get subsurfaceRadiusScale(): Color3;
1137
+ /**
1138
+ * Sets the subsurface radius scale (used for subsurface scattering)
1139
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
1140
+ * @param value The subsurface radius scale as a Color3
1141
+ */
1142
+ set subsurfaceRadiusScale(value: Color3);
1143
+ /**
1144
+ * Sets the subsurface scattering anisotropy.
1145
+ * Note: PBRMaterial does not have a direct equivalent, so this is a no-op.
1146
+ * @param value The anisotropy intensity value (ignored for PBR)
1147
+ */
1148
+ set subsurfaceScatterAnisotropy(value: number);
1050
1149
  /**
1051
1150
  * Configures sheen for PBR material.
1052
1151
  * Enables sheen and sets up proper configuration.
@@ -1152,12 +1251,6 @@ declare module BABYLON.GLTF2 {
1152
1251
  * @param value The iridescence thickness texture or null
1153
1252
  */
1154
1253
  set thinFilmThicknessTexture(value: Nullable<BaseTexture>);
1155
- /**
1156
- * Sets the transmission dispersion value.
1157
- * Note: PBR doesn't have direct dispersion support, so this stores it as metadata.
1158
- * @param value The dispersion value (stored as metadata)
1159
- */
1160
- set transmissionDispersion(value: number);
1161
1254
  /**
1162
1255
  * Sets whether the material is unlit.
1163
1256
  * @param value True to make the material unlit
@@ -1221,6 +1314,7 @@ declare module BABYLON.GLTF2 {
1221
1314
  */
1222
1315
  export class OpenPBRMaterialLoadingAdapter implements BABYLON.GLTF2.IMaterialLoadingAdapter {
1223
1316
  private _material;
1317
+ private _extinctionCoefficient;
1224
1318
  /**
1225
1319
  * Creates a new instance of the OpenPBRMaterialLoadingAdapter.
1226
1320
  * @param material - The OpenPBR material to adapt.
@@ -1583,55 +1677,87 @@ declare module BABYLON.GLTF2 {
1583
1677
  * @returns Currently returns null as coat anisotropy is not yet available
1584
1678
  */
1585
1679
  get geometryCoatTangentTexture(): Nullable<BaseTexture>;
1680
+ /**
1681
+ * Configures transmission for OpenPBR material.
1682
+ */
1683
+ configureTransmission(): void;
1586
1684
  /**
1587
1685
  * Sets the transmission weight.
1588
- * TODO: Implementation pending OpenPBR transmission feature availability.
1589
1686
  * @param value The transmission weight value (0-1)
1590
1687
  */
1591
1688
  set transmissionWeight(value: number);
1592
1689
  /**
1593
1690
  * Sets the transmission weight texture.
1594
- * TODO: Implementation pending OpenPBR transmission feature availability.
1595
1691
  * @param value The transmission weight texture or null
1596
1692
  */
1597
1693
  set transmissionWeightTexture(value: Nullable<BaseTexture>);
1598
1694
  /**
1599
1695
  * Gets the transmission weight.
1600
- * TODO: Implementation pending OpenPBR transmission feature availability.
1601
1696
  * @returns Currently returns 0 as transmission is not yet available
1602
1697
  */
1603
1698
  get transmissionWeight(): number;
1604
1699
  /**
1605
- * Gets the transmission dispersion Abbe number.
1700
+ * Sets the transmission scatter coefficient.
1701
+ * @param value The scatter coefficient as a Vector3
1702
+ */
1703
+ set transmissionScatter(value: Color3);
1704
+ /**
1705
+ * Gets the transmission scatter coefficient.
1706
+ * @returns The scatter coefficient as a Vector3
1707
+ */
1708
+ get transmissionScatter(): Color3;
1709
+ set transmissionScatterTexture(value: Nullable<BaseTexture>);
1710
+ get transmissionScatterTexture(): Nullable<BaseTexture>;
1711
+ /**
1712
+ * Sets the transmission scattering anisotropy.
1713
+ * @param value The anisotropy intensity value (-1 to 1)
1714
+ */
1715
+ set transmissionScatterAnisotropy(value: number);
1716
+ /**
1717
+ * Sets the transmission dispersion Abbe number.
1606
1718
  * @param value The Abbe number value
1607
1719
  */
1608
1720
  set transmissionDispersionAbbeNumber(value: number);
1609
1721
  /**
1610
- * Configures transmission for OpenPBR material.
1611
- * TODO: Implementation pending OpenPBR transmission feature availability.
1722
+ * Sets the transmission dispersion scale.
1723
+ * @param value The dispersion scale value
1612
1724
  */
1613
- configureTransmission(): void;
1725
+ set transmissionDispersionScale(value: number);
1614
1726
  /**
1615
- * Sets the attenuation distance for volume scattering.
1616
- * TODO: Implementation pending OpenPBR volume feature availability.
1727
+ * Sets the attenuation distance.
1617
1728
  * @param value The attenuation distance value
1618
1729
  */
1619
1730
  set transmissionDepth(value: number);
1620
1731
  /**
1621
- * Sets the attenuation color for volume scattering.
1622
- * TODO: Implementation pending OpenPBR volume feature availability.
1732
+ * Gets the attenuation distance.
1733
+ */
1734
+ get transmissionDepth(): number;
1735
+ /**
1736
+ * Sets the attenuation color.
1623
1737
  * @param value The attenuation color as a Color3
1624
1738
  */
1625
1739
  set transmissionColor(value: Color3);
1626
1740
  /**
1627
- * Sets the thickness texture for volume scattering.
1628
- * TODO: Implementation pending OpenPBR volume feature availability.
1741
+ * Gets the attenuation color.
1742
+ */
1743
+ get transmissionColor(): Color3;
1744
+ /**
1745
+ * Gets the refraction background texture
1746
+ * @returns The refraction background texture or null
1747
+ */
1748
+ get refractionBackgroundTexture(): Nullable<BaseTexture>;
1749
+ /**
1750
+ * Sets the refraction background texture
1751
+ * @param value The refraction background texture or null
1752
+ */
1753
+ set refractionBackgroundTexture(value: Nullable<BaseTexture>);
1754
+ /**
1755
+ * Sets the thickness texture.
1629
1756
  * @param value The thickness texture or null
1630
1757
  */
1631
1758
  set volumeThicknessTexture(value: Nullable<BaseTexture>);
1632
1759
  /**
1633
- * Sets the thickness factor for volume scattering.
1634
- * TODO: Implementation pending OpenPBR volume feature availability.
1760
+ * Sets the thickness factor.
1635
1761
  * @param value The thickness value
1636
1762
  */
1637
1763
  set volumeThickness(value: number);
@@ -1639,6 +1765,15 @@ declare module BABYLON.GLTF2 {
1639
1765
  * Configures subsurface properties for PBR material
1640
1766
  */
1641
1767
  configureSubsurface(): void;
1768
+ /**
1769
+ * Sets the extinction coefficient of the volume.
1770
+ * @param value The extinction coefficient as a Vector3
1771
+ */
1772
+ set extinctionCoefficient(value: Vector3);
1773
+ /**
1774
+ * Gets the extinction coefficient of the volume.
1775
+ */
1776
+ get extinctionCoefficient(): Vector3;
1642
1777
  /**
1643
1778
  * Sets the subsurface weight
1644
1779
  */
@@ -1658,6 +1793,45 @@ declare module BABYLON.GLTF2 {
1658
1793
  * @param value The subsurface tint texture or null
1659
1794
  */
1660
1795
  set subsurfaceColorTexture(value: Nullable<BaseTexture>);
1796
+ /**
1797
+ * Sets the surface tint of the material (when using subsurface scattering)
1798
+ */
1799
+ set subsurfaceConstantTint(value: Color3);
1800
+ /**
1801
+ * Gets the surface tint of the material (when using subsurface scattering)
1802
+ */
1803
+ get subsurfaceConstantTint(): Color3;
1804
+ /**
1805
+ * Sets the surface tint texture of the material (when using subsurface scattering)
1806
+ */
1807
+ set subsurfaceConstantTintTexture(value: Nullable<BaseTexture>);
1808
+ /**
1809
+ * Gets the subsurface radius for subsurface scattering.
1810
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
1811
+ */
1812
+ get subsurfaceRadius(): number;
1813
+ /**
1814
+ * Sets the subsurface radius for subsurface scattering.
1815
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
1816
+ * @param value The subsurface radius value
1817
+ */
1818
+ set subsurfaceRadius(value: number);
1819
+ /**
1820
+ * Gets the subsurface radius scale for subsurface scattering.
1821
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
1822
+ */
1823
+ get subsurfaceRadiusScale(): Color3;
1824
+ /**
1825
+ * Sets the subsurface radius scale for subsurface scattering.
1826
+ * subsurfaceRadiusScale * subsurfaceRadius gives the mean free path per color channel.
1827
+ * @param value The subsurface radius scale as a Color3
1828
+ */
1829
+ set subsurfaceRadiusScale(value: Color3);
1830
+ /**
1831
+ * Sets the subsurface scattering anisotropy.
1832
+ * @param value The anisotropy intensity value
1833
+ */
1834
+ set subsurfaceScatterAnisotropy(value: number);
1661
1835
  /**
1662
1836
  * Configures fuzz for OpenPBR.
1663
1837
  * Enables fuzz and sets up proper configuration.
@@ -1997,10 +2171,26 @@ declare module BABYLON.GLTF2 {
1997
2171
  * Sets the attenuation color
1998
2172
  */
1999
2173
  transmissionColor: Color3;
2174
+ /**
2175
+ * Sets the scattering coefficient
2176
+ */
2177
+ transmissionScatter: Color3;
2178
+ /**
2179
+ * Sets the scattering anisotropy (-1 to 1)
2180
+ */
2181
+ transmissionScatterAnisotropy: number;
2000
2182
  /**
2001
2183
  * Sets the dispersion Abbe number
2002
2184
  */
2003
2185
  transmissionDispersionAbbeNumber: number;
2186
+ /**
2187
+ * Sets the dispersion scale
2188
+ */
2189
+ transmissionDispersionScale: number;
2190
+ /**
2191
+ * The refraction background texture
2192
+ */
2193
+ refractionBackgroundTexture: Nullable<BaseTexture>;
2004
2194
  /**
2005
2195
  * Configures transmission for thin-surface transmission (KHR_materials_transmission)
2006
2196
  */
@@ -2014,9 +2204,14 @@ declare module BABYLON.GLTF2 {
2014
2204
  */
2015
2205
  volumeThickness: number;
2016
2206
  /**
2017
- * Configures subsurface properties for PBR material
2207
+ * Configures subsurface properties
2018
2208
  */
2019
2209
  configureSubsurface(): void;
2210
+ /**
2211
+ * @internal
2212
+ * Sets/gets the extinction coefficient
2213
+ */
2214
+ extinctionCoefficient: Vector3;
2020
2215
  /**
2021
2216
  * Sets/gets the subsurface weight
2022
2217
  */
@@ -2033,6 +2228,26 @@ declare module BABYLON.GLTF2 {
2033
2228
  * Sets/gets the subsurface color texture
2034
2229
  */
2035
2230
  subsurfaceColorTexture: Nullable<BaseTexture>;
2231
+ /**
2232
+ * Sets/gets the surface tint of the material (when using subsurface scattering)
2233
+ */
2234
+ subsurfaceConstantTint: Color3;
2235
+ /**
2236
+ * Sets/gets the surface tint texture of the material (when using subsurface scattering)
2237
+ */
2238
+ subsurfaceConstantTintTexture: Nullable<BaseTexture>;
2239
+ /**
2240
+ * Sets/gets the subsurface radius (used for subsurface scattering)
2241
+ */
2242
+ subsurfaceRadius: number;
2243
+ /**
2244
+ * Sets/gets the subsurface radius scale (used for subsurface scattering)
2245
+ */
2246
+ subsurfaceRadiusScale: Color3;
2247
+ /**
2248
+ * Sets/gets the subsurface scattering anisotropy
2249
+ */
2250
+ subsurfaceScatterAnisotropy: number;
2036
2251
  /**
2037
2252
  * Configures initial settings for fuzz for material.
2038
2253
  */
@@ -3904,6 +4119,52 @@ declare module BABYLON {
3904
4119
  ["KHR_mesh_quantization"]: {};
3905
4120
  }
3906
4121
 
4122
+ }
4123
+ declare module BABYLON.GLTF2.Loader.Extensions {
4124
+ /**
4125
+ * TODO: In-progress specification
4126
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/7ea427ed55d44427e83c0a6d1c87068b1a4151c5/extensions/2.0/Khronos/KHR_materials_volume_scatter/README.md)
4127
+ * @experimental
4128
+ * @since 9.0.0
4129
+ */
4130
+ export class KHR_materials_volume_scatter implements BABYLON.GLTF2.IGLTFLoaderExtension {
4131
+ /**
4132
+ * The name of this extension.
4133
+ */
4134
+ readonly name = "KHR_materials_volume_scatter";
4135
+ /**
4136
+ * Defines whether this extension is enabled.
4137
+ */
4138
+ enabled: boolean;
4139
+ /**
4140
+ * Defines a number that determines the order the extensions are applied.
4141
+ */
4142
+ order: number;
4143
+ private _loader;
4144
+ /**
4145
+ * @internal
4146
+ */
4147
+ constructor(loader: BABYLON.GLTF2.GLTFLoader);
4148
+ /** @internal */
4149
+ dispose(): void;
4150
+ /**
4151
+ * @internal
4152
+ */
4153
+ loadMaterialPropertiesAsync(context: string, material: BABYLON.GLTF2.Loader.IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
4154
+ private _loadVolumePropertiesAsync;
4155
+ }
4156
+
4157
+
4158
+
4159
+ }
4160
+ declare module BABYLON {
4161
+ interface GLTFLoaderExtensionOptions {
4162
+ /**
4163
+ * Defines options for the KHR_materials_volume_scatter extension.
4164
+ */
4165
+ ["KHR_materials_volume_scatter"]: {};
4166
+ }
4167
+
3907
4168
  }
3908
4169
  declare module BABYLON.GLTF2.Loader.Extensions {
3909
4170
  /**
@@ -4367,7 +4628,8 @@ declare module BABYLON {
4367
4628
  }
4368
4629
  declare module BABYLON.GLTF2.Loader.Extensions {
4369
4630
  /**
4370
- * [Specification]
4631
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/9734e44accd0dfb986ec5f376117aa00192745fe/extensions/2.0/Khronos/KHR_materials_fuzz/README.md)
4632
+ * @experimental
4371
4633
  */
4372
4634
  export class KHR_materials_fuzz implements BABYLON.GLTF2.IGLTFLoaderExtension {
4373
4635
  /**
@@ -4541,7 +4803,7 @@ declare module BABYLON {
4541
4803
  }
4542
4804
  declare module BABYLON.GLTF2.Loader.Extensions {
4543
4805
  /**
4544
- * [Specification](https://github.com/KhronosGroup/glTF/blob/fdee35425ae560ea378092e38977216d63a094ec/extensions/2.0/Khronos/KHR_materials_diffuse_roughness/README.md)
4806
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/b102d2d2b40d44a8776800bb2bf85e218853c17d/extensions/2.0/Khronos/KHR_materials_diffuse_roughness/README.md)
4545
4807
  * @experimental
4546
4808
  */
4547
4809
  export class KHR_materials_diffuse_roughness implements BABYLON.GLTF2.IGLTFLoaderExtension {
@@ -4585,8 +4847,8 @@ declare module BABYLON {
4585
4847
  }
4586
4848
  declare module BABYLON.GLTF2.Loader.Extensions {
4587
4849
  /**
4588
- * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_coat/README.md)
4589
- * [Playground Sample](https://www.babylonjs-playground.com/frame.html#7F7PN6#8)
4850
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/6cb2cb84b504c245c49cf2e9a8ae16d26f72ac97/extensions/2.0/Khronos/KHR_materials_coat/README.md)
4851
+ * @experimental
4590
4852
  */
4591
4853
  export class KHR_materials_coat implements BABYLON.GLTF2.IGLTFLoaderExtension {
4592
4854
  /**