@galacean/engine-core 1.5.12 → 1.5.13

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 CHANGED
@@ -4752,7 +4752,7 @@ var particle_common = "\n\nvec3 rotationByEuler(in vec3 vector, in vec3 rot) {\n
4752
4752
 
4753
4753
  var velocity_over_lifetime_module = "#if defined(RENDERER_VOL_CONSTANT_MODE) || defined(RENDERER_VOL_CURVE_MODE)\n #define _VOL_MODULE_ENABLED\n#endif\n\n#ifdef _VOL_MODULE_ENABLED\n uniform int renderer_VOLSpace;\n\n #ifdef RENDERER_VOL_CONSTANT_MODE\n uniform vec3 renderer_VOLMaxConst;\n\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n uniform vec3 renderer_VOLMinConst;\n #endif\n #endif\n\n #ifdef RENDERER_VOL_CURVE_MODE\n uniform vec2 renderer_VOLMaxGradientX[4]; // x:time y:value\n uniform vec2 renderer_VOLMaxGradientY[4]; // x:time y:value\n uniform vec2 renderer_VOLMaxGradientZ[4]; // x:time y:value\n\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n uniform vec2 renderer_VOLMinGradientX[4]; // x:time y:value\n uniform vec2 renderer_VOLMinGradientY[4]; // x:time y:value\n uniform vec2 renderer_VOLMinGradientZ[4]; // x:time y:value\n #endif\n #endif\n\n\n vec3 computeVelocityPositionOffset(in float normalizedAge, in float age, out vec3 currentVelocity) {\n vec3 velocityPosition;\n\n #ifdef RENDERER_VOL_CONSTANT_MODE\n currentVelocity = renderer_VOLMaxConst;\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n currentVelocity = mix(renderer_VOLMinConst, currentVelocity, a_Random1.yzw);\n #endif\n\n velocityPosition = currentVelocity * age;\n #endif\n\n #ifdef RENDERER_VOL_CURVE_MODE\n velocityPosition = vec3(\n evaluateParticleCurveCumulative(renderer_VOLMaxGradientX, normalizedAge, currentVelocity.x),\n evaluateParticleCurveCumulative(renderer_VOLMaxGradientY, normalizedAge, currentVelocity.y),\n evaluateParticleCurveCumulative(renderer_VOLMaxGradientZ, normalizedAge, currentVelocity.z));\n\n #ifdef RENDERER_VOL_IS_RANDOM_TWO\n vec3 minCurrentVelocity;\n vec3 minVelocityPosition = vec3(\n evaluateParticleCurveCumulative(renderer_VOLMinGradientX, normalizedAge, minCurrentVelocity.x),\n evaluateParticleCurveCumulative(renderer_VOLMinGradientY, normalizedAge, minCurrentVelocity.y),\n evaluateParticleCurveCumulative(renderer_VOLMinGradientZ, normalizedAge, minCurrentVelocity.z));\n\n currentVelocity = mix(minCurrentVelocity, currentVelocity, a_Random1.yzw);\n velocityPosition = mix(minVelocityPosition, velocityPosition, a_Random1.yzw);\n #endif\n\n velocityPosition *= vec3(a_ShapePositionStartLifeTime.w);\n #endif\n return velocityPosition;\n }\n#endif\n"; // eslint-disable-line
4754
4754
 
