@galacean/engine-core 1.3.25 → 1.3.27

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.
@@ -4074,6 +4074,28 @@ __decorate([
4074
4074
  */ Shader.find = function find(name) {
4075
4075
  return Shader._shaderMap[name];
4076
4076
  };
4077
+ /**
4078
+ * @internal
4079
+ */ Shader._clear = function _clear(engine) {
4080
+ var shaderMap = Shader._shaderMap;
4081
+ for(var key in shaderMap){
4082
+ var shader = shaderMap[key];
4083
+ var subShaders = shader._subShaders;
4084
+ for(var i = 0, n = subShaders.length; i < n; i++){
4085
+ var passes = subShaders[i].passes;
4086
+ for(var j = 0, m = passes.length; j < m; j++){
4087
+ var pass = passes[j];
4088
+ var passShaderProgramPools = pass._shaderProgramPools;
4089
+ for(var k = passShaderProgramPools.length - 1; k >= 0; k--){
4090
+ var shaderProgramPool = passShaderProgramPools[k];
4091
+ if (shaderProgramPool.engine !== engine) continue;
4092
+ shaderProgramPool._destroy();
4093
+ passShaderProgramPools.splice(k, 1);
4094
+ }
4095
+ }
4096
+ }
4097
+ }
4098
+ };
4077
4099
  Shader._applyConstRenderStates = function _applyConstRenderStates(renderState, key, value) {
4078
4100
  switch(key){
4079
4101
  case exports.RenderStateDataKey.BlendStateEnabled0:
@@ -8317,6 +8339,7 @@ var /**
8317
8339
  program.uploadUnGroupTextures();
8318
8340
  (pass._renderState || blitMaterial.renderState)._applyStates(engine, false, pass._renderStateDataMap, blitMaterial.shaderData);
8319
8341
  rhi.drawPrimitive(blitMesh._primitive, blitMesh.subMesh, program);
8342
+ rendererShaderData.setTexture(PipelineUtils._blitTextureProperty, null);
8320
8343
  };
8321
8344
  return PipelineUtils;
8322
8345
  }();
@@ -8664,6 +8687,7 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component1) {
8664
8687
  }
8665
8688
  this._renderPipeline.render(context, cubeFace, mipLevel, ignoreClearFlags);
8666
8689
  engine._renderCount++;
8690
+ context.camera = null;
8667
8691
  };
8668
8692
  _proto.setReplacementShader = function setReplacementShader(shader, replacementTag, failureStrategy) {
8669
8693
  if (failureStrategy === void 0) failureStrategy = exports.ReplacementFailureStrategy.KeepOriginalShader;
@@ -9413,17 +9437,20 @@ var ContextRendererUpdateFlag;
9413
9437
  _proto._drawMask = function _drawMask(context, pipelineStageTagValue, master) {
9414
9438
  var incrementMaskQueue = MaskManager.getMaskIncrementRenderQueue();
9415
9439
  incrementMaskQueue.renderQueueType = this.renderQueueType;
9416
- incrementMaskQueue.clear();
9417
9440
  var decrementMaskQueue = MaskManager.getMaskDecrementRenderQueue();
9418
9441
  decrementMaskQueue.renderQueueType = this.renderQueueType;
9419
- decrementMaskQueue.clear();
9420
9442
  var camera = context.camera;
9421
9443
  var engine = camera.engine;
9422
9444
  camera.scene._maskManager.buildMaskRenderElement(master, incrementMaskQueue, decrementMaskQueue);
9445
+ var primitiveChunkManagerMask = engine._batcherManager.primitiveChunkManagerMask;
9423
9446
  incrementMaskQueue._batch(engine._batcherManager);
9447
+ primitiveChunkManagerMask.uploadBuffer();
9424
9448
  incrementMaskQueue.render(context, pipelineStageTagValue, 1);
9449
+ incrementMaskQueue.clear();
9425
9450
  decrementMaskQueue._batch(engine._batcherManager);
9451
+ primitiveChunkManagerMask.uploadBuffer();
9426
9452
  decrementMaskQueue.render(context, pipelineStageTagValue, 2);
9453
+ decrementMaskQueue.clear();
9427
9454
  };
9428
9455
  RenderQueue.compareForOpaque = function compareForOpaque(a, b) {
9429
9456
  return a.priority - b.priority || a.distanceForSort - b.distanceForSort;
@@ -18764,6 +18791,7 @@ __decorate([
18764
18791
  * @internal
18765
18792
  */ var BasicResources = /*#__PURE__*/ function() {
18766
18793
  function BasicResources(engine) {
18794
+ this.engine = engine;
18767
18795
  // prettier-ignore
18768
18796
  var vertices = new Float32Array([
18769
18797
  -1,
@@ -18823,6 +18851,11 @@ __decorate([
18823
18851
  }
18824
18852
  }
18825
18853
  var _proto = BasicResources.prototype;
18854
+ /**
18855
+ * @internal
18856
+ */ _proto._getBlinnPhongMaterial = function _getBlinnPhongMaterial() {
18857
+ return this._blinnPhongMaterial || (this._blinnPhongMaterial = new BlinnPhongMaterial(this.engine));
18858
+ };
18826
18859
  _proto._createBlitMesh = function _createBlitMesh(engine, vertices) {
18827
18860
  var mesh = new ModelMesh(engine);
18828
18861
  mesh._addReferCount(1);
@@ -19578,12 +19611,24 @@ var AssetPromise = /*#__PURE__*/ function() {
19578
19611
  this._onCancelHandler && this._onCancelHandler();
19579
19612
  return this;
19580
19613
  };
19581
- /**
19582
- * Return a new resource Promise through the provided asset promise collection.
19583
- * The resolved of the new AssetPromise will be triggered when all the Promises in the provided set are completed.
19584
- * @param - Promise Collection
19585
- * @returns AssetPromise
19586
- */ AssetPromise.all = function all(promises) {
19614
+ AssetPromise.resolve = function resolve(value) {
19615
+ if (value === undefined) {
19616
+ return new AssetPromise(function(resolve) {
19617
+ return resolve();
19618
+ });
19619
+ } else if (_instanceof(value, AssetPromise) || _instanceof(value, Promise)) {
19620
+ return new AssetPromise(function(resolve, reject) {
19621
+ value.then(function(resolved) {
19622
+ return resolve(resolved);
19623
+ }, reject);
19624
+ });
19625
+ } else {
19626
+ return new AssetPromise(function(resolve) {
19627
+ return resolve(value);
19628
+ });
19629
+ }
19630
+ };
19631
+ AssetPromise.all = function all(values) {
19587
19632
  return new AssetPromise(function(resolve, reject, setTaskCompleteProgress) {
19588
19633
  var onComplete = function onComplete(index, resultValue) {
19589
19634
  completed++;
@@ -19594,7 +19639,7 @@ var AssetPromise = /*#__PURE__*/ function() {
19594
19639
  }
19595
19640
  };
19596
19641
  var onProgress = function onProgress(promise, index) {
19597
- if (_instanceof(promise, Promise) || _instanceof(promise, AssetPromise)) {
19642
+ if (_instanceof(promise, AssetPromise) || _instanceof(promise, Promise)) {
19598
19643
  promise.then(function(value) {
19599
19644
  onComplete(index, value);
19600
19645
  }, reject);
@@ -19604,14 +19649,14 @@ var AssetPromise = /*#__PURE__*/ function() {
19604
19649
  });
19605
19650
  }
19606
19651
  };
19607
- var count = promises.length;
19652
+ var count = Array.from(values).length;
19608
19653
  var results = new Array(count);
19609
19654
  var completed = 0;
19610
19655
  if (count === 0) {
19611
19656
  return resolve(results);
19612
19657
  }
19613
19658
  for(var i = 0; i < count; i++){
19614
- onProgress(promises[i], i);
19659
+ onProgress(values[i], i);
19615
19660
  }
19616
19661
  });
19617
19662
  };
@@ -20193,12 +20238,12 @@ var MultiExecutor = /*#__PURE__*/ function() {
20193
20238
  var obj = this._objectPool[refId];
20194
20239
  var promise;
20195
20240
  if (obj) {
20196
- promise = Promise.resolve(obj);
20241
+ promise = AssetPromise.resolve(obj);
20197
20242
  } else {
20198
20243
  var resourceConfig = this._editorResourceConfig[refId];
20199
20244
  if (!resourceConfig) {
20200
- Logger.warn("refId:" + refId + " is not find in this._editorResourceConfig.");
20201
- return Promise.resolve(null);
20245
+ Logger.warn("refId:" + refId + " is not find in this._idResourceMap.");
20246
+ return AssetPromise.resolve(null);
20202
20247
  }
20203
20248
  var url = resourceConfig.virtualPath;
20204
20249
  if (key) {
@@ -21154,16 +21199,24 @@ var Collision = function Collision() {
21154
21199
  }
21155
21200
  return shape.collider.entity.layer & layerMask && shape.isSceneQuery;
21156
21201
  };
21202
+ var outIDX;
21203
+ var outDistance;
21204
+ var outPosition;
21205
+ var outNormal;
21157
21206
  if (hitResult != undefined) {
21158
21207
  var result = this._nativePhysicsScene.raycast(ray, distance, onRaycast, function(idx, distance, position, normal) {
21159
- var hitShape = _this._scene.engine._physicalObjectsMap[idx];
21160
- hitResult.entity = hitShape._collider.entity;
21161
- hitResult.shape = hitShape;
21162
- hitResult.distance = distance;
21163
- hitResult.normal.copyFrom(normal);
21164
- hitResult.point.copyFrom(position);
21208
+ outIDX = idx;
21209
+ outDistance = distance;
21210
+ outPosition = position;
21211
+ outNormal = normal;
21165
21212
  });
21166
21213
  if (result) {
21214
+ var hitShape = this._scene.engine._physicalObjectsMap[outIDX];
21215
+ hitResult.entity = hitShape._collider.entity;
21216
+ hitResult.shape = hitShape;
21217
+ hitResult.distance = outDistance;
21218
+ hitResult.point.copyFrom(outPosition);
21219
+ hitResult.normal.copyFrom(outNormal);
21167
21220
  return true;
21168
21221
  } else {
21169
21222
  hitResult.entity = null;
@@ -23887,21 +23940,15 @@ ShaderPool.init();
23887
23940
  var _this_xrManager;
23888
23941
  this._sceneManager._destroyAllScene();
23889
23942
  this._resourceManager._destroy();
23890
- this._textDefaultFont = null;
23891
- this._fontMap = null;
23892
23943
  this.inputManager._destroy();
23893
23944
  this._batcherManager.destroy();
23894
23945
  (_this_xrManager = this.xrManager) == null ? void 0 : _this_xrManager._destroy();
23895
23946
  this.dispatch("shutdown", this);
23896
23947
  // Cancel animation
23897
23948
  this.pause();
23949
+ Shader._clear(this);
23898
23950
  this._hardwareRenderer.destroy();
23899
23951
  this.removeAllEventListeners();
23900
- this._animate = null;
23901
- this._sceneManager = null;
23902
- this._resourceManager = null;
23903
- this._canvas = null;
23904
- this._time = null;
23905
23952
  this._waitingDestroy = false;
23906
23953
  this._destroyed = true;
23907
23954
  };
@@ -24069,6 +24116,7 @@ ShaderPool.init();
24069
24116
  this._hardwareRenderer.resetState();
24070
24117
  this._lastRenderState = new RenderState();
24071
24118
  // Clear shader pools
24119
+ Shader._clear(this);
24072
24120
  this._shaderProgramPools.length = 0;
24073
24121
  var resourceManager = this.resourceManager;
24074
24122
  // Restore graphic resources
@@ -27188,11 +27236,13 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
27188
27236
  * @param time - The time to sample an animation
27189
27237
  */ _proto._sampleAnimation = function _sampleAnimation(entity, time) {
27190
27238
  var _this = this, curveBindings = _this._curveBindings;
27239
+ var components = AnimationCurveOwner._components;
27191
27240
  for(var i = curveBindings.length - 1; i >= 0; i--){
27192
27241
  var curve = curveBindings[i];
27193
27242
  var targetEntity = entity.findByPath(curve.relativePath);
27194
27243
  if (targetEntity) {
27195
- var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, AnimationCurveOwner._components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
27244
+ var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
27245
+ components.length = 0;
27196
27246
  if (!component) {
27197
27247
  continue;
27198
27248
  }
@@ -28807,13 +28857,15 @@ exports.AnimatorLayerBlendingMode = void 0;
28807
28857
  var curveLayerOwner = animatorStateData.curveLayerOwner;
28808
28858
  var _animatorState_clip = animatorState.clip, curves = _animatorState_clip._curveBindings;
28809
28859
  var layerCurveOwnerPool = animatorLayerData.curveOwnerPool;
28860
+ var components = AnimationCurveOwner._components;
28810
28861
  for(var i = curves.length - 1; i >= 0; i--){
28811
28862
  var curve = curves[i];
28812
28863
  var relativePath = curve.relativePath;
28813
28864
  var targetEntity = curve.relativePath === "" ? entity : entity.findByPath(curve.relativePath);
28814
28865
  if (targetEntity) {
28815
28866
  var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
28816
- var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, AnimationCurveOwner._components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
28867
+ var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
28868
+ components.length = 0;
28817
28869
  if (!component) {
28818
28870
  continue;
28819
28871
  }
package/dist/module.js CHANGED
@@ -4069,6 +4069,28 @@ __decorate([
4069
4069
  */ Shader.find = function find(name) {
4070
4070
  return Shader._shaderMap[name];
4071
4071
  };
4072
+ /**
4073
+ * @internal
4074
+ */ Shader._clear = function _clear(engine) {
4075
+ var shaderMap = Shader._shaderMap;
4076
+ for(var key in shaderMap){
4077
+ var shader = shaderMap[key];
4078
+ var subShaders = shader._subShaders;
4079
+ for(var i = 0, n = subShaders.length; i < n; i++){
4080
+ var passes = subShaders[i].passes;
4081
+ for(var j = 0, m = passes.length; j < m; j++){
4082
+ var pass = passes[j];
4083
+ var passShaderProgramPools = pass._shaderProgramPools;
4084
+ for(var k = passShaderProgramPools.length - 1; k >= 0; k--){
4085
+ var shaderProgramPool = passShaderProgramPools[k];
4086
+ if (shaderProgramPool.engine !== engine) continue;
4087
+ shaderProgramPool._destroy();
4088
+ passShaderProgramPools.splice(k, 1);
4089
+ }
4090
+ }
4091
+ }
4092
+ }
4093
+ };
4072
4094
  Shader._applyConstRenderStates = function _applyConstRenderStates(renderState, key, value) {
4073
4095
  switch(key){
4074
4096
  case RenderStateElementKey.BlendStateEnabled0:
@@ -8312,6 +8334,7 @@ var /**
8312
8334
  program.uploadUnGroupTextures();
8313
8335
  (pass._renderState || blitMaterial.renderState)._applyStates(engine, false, pass._renderStateDataMap, blitMaterial.shaderData);
8314
8336
  rhi.drawPrimitive(blitMesh._primitive, blitMesh.subMesh, program);
8337
+ rendererShaderData.setTexture(PipelineUtils._blitTextureProperty, null);
8315
8338
  };
8316
8339
  return PipelineUtils;
8317
8340
  }();
@@ -8659,6 +8682,7 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
8659
8682
  }
8660
8683
  this._renderPipeline.render(context, cubeFace, mipLevel, ignoreClearFlags);
8661
8684
  engine._renderCount++;
8685
+ context.camera = null;
8662
8686
  };
8663
8687
  _proto.setReplacementShader = function setReplacementShader(shader, replacementTag, failureStrategy) {
8664
8688
  if (failureStrategy === void 0) failureStrategy = ReplacementFailureStrategy.KeepOriginalShader;
@@ -9408,17 +9432,20 @@ var ContextRendererUpdateFlag;
9408
9432
  _proto._drawMask = function _drawMask(context, pipelineStageTagValue, master) {
9409
9433
  var incrementMaskQueue = MaskManager.getMaskIncrementRenderQueue();
9410
9434
  incrementMaskQueue.renderQueueType = this.renderQueueType;
9411
- incrementMaskQueue.clear();
9412
9435
  var decrementMaskQueue = MaskManager.getMaskDecrementRenderQueue();
9413
9436
  decrementMaskQueue.renderQueueType = this.renderQueueType;
9414
- decrementMaskQueue.clear();
9415
9437
  var camera = context.camera;
9416
9438
  var engine = camera.engine;
9417
9439
  camera.scene._maskManager.buildMaskRenderElement(master, incrementMaskQueue, decrementMaskQueue);
9440
+ var primitiveChunkManagerMask = engine._batcherManager.primitiveChunkManagerMask;
9418
9441
  incrementMaskQueue._batch(engine._batcherManager);
9442
+ primitiveChunkManagerMask.uploadBuffer();
9419
9443
  incrementMaskQueue.render(context, pipelineStageTagValue, 1);
9444
+ incrementMaskQueue.clear();
9420
9445
  decrementMaskQueue._batch(engine._batcherManager);
9446
+ primitiveChunkManagerMask.uploadBuffer();
9421
9447
  decrementMaskQueue.render(context, pipelineStageTagValue, 2);
9448
+ decrementMaskQueue.clear();
9422
9449
  };
9423
9450
  RenderQueue.compareForOpaque = function compareForOpaque(a, b) {
9424
9451
  return a.priority - b.priority || a.distanceForSort - b.distanceForSort;
@@ -18759,6 +18786,7 @@ __decorate([
18759
18786
  * @internal
18760
18787
  */ var BasicResources = /*#__PURE__*/ function() {
18761
18788
  function BasicResources(engine) {
18789
+ this.engine = engine;
18762
18790
  // prettier-ignore
18763
18791
  var vertices = new Float32Array([
18764
18792
  -1,
@@ -18818,6 +18846,11 @@ __decorate([
18818
18846
  }
18819
18847
  }
18820
18848
  var _proto = BasicResources.prototype;
18849
+ /**
18850
+ * @internal
18851
+ */ _proto._getBlinnPhongMaterial = function _getBlinnPhongMaterial() {
18852
+ return this._blinnPhongMaterial || (this._blinnPhongMaterial = new BlinnPhongMaterial(this.engine));
18853
+ };
18821
18854
  _proto._createBlitMesh = function _createBlitMesh(engine, vertices) {
18822
18855
  var mesh = new ModelMesh(engine);
18823
18856
  mesh._addReferCount(1);
@@ -19573,12 +19606,24 @@ var AssetPromise = /*#__PURE__*/ function() {
19573
19606
  this._onCancelHandler && this._onCancelHandler();
19574
19607
  return this;
19575
19608
  };
19576
- /**
19577
- * Return a new resource Promise through the provided asset promise collection.
19578
- * The resolved of the new AssetPromise will be triggered when all the Promises in the provided set are completed.
19579
- * @param - Promise Collection
19580
- * @returns AssetPromise
19581
- */ AssetPromise.all = function all(promises) {
19609
+ AssetPromise.resolve = function resolve(value) {
19610
+ if (value === undefined) {
19611
+ return new AssetPromise(function(resolve) {
19612
+ return resolve();
19613
+ });
19614
+ } else if (_instanceof(value, AssetPromise) || _instanceof(value, Promise)) {
19615
+ return new AssetPromise(function(resolve, reject) {
19616
+ value.then(function(resolved) {
19617
+ return resolve(resolved);
19618
+ }, reject);
19619
+ });
19620
+ } else {
19621
+ return new AssetPromise(function(resolve) {
19622
+ return resolve(value);
19623
+ });
19624
+ }
19625
+ };
19626
+ AssetPromise.all = function all(values) {
19582
19627
  return new AssetPromise(function(resolve, reject, setTaskCompleteProgress) {
19583
19628
  var onComplete = function onComplete(index, resultValue) {
19584
19629
  completed++;
@@ -19589,7 +19634,7 @@ var AssetPromise = /*#__PURE__*/ function() {
19589
19634
  }
19590
19635
  };
19591
19636
  var onProgress = function onProgress(promise, index) {
19592
- if (_instanceof(promise, Promise) || _instanceof(promise, AssetPromise)) {
19637
+ if (_instanceof(promise, AssetPromise) || _instanceof(promise, Promise)) {
19593
19638
  promise.then(function(value) {
19594
19639
  onComplete(index, value);
19595
19640
  }, reject);
@@ -19599,14 +19644,14 @@ var AssetPromise = /*#__PURE__*/ function() {
19599
19644
  });
19600
19645
  }
19601
19646
  };
19602
- var count = promises.length;
19647
+ var count = Array.from(values).length;
19603
19648
  var results = new Array(count);
19604
19649
  var completed = 0;
19605
19650
  if (count === 0) {
19606
19651
  return resolve(results);
19607
19652
  }
19608
19653
  for(var i = 0; i < count; i++){
19609
- onProgress(promises[i], i);
19654
+ onProgress(values[i], i);
19610
19655
  }
19611
19656
  });
19612
19657
  };
@@ -20188,12 +20233,12 @@ var MultiExecutor = /*#__PURE__*/ function() {
20188
20233
  var obj = this._objectPool[refId];
20189
20234
  var promise;
20190
20235
  if (obj) {
20191
- promise = Promise.resolve(obj);
20236
+ promise = AssetPromise.resolve(obj);
20192
20237
  } else {
20193
20238
  var resourceConfig = this._editorResourceConfig[refId];
20194
20239
  if (!resourceConfig) {
20195
- Logger.warn("refId:" + refId + " is not find in this._editorResourceConfig.");
20196
- return Promise.resolve(null);
20240
+ Logger.warn("refId:" + refId + " is not find in this._idResourceMap.");
20241
+ return AssetPromise.resolve(null);
20197
20242
  }
20198
20243
  var url = resourceConfig.virtualPath;
20199
20244
  if (key) {
@@ -21149,16 +21194,24 @@ var Collision = function Collision() {
21149
21194
  }
21150
21195
  return shape.collider.entity.layer & layerMask && shape.isSceneQuery;
21151
21196
  };
21197
+ var outIDX;
21198
+ var outDistance;
21199
+ var outPosition;
21200
+ var outNormal;
21152
21201
  if (hitResult != undefined) {
21153
21202
  var result = this._nativePhysicsScene.raycast(ray, distance, onRaycast, function(idx, distance, position, normal) {
21154
- var hitShape = _this._scene.engine._physicalObjectsMap[idx];
21155
- hitResult.entity = hitShape._collider.entity;
21156
- hitResult.shape = hitShape;
21157
- hitResult.distance = distance;
21158
- hitResult.normal.copyFrom(normal);
21159
- hitResult.point.copyFrom(position);
21203
+ outIDX = idx;
21204
+ outDistance = distance;
21205
+ outPosition = position;
21206
+ outNormal = normal;
21160
21207
  });
21161
21208
  if (result) {
21209
+ var hitShape = this._scene.engine._physicalObjectsMap[outIDX];
21210
+ hitResult.entity = hitShape._collider.entity;
21211
+ hitResult.shape = hitShape;
21212
+ hitResult.distance = outDistance;
21213
+ hitResult.point.copyFrom(outPosition);
21214
+ hitResult.normal.copyFrom(outNormal);
21162
21215
  return true;
21163
21216
  } else {
21164
21217
  hitResult.entity = null;
@@ -23882,21 +23935,15 @@ ShaderPool.init();
23882
23935
  var _this_xrManager;
23883
23936
  this._sceneManager._destroyAllScene();
23884
23937
  this._resourceManager._destroy();
23885
- this._textDefaultFont = null;
23886
- this._fontMap = null;
23887
23938
  this.inputManager._destroy();
23888
23939
  this._batcherManager.destroy();
23889
23940
  (_this_xrManager = this.xrManager) == null ? void 0 : _this_xrManager._destroy();
23890
23941
  this.dispatch("shutdown", this);
23891
23942
  // Cancel animation
23892
23943
  this.pause();
23944
+ Shader._clear(this);
23893
23945
  this._hardwareRenderer.destroy();
23894
23946
  this.removeAllEventListeners();
23895
- this._animate = null;
23896
- this._sceneManager = null;
23897
- this._resourceManager = null;
23898
- this._canvas = null;
23899
- this._time = null;
23900
23947
  this._waitingDestroy = false;
23901
23948
  this._destroyed = true;
23902
23949
  };
@@ -24064,6 +24111,7 @@ ShaderPool.init();
24064
24111
  this._hardwareRenderer.resetState();
24065
24112
  this._lastRenderState = new RenderState();
24066
24113
  // Clear shader pools
24114
+ Shader._clear(this);
24067
24115
  this._shaderProgramPools.length = 0;
24068
24116
  var resourceManager = this.resourceManager;
24069
24117
  // Restore graphic resources
@@ -27183,11 +27231,13 @@ AnimationCurveOwner.registerAssembler(SkinnedMeshRenderer, "blendShapeWeights",
27183
27231
  * @param time - The time to sample an animation
27184
27232
  */ _proto._sampleAnimation = function _sampleAnimation(entity, time) {
27185
27233
  var _this = this, curveBindings = _this._curveBindings;
27234
+ var components = AnimationCurveOwner._components;
27186
27235
  for(var i = curveBindings.length - 1; i >= 0; i--){
27187
27236
  var curve = curveBindings[i];
27188
27237
  var targetEntity = entity.findByPath(curve.relativePath);
27189
27238
  if (targetEntity) {
27190
- var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, AnimationCurveOwner._components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
27239
+ var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
27240
+ components.length = 0;
27191
27241
  if (!component) {
27192
27242
  continue;
27193
27243
  }
@@ -28802,13 +28852,15 @@ var AnimatorLayerBlendingMode;
28802
28852
  var curveLayerOwner = animatorStateData.curveLayerOwner;
28803
28853
  var _animatorState_clip = animatorState.clip, curves = _animatorState_clip._curveBindings;
28804
28854
  var layerCurveOwnerPool = animatorLayerData.curveOwnerPool;
28855
+ var components = AnimationCurveOwner._components;
28805
28856
  for(var i = curves.length - 1; i >= 0; i--){
28806
28857
  var curve = curves[i];
28807
28858
  var relativePath = curve.relativePath;
28808
28859
  var targetEntity = curve.relativePath === "" ? entity : entity.findByPath(curve.relativePath);
28809
28860
  if (targetEntity) {
28810
28861
  var _curveOwnerPool, _instanceId, _propertyOwners, _property, _layerCurveOwnerPool, _instanceId1, _layerPropertyOwners, _property1;
28811
- var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, AnimationCurveOwner._components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
28862
+ var component = curve.typeIndex > 0 ? targetEntity.getComponents(curve.type, components)[curve.typeIndex] : targetEntity.getComponent(curve.type);
28863
+ components.length = 0;
28812
28864
  if (!component) {
28813
28865
  continue;
28814
28866
  }