babylonjs-serializers 5.0.4 → 5.3.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.
@@ -61,6 +61,27 @@ declare module BABYLON {
61
61
  }
62
62
 
63
63
 
64
+ /**
65
+ * @hidden
66
+ */
67
+ export class KHR_materials_iridescence implements IGLTFExporterExtensionV2 {
68
+ /** Name of this extension */
69
+ readonly name = "KHR_materials_iridescence";
70
+ /** Defines whether this extension is enabled */
71
+ enabled: boolean;
72
+ /** Defines whether this extension is required */
73
+ required: boolean;
74
+ private _exporter;
75
+ private _wasUsed;
76
+ constructor(exporter: _Exporter);
77
+ dispose(): void;
78
+ /** @hidden */
79
+ get wasUsed(): boolean;
80
+ postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
81
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
82
+ }
83
+
84
+
64
85
  /**
65
86
  * @hidden
66
87
  */
@@ -82,6 +103,29 @@ declare module BABYLON {
82
103
  }
83
104
 
84
105
 
106
+ /**
107
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_specular/README.md)
108
+ */
109
+ export class KHR_materials_specular implements IGLTFExporterExtensionV2 {
110
+ /** Name of this extension */
111
+ readonly name = "KHR_materials_specular";
112
+ /** Defines whether this extension is enabled */
113
+ enabled: boolean;
114
+ /** Defines whether this extension is required */
115
+ required: boolean;
116
+ private _exporter;
117
+ private _wasUsed;
118
+ constructor(exporter: _Exporter);
119
+ dispose(): void;
120
+ /** @hidden */
121
+ get wasUsed(): boolean;
122
+ postExportMaterialAdditionalTextures?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): BaseTexture[];
123
+ private _isExtensionEnabled;
124
+ private _hasTexturesExtension;
125
+ postExportMaterialAsync?(context: string, node: BABYLON.GLTF2.IMaterial, babylonMaterial: Material): Promise<BABYLON.GLTF2.IMaterial>;
126
+ }
127
+
128
+
85
129
  /**
86
130
  * @hidden
87
131
  */