4755
- var rotation_over_lifetime_module = "#if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n uniform vec2 renderer_ROLMaxCurveZ[4];\n // #ifdef RENDERER_ROL_IS_SEPARATE\n // uniform vec2 renderer_ROLMaxCurveX[4];\n // uniform vec2 renderer_ROLMaxCurveY[4];\n // #endif\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec2 renderer_ROLMinCurveZ[4];\n // #ifdef RENDERER_ROL_IS_SEPARATE\n // uniform vec2 renderer_ROLMinCurveX[4];\n // uniform vec2 renderer_ROLMinCurveY[4];\n // #endif\n #endif\n #else\n uniform vec3 renderer_ROLMaxConst;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec3 renderer_ROLMinConst;\n #endif\n #endif\n#endif\n\nfloat computeParticleRotationFloat(in float rotation, in float age, in float normalizedAge) {\n #if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n float lifeRotation = evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge);\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveZ, normalizedAge), lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * a_ShapePositionStartLifeTime.w;\n #else\n float lifeRotation = renderer_ROLMaxConst.z;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(renderer_ROLMinConst.z, lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * age;\n #endif\n #endif\n return rotation;\n}\n\n\n#if defined(RENDERER_MODE_MESH) && (defined(ROTATION_OVER_LIFETIME) || defined(ROTATION_OVER_LIFETIME_SEPARATE))\nvec3 computeParticleRotationVec3(in vec3 rotation,\n in float age,\n in float normalizedAge) {\n#ifdef ROTATION_OVER_LIFETIME\n #ifdef ROTATION_OVER_LIFETIME_CONSTANT\n float ageRot = u_ROLAngularVelocityConst * age;\n rotation += ageRot;\n #endif\n #ifdef ROTATION_OVER_LIFETIME_CURVE\n rotation += getTotalValueFromGradientFloat(u_ROLAngularVelocityGradient, normalizedAge);\n #endif\n #ifdef ROTATION_OVER_LIFETIME_RANDOM_CONSTANTS\n float ageRot = mix(u_ROLAngularVelocityConst, u_ROLAngularVelocityConstMax, a_Random0.w) * age;\n rotation += ageRot;\n #endif\n #ifdef ROTATION_OVER_LIFETIME_RANDOM_CURVES\n rotation += mix(\n getTotalValueFromGradientFloat(u_ROLAngularVelocityGradient, normalizedAge),\n getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientMax,\n normalizedAge),\n a_Random0.w);\n #endif\n#endif\n\n#ifdef ROTATION_OVER_LIFETIME_SEPARATE\n #ifdef ROTATION_OVER_LIFETIME_CONSTANT\n vec3 ageRot = u_ROLAngularVelocityConstSeparate * age;\n rotation += ageRot;\n #endif\n #ifdef ROTATION_OVER_LIFETIME_CURVE\n rotation += vec3(getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientX,\n normalizedAge),\n getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientY,\n normalizedAge),\n getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientZ,\n normalizedAge));\n #endif\n #ifdef ROTATION_OVER_LIFETIME_RANDOM_CONSTANTS\n vec3 ageRot = mix(u_ROLAngularVelocityConstSeparate,\n renderer_ROLMaxConst,\n a_Random0.w)\n * age;\n rotation += ageRot;\n #endif\n #ifdef ROTATION_OVER_LIFETIME_RANDOM_CURVES\n rotation += vec3(mix(getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientX,\n normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveX,\n normalizedAge),\n a_Random0.w),\n mix(getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientY,\n normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveY,\n normalizedAge),\n a_Random0.w),\n mix(getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientZ,\n normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveZ,\n normalizedAge),\n a_Random0.w));\n #endif\n#endif\n return rotation;\n}\n#endif\n"; // eslint-disable-line
4755
+ var rotation_over_lifetime_module = "#if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n uniform vec2 renderer_ROLMaxCurveZ[4];\n // #ifdef RENDERER_ROL_IS_SEPARATE\n // uniform vec2 renderer_ROLMaxCurveX[4];\n // uniform vec2 renderer_ROLMaxCurveY[4];\n // #endif\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec2 renderer_ROLMinCurveZ[4];\n // #ifdef RENDERER_ROL_IS_SEPARATE\n // uniform vec2 renderer_ROLMinCurveX[4];\n // uniform vec2 renderer_ROLMinCurveY[4];\n // #endif\n #endif\n #else\n uniform vec3 renderer_ROLMaxConst;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n uniform vec3 renderer_ROLMinConst;\n #endif\n #endif\n#endif\n\nfloat computeParticleRotationFloat(in float rotation, in float age, in float normalizedAge) {\n #if defined(RENDERER_ROL_CONSTANT_MODE) || defined(RENDERER_ROL_CURVE_MODE)\n #ifdef RENDERER_ROL_CURVE_MODE\n float currentValue;\n float lifeRotation = evaluateParticleCurveCumulative(renderer_ROLMaxCurveZ, normalizedAge, currentValue);\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(evaluateParticleCurveCumulative(renderer_ROLMinCurveZ, normalizedAge, currentValue), lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * a_ShapePositionStartLifeTime.w;\n #else\n float lifeRotation = renderer_ROLMaxConst.z;\n #ifdef RENDERER_ROL_IS_RANDOM_TWO\n lifeRotation = mix(renderer_ROLMinConst.z, lifeRotation, a_Random0.w);\n #endif\n rotation += lifeRotation * age;\n #endif\n #endif\n return rotation;\n}\n\n\n#if defined(RENDERER_MODE_MESH) && (defined(ROTATION_OVER_LIFETIME) || defined(ROTATION_OVER_LIFETIME_SEPARATE))\nvec3 computeParticleRotationVec3(in vec3 rotation,\n in float age,\n in float normalizedAge) {\n#ifdef ROTATION_OVER_LIFETIME\n #ifdef ROTATION_OVER_LIFETIME_CONSTANT\n float ageRot = u_ROLAngularVelocityConst * age;\n rotation += ageRot;\n #endif\n #ifdef ROTATION_OVER_LIFETIME_CURVE\n rotation += getTotalValueFromGradientFloat(u_ROLAngularVelocityGradient, normalizedAge);\n #endif\n #ifdef ROTATION_OVER_LIFETIME_RANDOM_CONSTANTS\n float ageRot = mix(u_ROLAngularVelocityConst, u_ROLAngularVelocityConstMax, a_Random0.w) * age;\n rotation += ageRot;\n #endif\n #ifdef ROTATION_OVER_LIFETIME_RANDOM_CURVES\n rotation += mix(\n getTotalValueFromGradientFloat(u_ROLAngularVelocityGradient, normalizedAge),\n getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientMax,\n normalizedAge),\n a_Random0.w);\n #endif\n#endif\n\n#ifdef ROTATION_OVER_LIFETIME_SEPARATE\n #ifdef ROTATION_OVER_LIFETIME_CONSTANT\n vec3 ageRot = u_ROLAngularVelocityConstSeparate * age;\n rotation += ageRot;\n #endif\n #ifdef ROTATION_OVER_LIFETIME_CURVE\n rotation += vec3(getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientX,\n normalizedAge),\n getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientY,\n normalizedAge),\n getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientZ,\n normalizedAge));\n #endif\n #ifdef ROTATION_OVER_LIFETIME_RANDOM_CONSTANTS\n vec3 ageRot = mix(u_ROLAngularVelocityConstSeparate,\n renderer_ROLMaxConst,\n a_Random0.w)\n * age;\n rotation += ageRot;\n #endif\n #ifdef ROTATION_OVER_LIFETIME_RANDOM_CURVES\n rotation += vec3(mix(getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientX,\n normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveX,\n normalizedAge),\n a_Random0.w),\n mix(getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientY,\n normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveY,\n normalizedAge),\n a_Random0.w),\n mix(getTotalValueFromGradientFloat(u_ROLAngularVelocityGradientZ,\n normalizedAge),\n getTotalValueFromGradientFloat(renderer_ROLMaxCurveZ,\n normalizedAge),\n a_Random0.w));\n #endif\n#endif\n return rotation;\n}\n#endif\n"; // eslint-disable-line
4756
4756
 
