babylonjs-serializers 5.1.0 → 5.4.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.glTF2Serializer.js +491 -82
- package/babylon.glTF2Serializer.js.map +1 -1
- package/babylon.glTF2Serializer.min.js +1 -1
- package/babylon.glTF2Serializer.min.js.map +1 -1
- package/babylonjs.serializers.d.ts +110 -7
- package/babylonjs.serializers.js +506 -82
- package/babylonjs.serializers.js.map +1 -1
- package/babylonjs.serializers.min.js +1 -1
- package/babylonjs.serializers.min.js.map +1 -1
- package/babylonjs.serializers.module.d.ts +253 -15
- package/package.json +3 -3
|
@@ -600,6 +600,166 @@ var KHR_materials_clearcoat = /** @class */ (function () {
|
|
|
600
600
|
_glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new KHR_materials_clearcoat(exporter); });
|
|
601
601
|
|
|
602
602
|
|
|
603
|
+
/***/ }),
|
|
604
|
+
|
|
605
|
+
/***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_ior.js":
|
|
606
|
+
/*!******************************************************************************!*\
|
|
607
|
+
!*** ../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_ior.js ***!
|
|
608
|
+
\******************************************************************************/
|
|
609
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
610
|
+
|
|
611
|
+
__webpack_require__.r(__webpack_exports__);
|
|
612
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
613
|
+
/* harmony export */ "KHR_materials_ior": () => (/* binding */ KHR_materials_ior)
|
|
614
|
+
/* harmony export */ });
|
|
615
|
+
/* harmony import */ var _glTFExporter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../glTFExporter */ "../../../lts/serializers/dist/glTF/2.0/glTFExporter.js");
|
|
616
|
+
/* harmony import */ var core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Materials/PBR/pbrMaterial */ "core/Maths/math.vector");
|
|
617
|
+
/* harmony import */ var core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__);
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
var NAME = "KHR_materials_ior";
|
|
621
|
+
/**
|
|
622
|
+
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_ior/README.md)
|
|
623
|
+
*/
|
|
624
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
625
|
+
var KHR_materials_ior = /** @class */ (function () {
|
|
626
|
+
function KHR_materials_ior() {
|
|
627
|
+
/** Name of this extension */
|
|
628
|
+
this.name = NAME;
|
|
629
|
+
/** Defines whether this extension is enabled */
|
|
630
|
+
this.enabled = true;
|
|
631
|
+
/** Defines whether this extension is required */
|
|
632
|
+
this.required = false;
|
|
633
|
+
this._wasUsed = false;
|
|
634
|
+
}
|
|
635
|
+
KHR_materials_ior.prototype.dispose = function () { };
|
|
636
|
+
Object.defineProperty(KHR_materials_ior.prototype, "wasUsed", {
|
|
637
|
+
/** @hidden */
|
|
638
|
+
get: function () {
|
|
639
|
+
return this._wasUsed;
|
|
640
|
+
},
|
|
641
|
+
enumerable: false,
|
|
642
|
+
configurable: true
|
|
643
|
+
});
|
|
644
|
+
KHR_materials_ior.prototype._isExtensionEnabled = function (mat) {
|
|
645
|
+
// This extension must not be used on a material that also uses KHR_materials_unlit
|
|
646
|
+
if (mat.unlit) {
|
|
647
|
+
return false;
|
|
648
|
+
}
|
|
649
|
+
return mat.indexOfRefraction != undefined && mat.indexOfRefraction != 1.5; // 1.5 is normative default value.
|
|
650
|
+
};
|
|
651
|
+
KHR_materials_ior.prototype.postExportMaterialAsync = function (context, node, babylonMaterial) {
|
|
652
|
+
var _this = this;
|
|
653
|
+
return new Promise(function (resolve) {
|
|
654
|
+
if (babylonMaterial instanceof core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRMaterial && _this._isExtensionEnabled(babylonMaterial)) {
|
|
655
|
+
_this._wasUsed = true;
|
|
656
|
+
var iorInfo = {
|
|
657
|
+
ior: babylonMaterial.indexOfRefraction,
|
|
658
|
+
};
|
|
659
|
+
node.extensions = node.extensions || {};
|
|
660
|
+
node.extensions[NAME] = iorInfo;
|
|
661
|
+
}
|
|
662
|
+
resolve(node);
|
|
663
|
+
});
|
|
664
|
+
};
|
|
665
|
+
return KHR_materials_ior;
|
|
666
|
+
}());
|
|
667
|
+
|
|
668
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
669
|
+
_glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new KHR_materials_ior(); });
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
/***/ }),
|
|
673
|
+
|
|
674
|
+
/***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_iridescence.js":
|
|
675
|
+
/*!**************************************************************************************!*\
|
|
676
|
+
!*** ../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_iridescence.js ***!
|
|
677
|
+
\**************************************************************************************/
|
|
678
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
679
|
+
|
|
680
|
+
__webpack_require__.r(__webpack_exports__);
|
|
681
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
682
|
+
/* harmony export */ "KHR_materials_iridescence": () => (/* binding */ KHR_materials_iridescence)
|
|
683
|
+
/* harmony export */ });
|
|
684
|
+
/* harmony import */ var _glTFExporter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../glTFExporter */ "../../../lts/serializers/dist/glTF/2.0/glTFExporter.js");
|
|
685
|
+
/* harmony import */ var core_Materials_PBR_pbrBaseMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Materials/PBR/pbrBaseMaterial */ "core/Maths/math.vector");
|
|
686
|
+
/* harmony import */ var core_Materials_PBR_pbrBaseMaterial__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Materials_PBR_pbrBaseMaterial__WEBPACK_IMPORTED_MODULE_1__);
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
var NAME = "KHR_materials_iridescence";
|
|
690
|
+
/**
|
|
691
|
+
* @hidden
|
|
692
|
+
*/
|
|
693
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
694
|
+
var KHR_materials_iridescence = /** @class */ (function () {
|
|
695
|
+
function KHR_materials_iridescence(exporter) {
|
|
696
|
+
/** Name of this extension */
|
|
697
|
+
this.name = NAME;
|
|
698
|
+
/** Defines whether this extension is enabled */
|
|
699
|
+
this.enabled = true;
|
|
700
|
+
/** Defines whether this extension is required */
|
|
701
|
+
this.required = false;
|
|
702
|
+
this._wasUsed = false;
|
|
703
|
+
this._exporter = exporter;
|
|
704
|
+
}
|
|
705
|
+
KHR_materials_iridescence.prototype.dispose = function () { };
|
|
706
|
+
Object.defineProperty(KHR_materials_iridescence.prototype, "wasUsed", {
|
|
707
|
+
/** @hidden */
|
|
708
|
+
get: function () {
|
|
709
|
+
return this._wasUsed;
|
|
710
|
+
},
|
|
711
|
+
enumerable: false,
|
|
712
|
+
configurable: true
|
|
713
|
+
});
|
|
714
|
+
KHR_materials_iridescence.prototype.postExportMaterialAdditionalTextures = function (context, node, babylonMaterial) {
|
|
715
|
+
var additionalTextures = [];
|
|
716
|
+
if (babylonMaterial instanceof core_Materials_PBR_pbrBaseMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRBaseMaterial) {
|
|
717
|
+
if (babylonMaterial.iridescence.isEnabled) {
|
|
718
|
+
if (babylonMaterial.iridescence.texture) {
|
|
719
|
+
additionalTextures.push(babylonMaterial.iridescence.texture);
|
|
720
|
+
}
|
|
721
|
+
if (babylonMaterial.iridescence.thicknessTexture && babylonMaterial.iridescence.thicknessTexture !== babylonMaterial.iridescence.texture) {
|
|
722
|
+
additionalTextures.push(babylonMaterial.iridescence.thicknessTexture);
|
|
723
|
+
}
|
|
724
|
+
return additionalTextures;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return [];
|
|
728
|
+
};
|
|
729
|
+
KHR_materials_iridescence.prototype.postExportMaterialAsync = function (context, node, babylonMaterial) {
|
|
730
|
+
var _this = this;
|
|
731
|
+
return new Promise(function (resolve) {
|
|
732
|
+
if (babylonMaterial instanceof core_Materials_PBR_pbrBaseMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRBaseMaterial) {
|
|
733
|
+
if (!babylonMaterial.iridescence.isEnabled) {
|
|
734
|
+
resolve(node);
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
_this._wasUsed = true;
|
|
738
|
+
node.extensions = node.extensions || {};
|
|
739
|
+
var iridescenceTextureInfo = _this._exporter._glTFMaterialExporter._getTextureInfo(babylonMaterial.iridescence.texture);
|
|
740
|
+
var iridescenceThicknessTextureInfo = _this._exporter._glTFMaterialExporter._getTextureInfo(babylonMaterial.iridescence.thicknessTexture);
|
|
741
|
+
var iridescenceInfo_1 = {
|
|
742
|
+
iridescenceFactor: babylonMaterial.iridescence.intensity,
|
|
743
|
+
iridescenceIor: babylonMaterial.iridescence.indexOfRefraction,
|
|
744
|
+
iridescenceThicknessMinimum: babylonMaterial.iridescence.minimumThickness,
|
|
745
|
+
iridescenceThicknessMaximum: babylonMaterial.iridescence.maximumThickness,
|
|
746
|
+
iridescenceTexture: iridescenceTextureInfo !== null && iridescenceTextureInfo !== void 0 ? iridescenceTextureInfo : undefined,
|
|
747
|
+
iridescenceThicknessTexture: iridescenceThicknessTextureInfo !== null && iridescenceThicknessTextureInfo !== void 0 ? iridescenceThicknessTextureInfo : undefined,
|
|
748
|
+
hasTextures: function () {
|
|
749
|
+
return iridescenceInfo_1.iridescenceTexture !== null || iridescenceInfo_1.iridescenceThicknessTexture !== null;
|
|
750
|
+
},
|
|
751
|
+
};
|
|
752
|
+
node.extensions[NAME] = iridescenceInfo_1;
|
|
753
|
+
}
|
|
754
|
+
resolve(node);
|
|
755
|
+
});
|
|
756
|
+
};
|
|
757
|
+
return KHR_materials_iridescence;
|
|
758
|
+
}());
|
|
759
|
+
|
|
760
|
+
_glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new KHR_materials_iridescence(exporter); });
|
|
761
|
+
|
|
762
|
+
|
|
603
763
|
/***/ }),
|
|
604
764
|
|
|
605
765
|
/***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_sheen.js":
|
|
@@ -690,6 +850,201 @@ var KHR_materials_sheen = /** @class */ (function () {
|
|
|
690
850
|
_glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new KHR_materials_sheen(exporter); });
|
|
691
851
|
|
|
692
852
|
|
|
853
|
+
/***/ }),
|
|
854
|
+
|
|
855
|
+
/***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_specular.js":
|
|
856
|
+
/*!***********************************************************************************!*\
|
|
857
|
+
!*** ../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_specular.js ***!
|
|
858
|
+
\***********************************************************************************/
|
|
859
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
860
|
+
|
|
861
|
+
__webpack_require__.r(__webpack_exports__);
|
|
862
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
863
|
+
/* harmony export */ "KHR_materials_specular": () => (/* binding */ KHR_materials_specular)
|
|
864
|
+
/* harmony export */ });
|
|
865
|
+
/* harmony import */ var _glTFExporter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../glTFExporter */ "../../../lts/serializers/dist/glTF/2.0/glTFExporter.js");
|
|
866
|
+
/* harmony import */ var core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Materials/PBR/pbrMaterial */ "core/Maths/math.vector");
|
|
867
|
+
/* harmony import */ var core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__);
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
var NAME = "KHR_materials_specular";
|
|
871
|
+
/**
|
|
872
|
+
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_specular/README.md)
|
|
873
|
+
*/
|
|
874
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
875
|
+
var KHR_materials_specular = /** @class */ (function () {
|
|
876
|
+
function KHR_materials_specular(exporter) {
|
|
877
|
+
/** Name of this extension */
|
|
878
|
+
this.name = NAME;
|
|
879
|
+
/** Defines whether this extension is enabled */
|
|
880
|
+
this.enabled = true;
|
|
881
|
+
/** Defines whether this extension is required */
|
|
882
|
+
this.required = false;
|
|
883
|
+
this._wasUsed = false;
|
|
884
|
+
this._exporter = exporter;
|
|
885
|
+
}
|
|
886
|
+
KHR_materials_specular.prototype.dispose = function () { };
|
|
887
|
+
Object.defineProperty(KHR_materials_specular.prototype, "wasUsed", {
|
|
888
|
+
/** @hidden */
|
|
889
|
+
get: function () {
|
|
890
|
+
return this._wasUsed;
|
|
891
|
+
},
|
|
892
|
+
enumerable: false,
|
|
893
|
+
configurable: true
|
|
894
|
+
});
|
|
895
|
+
KHR_materials_specular.prototype.postExportMaterialAdditionalTextures = function (context, node, babylonMaterial) {
|
|
896
|
+
var additionalTextures = [];
|
|
897
|
+
if (babylonMaterial instanceof core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRMaterial) {
|
|
898
|
+
if (this._isExtensionEnabled(babylonMaterial)) {
|
|
899
|
+
if (babylonMaterial.metallicReflectanceTexture) {
|
|
900
|
+
additionalTextures.push(babylonMaterial.metallicReflectanceTexture);
|
|
901
|
+
}
|
|
902
|
+
if (babylonMaterial.reflectanceTexture) {
|
|
903
|
+
additionalTextures.push(babylonMaterial.reflectanceTexture);
|
|
904
|
+
}
|
|
905
|
+
return additionalTextures;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
return additionalTextures;
|
|
909
|
+
};
|
|
910
|
+
KHR_materials_specular.prototype._isExtensionEnabled = function (mat) {
|
|
911
|
+
// This extension must not be used on a material that also uses KHR_materials_unlit
|
|
912
|
+
if (mat.unlit) {
|
|
913
|
+
return false;
|
|
914
|
+
}
|
|
915
|
+
return ((mat.metallicF0Factor != undefined && mat.metallicF0Factor != 1.0) ||
|
|
916
|
+
(mat.metallicReflectanceColor != undefined && !mat.metallicReflectanceColor.equalsFloats(1.0, 1.0, 1.0)) ||
|
|
917
|
+
this._hasTexturesExtension(mat));
|
|
918
|
+
};
|
|
919
|
+
KHR_materials_specular.prototype._hasTexturesExtension = function (mat) {
|
|
920
|
+
return mat.metallicReflectanceTexture != null || mat.reflectanceTexture != null;
|
|
921
|
+
};
|
|
922
|
+
KHR_materials_specular.prototype.postExportMaterialAsync = function (context, node, babylonMaterial) {
|
|
923
|
+
var _this = this;
|
|
924
|
+
return new Promise(function (resolve) {
|
|
925
|
+
var _a, _b;
|
|
926
|
+
if (babylonMaterial instanceof core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRMaterial && _this._isExtensionEnabled(babylonMaterial)) {
|
|
927
|
+
_this._wasUsed = true;
|
|
928
|
+
node.extensions = node.extensions || {};
|
|
929
|
+
var metallicReflectanceTexture = (_a = _this._exporter._glTFMaterialExporter._getTextureInfo(babylonMaterial.metallicReflectanceTexture)) !== null && _a !== void 0 ? _a : undefined;
|
|
930
|
+
var reflectanceTexture = (_b = _this._exporter._glTFMaterialExporter._getTextureInfo(babylonMaterial.reflectanceTexture)) !== null && _b !== void 0 ? _b : undefined;
|
|
931
|
+
var metallicF0Factor = babylonMaterial.metallicF0Factor == 1.0 ? undefined : babylonMaterial.metallicF0Factor;
|
|
932
|
+
var metallicReflectanceColor = babylonMaterial.metallicReflectanceColor.equalsFloats(1.0, 1.0, 1.0)
|
|
933
|
+
? undefined
|
|
934
|
+
: babylonMaterial.metallicReflectanceColor.asArray();
|
|
935
|
+
var specularInfo = {
|
|
936
|
+
specularFactor: metallicF0Factor,
|
|
937
|
+
specularTexture: metallicReflectanceTexture,
|
|
938
|
+
specularColorFactor: metallicReflectanceColor,
|
|
939
|
+
specularColorTexture: reflectanceTexture,
|
|
940
|
+
hasTextures: function () {
|
|
941
|
+
return _this._hasTexturesExtension(babylonMaterial);
|
|
942
|
+
},
|
|
943
|
+
};
|
|
944
|
+
node.extensions[NAME] = specularInfo;
|
|
945
|
+
}
|
|
946
|
+
resolve(node);
|
|
947
|
+
});
|
|
948
|
+
};
|
|
949
|
+
return KHR_materials_specular;
|
|
950
|
+
}());
|
|
951
|
+
|
|
952
|
+
_glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new KHR_materials_specular(exporter); });
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
/***/ }),
|
|
956
|
+
|
|
957
|
+
/***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_transmission.js":
|
|
958
|
+
/*!***************************************************************************************!*\
|
|
959
|
+
!*** ../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_transmission.js ***!
|
|
960
|
+
\***************************************************************************************/
|
|
961
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
962
|
+
|
|
963
|
+
__webpack_require__.r(__webpack_exports__);
|
|
964
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
965
|
+
/* harmony export */ "KHR_materials_transmission": () => (/* binding */ KHR_materials_transmission)
|
|
966
|
+
/* harmony export */ });
|
|
967
|
+
/* harmony import */ var _glTFExporter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../glTFExporter */ "../../../lts/serializers/dist/glTF/2.0/glTFExporter.js");
|
|
968
|
+
/* harmony import */ var core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Materials/PBR/pbrMaterial */ "core/Maths/math.vector");
|
|
969
|
+
/* harmony import */ var core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__);
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
var NAME = "KHR_materials_transmission";
|
|
973
|
+
/**
|
|
974
|
+
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_transmission/README.md)
|
|
975
|
+
*/
|
|
976
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
977
|
+
var KHR_materials_transmission = /** @class */ (function () {
|
|
978
|
+
function KHR_materials_transmission(exporter) {
|
|
979
|
+
/** Name of this extension */
|
|
980
|
+
this.name = NAME;
|
|
981
|
+
/** Defines whether this extension is enabled */
|
|
982
|
+
this.enabled = true;
|
|
983
|
+
/** Defines whether this extension is required */
|
|
984
|
+
this.required = false;
|
|
985
|
+
this._wasUsed = false;
|
|
986
|
+
this._exporter = exporter;
|
|
987
|
+
}
|
|
988
|
+
KHR_materials_transmission.prototype.dispose = function () { };
|
|
989
|
+
Object.defineProperty(KHR_materials_transmission.prototype, "wasUsed", {
|
|
990
|
+
/** @hidden */
|
|
991
|
+
get: function () {
|
|
992
|
+
return this._wasUsed;
|
|
993
|
+
},
|
|
994
|
+
enumerable: false,
|
|
995
|
+
configurable: true
|
|
996
|
+
});
|
|
997
|
+
KHR_materials_transmission.prototype.postExportMaterialAdditionalTextures = function (context, node, babylonMaterial) {
|
|
998
|
+
var additionalTextures = [];
|
|
999
|
+
if (babylonMaterial instanceof core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRMaterial) {
|
|
1000
|
+
if (this._isExtensionEnabled(babylonMaterial)) {
|
|
1001
|
+
if (babylonMaterial.subSurface.thicknessTexture) {
|
|
1002
|
+
additionalTextures.push(babylonMaterial.subSurface.thicknessTexture);
|
|
1003
|
+
}
|
|
1004
|
+
return additionalTextures;
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
return additionalTextures;
|
|
1008
|
+
};
|
|
1009
|
+
KHR_materials_transmission.prototype._isExtensionEnabled = function (mat) {
|
|
1010
|
+
// This extension must not be used on a material that also uses KHR_materials_unlit
|
|
1011
|
+
if (mat.unlit) {
|
|
1012
|
+
return false;
|
|
1013
|
+
}
|
|
1014
|
+
var subs = mat.subSurface;
|
|
1015
|
+
return (subs.isRefractionEnabled && subs.refractionIntensity != undefined && subs.refractionIntensity != 0) || this._hasTexturesExtension(mat);
|
|
1016
|
+
};
|
|
1017
|
+
KHR_materials_transmission.prototype._hasTexturesExtension = function (mat) {
|
|
1018
|
+
return mat.subSurface.refractionIntensityTexture != null;
|
|
1019
|
+
};
|
|
1020
|
+
KHR_materials_transmission.prototype.postExportMaterialAsync = function (context, node, babylonMaterial) {
|
|
1021
|
+
var _this = this;
|
|
1022
|
+
return new Promise(function (resolve) {
|
|
1023
|
+
var _a;
|
|
1024
|
+
if (babylonMaterial instanceof core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRMaterial && _this._isExtensionEnabled(babylonMaterial)) {
|
|
1025
|
+
_this._wasUsed = true;
|
|
1026
|
+
var subs = babylonMaterial.subSurface;
|
|
1027
|
+
var transmissionFactor = subs.refractionIntensity === 0 ? undefined : subs.refractionIntensity;
|
|
1028
|
+
var transmissionTexture = (_a = _this._exporter._glTFMaterialExporter._getTextureInfo(subs.refractionIntensityTexture)) !== null && _a !== void 0 ? _a : undefined;
|
|
1029
|
+
var volumeInfo = {
|
|
1030
|
+
transmissionFactor: transmissionFactor,
|
|
1031
|
+
transmissionTexture: transmissionTexture,
|
|
1032
|
+
hasTextures: function () {
|
|
1033
|
+
return _this._hasTexturesExtension(babylonMaterial);
|
|
1034
|
+
},
|
|
1035
|
+
};
|
|
1036
|
+
node.extensions = node.extensions || {};
|
|
1037
|
+
node.extensions[NAME] = volumeInfo;
|
|
1038
|
+
}
|
|
1039
|
+
resolve(node);
|
|
1040
|
+
});
|
|
1041
|
+
};
|
|
1042
|
+
return KHR_materials_transmission;
|
|
1043
|
+
}());
|
|
1044
|
+
|
|
1045
|
+
_glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new KHR_materials_transmission(exporter); });
|
|
1046
|
+
|
|
1047
|
+
|
|
693
1048
|
/***/ }),
|
|
694
1049
|
|
|
695
1050
|
/***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_unlit.js":
|
|
@@ -758,6 +1113,111 @@ var KHR_materials_unlit = /** @class */ (function () {
|
|
|
758
1113
|
_glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function () { return new KHR_materials_unlit(); });
|
|
759
1114
|
|
|
760
1115
|
|
|
1116
|
+
/***/ }),
|
|
1117
|
+
|
|
1118
|
+
/***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_volume.js":
|
|
1119
|
+
/*!*********************************************************************************!*\
|
|
1120
|
+
!*** ../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_volume.js ***!
|
|
1121
|
+
\*********************************************************************************/
|
|
1122
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1123
|
+
|
|
1124
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1125
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1126
|
+
/* harmony export */ "KHR_materials_volume": () => (/* binding */ KHR_materials_volume)
|
|
1127
|
+
/* harmony export */ });
|
|
1128
|
+
/* harmony import */ var _glTFExporter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../glTFExporter */ "../../../lts/serializers/dist/glTF/2.0/glTFExporter.js");
|
|
1129
|
+
/* harmony import */ var core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core/Maths/math.color */ "core/Maths/math.vector");
|
|
1130
|
+
/* harmony import */ var core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__);
|
|
1131
|
+
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
var NAME = "KHR_materials_volume";
|
|
1135
|
+
/**
|
|
1136
|
+
* [Specification](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_volume/README.md)
|
|
1137
|
+
*/
|
|
1138
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
1139
|
+
var KHR_materials_volume = /** @class */ (function () {
|
|
1140
|
+
function KHR_materials_volume(exporter) {
|
|
1141
|
+
/** Name of this extension */
|
|
1142
|
+
this.name = NAME;
|
|
1143
|
+
/** Defines whether this extension is enabled */
|
|
1144
|
+
this.enabled = true;
|
|
1145
|
+
/** Defines whether this extension is required */
|
|
1146
|
+
this.required = false;
|
|
1147
|
+
this._wasUsed = false;
|
|
1148
|
+
this._exporter = exporter;
|
|
1149
|
+
}
|
|
1150
|
+
KHR_materials_volume.prototype.dispose = function () { };
|
|
1151
|
+
Object.defineProperty(KHR_materials_volume.prototype, "wasUsed", {
|
|
1152
|
+
/** @hidden */
|
|
1153
|
+
get: function () {
|
|
1154
|
+
return this._wasUsed;
|
|
1155
|
+
},
|
|
1156
|
+
enumerable: false,
|
|
1157
|
+
configurable: true
|
|
1158
|
+
});
|
|
1159
|
+
KHR_materials_volume.prototype.postExportMaterialAdditionalTextures = function (context, node, babylonMaterial) {
|
|
1160
|
+
var additionalTextures = [];
|
|
1161
|
+
if (babylonMaterial instanceof core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRMaterial) {
|
|
1162
|
+
if (this._isExtensionEnabled(babylonMaterial)) {
|
|
1163
|
+
if (babylonMaterial.subSurface.thicknessTexture) {
|
|
1164
|
+
additionalTextures.push(babylonMaterial.subSurface.thicknessTexture);
|
|
1165
|
+
}
|
|
1166
|
+
return additionalTextures;
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
return additionalTextures;
|
|
1170
|
+
};
|
|
1171
|
+
KHR_materials_volume.prototype._isExtensionEnabled = function (mat) {
|
|
1172
|
+
// This extension must not be used on a material that also uses KHR_materials_unlit
|
|
1173
|
+
if (mat.unlit) {
|
|
1174
|
+
return false;
|
|
1175
|
+
}
|
|
1176
|
+
var subs = mat.subSurface;
|
|
1177
|
+
// this extension requires either the KHR_materials_transmission or KHR_materials_translucency extensions.
|
|
1178
|
+
if (!subs.isRefractionEnabled && !subs.isTranslucencyEnabled) {
|
|
1179
|
+
return false;
|
|
1180
|
+
}
|
|
1181
|
+
return ((subs.maximumThickness != undefined && subs.maximumThickness != 0) ||
|
|
1182
|
+
(subs.tintColorAtDistance != undefined && subs.tintColorAtDistance != Number.POSITIVE_INFINITY) ||
|
|
1183
|
+
(subs.tintColor != undefined && subs.tintColor != core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__.Color3.White()) ||
|
|
1184
|
+
this._hasTexturesExtension(mat));
|
|
1185
|
+
};
|
|
1186
|
+
KHR_materials_volume.prototype._hasTexturesExtension = function (mat) {
|
|
1187
|
+
return mat.subSurface.thicknessTexture != null;
|
|
1188
|
+
};
|
|
1189
|
+
KHR_materials_volume.prototype.postExportMaterialAsync = function (context, node, babylonMaterial) {
|
|
1190
|
+
var _this = this;
|
|
1191
|
+
return new Promise(function (resolve) {
|
|
1192
|
+
var _a;
|
|
1193
|
+
if (babylonMaterial instanceof core_Materials_PBR_pbrMaterial__WEBPACK_IMPORTED_MODULE_1__.PBRMaterial && _this._isExtensionEnabled(babylonMaterial)) {
|
|
1194
|
+
_this._wasUsed = true;
|
|
1195
|
+
var subs = babylonMaterial.subSurface;
|
|
1196
|
+
var thicknessFactor = subs.maximumThickness == 0 ? undefined : subs.maximumThickness;
|
|
1197
|
+
var thicknessTexture = (_a = _this._exporter._glTFMaterialExporter._getTextureInfo(subs.thicknessTexture)) !== null && _a !== void 0 ? _a : undefined;
|
|
1198
|
+
var attenuationDistance = subs.tintColorAtDistance == Number.POSITIVE_INFINITY ? undefined : subs.tintColorAtDistance;
|
|
1199
|
+
var attenuationColor = subs.tintColor.equalsFloats(1.0, 1.0, 1.0) ? undefined : subs.tintColor.asArray();
|
|
1200
|
+
var volumeInfo = {
|
|
1201
|
+
thicknessFactor: thicknessFactor,
|
|
1202
|
+
thicknessTexture: thicknessTexture,
|
|
1203
|
+
attenuationDistance: attenuationDistance,
|
|
1204
|
+
attenuationColor: attenuationColor,
|
|
1205
|
+
hasTextures: function () {
|
|
1206
|
+
return _this._hasTexturesExtension(babylonMaterial);
|
|
1207
|
+
},
|
|
1208
|
+
};
|
|
1209
|
+
node.extensions = node.extensions || {};
|
|
1210
|
+
node.extensions[NAME] = volumeInfo;
|
|
1211
|
+
}
|
|
1212
|
+
resolve(node);
|
|
1213
|
+
});
|
|
1214
|
+
};
|
|
1215
|
+
return KHR_materials_volume;
|
|
1216
|
+
}());
|
|
1217
|
+
|
|
1218
|
+
_glTFExporter__WEBPACK_IMPORTED_MODULE_0__._Exporter.RegisterExtension(NAME, function (exporter) { return new KHR_materials_volume(exporter); });
|
|
1219
|
+
|
|
1220
|
+
|
|
761
1221
|
/***/ }),
|
|
762
1222
|
|
|
763
1223
|
/***/ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_texture_transform.js":
|
|
@@ -925,15 +1385,30 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
925
1385
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
926
1386
|
/* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _KHR_lights_punctual__WEBPACK_IMPORTED_MODULE_1__.KHR_lights_punctual),
|
|
927
1387
|
/* harmony export */ "KHR_materials_clearcoat": () => (/* reexport safe */ _KHR_materials_clearcoat__WEBPACK_IMPORTED_MODULE_2__.KHR_materials_clearcoat),
|
|
928
|
-
/* harmony export */ "
|
|
929
|
-
/* harmony export */ "
|
|
1388
|
+
/* harmony export */ "KHR_materials_ior": () => (/* reexport safe */ _KHR_materials_ior__WEBPACK_IMPORTED_MODULE_6__.KHR_materials_ior),
|
|
1389
|
+
/* harmony export */ "KHR_materials_iridescence": () => (/* reexport safe */ _KHR_materials_iridescence__WEBPACK_IMPORTED_MODULE_3__.KHR_materials_iridescence),
|
|
1390
|
+
/* harmony export */ "KHR_materials_sheen": () => (/* reexport safe */ _KHR_materials_sheen__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_sheen),
|
|
1391
|
+
/* harmony export */ "KHR_materials_specular": () => (/* reexport safe */ _KHR_materials_specular__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_specular),
|
|
1392
|
+
/* harmony export */ "KHR_materials_transmission": () => (/* reexport safe */ _KHR_materials_transmission__WEBPACK_IMPORTED_MODULE_9__.KHR_materials_transmission),
|
|
1393
|
+
/* harmony export */ "KHR_materials_unlit": () => (/* reexport safe */ _KHR_materials_unlit__WEBPACK_IMPORTED_MODULE_5__.KHR_materials_unlit),
|
|
1394
|
+
/* harmony export */ "KHR_materials_volume": () => (/* reexport safe */ _KHR_materials_volume__WEBPACK_IMPORTED_MODULE_8__.KHR_materials_volume),
|
|
930
1395
|
/* harmony export */ "KHR_texture_transform": () => (/* reexport safe */ _KHR_texture_transform__WEBPACK_IMPORTED_MODULE_0__.KHR_texture_transform)
|
|
931
1396
|
/* harmony export */ });
|
|
932
1397
|
/* 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");
|
|
933
1398
|
/* 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");
|
|
934
1399
|
/* 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");
|
|
935
|
-
/* harmony import */ var
|
|
936
|
-
/* harmony import */ var
|
|
1400
|
+
/* 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");
|
|
1401
|
+
/* 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");
|
|
1402
|
+
/* 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");
|
|
1403
|
+
/* harmony import */ var _KHR_materials_ior__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./KHR_materials_ior */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_ior.js");
|
|
1404
|
+
/* harmony import */ var _KHR_materials_specular__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./KHR_materials_specular */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_specular.js");
|
|
1405
|
+
/* harmony import */ var _KHR_materials_volume__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./KHR_materials_volume */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_volume.js");
|
|
1406
|
+
/* harmony import */ var _KHR_materials_transmission__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./KHR_materials_transmission */ "../../../lts/serializers/dist/glTF/2.0/Extensions/KHR_materials_transmission.js");
|
|
1407
|
+
|
|
1408
|
+
|
|
1409
|
+
|
|
1410
|
+
|
|
1411
|
+
|
|
937
1412
|
|
|
938
1413
|
|
|
939
1414
|
|
|
@@ -4112,7 +4587,7 @@ var _GLTFMaterialExporter = /** @class */ (function () {
|
|
|
4112
4587
|
var glTFMaterial = { name: babylonStandardMaterial.name };
|
|
4113
4588
|
if (babylonStandardMaterial.backFaceCulling != null && !babylonStandardMaterial.backFaceCulling) {
|
|
4114
4589
|
if (!babylonStandardMaterial.twoSidedLighting) {
|
|
4115
|
-
core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn(babylonStandardMaterial.name + ": Back-face culling
|
|
4590
|
+
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.");
|
|
4116
4591
|
}
|
|
4117
4592
|
glTFMaterial.doubleSided = true;
|
|
4118
4593
|
}
|
|
@@ -4195,82 +4670,6 @@ var _GLTFMaterialExporter = /** @class */ (function () {
|
|
|
4195
4670
|
});
|
|
4196
4671
|
});
|
|
4197
4672
|
};
|
|
4198
|
-
/**
|
|
4199
|
-
* Converts a Babylon PBR Metallic Roughness Material to a glTF Material
|
|
4200
|
-
* @param babylonPBRMetalRoughMaterial BJS PBR Metallic Roughness Material
|
|
4201
|
-
* @param mimeType mime type to use for the textures
|
|
4202
|
-
* @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
|
|
4203
|
-
*/
|
|
4204
|
-
_GLTFMaterialExporter.prototype._convertPBRMetallicRoughnessMaterialAsync = function (babylonPBRMetalRoughMaterial, mimeType, hasTextureCoords) {
|
|
4205
|
-
var materialMap = this._exporter._materialMap;
|
|
4206
|
-
var materials = this._exporter._materials;
|
|
4207
|
-
var promises = [];
|
|
4208
|
-
var glTFPbrMetallicRoughness = {};
|
|
4209
|
-
if (babylonPBRMetalRoughMaterial.baseColor) {
|
|
4210
|
-
glTFPbrMetallicRoughness.baseColorFactor = [
|
|
4211
|
-
babylonPBRMetalRoughMaterial.baseColor.r,
|
|
4212
|
-
babylonPBRMetalRoughMaterial.baseColor.g,
|
|
4213
|
-
babylonPBRMetalRoughMaterial.baseColor.b,
|
|
4214
|
-
babylonPBRMetalRoughMaterial.alpha,
|
|
4215
|
-
];
|
|
4216
|
-
}
|
|
4217
|
-
if (babylonPBRMetalRoughMaterial.metallic != null && babylonPBRMetalRoughMaterial.metallic !== 1) {
|
|
4218
|
-
glTFPbrMetallicRoughness.metallicFactor = babylonPBRMetalRoughMaterial.metallic;
|
|
4219
|
-
}
|
|
4220
|
-
if (babylonPBRMetalRoughMaterial.roughness != null && babylonPBRMetalRoughMaterial.roughness !== 1) {
|
|
4221
|
-
glTFPbrMetallicRoughness.roughnessFactor = babylonPBRMetalRoughMaterial.roughness;
|
|
4222
|
-
}
|
|
4223
|
-
var glTFMaterial = {
|
|
4224
|
-
name: babylonPBRMetalRoughMaterial.name,
|
|
4225
|
-
};
|
|
4226
|
-
if (babylonPBRMetalRoughMaterial.doubleSided) {
|
|
4227
|
-
glTFMaterial.doubleSided = babylonPBRMetalRoughMaterial.doubleSided;
|
|
4228
|
-
}
|
|
4229
|
-
_GLTFMaterialExporter._SetAlphaMode(glTFMaterial, babylonPBRMetalRoughMaterial);
|
|
4230
|
-
if (hasTextureCoords) {
|
|
4231
|
-
if (babylonPBRMetalRoughMaterial.baseTexture != null) {
|
|
4232
|
-
promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.baseTexture, mimeType).then(function (glTFTexture) {
|
|
4233
|
-
if (glTFTexture) {
|
|
4234
|
-
glTFPbrMetallicRoughness.baseColorTexture = glTFTexture;
|
|
4235
|
-
}
|
|
4236
|
-
}));
|
|
4237
|
-
}
|
|
4238
|
-
if (babylonPBRMetalRoughMaterial.normalTexture) {
|
|
4239
|
-
promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.normalTexture, mimeType).then(function (glTFTexture) {
|
|
4240
|
-
if (glTFTexture) {
|
|
4241
|
-
glTFMaterial.normalTexture = glTFTexture;
|
|
4242
|
-
if (babylonPBRMetalRoughMaterial.normalTexture.level !== 1) {
|
|
4243
|
-
glTFMaterial.normalTexture.scale = babylonPBRMetalRoughMaterial.normalTexture.level;
|
|
4244
|
-
}
|
|
4245
|
-
}
|
|
4246
|
-
}));
|
|
4247
|
-
}
|
|
4248
|
-
if (babylonPBRMetalRoughMaterial.occlusionTexture) {
|
|
4249
|
-
promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.occlusionTexture, mimeType).then(function (glTFTexture) {
|
|
4250
|
-
if (glTFTexture) {
|
|
4251
|
-
glTFMaterial.occlusionTexture = glTFTexture;
|
|
4252
|
-
if (babylonPBRMetalRoughMaterial.occlusionStrength != null) {
|
|
4253
|
-
glTFMaterial.occlusionTexture.strength = babylonPBRMetalRoughMaterial.occlusionStrength;
|
|
4254
|
-
}
|
|
4255
|
-
}
|
|
4256
|
-
}));
|
|
4257
|
-
}
|
|
4258
|
-
if (babylonPBRMetalRoughMaterial.emissiveTexture) {
|
|
4259
|
-
promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.emissiveTexture, mimeType).then(function (glTFTexture) {
|
|
4260
|
-
if (glTFTexture) {
|
|
4261
|
-
glTFMaterial.emissiveTexture = glTFTexture;
|
|
4262
|
-
}
|
|
4263
|
-
}));
|
|
4264
|
-
}
|
|
4265
|
-
}
|
|
4266
|
-
if (_GLTFMaterialExporter._FuzzyEquals(babylonPBRMetalRoughMaterial.emissiveColor, core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Color3.Black(), _GLTFMaterialExporter._Epsilon)) {
|
|
4267
|
-
glTFMaterial.emissiveFactor = babylonPBRMetalRoughMaterial.emissiveColor.asArray();
|
|
4268
|
-
}
|
|
4269
|
-
glTFMaterial.pbrMetallicRoughness = glTFPbrMetallicRoughness;
|
|
4270
|
-
materials.push(glTFMaterial);
|
|
4271
|
-
materialMap[babylonPBRMetalRoughMaterial.uniqueId] = materials.length - 1;
|
|
4272
|
-
return this._finishMaterial(promises, glTFMaterial, babylonPBRMetalRoughMaterial, mimeType);
|
|
4273
|
-
};
|
|
4274
4673
|
/**
|
|
4275
4674
|
* Converts an image typed array buffer to a base64 image
|
|
4276
4675
|
* @param buffer typed array buffer
|
|
@@ -4799,7 +5198,7 @@ var _GLTFMaterialExporter = /** @class */ (function () {
|
|
|
4799
5198
|
}
|
|
4800
5199
|
if (babylonPBRMaterial.backFaceCulling != null && !babylonPBRMaterial.backFaceCulling) {
|
|
4801
5200
|
if (!babylonPBRMaterial._twoSidedLighting) {
|
|
4802
|
-
core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn(babylonPBRMaterial.name + ": Back-face culling
|
|
5201
|
+
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.");
|
|
4803
5202
|
}
|
|
4804
5203
|
glTFMaterial.doubleSided = true;
|
|
4805
5204
|
}
|
|
@@ -5324,8 +5723,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5324
5723
|
/* harmony export */ "GLTFData": () => (/* reexport safe */ _glTFData__WEBPACK_IMPORTED_MODULE_1__.GLTFData),
|
|
5325
5724
|
/* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_lights_punctual),
|
|
5326
5725
|
/* harmony export */ "KHR_materials_clearcoat": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_clearcoat),
|
|
5726
|
+
/* harmony export */ "KHR_materials_ior": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_ior),
|
|
5727
|
+
/* harmony export */ "KHR_materials_iridescence": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_iridescence),
|
|
5327
5728
|
/* harmony export */ "KHR_materials_sheen": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_sheen),
|
|
5729
|
+
/* harmony export */ "KHR_materials_specular": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_specular),
|
|
5730
|
+
/* harmony export */ "KHR_materials_transmission": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_transmission),
|
|
5328
5731
|
/* harmony export */ "KHR_materials_unlit": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_unlit),
|
|
5732
|
+
/* harmony export */ "KHR_materials_volume": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_materials_volume),
|
|
5329
5733
|
/* harmony export */ "KHR_texture_transform": () => (/* reexport safe */ _Extensions_index__WEBPACK_IMPORTED_MODULE_7__.KHR_texture_transform),
|
|
5330
5734
|
/* harmony export */ "_BinaryWriter": () => (/* reexport safe */ _glTFExporter__WEBPACK_IMPORTED_MODULE_2__._BinaryWriter),
|
|
5331
5735
|
/* harmony export */ "_Exporter": () => (/* reexport safe */ _glTFExporter__WEBPACK_IMPORTED_MODULE_2__._Exporter),
|
|
@@ -5408,8 +5812,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5408
5812
|
/* harmony export */ "GLTFData": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.GLTFData),
|
|
5409
5813
|
/* harmony export */ "KHR_lights_punctual": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_lights_punctual),
|
|
5410
5814
|
/* harmony export */ "KHR_materials_clearcoat": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_clearcoat),
|
|
5815
|
+
/* harmony export */ "KHR_materials_ior": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_ior),
|
|
5816
|
+
/* harmony export */ "KHR_materials_iridescence": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_iridescence),
|
|
5411
5817
|
/* harmony export */ "KHR_materials_sheen": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_sheen),
|
|
5818
|
+
/* harmony export */ "KHR_materials_specular": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_specular),
|
|
5819
|
+
/* harmony export */ "KHR_materials_transmission": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_transmission),
|
|
5412
5820
|
/* harmony export */ "KHR_materials_unlit": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_unlit),
|
|
5821
|
+
/* harmony export */ "KHR_materials_volume": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_materials_volume),
|
|
5413
5822
|
/* harmony export */ "KHR_texture_transform": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__.KHR_texture_transform),
|
|
5414
5823
|
/* harmony export */ "_BinaryWriter": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__._BinaryWriter),
|
|
5415
5824
|
/* harmony export */ "_Exporter": () => (/* reexport safe */ _glTF_2_0_index__WEBPACK_IMPORTED_MODULE_4__._Exporter),
|