@@ -939,13 +983,6 @@ declare module BABYLON {
939
983
  */
940
984
  _convertStandardMaterialAsync(babylonStandardMaterial: StandardMaterial, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<BABYLON.GLTF2.IMaterial>;
941
985
  private _finishMaterial;
942
- /**
943
- * Converts a Babylon PBR Metallic Roughness Material to a glTF Material
944
- * @param babylonPBRMetalRoughMaterial BJS PBR Metallic Roughness Material
945
- * @param mimeType mime type to use for the textures
946
- * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
947
- */
948
- _convertPBRMetallicRoughnessMaterialAsync(babylonPBRMetalRoughMaterial: PBRMetallicRoughnessMaterial, mimeType: BABYLON.GLTF2.ImageMimeType, hasTextureCoords: boolean): Promise<BABYLON.GLTF2.IMaterial>;
949
986
  /**
950
987
  * Converts an image typed array buffer to a base64 image
951
988
  * @param buffer typed array buffer
@@ -806,6 +806,97 @@ var KHR_materials_clearcoat = /** @class */ (function () {
806
806
  _glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new KHR_materials_clearcoat(exporter); });
807
807
 
808
808
 
809
+ /***/ }),
810
+
811
+ /***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_iridescence.js":
812
+ /*!**************************************************************************************!*\
813
+ !*** ../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_iridescence.js ***!
814
+ \**************************************************************************************/
815
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
816
+
817
+ __webpack_require__.r(__webpack_exports__);
818
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
819
+ /* harmony export */ "KHR_materials_iridescence": () => (/* binding */ KHR_materials_iridescence)
820
+ /* harmony export */ });
821
+ /* harmony import */ var _glTFExporter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../glTFExporter */ "../../../lts/serializers/dist/glTF/2.0/glTFExporter.js");
822
+ /* harmony import */ var core_Materials_PBR_pbrBaseMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Materials/PBR/pbrBaseMaterial */ "core/Maths/math.vector");
823
+ /* harmony import */ var core_Materials_PBR_pbrBaseMaterial__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Materials_PBR_pbrBaseMaterial__WEBPACK_IMPORTED_MODULE_1__);
824
+
825
+
826
+ var NAME = "KHR_materials_iridescence";
827
+ /**
828
+ * @hidden
829
+ */
830
+ // eslint-disable-next-line @typescript-eslint/naming-convention
831
+ var KHR_materials_iridescence = /** @class */ (function () {
832
+ function KHR_materials_iridescence(exporter) {
833
+ /** Name of this extension */
834
+ this.name = NAME;
835
+ /** Defines whether this extension is enabled */
836
+ this.enabled = true;
837
+ /** Defines whether this extension is required */
838
+ this.required = false;
839
+ this._wasUsed = false;
840
+ this._exporter = exporter;
841
+ }
842
+ KHR_materials_iridescence.prototype.dispose = function () { };
843
+ Object.defineProperty(KHR_materials_iridescence.prototype, "wasUsed", {
844
+ /** @hidden */
845
+ get: function () {
846
+ return this._wasUsed;
847
+ },
848
+ enumerable: false,
849
+ configurable: true
850
+ });
851
+ KHR_materials_iridescence.prototype.postExportMaterialAdditionalTextures = function (context, node, babylonMaterial) {
852
+ var additionalTextures = [];
853
+ if (babylonMaterial instanceof core_Materials_PBR_pbrBaseMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRBaseMaterial) {
854
+ if (babylonMaterial.iridescence.isEnabled) {
855
+ if (babylonMaterial.iridescence.texture) {
856
+ additionalTextures.push(babylonMaterial.iridescence.texture);
857
+ }
858
+ if (babylonMaterial.iridescence.thicknessTexture && babylonMaterial.iridescence.thicknessTexture !== babylonMaterial.iridescence.texture) {
859
+ additionalTextures.push(babylonMaterial.iridescence.thicknessTexture);
860
+ }
861
+ return additionalTextures;
862
+ }
863
+ }
864
+ return [];
865
+ };
866
+ KHR_materials_iridescence.prototype.postExportMaterialAsync = function (context, node, babylonMaterial) {
867
+ var _this = this;
868
+ return new Promise(function (resolve) {
869
+ if (babylonMaterial instanceof core_Materials_PBR_pbrBaseMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRBaseMaterial) {
870
+ if (!babylonMaterial.iridescence.isEnabled) {
871
+ resolve(node);
872
+ return;
873
+ }
874
+ _this._wasUsed = true;
875
+ node.extensions = node.extensions || {};
876
+ var iridescenceTextureInfo = _this._exporter._glTFMaterialExporter._getTextureInfo(babylonMaterial.iridescence.texture);
877
+ var iridescenceThicknessTextureInfo = _this._exporter._glTFMaterialExporter._getTextureInfo(babylonMaterial.iridescence.thicknessTexture);
878
+ var iridescenceInfo_1 = {
879
+ iridescenceFactor: babylonMaterial.iridescence.intensity,
880
+ iridescenceIor: babylonMaterial.iridescence.indexOfRefraction,
881
+ iridescenceThicknessMinimum: babylonMaterial.iridescence.minimumThickness,
882
+ iridescenceThicknessMaximum: babylonMaterial.iridescence.maximumThickness,
883
+ iridescenceTexture: iridescenceTextureInfo !== null && iridescenceTextureInfo !== void 0 ? iridescenceTextureInfo : undefined,
884
+ iridescenceThicknessTexture: iridescenceThicknessTextureInfo !== null && iridescenceThicknessTextureInfo !== void 0 ? iridescenceThicknessTextureInfo : undefined,
885
+ hasTextures: function () {
886
+ return iridescenceInfo_1.iridescenceTexture !== null || iridescenceInfo_1.iridescenceThicknessTexture !== null;
887
+ },
888
+ };
889
+ node.extensions[NAME] = iridescenceInfo_1;
890
+ }
891
+ resolve(node);
892
+ });
893
+ };
894
+ return KHR_materials_iridescence;
895
+ }());
896
+
897
+ _glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new KHR_materials_iridescence(exporter); });
898
+
899
+
809
900
  /***/ }),