4757
4757
  var size_over_lifetime_module = "#ifdef RENDERER_SOL_CURVE_MODE\n uniform vec2 renderer_SOLMaxCurveX[4]; // x:time y:value\n #ifdef RENDERER_SOL_IS_SEPARATE\n uniform vec2 renderer_SOLMaxCurveY[4]; // x:time y:value\n uniform vec2 renderer_SOLMaxCurveZ[4]; // x:time y:value\n #endif\n\n #ifdef RENDERER_SOL_IS_RANDOM_TWO\n uniform vec2 renderer_SOLMinCurveX[4]; // x:time y:value\n #ifdef RENDERER_SOL_IS_SEPARATE\n uniform vec2 renderer_SOLMinCurveY[4]; // x:time y:value\n uniform vec2 renderer_SOLMinCurveZ[4]; // x:time y:value\n #endif\n #endif\n#endif\n\nvec2 computeParticleSizeBillboard(in vec2 size, in float normalizedAge) {\n #ifdef RENDERER_SOL_CURVE_MODE\n float lifeSizeX = evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge);\n #ifdef RENDERER_SOL_IS_RANDOM_TWO\n lifeSizeX = mix(evaluateParticleCurve(renderer_SOLMinCurveX, normalizedAge), lifeSizeX, a_Random0.z);\n #endif\n\n #ifdef RENDERER_SOL_IS_SEPARATE\n float lifeSizeY = evaluateParticleCurve(renderer_SOLMaxCurveY, normalizedAge);\n #ifdef RENDERER_SOL_IS_RANDOM_TWO\n lifeSizeY = mix(evaluateParticleCurve(renderer_SOLMinCurveY, normalizedAge), lifeSizeY, a_Random0.z);\n #endif\n size *= vec2(lifeSizeX, lifeSizeY);\n #else\n size *= lifeSizeX;\n #endif\n #endif\n return size;\n}\n\n#ifdef RENDERER_MODE_MESH\n vec3 computeParticleSizeMesh(in vec3 size, in float normalizedAge) {\n #ifdef RENDERER_SOL_CURVE\n size *= evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge);\n #endif\n #ifdef RENDERER_SOL_RANDOM_CURVES\n size *= mix(evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge),\n evaluateParticleCurve(u_SOLSizeGradientMax, normalizedAge),\n a_Random0.z);\n #endif\n #ifdef RENDERER_SOL_CURVE_SEPARATE\n size *= vec3(evaluateParticleCurve(renderer_SOLMinCurveX, normalizedAge),\n evaluateParticleCurve(renderer_SOLMinCurveY, normalizedAge),\n evaluateParticleCurve(renderer_SOLMinCurveZ, normalizedAge));\n #endif\n #ifdef RENDERER_SOL_RANDOM_CURVES_SEPARATE\n size *= vec3(mix(evaluateParticleCurve(renderer_SOLMinCurveX, normalizedAge),\n evaluateParticleCurve(renderer_SOLMaxCurveX, normalizedAge),\n a_Random0.z),\n mix(evaluateParticleCurve(renderer_SOLMinCurveY, normalizedAge),\n evaluateParticleCurve(renderer_SOLMaxCurveY, normalizedAge),\n a_Random0.z),\n mix(evaluateParticleCurve(renderer_SOLMinCurveZ, normalizedAge),\n evaluateParticleCurve(renderer_SOLMaxCurveZ, normalizedAge),\n a_Random0.z));\n #endif\n return size;\n }\n#endif"; // eslint-disable-line
