babylonjs-serializers 5.2.0 → 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.
- package/babylon.glTF2Serializer.js +3 -79
- 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 +0 -7
- package/babylonjs.serializers.js +3 -79
- 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 +0 -15
- package/package.json +3 -3
|
@@ -671,7 +671,7 @@ var KHR_materials_iridescence = /** @class */ (function () {
|
|
|
671
671
|
var iridescenceThicknessTextureInfo = _this._exporter._glTFMaterialExporter._getTextureInfo(babylonMaterial.iridescence.thicknessTexture);
|
|
672
672
|
var iridescenceInfo_1 = {
|
|
673
673
|
iridescenceFactor: babylonMaterial.iridescence.intensity,
|
|
674
|
-
|
|
674
|
+
iridescenceIor: babylonMaterial.iridescence.indexOfRefraction,
|
|
675
675
|
iridescenceThicknessMinimum: babylonMaterial.iridescence.minimumThickness,
|
|
676
676
|
iridescenceThicknessMaximum: babylonMaterial.iridescence.maximumThickness,
|
|
677
677
|
iridescenceTexture: iridescenceTextureInfo !== null && iridescenceTextureInfo !== void 0 ? iridescenceTextureInfo : undefined,
|
|
@@ -4307,7 +4307,7 @@ var _GLTFMaterialExporter = /** @class */ (function () {
|
|
|
4307
4307
|
var glTFMaterial = { name: babylonStandardMaterial.name };
|
|
4308
4308
|
if (babylonStandardMaterial.backFaceCulling != null && !babylonStandardMaterial.backFaceCulling) {
|
|
4309
4309
|
if (!babylonStandardMaterial.twoSidedLighting) {
|
|
4310
|
-
core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn(babylonStandardMaterial.name + ": Back-face culling
|
|
4310
|
+
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.");
|
|
4311
4311
|
}
|
|
4312
4312
|
glTFMaterial.doubleSided = true;
|
|
4313
4313
|
}
|
|
@@ -4390,82 +4390,6 @@ var _GLTFMaterialExporter = /** @class */ (function () {
|
|
|
4390
4390
|
});
|
|
4391
4391
|
});
|
|
4392
4392
|
};
|
|
4393
|
-
/**
|
|
4394
|
-
* Converts a Babylon PBR Metallic Roughness Material to a glTF Material
|
|
4395
|
-
* @param babylonPBRMetalRoughMaterial BJS PBR Metallic Roughness Material
|
|
4396
|
-
* @param mimeType mime type to use for the textures
|
|
4397
|
-
* @param hasTextureCoords specifies if texture coordinates are present on the submesh to determine if textures should be applied
|
|
4398
|
-
*/
|
|
4399
|
-
_GLTFMaterialExporter.prototype._convertPBRMetallicRoughnessMaterialAsync = function (babylonPBRMetalRoughMaterial, mimeType, hasTextureCoords) {
|
|
4400
|
-
var materialMap = this._exporter._materialMap;
|
|
4401
|
-
var materials = this._exporter._materials;
|
|
4402
|
-
var promises = [];
|
|
4403
|
-
var glTFPbrMetallicRoughness = {};
|
|
4404
|
-
if (babylonPBRMetalRoughMaterial.baseColor) {
|
|
4405
|
-
glTFPbrMetallicRoughness.baseColorFactor = [
|
|
4406
|
-
babylonPBRMetalRoughMaterial.baseColor.r,
|
|
4407
|
-
babylonPBRMetalRoughMaterial.baseColor.g,
|
|
4408
|
-
babylonPBRMetalRoughMaterial.baseColor.b,
|
|
4409
|
-
babylonPBRMetalRoughMaterial.alpha,
|
|
4410
|
-
];
|
|
4411
|
-
}
|
|
4412
|
-
if (babylonPBRMetalRoughMaterial.metallic != null && babylonPBRMetalRoughMaterial.metallic !== 1) {
|
|
4413
|
-
glTFPbrMetallicRoughness.metallicFactor = babylonPBRMetalRoughMaterial.metallic;
|
|
4414
|
-
}
|
|
4415
|
-
if (babylonPBRMetalRoughMaterial.roughness != null && babylonPBRMetalRoughMaterial.roughness !== 1) {
|
|
4416
|
-
glTFPbrMetallicRoughness.roughnessFactor = babylonPBRMetalRoughMaterial.roughness;
|
|
4417
|
-
}
|
|
4418
|
-
var glTFMaterial = {
|
|
4419
|
-
name: babylonPBRMetalRoughMaterial.name,
|
|
4420
|
-
};
|
|
4421
|
-
if (babylonPBRMetalRoughMaterial.doubleSided) {
|
|
4422
|
-
glTFMaterial.doubleSided = babylonPBRMetalRoughMaterial.doubleSided;
|
|
4423
|
-
}
|
|
4424
|
-
_GLTFMaterialExporter._SetAlphaMode(glTFMaterial, babylonPBRMetalRoughMaterial);
|
|
4425
|
-
if (hasTextureCoords) {
|
|
4426
|
-
if (babylonPBRMetalRoughMaterial.baseTexture != null) {
|
|
4427
|
-
promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.baseTexture, mimeType).then(function (glTFTexture) {
|
|
4428
|
-
if (glTFTexture) {
|
|
4429
|
-
glTFPbrMetallicRoughness.baseColorTexture = glTFTexture;
|
|
4430
|
-
}
|
|
4431
|
-
}));
|
|
4432
|
-
}
|
|
4433
|
-
if (babylonPBRMetalRoughMaterial.normalTexture) {
|
|
4434
|
-
promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.normalTexture, mimeType).then(function (glTFTexture) {
|
|
4435
|
-
if (glTFTexture) {
|
|
4436
|
-
glTFMaterial.normalTexture = glTFTexture;
|
|
4437
|
-
if (babylonPBRMetalRoughMaterial.normalTexture.level !== 1) {
|
|
4438
|
-
glTFMaterial.normalTexture.scale = babylonPBRMetalRoughMaterial.normalTexture.level;
|
|
4439
|
-
}
|
|
4440
|
-
}
|
|
4441
|
-
}));
|
|
4442
|
-
}
|
|
4443
|
-
if (babylonPBRMetalRoughMaterial.occlusionTexture) {
|
|
4444
|
-
promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.occlusionTexture, mimeType).then(function (glTFTexture) {
|
|
4445
|
-
if (glTFTexture) {
|
|
4446
|
-
glTFMaterial.occlusionTexture = glTFTexture;
|
|
4447
|
-
if (babylonPBRMetalRoughMaterial.occlusionStrength != null) {
|
|
4448
|
-
glTFMaterial.occlusionTexture.strength = babylonPBRMetalRoughMaterial.occlusionStrength;
|
|
4449
|
-
}
|
|
4450
|
-
}
|
|
4451
|
-
}));
|
|
4452
|
-
}
|
|
4453
|
-
if (babylonPBRMetalRoughMaterial.emissiveTexture) {
|
|
4454
|
-
promises.push(this._exportTextureAsync(babylonPBRMetalRoughMaterial.emissiveTexture, mimeType).then(function (glTFTexture) {
|
|
4455
|
-
if (glTFTexture) {
|
|
4456
|
-
glTFMaterial.emissiveTexture = glTFTexture;
|
|
4457
|
-
}
|
|
4458
|
-
}));
|
|
4459
|
-
}
|
|
4460
|
-
}
|
|
4461
|
-
if (_GLTFMaterialExporter._FuzzyEquals(babylonPBRMetalRoughMaterial.emissiveColor, core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Color3.Black(), _GLTFMaterialExporter._Epsilon)) {
|
|
4462
|
-
glTFMaterial.emissiveFactor = babylonPBRMetalRoughMaterial.emissiveColor.asArray();
|
|
4463
|
-
}
|
|
4464
|
-
glTFMaterial.pbrMetallicRoughness = glTFPbrMetallicRoughness;
|
|
4465
|
-
materials.push(glTFMaterial);
|
|
4466
|
-
materialMap[babylonPBRMetalRoughMaterial.uniqueId] = materials.length - 1;
|
|
4467
|
-
return this._finishMaterial(promises, glTFMaterial, babylonPBRMetalRoughMaterial, mimeType);
|
|
4468
|
-
};
|
|
4469
4393
|
/**
|
|
4470
4394
|
* Converts an image typed array buffer to a base64 image
|
|
4471
4395
|
* @param buffer typed array buffer
|
|
@@ -4994,7 +4918,7 @@ var _GLTFMaterialExporter = /** @class */ (function () {
|
|
|
4994
4918
|
}
|
|
4995
4919
|
if (babylonPBRMaterial.backFaceCulling != null && !babylonPBRMaterial.backFaceCulling) {
|
|
4996
4920
|
if (!babylonPBRMaterial._twoSidedLighting) {
|
|
4997
|
-
core_Maths_math_vector__WEBPACK_IMPORTED_MODULE_1__.Tools.Warn(babylonPBRMaterial.name + ": Back-face culling
|
|
4921
|
+
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.");
|
|
4998
4922
|
}
|
|
4999
4923
|
glTFMaterial.doubleSided = true;
|
|
5000
4924
|
}
|