@galacean/engine 0.0.0-experimental-animator-additive.1 → 0.0.0-experimental-animator-additive.3

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/browser.js CHANGED
@@ -17730,6 +17730,7 @@
17730
17730
  var SkinnedMeshRenderer = function SkinnedMeshRenderer(entity) {
17731
17731
  var _this;
17732
17732
  _this = MeshRenderer.call(this, entity) || this;
17733
+ _this._supportSkinning = false;
17733
17734
  _this._hasInitSkin = false;
17734
17735
  _this._jointDataCreateCache = new Vector2(-1, -1);
17735
17736
  _this._localBounds = new BoundingBox();
@@ -17739,7 +17740,7 @@
17739
17740
  // Limit size to 256 to avoid some problem:
17740
17741
  // For renderer is "Apple GPU", when uniform is large than 256 the skeleton matrix array access in shader very slow in Safari or WKWebview. This may be a apple bug, Chrome and Firefox is OK!
17741
17742
  // For renderer is "ANGLE (AMD, AMD Radeon(TM) Graphics Direct3011 vs_5_0 ps_5_0, D3011)", compile shader si very slow because of max uniform is 4096.
17742
- maxVertexUniformVectors = Math.min(maxVertexUniformVectors, 256);
17743
+ maxVertexUniformVectors = Math.min(maxVertexUniformVectors, rhi._options._maxAllowSkinUniformVectorCount);
17743
17744
  _this._maxVertexUniformVectors = maxVertexUniformVectors;
17744
17745
  _this._onLocalBoundsChanged = _this._onLocalBoundsChanged.bind(_assert_this_initialized(_this));
17745
17746
  var localBounds = _this._localBounds;
@@ -17758,9 +17759,8 @@
17758
17759
  this._initSkin();
17759
17760
  this._hasInitSkin = true;
17760
17761
  }
17761
- var skin = this._skin;
17762
- if (skin) {
17763
- var ibms = skin.inverseBindMatrices;
17762
+ if (this._supportSkinning) {
17763
+ var ibms = this._skin.inverseBindMatrices;
17764
17764
  var worldToLocal = this._rootBone.getInvModelMatrix();
17765
17765
  var _this = this, joints = _this._jointEntities, jointMatrices = _this._jointMatrices;
17766
17766
  for(var i = joints.length - 1; i >= 0; i--){
@@ -17779,8 +17779,6 @@
17779
17779
  * @override
17780
17780
  */ _proto._updateShaderData = function _updateShaderData(context) {
17781
17781
  var entity = this.entity;
17782
- var worldMatrix = this._rootBone ? this._rootBone.transform.worldMatrix : entity.transform.worldMatrix;
17783
- this._updateTransformShaderData(context, worldMatrix);
17784
17782
  var shaderData = this.shaderData;
17785
17783
  var mesh = this.mesh;
17786
17784
  var blendShapeManager = mesh._blendShapeManager;
@@ -17807,12 +17805,18 @@
17807
17805
  shaderData.disableMacro("O3_JOINTS_NUM");
17808
17806
  shaderData.enableMacro("O3_USE_JOINT_TEXTURE");
17809
17807
  shaderData.setTexture(SkinnedMeshRenderer._jointSamplerProperty, this._jointTexture);
17808
+ this._supportSkinning = true;
17810
17809
  } else {
17811
- Logger.error("component's joints count(" + jointCount + ") greater than device's MAX_VERTEX_UNIFORM_VECTORS number " + this._maxVertexUniformVectors + ", and don't support jointTexture in this device. suggest joint count less than " + remainUniformJointCount + ".", this);
17810
+ var _this__jointTexture1;
17811
+ this._supportSkinning = false;
17812
+ (_this__jointTexture1 = this._jointTexture) == null ? void 0 : _this__jointTexture1.destroy();
17813
+ shaderData.disableMacro("O3_HAS_SKIN");
17814
+ Logger.warn("component's joints count(" + jointCount + ") greater than device's MAX_VERTEX_UNIFORM_VECTORS number " + this._maxVertexUniformVectors + ", and don't support jointTexture in this device. suggest joint count less than " + remainUniformJointCount + ".", this);
17812
17815
  }
17813
17816
  } else {
17814
- var _this__jointTexture1;
17815
- (_this__jointTexture1 = this._jointTexture) == null ? void 0 : _this__jointTexture1.destroy();
17817
+ var _this__jointTexture2;
17818
+ this._supportSkinning = true;
17819
+ (_this__jointTexture2 = this._jointTexture) == null ? void 0 : _this__jointTexture2.destroy();
17816
17820
  shaderData.disableMacro("O3_USE_JOINT_TEXTURE");
17817
17821
  shaderData.enableMacro("O3_JOINTS_NUM", remainUniformJointCount.toString());
17818
17822
  shaderData.setFloatArray(SkinnedMeshRenderer._jointMatrixProperty, this._jointMatrices);
@@ -17823,6 +17827,8 @@
17823
17827
  this._jointTexture.setPixelBuffer(this._jointMatrices);
17824
17828
  }
17825
17829
  }
17830
+ var worldMatrix = this._supportSkinning && this._rootBone ? this._rootBone.transform.worldMatrix : entity.transform.worldMatrix;
17831
+ this._updateTransformShaderData(context, worldMatrix);
17826
17832
  var layer = entity.layer;
17827
17833
  this._rendererLayer.set(layer & 65535, layer >>> 16 & 65535, 0, 0);
17828
17834
  };
