@galacean/engine-loader 1.5.5 → 1.5.6
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/dist/main.js +10 -2
- package/dist/main.js.map +1 -1
- package/dist/module.js +10 -2
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
package/dist/module.js
CHANGED
|
@@ -4534,6 +4534,8 @@ GLTFEntityParser = __decorate([
|
|
|
4534
4534
|
registerGLTFParser(GLTFParserType.Entity)
|
|
4535
4535
|
], GLTFEntityParser);
|
|
4536
4536
|
|
|
4537
|
+
// @todo: remap plugin should have a higher priority storage location
|
|
4538
|
+
var REMAP_NAME = "GALACEAN_materials_remap";
|
|
4537
4539
|
var GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
4538
4540
|
_inherits(GLTFMaterialParser, GLTFParser1);
|
|
4539
4541
|
function GLTFMaterialParser() {
|
|
@@ -4544,7 +4546,13 @@ var GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4544
4546
|
var materialInfo = context.glTF.materials[index];
|
|
4545
4547
|
var glTFResource = context.glTFResource;
|
|
4546
4548
|
var engine = glTFResource.engine;
|
|
4547
|
-
var
|
|
4549
|
+
var extensions = materialInfo.extensions || {};
|
|
4550
|
+
//Keep only the remap extension
|
|
4551
|
+
if (extensions[REMAP_NAME]) {
|
|
4552
|
+
var _obj;
|
|
4553
|
+
extensions = (_obj = {}, _obj[REMAP_NAME] = extensions[REMAP_NAME], _obj);
|
|
4554
|
+
}
|
|
4555
|
+
var material = GLTFParser.executeExtensionsCreateAndParse(extensions, context, materialInfo);
|
|
4548
4556
|
if (!material) {
|
|
4549
4557
|
material = new PBRMaterial(engine);
|
|
4550
4558
|
material.name = materialInfo.name;
|
|
@@ -4553,7 +4561,7 @@ var GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
|
|
|
4553
4561
|
return AssetPromise.resolve(material).then(function(material) {
|
|
4554
4562
|
// @ts-ignore
|
|
4555
4563
|
material || (material = engine._basicResources._getBlinnPhongMaterial());
|
|
4556
|
-
GLTFParser.executeExtensionsAdditiveAndParse(
|
|
4564
|
+
GLTFParser.executeExtensionsAdditiveAndParse(extensions, context, material, materialInfo);
|
|
4557
4565
|
// @ts-ignore
|
|
4558
4566
|
material._associationSuperResource(glTFResource);
|
|
4559
4567
|
return material;
|