810
901
 
811
902
  /***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_sheen.js":
@@ -896,6 +987,104 @@ var KHR_materials_sheen = /** @class */ (function () {
896
987
  _glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new KHR_materials_sheen(exporter); });
897
988
 
898
989
 
990
+ /***/ }),
991
+
992
+ /***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_specular.js":
993
+ /*!***********************************************************************************!*\
994
+ !*** ../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_specular.js ***!
995
+ \***********************************************************************************/
996
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
997
+
998
+ __webpack_require__.r(__webpack_exports__);
999
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1000
+ /* harmony export */ "KHR_materials_specular": () => (/* binding */ KHR_materials_specular)
1001
+ /* harmony export */ });
1002
+ /* harmony import */ var _glTFExporter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../glTFExporter */ "../../../lts/serializers/dist/glTF/2.0/glTFExporter.js");
1003
+ /* harmony import */ var core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Materials/PBR/pbrMaterial */ "core/Maths/math.vector");
1004
+ /* harmony import */ var core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__);
1005
+
1006
+
1007
+ var NAME = "KHR_materials_specular";
1008
+ /**
1009
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_specular/README.md)
1010
+ */
1011
+ // eslint-disable-next-line @typescript-eslint/naming-convention
1012
+ var KHR_materials_specular = /** @class */ (function () {
1013
+ function KHR_materials_specular(exporter) {
1014
+ /** Name of this extension */
1015
+ this.name = NAME;
1016
+ /** Defines whether this extension is enabled */
1017
+ this.enabled = true;
1018
+ /** Defines whether this extension is required */
1019
+ this.required = false;
1020
+ this._wasUsed = false;
1021
+ this._exporter = exporter;
1022
+ }
1023
+ KHR_materials_specular.prototype.dispose = function () { };
1024
+ Object.defineProperty(KHR_materials_specular.prototype, "wasUsed", {
1025
+ /** @hidden */
1026
+ get: function () {
1027
+ return this._wasUsed;
1028
+ },
1029
+ enumerable: false,
1030
+ configurable: true
1031
+ });
1032
+ KHR_materials_specular.prototype.postExportMaterialAdditionalTextures = function (context, node, babylonMaterial) {
1033
+ var additionalTextures = [];
1034
+ if (babylonMaterial instanceof core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRMaterial) {
1035
+ if (this._isExtensionEnabled(babylonMaterial)) {
1036
+ if (babylonMaterial.metallicReflectanceTexture) {
1037
+ additionalTextures.push(babylonMaterial.metallicReflectanceTexture);
1038
+ }
1039
+ if (babylonMaterial.reflectanceTexture) {
1040
+ additionalTextures.push(babylonMaterial.reflectanceTexture);
1041
+ }
1042
+ return additionalTextures;
1043
+ }
1044
+ }
1045
+ return additionalTextures;
1046
+ };
1047
+ KHR_materials_specular.prototype._isExtensionEnabled = function (mat) {
1048
+ return ((mat.metallicF0Factor != undefined && mat.metallicF0Factor != 1.0) ||
1049
+ (mat.metallicReflectanceColor != undefined && !mat.metallicReflectanceColor.equalsFloats(1.0, 1.0, 1.0)) ||
1050
+ this._hasTexturesExtension(mat));
1051
+ };
1052
+ KHR_materials_specular.prototype._hasTexturesExtension = function (mat) {
1053
+ return mat.metallicReflectanceTexture != null || mat.reflectanceTexture != null;
1054
+ };
1055
+ KHR_materials_specular.prototype.postExportMaterialAsync = function (context, node, babylonMaterial) {
1056
+ var _this = this;
1057
+ return new Promise(function (resolve) {
1058
+ var _a, _b;
1059
+ if (babylonMaterial instanceof core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRMaterial && _this._isExtensionEnabled(babylonMaterial)) {
1060
+ _this._wasUsed = true;
1061
+ node.extensions = node.extensions || {};
1062
+ var metallicReflectanceTexture = (_a = _this._exporter._glTFMaterialExporter._getTextureInfo(babylonMaterial.metallicReflectanceTexture)) !== null && _a !== void 0 ? _a : undefined;
1063
+ var reflectanceTexture = (_b = _this._exporter._glTFMaterialExporter._getTextureInfo(babylonMaterial.reflectanceTexture)) !== null && _b !== void 0 ? _b : undefined;
1064
+ var metallicF0Factor = babylonMaterial.metallicF0Factor == 1.0 ? undefined : babylonMaterial.metallicF0Factor;
1065
+ var metallicReflectanceColor = babylonMaterial.metallicReflectanceColor.equalsFloats(1.0, 1.0, 1.0)
1066
+ ? undefined
1067
+ : babylonMaterial.metallicReflectanceColor.asArray();
1068
+ var specularInfo = {
1069
+ specularFactor: metallicF0Factor,
1070
+ specularTexture: metallicReflectanceTexture,
1071
+ specularColorFactor: metallicReflectanceColor,
1072
+ specularColorTexture: reflectanceTexture,
1073
+ hasTextures: function () {
1074
+ return _this._hasTexturesExtension(babylonMaterial);
1075
+ },
1076
+ };
1077
+ node.extensions[NAME] = specularInfo;
1078
+ }
1079
+ resolve(node);
1080
+ });
1081
+ };
1082
+ return KHR_materials_specular;
1083
+ }());
1084
+
1085
+ _glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new KHR_materials_specular(exporter); });
1086
+
1087
+
899
1088
  /***/ }),