4758
4758
 
@@ -8458,15 +8458,30 @@ __decorate([
8458
8458
  /**
8459
8459
  * @internal
8460
8460
  */ var VirtualCamera = function VirtualCamera() {
8461
- this.position = new engineMath.Vector3();
8462
8461
  this.isOrthographic = false;
8462
+ this.nearClipPlane = 0.1;
8463
+ this.farClipPlane = 100;
8464
+ this.position = new engineMath.Vector3();
8463
8465
  this.viewMatrix = new engineMath.Matrix();
8464
8466
  this.projectionMatrix = new engineMath.Matrix();
8465
8467
  this.viewProjectionMatrix = new engineMath.Matrix();
8466
- this.nearClipPlane = 0.1;
8467
- this.farClipPlane = 100;
8468
8468
  /** Only orth mode use. */ this.forward = new engineMath.Vector3();
8469
8469
  };
8470
+ __decorate([
8471
+ ignoreClone
8472
+ ], VirtualCamera.prototype, "position", void 0);
8473
+ __decorate([
8474
+ ignoreClone
8475
+ ], VirtualCamera.prototype, "viewMatrix", void 0);
8476
+ __decorate([
8477
+ ignoreClone
8478
+ ], VirtualCamera.prototype, "projectionMatrix", void 0);
8479
+ __decorate([
8480
+ ignoreClone
8481
+ ], VirtualCamera.prototype, "viewProjectionMatrix", void 0);
8482
+ __decorate([
8483
+ ignoreClone
8484
+ ], VirtualCamera.prototype, "forward", void 0);
8470
8485
 
8471
8486
  /**
8472
8487
  * The anti-aliasing mode.
@@ -8588,7 +8603,7 @@ exports.Camera = /*#__PURE__*/ function(Component) {
8588
8603
  * Set to true if you need to ensure the alpha channel is preserved, for example, when performing canvas transparent blending.
8589
8604
  *
8590
8605
  * @defaultValue `false`
8591
- */ _this.isAlphaOutputRequired = false, /** @internal */ _this._cameraType = CameraType.Normal, /** @internal */ _this._globalShaderMacro = new ShaderMacroCollection(), /** @internal */ _this._frustum = new engineMath.BoundingFrustum(), /** @internal */ _this._virtualCamera = new VirtualCamera(), /** @internal */ _this._replacementShader = null, /** @internal */ _this._replacementSubShaderTag = null, /** @internal */ _this._replacementFailureStrategy = null, /** @internal */ _this._cameraIndex = -1, _this._priority = 0, _this._shaderData = new ShaderData(ShaderDataGroup.Camera), _this._isCustomViewMatrix = false, _this._isCustomProjectionMatrix = false, _this._fieldOfView = 45, _this._orthographicSize = 10, _this._isProjectionDirty = true, _this._isInvProjMatDirty = true, _this._customAspectRatio = undefined, _this._renderTarget = null, _this._depthBufferParams = new engineMath.Vector4(), _this._opaqueTextureEnabled = false, _this._enableHDR = false, _this._enablePostProcess = false, _this._viewport = new engineMath.Vector4(0, 0, 1, 1), _this._pixelViewport = new engineMath.Rect(0, 0, 0, 0), _this._inverseProjectionMatrix = new engineMath.Matrix(), _this._invViewProjMat = new engineMath.Matrix();
8606
+ */ _this.isAlphaOutputRequired = false, /** @internal */ _this._cameraType = CameraType.Normal, /** @internal */ _this._globalShaderMacro = new ShaderMacroCollection(), /** @internal */ _this._frustum = new engineMath.BoundingFrustum(), /** @internal */ _this._virtualCamera = new VirtualCamera(), /** @internal */ _this._replacementShader = null, /** @internal */ _this._replacementSubShaderTag = null, /** @internal */ _this._replacementFailureStrategy = null, /** @internal */ _this._cameraIndex = -1, _this._priority = 0, _this._isCustomViewMatrix = false, _this._isCustomProjectionMatrix = false, _this._fieldOfView = 45, _this._orthographicSize = 10, _this._isProjectionDirty = true, _this._isInvProjMatDirty = true, _this._customAspectRatio = undefined, _this._opaqueTextureEnabled = false, _this._enableHDR = false, _this._enablePostProcess = false, _this._renderTarget = null, _this._shaderData = new ShaderData(ShaderDataGroup.Camera), _this._depthBufferParams = new engineMath.Vector4(), _this._viewport = new engineMath.Vector4(0, 0, 1, 1), _this._pixelViewport = new engineMath.Rect(0, 0, 0, 0), _this._inverseProjectionMatrix = new engineMath.Matrix(), _this._invViewProjMat = new engineMath.Matrix();
8592
8607
  // Includes hardware detection correction
8593
8608
  _this.msaaSamples = MSAASamples.FourX;
8594
8609
  _this._isViewMatrixDirty = entity.registerWorldChangeFlag();
@@ -8858,6 +8873,12 @@ exports.Camera = /*#__PURE__*/ function(Component) {
8858
8873
  };
8859
8874
  /**
8860
8875
  * @internal
8876
+ */ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
8877
+ var _this__renderTarget;
8878
+ (_this__renderTarget = this._renderTarget) == null ? void 0 : _this__renderTarget._addReferCount(1);
8879
+ };
8880
+ /**
8881
+ * @internal
8861
8882
  * @inheritdoc
8862
8883
  */ _proto._onDestroy = function _onDestroy() {
8863
8884
  var _this__renderPipeline;
@@ -8866,6 +8887,7 @@ exports.Camera = /*#__PURE__*/ function(Component) {
8866
8887
  this._isInvViewProjDirty.destroy();
8867
8888
  this._isViewMatrixDirty.destroy();
8868
8889
  this._addResourceReferCount(this.shaderData, -1);
8890
+ this._renderTarget && this._addResourceReferCount(this._renderTarget, -1);
8869
8891
  //@ts-ignore
8870
8892
  this._viewport._onValueChanged = null;
8871
8893
  this.engine.canvas._sizeUpdateFlagManager.removeListener(this._onPixelViewportChanged);
@@ -9240,6 +9262,12 @@ exports.Camera._cameraPositionProperty = ShaderProperty.getByName("camera_Positi
9240
9262
  exports.Camera._cameraForwardProperty = ShaderProperty.getByName("camera_Forward");
9241
9263
  exports.Camera._cameraUpProperty = ShaderProperty.getByName("camera_Up");
9242
9264
  exports.Camera._cameraDepthBufferParamsProperty = ShaderProperty.getByName("camera_DepthBufferParams");
9265
+ __decorate([
9266
+ ignoreClone
9267
+ ], exports.Camera.prototype, "_cameraType", void 0);
9268
+ __decorate([
9269
+ ignoreClone
9270
+ ], exports.Camera.prototype, "_globalShaderMacro", void 0);
9243
9271
  __decorate([
9244
9272
  deepClone
9245
9273
  ], exports.Camera.prototype, "_frustum", void 0);
@@ -9247,7 +9275,7 @@ __decorate([
9247
9275
  ignoreClone
9248
9276
  ], exports.Camera.prototype, "_renderPipeline", void 0);
9249
9277
  __decorate([
9250
- ignoreClone
9278
+ deepClone
9251
9279
  ], exports.Camera.prototype, "_virtualCamera", void 0);
9252
9280
  __decorate([
9253
9281
  ignoreClone
@@ -9264,6 +9292,12 @@ __decorate([
9264
9292
  __decorate([
9265
9293
  ignoreClone
9266
9294
  ], exports.Camera.prototype, "_isInvViewProjDirty", void 0);
9295
+ __decorate([
9296
+ deepClone
9297
+ ], exports.Camera.prototype, "_shaderData", void 0);
9298
+ __decorate([
9299
+ ignoreClone
9300
+ ], exports.Camera.prototype, "_depthBufferParams", void 0);
9267
9301
  __decorate([
9268
9302
  deepClone
9269
9303
  ], exports.Camera.prototype, "_viewport", void 0);
@@ -26907,7 +26941,7 @@ AmbientLight._mipLevelProperty = ShaderProperty.getByName("scene_EnvMapLight.mip
26907
26941
  */ _this.cullingMask = Layer.Everything, /** How this light casts shadows. */ _this.shadowType = ShadowType.None, /** Shadow bias.*/ _this.shadowBias = 1, /** Shadow mapping normal-based bias. */ _this.shadowNormalBias = 1, /**
26908
26942
  * @deprecated
26909
26943
  * Please use `shadowNearPlaneOffset` instead.
26910
- */ _this.shadowNearPlane = 0.1, /** @internal */ _this._lightIndex = -1, /** @internal */ _this._lightColor = new engineMath.Color(), _this._shadowStrength = 1.0, _this._color = new engineMath.Color(1, 1, 1, 1);
26944
+ */ _this.shadowNearPlane = 0.1, /** @internal */ _this._lightIndex = -1, _this._shadowStrength = 1.0, _this._color = new engineMath.Color(1, 1, 1, 1);
26911
26945
  return _this;
26912
26946
  }
26913
26947
  _create_class(Light, [
@@ -26959,6 +26993,15 @@ AmbientLight._mipLevelProperty = ShaderProperty.getByName("scene_EnvMapLight.mip
26959
26993
  __decorate([
26960
26994
  ignoreClone
26961
26995
  ], Light.prototype, "_lightIndex", void 0);
26996
+ __decorate([
26997
+ deepClone
26998
+ ], Light.prototype, "_color", void 0);
26999
+ __decorate([
27000
+ ignoreClone
27001
+ ], Light.prototype, "_viewMat", void 0);
27002
+ __decorate([
27003
+ ignoreClone
27004
+ ], Light.prototype, "_inverseViewMat", void 0);
26962
27005
 
26963
27006
  /**
26964
27007
  * Directional light.
@@ -27031,6 +27074,9 @@ __decorate([
27031
27074
  DirectLight._cullingMaskProperty = ShaderProperty.getByName("scene_DirectLightCullingMask");
27032
27075
  DirectLight._colorProperty = ShaderProperty.getByName("scene_DirectLightColor");
27033
27076
  DirectLight._directionProperty = ShaderProperty.getByName("scene_DirectLightDirection");
27077
+ __decorate([
27078
+ ignoreClone
27079
+ ], DirectLight.prototype, "_reverseDirection", void 0);
27034
27080
 
27035
27081
  /**
27036
27082
  * Point light.
@@ -27102,7 +27148,7 @@ PointLight._distanceProperty = ShaderProperty.getByName("scene_PointLightDistanc
27102
27148
  _inherits(SpotLight, Light);
27103
27149
  function SpotLight() {
27104
27150
  var _this;
27105
- _this = Light.apply(this, arguments) || this, /** Defines a distance cutoff at which the light's intensity must be considered zero. */ _this.distance = 100, /** Angle, in radians, from centre of spotlight where falloff begins. */ _this.angle = Math.PI / 6, /** Angle, in radians, from falloff begins to ends. */ _this.penumbra = Math.PI / 12, _this._inverseDirection = new engineMath.Vector3(), _this._projectMatrix = new engineMath.Matrix();
27151
+ _this = Light.apply(this, arguments) || this, /** Defines a distance cutoff at which the light's intensity must be considered zero. */ _this.distance = 100, /** Angle, in radians, from centre of spotlight where falloff begins. */ _this.angle = Math.PI / 6, /** Angle, in radians, from falloff begins to ends. */ _this.penumbra = Math.PI / 12, _this._inverseDirection = new engineMath.Vector3();
27106
27152
  return _this;
27107
27153
  }
27108
27154
  var _proto = SpotLight.prototype;
@@ -27190,6 +27236,9 @@ SpotLight._directionProperty = ShaderProperty.getByName("scene_SpotLightDirectio
27190
27236
  SpotLight._distanceProperty = ShaderProperty.getByName("scene_SpotLightDistance");
27191
27237
  SpotLight._angleCosProperty = ShaderProperty.getByName("scene_SpotLightAngleCos");
27192
27238
  SpotLight._penumbraCosProperty = ShaderProperty.getByName("scene_SpotLightPenumbraCos");
27239
+ __decorate([
27240
+ ignoreClone
27241
+ ], SpotLight.prototype, "_inverseDirection", void 0);
27193
27242
 
27194
27243
  /**
27195
27244
  * Light manager.
@@ -27521,7 +27570,7 @@ SpotLight._penumbraCosProperty = ShaderProperty.getByName("scene_SpotLightPenumb
27521
27570
  var sunlight = this._lightManager._sunlight = this._getSunlight();
27522
27571
  if (sunlight) {
27523
27572
  lightManager._updateSunlightIndex(sunlight);
27524
- shaderData.setColor(LightManager._sunlightColorProperty, sunlight._lightColor);
27573
+ shaderData.setColor(LightManager._sunlightColorProperty, sunlight.color);
27525
27574
  shaderData.setVector3(LightManager._sunlightDirectionProperty, sunlight.direction);
27526
27575
  } else {
27527
27576
  // @ts-ignore
@@ -30054,6 +30103,24 @@ function _type_of(obj) {
30054
30103
  this._controllerUpdateFlag.flag = false;
30055
30104
  }
30056
30105
  };
30106
+ /**
30107
+ * @internal
30108
+ */ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
30109
+ var animatorController = target._animatorController;
30110
+ if (animatorController) {
30111
+ target._addResourceReferCount(animatorController, 1);
30112
+ target._controllerUpdateFlag = animatorController._registerChangeFlag();
30113
+ }
30114
+ };
30115
+ _proto._onDestroy = function _onDestroy() {
30116
+ Component.prototype._onDestroy.call(this);
30117
+ var controller = this._animatorController;
30118
+ if (controller) {
30119
+ var _this__controllerUpdateFlag;
30120
+ this._addResourceReferCount(controller, -1);
30121
+ (_this__controllerUpdateFlag = this._controllerUpdateFlag) == null ? void 0 : _this__controllerUpdateFlag.destroy();
30122
+ }
30123
+ };
30057
30124
  _proto._crossFade = function _crossFade(stateName, duration, layerIndex, normalizedTimeOffset, isFixedDuration) {
30058
30125
  var _this__controllerUpdateFlag;
30059
30126
  if ((_this__controllerUpdateFlag = this._controllerUpdateFlag) == null ? void 0 : _this__controllerUpdateFlag.flag) {
@@ -30854,10 +30921,15 @@ function _type_of(obj) {
30854
30921
  return this._animatorController;
30855
30922
  },
30856
30923
  set: function set(animatorController) {
30857
- if (animatorController !== this._animatorController) {
30858
- this._reset();
30924
+ var lastController = this._animatorController;
30925
+ if (animatorController !== lastController) {
30926
+ lastController && this._addResourceReferCount(lastController, -1);
30859
30927
  this._controllerUpdateFlag && this._controllerUpdateFlag.destroy();
30860
- this._controllerUpdateFlag = animatorController && animatorController._registerChangeFlag();
30928
+ this._reset();
30929
+ if (animatorController) {
30930
+ this._addResourceReferCount(animatorController, 1);
30931
+ this._controllerUpdateFlag = animatorController._registerChangeFlag();
30932
+ }
30861
30933
  this._animatorController = animatorController;
30862
30934
  }
30863
30935
  }
@@ -30887,6 +30959,9 @@ Animator._passedTriggerParameterNames = new Array();
30887
30959
  __decorate([
30888
30960
  assignmentClone
30889
30961
  ], Animator.prototype, "speed", void 0);
30962
+ __decorate([
30963
+ assignmentClone
30964
+ ], Animator.prototype, "_animatorController", void 0);
30890
30965
  __decorate([
30891
30966
  ignoreClone
30892
30967
  ], Animator.prototype, "_controllerUpdateFlag", void 0);
@@ -33943,10 +34018,12 @@ __decorate([
33943
34018
  * Texture sheet animation module.
33944
34019
  */ var TextureSheetAnimationModule = /*#__PURE__*/ function(ParticleGeneratorModule) {
33945
34020
  _inherits(TextureSheetAnimationModule, ParticleGeneratorModule);
33946
- function TextureSheetAnimationModule() {
34021
+ function TextureSheetAnimationModule(generator) {
33947
34022
  var _this;
33948
- _this = ParticleGeneratorModule.apply(this, arguments) || this, /** Frame over time curve of the texture sheet. */ _this.frameOverTime = new ParticleCompositeCurve(new ParticleCurve(new CurveKey(0, 0), new CurveKey(1, 1))), /** Texture sheet animation type. */ _this.type = 0, /** Cycle count. */ _this.cycleCount = 1, /** @internal */ _this._tillingInfo = new engineMath.Vector3(1, 1, 1) // x:subU, y:subV, z:tileCount
34023
+ _this = ParticleGeneratorModule.call(this, generator) || this, /** Frame over time curve of the texture sheet. */ _this.frameOverTime = new ParticleCompositeCurve(new ParticleCurve(new CurveKey(0, 0), new CurveKey(1, 1))), /** Texture sheet animation type. */ _this.type = 0, /** Cycle count. */ _this.cycleCount = 1, /** @internal */ _this._tillingInfo = new engineMath.Vector3(1, 1, 1) // x:subU, y:subV, z:tileCount
33949
34024
  , /** @internal */ _this._frameOverTimeRand = new engineMath.Rand(0, ParticleRandomSubSeeds.TextureSheetAnimation), _this._tiling = new engineMath.Vector2(1, 1);
34025
+ // @ts-ignore
34026
+ _this._tiling._onValueChanged = _this._onTilingChanged.bind(_this);
33950
34027
  return _this;
33951
34028
  }
33952
34029
  var _proto = TextureSheetAnimationModule.prototype;
@@ -33976,6 +34053,10 @@ __decorate([
33976
34053
  */ _proto._resetRandomSeed = function _resetRandomSeed(randomSeed) {
33977
34054
  this._frameOverTimeRand.reset(randomSeed, ParticleRandomSubSeeds.TextureSheetAnimation);
33978
34055
  };
34056
+ _proto._onTilingChanged = function _onTilingChanged() {
34057
+ var tiling = this.tiling;
34058
+ this._tillingInfo.set(1.0 / tiling.x, 1.0 / tiling.y, tiling.x * tiling.y);
34059
+ };
33979
34060
  _create_class(TextureSheetAnimationModule, [
33980
34061
  {
33981
34062
  key: "tiling",
@@ -33985,8 +34066,7 @@ __decorate([
33985
34066
  return this._tiling;
33986
34067
  },
33987
34068
  set: function set(value) {
33988
- this._tiling = value;
33989
- this._tillingInfo.set(1.0 / value.x, 1.0 / value.y, value.x * value.y);
34069
+ value !== this._tiling && this._tiling.copyFrom(value);
33990
34070
  }
33991
34071
  }
33992
34072
  ]);
@@ -34013,6 +34093,9 @@ __decorate([
34013
34093
  __decorate([
34014
34094
  ignoreClone
34015
34095
  ], TextureSheetAnimationModule.prototype, "_frameCurveMacro", void 0);
34096
+ __decorate([
34097
+ ignoreClone
34098
+ ], TextureSheetAnimationModule.prototype, "_onTilingChanged", null);
34016
34099
 
34017
34100
  /**
34018
34101
  * Velocity over lifetime module.
@@ -36402,6 +36485,13 @@ AudioManager._isResuming = false;
36402
36485
  };
36403
36486
  /**
36404
36487
  * @internal
36488
+ */ _proto._cloneTo = function _cloneTo(target, srcRoot, targetRoot) {
36489
+ var _target__clip;
36490
+ (_target__clip = target._clip) == null ? void 0 : _target__clip._addReferCount(1);
36491
+ target._gainNode.gain.setValueAtTime(target._volume, AudioManager.getContext().currentTime);
36492
+ };
36493
+ /**
36494
+ * @internal
36405
36495
  */ _proto._onEnable = function _onEnable() {
36406
36496
  this.playOnEnabled && this.play();
36407
36497
  };
@@ -36551,32 +36641,35 @@ __decorate([
36551
36641
  ignoreClone
36552
36642
  ], AudioSource.prototype, "_isPlaying", void 0);
36553
36643
  __decorate([
36554
- ignoreClone
36644
+ assignmentClone
36555
36645
  ], AudioSource.prototype, "_clip", void 0);
36556
36646
  __decorate([
36557
- deepClone
36647
+ ignoreClone
36558
36648
  ], AudioSource.prototype, "_gainNode", void 0);
36559
36649
  __decorate([
36560
36650
  ignoreClone
36561
36651
  ], AudioSource.prototype, "_sourceNode", void 0);
36562
36652
  __decorate([
36563
- deepClone
36653
+ ignoreClone
36564
36654
  ], AudioSource.prototype, "_pausedTime", void 0);
36565
36655
  __decorate([
36566
36656
  ignoreClone
36567
36657
  ], AudioSource.prototype, "_playTime", void 0);
36568
36658
  __decorate([
36569
- deepClone
36659
+ assignmentClone
36570
36660
  ], AudioSource.prototype, "_volume", void 0);
36571
36661
  __decorate([
36572
- deepClone
36662
+ assignmentClone
36573
36663
  ], AudioSource.prototype, "_lastVolume", void 0);
36574
36664
  __decorate([
36575
- deepClone
36665
+ assignmentClone
36576
36666
  ], AudioSource.prototype, "_playbackRate", void 0);
36577
36667
  __decorate([
36578
- deepClone
36668
+ assignmentClone
36579
36669
  ], AudioSource.prototype, "_loop", void 0);
36670
+ __decorate([
36671
+ ignoreClone
36672
+ ], AudioSource.prototype, "_onPlayEnd", null);
36580
36673
 
36581
36674
  /**
36582
36675
  * @internal