@galacean/engine-loader 1.4.12 → 1.4.14

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/module.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Utils, ModelMesh, BlendShape, Texture2D, Loader, Entity, Transform, AnimationClip, AnimationEvent, AnimationStringCurve, Keyframe, AnimationBoolCurve, AnimationRefCurve, AnimationQuaternionCurve, AnimationColorCurve, AnimationVector4Curve, AnimationVector3Curve, AnimationVector2Curve, AnimationFloatArrayCurve, AnimationArrayCurve, AnimationFloatCurve, ReferResource, Scene, resourceLoader, AssetPromise, AssetType, AnimatorController, AnimatorControllerLayer, AnimatorStateTransition, AmbientLight, DiffuseMode, TextureCube, TextureFilterMode, TextureCubeFace, request, ContentRestorer, Font, Animator, IndexFormat, VertexElementFormat, GLCapabilityType, Logger, TextureFormat, InterpolationType, SkinnedMeshRenderer, PBRMaterial, BlinnPhongMaterial, PBRSpecularMaterial, TextureCoordinate, RenderFace, VertexElement, Buffer, BufferBindFlag, BufferUsage, Camera, MeshRenderer, Skin, TextureWrapMode as TextureWrapMode$1, AnimatorStateMachine, SystemInfo, Shader, Material, PrimitiveMesh, SpriteAtlas, Sprite, AudioClip, AudioManager, ShaderFactory, ShaderLib, PhysicsMaterial, BackgroundMode, DirectLight, PointLight, SpotLight, UnlitMaterial } from '@galacean/engine-core';
1
+ import { Utils, ModelMesh, BlendShape, Texture2D, Loader, Entity, Transform, AnimationClip, AnimationEvent, AnimationStringCurve, Keyframe, AnimationBoolCurve, AnimationRefCurve, AnimationQuaternionCurve, AnimationColorCurve, AnimationVector4Curve, AnimationVector3Curve, AnimationVector2Curve, AnimationFloatArrayCurve, AnimationArrayCurve, AnimationFloatCurve, ReferResource, Scene, resourceLoader, AssetPromise, AssetType, AnimatorController, AnimatorControllerLayer, AnimatorStateTransition, AmbientLight, DiffuseMode, TextureCube, TextureFilterMode, TextureCubeFace, request, ContentRestorer, Font, Animator, IndexFormat, VertexElementFormat, GLCapabilityType, Logger, TextureFormat, InterpolationType, SkinnedMeshRenderer, PBRMaterial, PBRSpecularMaterial, TextureCoordinate, RenderFace, VertexElement, Buffer, BufferBindFlag, BufferUsage, Camera, MeshRenderer, Skin, TextureWrapMode as TextureWrapMode$1, AnimatorStateMachine, SystemInfo, Shader, Material, PrimitiveMesh, SpriteAtlas, Sprite, AudioClip, AudioManager, ShaderFactory, ShaderLib, PhysicsMaterial, BackgroundMode, DirectLight, PointLight, SpotLight, UnlitMaterial } from '@galacean/engine-core';
2
2
  import { Color, Vector4, Vector3, Vector2, Quaternion, SphericalHarmonics3, MathUtil, BoundingBox, Matrix, Rect } from '@galacean/engine-math';
3
3
  import { GLCompressedTextureInternalFormat } from '@galacean/engine-rhi-webgl';
4
4
 
@@ -4262,17 +4262,14 @@ var GLTFMaterialParser = /*#__PURE__*/ function(GLTFParser1) {
4262
4262
  GLTFMaterialParser._parseStandardProperty(context, material, materialInfo);
4263
4263
  }
4264
4264
  return Promise.resolve(material).then(function(material) {
4265
- material || (material = GLTFMaterialParser._getDefaultMaterial(engine));
4265
+ // @ts-ignore
4266
+ material || (material = engine._basicResources._getBlinnPhongMaterial());
4266
4267
  GLTFParser.executeExtensionsAdditiveAndParse(materialInfo.extensions, context, material, materialInfo);
4267
4268
  // @ts-ignore
4268
4269
  material._associationSuperResource(glTFResource);
4269
4270
  return material;
4270
4271
  });
4271
4272
  };
4272
- /** @internal */ GLTFMaterialParser._getDefaultMaterial = function _getDefaultMaterial(engine) {
4273
- var _GLTFMaterialParser;
4274
- return (_GLTFMaterialParser = GLTFMaterialParser)._defaultMaterial || (_GLTFMaterialParser._defaultMaterial = new BlinnPhongMaterial(engine));
4275
- };
4276
4273
  /**
4277
4274
  * @internal
4278
4275
  */ GLTFMaterialParser._checkOtherTextureTransform = function _checkOtherTextureTransform(texture, textureName) {
@@ -4686,7 +4683,7 @@ var GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
4686
4683
  Promise.all(materialPromises)
4687
4684
  ]).then(function(param) {
4688
4685
  var _loop = function(i) {
4689
- var material = materials[i] || GLTFMaterialParser._getDefaultMaterial(context.glTFResource.engine);
4686
+ var material = materials[i] || basicResources._getBlinnPhongMaterial();
4690
4687
  var glTFPrimitive = glTFMeshPrimitives[i];
4691
4688
  var mesh = meshes[i];
4692
4689
  var renderer = void 0;
@@ -4715,6 +4712,8 @@ var GLTFSceneParser = /*#__PURE__*/ function(GLTFParser1) {
4715
4712
  GLTFParser.executeExtensionsAdditiveAndParse(glTFPrimitive.extensions, context, renderer, glTFPrimitive);
4716
4713
  };
4717
4714
  var meshes = param[0], skin = param[1], materials = param[2];
4715
+ // @ts-ignore
4716
+ var basicResources = context.glTFResource.engine._basicResources;
4718
4717
  for(var i = 0; i < rendererCount; i++)_loop(i);
4719
4718
  });
4720
4719
  };