900
1089
 
901
1090
  /***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_unlit.js":
@@ -1131,15 +1320,21 @@ __webpack_require__.r(__webpack_exports__);
1131
1320
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1132
1321
  /* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _KHR_lights_punctual__WEBPACK_IMPORTED_MODULE_1__.KHR_lights_punctual),
1133
1322
  /* harmony export */ "KHR_materials_clearcoat": () => (/* reexport safe */ _KHR_materials_clearcoat__WEBPACK_IMPORTED_MODULE_2__.KHR_materials_clearcoat),
1134
- /* harmony export */ "KHR_materials_sheen": () => (/* reexport safe */ _KHR_materials_sheen__WEBPACK_IMPORTED_MODULE_3__.KHR_materials_sheen),
1135
- /* harmony export */ "KHR_materials_unlit": () => (/* reexport safe */ _KHR_materials_unlit__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_unlit),
1323
+ /* harmony export */ "KHR_materials_iridescence": () => (/* reexport safe */ _KHR_materials_iridescence__WEBPACK_IMPORTED_MODULE_3__.KHR_materials_iridescence),
1324
+ /* harmony export */ "KHR_materials_sheen": () => (/* reexport safe */ _KHR_materials_sheen__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_sheen),
1325
+ /* harmony export */ "KHR_materials_specular": () => (/* reexport safe */ _KHR_materials_specular__WEBPACK_IMPORTED_MODULE_6__.KHR_materials_specular),
1326
+ /* harmony export */ "KHR_materials_unlit": () => (/* reexport safe */ _KHR_materials_unlit__WEBPACK_IMPORTED_MODULE_5__.KHR_materials_unlit),
1136
1327
  /* harmony export */ "KHR_texture_transform": () => (/* reexport safe */ _KHR_texture_transform__WEBPACK_IMPORTED_MODULE_0__.KHR_texture_transform)
1137
1328
  /* harmony export */ });
1138
1329
  /* harmony import */ var _KHR_texture_transform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KHR_texture_transform */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_texture_transform.js");
1139
1330
  /* harmony import */ var _KHR_lights_punctual__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./KHR_lights_punctual */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_lights_punctual.js");
1140
1331
  /* harmony import */ var _KHR_materials_clearcoat__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./KHR_materials_clearcoat */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_clearcoat.js");