@@ -18017,6 +18023,9 @@
18017
18023
  (function() {
18018
18024
  SkinnedMeshRenderer._jointMatrixProperty = Shader.getPropertyByName("u_jointMatrix");
18019
18025
  })();
18026
+ __decorate$1([
18027
+ ignoreClone
18028
+ ], SkinnedMeshRenderer.prototype, "_supportSkinning", void 0);
18020
18029
  __decorate$1([
18021
18030
  ignoreClone
18022
18031
  ], SkinnedMeshRenderer.prototype, "_hasInitSkin", void 0);
@@ -27016,7 +27025,13 @@
27016
27025
  var _this__animatorLayersData_i = this._animatorLayersData[i1], srcPlayData = _this__animatorLayersData_i.srcPlayData, destPlayData = _this__animatorLayersData_i.destPlayData;
27017
27026
  this._revertCurveOwners(srcPlayData == null ? void 0 : (_srcPlayData_stateData = srcPlayData.stateData) == null ? void 0 : _srcPlayData_stateData.curveOwners);
27018
27027
  this._revertCurveOwners(destPlayData == null ? void 0 : (_destPlayData_stateData = destPlayData.stateData) == null ? void 0 : _destPlayData_stateData.curveOwners);
27019
- this._updateLayer(i1, i1 === 0, deltaTime / 1000, animationUpdate);
27028
+ }
27029
+ for(var i2 = 0, n2 = animatorController.layers.length; i2 < n2; i2++){
27030
+ var animatorLayerData1 = this._getAnimatorLayerData(i2);
27031
+ if (animatorLayerData1.layerState === LayerState.Standby) {
27032
+ continue;
27033
+ }
27034
+ this._updateLayer(i2, i2 === 0, deltaTime / 1000, animationUpdate);
27020
27035
  }
27021
27036
  };
27022
27037
  /**
@@ -31052,7 +31067,8 @@
31052
31067
  webGLMode: 0,
31053
31068
  alpha: false,
31054
31069
  stencil: true,
31055
- _forceFlush: false
31070
+ _forceFlush: false,
31071
+ _maxAllowSkinUniformVectorCount: 256
31056
31072
  }, initializeOptions);
31057
31073
  if (SystemInfo.platform === exports.Platform.IPhone || SystemInfo.platform === exports.Platform.IPad) {
31058
31074
  var version = SystemInfo.operatingSystem.match(/(\d+).?(\d+)?.?(\d+)?/);
@@ -35789,7 +35805,7 @@
35789
35805
  }));
35790
35806
 
35791
35807
  //@ts-ignore
35792
- var version = "0.0.0-experimental-animator-additive.1";
35808
+ var version = "0.0.0-experimental-animator-additive.3";
35793
35809
  console.log("Galacean engine version: " + version);
35794
35810
  for(var key in CoreObjects){
35795
35811
  Loader.registerClass(key, CoreObjects[key]);