1141
- /* harmony import */ var _KHR_materials_sheen__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./KHR_materials_sheen */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_sheen.js");
1142
- /* harmony import */ var _KHR_materials_unlit__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./KHR_materials_unlit */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_unlit.js");
1332
+ /* harmony import */ var _KHR_materials_iridescence__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./KHR_materials_iridescence */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_iridescence.js");
1333
+ /* harmony import */ var _KHR_materials_sheen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./KHR_materials_sheen */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_sheen.js");
1334
+ /* harmony import */ var _KHR_materials_unlit__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./KHR_materials_unlit */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_unlit.js");
1335
+ /* harmony import */ var _KHR_materials_specular__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./KHR_materials_specular */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_specular.js");
1336
+
1337
+
1143
1338
 
1144
1339
 
1145
1340
 
@@ -4318,7 +4513,7 @@ var _GLTFMaterialExporter = /** @class */ (function () {
4318
4513
  var glTFMaterial = { name: babylonStandardMaterial.name };
4319
4514
  if (babylonStandardMaterial.backFaceCulling != null && !babylonStandardMaterial.backFaceCulling) {
4320
4515
  if (!babylonStandardMaterial.twoSidedLighting) {
4321
- core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn(babylonStandardMaterial.name + ": Back-face culling enabled and two-sided lighting disabled is not supported in glTF.");
4516
+ core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn(babylonStandardMaterial.name + ": Back-face culling disabled and two-sided lighting disabled is not supported in glTF.");
4322
4517
  }
4323
4518
  glTFMaterial.doubleSided = true;
4324
4519
  }
@@ -4401,82 +4596,6 @@ var _GLTFMaterialExporter = /** @class */ (function () {
4401
4596
  });
4402
4597
  });
4403
4598
  };
4404
- /**
4405
- * Converts a Babylon PBR Metallic Roughness Material to a glTF Material
4406
- * @param babylonPBRMetalRoughMaterial BJS PBR Metallic Roughness Material
4407
- * @param mimeType mime type to use for the textures
4408
- * @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
4409
- */
4410
- _GLTFMaterialExporter.prototype._convertPBRMetallicRoughnessMaterialAsync = function (babylonPBRMetalRoughMaterial, mimeType, hasTextureCoords) {
4411
- var materialMap = this._exporter._materialMap;
4412
- var materials = this._exporter._materials;
4413
- var promises = [];
4414
- var glTFPbrMetallicRoughness = {};
4415
- if (babylonPBRMetalRoughMaterial.baseColor) {
4416
- glTFPbrMetallicRoughness.baseColorFactor = [
4417
- babylonPBRMetalRoughMaterial.baseColor.r,
4418
- babylonPBRMetalRoughMaterial.baseColor.g,
4419
- babylonPBRMetalRoughMaterial.baseColor.b,
4420
- babylonPBRMetalRoughMaterial.alpha,
4421
- ];
4422
- }
4423
- if (babylonPBRMetalRoughMaterial.metallic != null && babylonPBRMetalRoughMaterial.metallic !== 1) {
4424
- glTFPbrMetallicRoughness.metallicFactor = babylonPBRMetalRoughMaterial.metallic;
4425
- }
4426
- if (babylonPBRMetalRoughMaterial.roughness != null && babylonPBRMetalRoughMaterial.roughness !== 1) {
4427
- glTFPbrMetallicRoughness.roughnessFactor = babylonPBRMetalRoughMaterial.roughness;
4428
- }
4429
- var glTFMaterial = {
4430
- name: babylonPBRMetalRoughMaterial.name,
4431
- };
4432
- if (babylonPBRMetalRoughMaterial.doubleSided) {
4433
- glTFMaterial.doubleSided = babylonPBRMetalRoughMaterial.doubleSided;
4434
- }
4435
- _GLTFMaterialExporter._SetAlphaMode(glTFMaterial, babylonPBRMetalRoughMaterial);
4436
- if (hasTextureCoords) {
4437
- if (babylonPBRMetalRoughMaterial.baseTexture != null) {
4438
- promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.baseTexture, mimeType).then(function (glTFTexture) {
4439
- if (glTFTexture) {
4440
- glTFPbrMetallicRoughness.baseColorTexture = glTFTexture;
4441
- }
4442
- }));
4443
- }
4444
- if (babylonPBRMetalRoughMaterial.normalTexture) {
4445
- promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.normalTexture, mimeType).then(function (glTFTexture) {
4446
- if (glTFTexture) {
4447
- glTFMaterial.normalTexture = glTFTexture;
4448
- if (babylonPBRMetalRoughMaterial.normalTexture.level !== 1) {
4449
- glTFMaterial.normalTexture.scale = babylonPBRMetalRoughMaterial.normalTexture.level;
4450
- }
4451
- }
4452
- }));
4453
- }
4454
- if (babylonPBRMetalRoughMaterial.occlusionTexture) {
4455
- promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.occlusionTexture, mimeType).then(function (glTFTexture) {
4456
- if (glTFTexture) {
4457
- glTFMaterial.occlusionTexture = glTFTexture;
4458
- if (babylonPBRMetalRoughMaterial.occlusionStrength != null) {
4459
- glTFMaterial.occlusionTexture.strength = babylonPBRMetalRoughMaterial.occlusionStrength;
4460
- }
4461
- }
4462
- }));
4463
- }
4464
- if (babylonPBRMetalRoughMaterial.emissiveTexture) {
4465
- promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.emissiveTexture, mimeType).then(function (glTFTexture) {
4466
- if (glTFTexture) {
4467
- glTFMaterial.emissiveTexture = glTFTexture;
4468
- }
4469
- }));
4470
- }
4471
- }
4472
- if (_GLTFMaterialExporter._FuzzyEquals(babylonPBRMetalRoughMaterial.emissiveColor, core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Color3.Black(), _GLTFMaterialExporter._Epsilon)) {
4473
- glTFMaterial.emissiveFactor = babylonPBRMetalRoughMaterial.emissiveColor.asArray();
4474
- }
4475
- glTFMaterial.pbrMetallicRoughness = glTFPbrMetallicRoughness;
4476
- materials.push(glTFMaterial);
4477
- materialMap[babylonPBRMetalRoughMaterial.uniqueId] = materials.length - 1;
4478
- return this._finishMaterial(promises, glTFMaterial, babylonPBRMetalRoughMaterial, mimeType);
4479
- };
4480
4599
  /**
4481
4600
  * Converts an image typed array buffer to a base64 image
4482
4601
  * @param buffer typed array buffer
@@ -5005,7 +5124,7 @@ var _GLTFMaterialExporter = /** @class */ (function () {
5005
5124
  }
5006
5125
  if (babylonPBRMaterial.backFaceCulling != null && !babylonPBRMaterial.backFaceCulling) {
5007
5126
  if (!babylonPBRMaterial._twoSidedLighting) {
5008
- core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn(babylonPBRMaterial.name + ": Back-face culling enabled and two-sided lighting disabled is not supported in glTF.");
5127
+ core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn(babylonPBRMaterial.name + ": Back-face culling disabled and two-sided lighting disabled is not supported in glTF.");
5009
5128
  }
5010
5129
  glTFMaterial.doubleSided = true;
5011
5130
  }
@@ -5530,7 +5649,9 @@ __webpack_require__.r(__webpack_exports__);
5530
5649
  /* harmony export */ "GLTFData": () => (/* reexport safe */ _glTFData__WEBPACK_IMPORTED_MODULE_1__.GLTFData),
5531
5650
  /* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_lights_punctual),
5532
5651
  /* harmony export */ "KHR_materials_clearcoat": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_clearcoat),
5652
+ /* harmony export */ "KHR_materials_iridescence": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_iridescence),
5533
5653
  /* harmony export */ "KHR_materials_sheen": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_sheen),
5654
+ /* harmony export */ "KHR_materials_specular": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_specular),
5534
5655
  /* harmony export */ "KHR_materials_unlit": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_unlit),
5535
5656
  /* harmony export */ "KHR_texture_transform": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_texture_transform),
5536
5657
  /* harmony export */ "_BinaryWriter": () => (/* reexport safe */ _glTFExporter__WEBPACK_IMPORTED_MODULE_2__._BinaryWriter),
@@ -5614,7 +5735,9 @@ __webpack_require__.r(__webpack_exports__);
5614
5735
  /* harmony export */ "GLTFData": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.GLTFData),
5615
5736
  /* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.KHR_lights_punctual),
5616
5737
  /* harmony export */ "KHR_materials_clearcoat": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_clearcoat),
5738
+ /* harmony export */ "KHR_materials_iridescence": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_iridescence),
5617
5739
  /* harmony export */ "KHR_materials_sheen": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_sheen),
5740
+ /* harmony export */ "KHR_materials_specular": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_specular),
5618
5741
  /* harmony export */ "KHR_materials_unlit": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_unlit),
5619
5742
  /* harmony export */ "KHR_texture_transform": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__.KHR_texture_transform),
5620
5743
  /* harmony export */ "_BinaryWriter": () => (/* reexport safe */ _2_0_index__WEBPACK_IMPORTED_MODULE_1__._BinaryWriter),
@@ -5646,7 +5769,9 @@ __webpack_require__.r(__webpack_exports__);
5646
5769
  /* harmony export */ "GLTFData": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.GLTFData),
5647
5770
  /* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.KHR_lights_punctual),
5648
5771
  /* harmony export */ "KHR_materials_clearcoat": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_clearcoat),
5772
+ /* harmony export */ "KHR_materials_iridescence": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_iridescence),
5649
5773
  /* harmony export */ "KHR_materials_sheen": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_sheen),
5774
+ /* harmony export */ "KHR_materials_specular": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_specular),
5650
5775
  /* harmony export */ "KHR_materials_unlit": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_unlit),
5651
5776
  /* harmony export */ "KHR_texture_transform": () => (/* reexport safe */ _glTF_index__WEBPACK_IMPORTED_MODULE_1__.KHR_texture_transform),
5652
5777
  /* harmony export */ "OBJExport": () => (/* reexport safe */ _OBJ_index__WEBPACK_IMPORTED_MODULE_0__.OBJExport),
@@ -5682,7 +5807,9 @@ __webpack_require__.r(__webpack_exports__);
5682
5807
  /* harmony export */ "GLTFData": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.GLTFData),
5683
5808
  /* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_lights_punctual),
5684
5809
  /* harmony export */ "KHR_materials_clearcoat": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_clearcoat),
5810
+ /* harmony export */ "KHR_materials_iridescence": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_iridescence),
5685
5811
  /* harmony export */ "KHR_materials_sheen": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_sheen),
5812
+ /* harmony export */ "KHR_materials_specular": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_specular),
5686
5813
  /* harmony export */ "KHR_materials_unlit": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_unlit),
5687
5814
  /* harmony export */ "KHR_texture_transform": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_texture_transform),
5688
5815
  /* harmony export */ "_BinaryWriter": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__._BinaryWriter),
@@ -5814,7 +5941,9 @@ __webpack_require__.r(__webpack_exports__);
5814
5941
  /* harmony export */ "GLTFData": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.GLTFData),
5815
5942
  /* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.KHR_lights_punctual),
5816
5943
  /* harmony export */ "KHR_materials_clearcoat": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_clearcoat),
5944
+ /* harmony export */ "KHR_materials_iridescence": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_iridescence),
5817
5945
  /* harmony export */ "KHR_materials_sheen": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_sheen),
5946
+ /* harmony export */ "KHR_materials_specular": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_specular),
5818
5947
  /* harmony export */ "KHR_materials_unlit": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.KHR_materials_unlit),
5819
5948
  /* harmony export */ "KHR_texture_transform": () => (/* reexport safe */ _legacy_glTF2Serializer__WEBPACK_IMPORTED_MODULE_1__.KHR_texture_transform),
5820
5949
  /* harmony export */ "OBJExport": () => (/* reexport safe */ _legacy_objSerializer__WEBPACK_IMPORTED_MODULE_2__.OBJExport),