@galacean/effects-threejs 2.1.0-alpha.9 → 2.1.0

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/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.1.0-alpha.9
6
+ * Version: v2.1.0
7
7
  */
8
8
 
9
9
  import * as THREE from 'three';
@@ -1092,39 +1092,39 @@ function _inherits(subClass, superClass) {
1092
1092
  })(MaskMode || (MaskMode = {}));
1093
1093
  /**
1094
1094
  * 发射器形状
1095
- */ var ShapeType;
1096
- (function(ShapeType) {
1095
+ */ var ParticleEmitterShapeType;
1096
+ (function(ParticleEmitterShapeType) {
1097
1097
  /**
1098
1098
  * 没有类型
1099
- */ ShapeType[ShapeType["NONE"] = 0] = "NONE";
1099
+ */ ParticleEmitterShapeType[ParticleEmitterShapeType["NONE"] = 0] = "NONE";
1100
1100
  /**
1101
1101
  * 圆球
1102
- */ ShapeType[ShapeType["SPHERE"] = 1] = "SPHERE";
1102
+ */ ParticleEmitterShapeType[ParticleEmitterShapeType["SPHERE"] = 1] = "SPHERE";
1103
1103
  /**
1104
1104
  * 圆锥
1105
- */ ShapeType[ShapeType["CONE"] = 2] = "CONE";
1105
+ */ ParticleEmitterShapeType[ParticleEmitterShapeType["CONE"] = 2] = "CONE";
1106
1106
  /**
1107
1107
  * 半球
1108
- */ ShapeType[ShapeType["HEMISPHERE"] = 3] = "HEMISPHERE";
1108
+ */ ParticleEmitterShapeType[ParticleEmitterShapeType["HEMISPHERE"] = 3] = "HEMISPHERE";
1109
1109
  /**
1110
1110
  * 圆
1111
- */ ShapeType[ShapeType["CIRCLE"] = 4] = "CIRCLE";
1111
+ */ ParticleEmitterShapeType[ParticleEmitterShapeType["CIRCLE"] = 4] = "CIRCLE";
1112
1112
  /**
1113
1113
  * 圆环
1114
- */ ShapeType[ShapeType["DONUT"] = 5] = "DONUT";
1114
+ */ ParticleEmitterShapeType[ParticleEmitterShapeType["DONUT"] = 5] = "DONUT";
1115
1115
  /**
1116
1116
  * 矩形
1117
- */ ShapeType[ShapeType["RECTANGLE"] = 6] = "RECTANGLE";
1117
+ */ ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE"] = 6] = "RECTANGLE";
1118
1118
  /**
1119
1119
  * 矩形框
1120
- */ ShapeType[ShapeType["RECTANGLE_EDGE"] = 7] = "RECTANGLE_EDGE";
1120
+ */ ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE_EDGE"] = 7] = "RECTANGLE_EDGE";
1121
1121
  /**
1122
1122
  * 直线
1123
- */ ShapeType[ShapeType["EDGE"] = 8] = "EDGE";
1123
+ */ ParticleEmitterShapeType[ParticleEmitterShapeType["EDGE"] = 8] = "EDGE";
1124
1124
  /**
1125
1125
  * 贴图
1126
- */ ShapeType[ShapeType["TEXTURE"] = 9] = "TEXTURE";
1127
- })(ShapeType || (ShapeType = {}));
1126
+ */ ParticleEmitterShapeType[ParticleEmitterShapeType["TEXTURE"] = 9] = "TEXTURE";
1127
+ })(ParticleEmitterShapeType || (ParticleEmitterShapeType = {}));
1128
1128
  /**
1129
1129
  * 插件类型
1130
1130
  */ var PluginType;
@@ -1220,6 +1220,12 @@ function _inherits(subClass, superClass) {
1220
1220
  /**
1221
1221
  * 特效元素
1222
1222
  */ ItemType["effect"] = "effect";
1223
+ /**
1224
+ * 形状元素
1225
+ */ ItemType["shape"] = "shape";
1226
+ /**
1227
+ * 后处理元素
1228
+ */ ItemType["postProcessVolume"] = "postProcessVolume";
1223
1229
  /**
1224
1230
  * 节点元素
1225
1231
  */ ItemType["node"] = "node";
@@ -1229,6 +1235,9 @@ function _inherits(subClass, superClass) {
1229
1235
  /**
1230
1236
  * 音频元素
1231
1237
  */ ItemType["audio"] = "audio";
1238
+ /**
1239
+ * 富文本元素
1240
+ */ ItemType["richtext"] = "richtext";
1232
1241
  })(ItemType || (ItemType = {}));
1233
1242
  /**
1234
1243
  * 渲染模式
@@ -1604,6 +1613,58 @@ var TextAlignment;
1604
1613
  */ FontStyle["oblique"] = "oblique";
1605
1614
  })(FontStyle || (FontStyle = {}));
1606
1615
 
1616
+ var BuiltinObjectGUID = {
1617
+ WhiteTexture: "whitetexture00000000000000000000",
1618
+ TransparentTexture: "transparenttexture00000000000000000000",
1619
+ PBRShader: "pbr00000000000000000000000000000",
1620
+ UnlitShader: "unlit000000000000000000000000000"
1621
+ };
1622
+
1623
+ /**
1624
+ * 矢量图形类型
1625
+ */ var ShapePrimitiveType;
1626
+ (function(ShapePrimitiveType) {
1627
+ /**
1628
+ * 自定义图形
1629
+ */ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
1630
+ /**
1631
+ * 矩形
1632
+ */ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
1633
+ /**
1634
+ * 椭圆
1635
+ */ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
1636
+ /**
1637
+ * 多边形
1638
+ */ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
1639
+ /**
1640
+ * 星形
1641
+ */ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
1642
+ })(ShapePrimitiveType || (ShapePrimitiveType = {}));
1643
+
1644
+ // 本期无该功能 待补充
1645
+ var ShapeConnectType;
1646
+ (function(ShapeConnectType) {})(ShapeConnectType || (ShapeConnectType = {}));
1647
+ // @待补充
1648
+ var ShapePointType;
1649
+ (function(ShapePointType) {})(ShapePointType || (ShapePointType = {}));
1650
+
1651
+ /**
1652
+ * 动态换图类型
1653
+ * @since 1.1.0
1654
+ */ var BackgroundType;
1655
+ (function(BackgroundType) {
1656
+ BackgroundType["video"] = "video";
1657
+ BackgroundType["image"] = "image";
1658
+ })(BackgroundType || (BackgroundType = {}));
1659
+ /**
1660
+ * 多媒体资源类型
1661
+ * @since 2.1.0
1662
+ */ var MultimediaType;
1663
+ (function(MultimediaType) {
1664
+ MultimediaType["video"] = "video";
1665
+ MultimediaType["audio"] = "audio";
1666
+ })(MultimediaType || (MultimediaType = {}));
1667
+
1607
1668
  var DataType;
1608
1669
  (function(DataType) {
1609
1670
  DataType["VFXItemData"] = "VFXItemData";
@@ -1614,8 +1675,10 @@ var DataType;
1614
1675
  DataType["ParticleSystem"] = "ParticleSystem";
1615
1676
  DataType["InteractComponent"] = "InteractComponent";
1616
1677
  DataType["CameraController"] = "CameraController";
1678
+ DataType["PostProcessVolume"] = "PostProcessVolume";
1617
1679
  DataType["Geometry"] = "Geometry";
1618
1680
  DataType["Texture"] = "Texture";
1681
+ DataType["Image"] = "Image";
1619
1682
  DataType["AnimationClip"] = "AnimationClip";
1620
1683
  DataType["TextComponent"] = "TextComponent";
1621
1684
  DataType["BinaryAsset"] = "BinaryAsset";
@@ -1636,7 +1699,6 @@ var DataType;
1636
1699
  DataType["SubCompositionPlayableAsset"] = "SubCompositionPlayableAsset";
1637
1700
  DataType["FloatPropertyPlayableAsset"] = "FloatPropertyPlayableAsset";
1638
1701
  DataType["ColorPropertyPlayableAsset"] = "ColorPropertyPlayableAsset";
1639
- // FIXME: 先完成ECS的场景转换,后面移到spec中
1640
1702
  DataType["MeshComponent"] = "MeshComponent";
1641
1703
  DataType["SkyboxComponent"] = "SkyboxComponent";
1642
1704
  DataType["LightComponent"] = "LightComponent";
@@ -1647,9 +1709,13 @@ var DataType;
1647
1709
  DataType["SpineComponent"] = "SpineComponent";
1648
1710
  DataType["VideoComponent"] = "VideoComponent";
1649
1711
  DataType["AudioComponent"] = "AudioComponent";
1712
+ DataType["RichTextComponent"] = "RichTextComponent";
1713
+ DataType["OrientationComponent"] = "OrientationComponent";
1714
+ DataType["ShapeComponent"] = "ShapeComponent";
1650
1715
  // Non-EffectObject
1651
1716
  DataType["TimelineClip"] = "TimelineClip";
1652
1717
  })(DataType || (DataType = {}));
1718
+
1653
1719
  var GeometryType;
1654
1720
  (function(GeometryType) {
1655
1721
  /**
@@ -1734,37 +1800,13 @@ var VertexBufferSemantic;
1734
1800
  VertexBufferSemantic["TangentBS3"] = "TANGENT_BS3";
1735
1801
  })(VertexBufferSemantic || (VertexBufferSemantic = {}));
1736
1802
 
1737
- var BuiltinObjectGUID = {
1738
- WhiteTexture: "whitetexture00000000000000000000",
1739
- TransparentTexture: "transparenttexture00000000000000000000",
1740
- PBRShader: "pbr00000000000000000000000000000",
1741
- UnlitShader: "unlit000000000000000000000000000"
1742
- };
1743
-
1744
- /**
1745
- * 动态换图类型
1746
- * @since 1.1.0
1747
- */ var BackgroundType;
1748
- (function(BackgroundType) {
1749
- BackgroundType["video"] = "video";
1750
- BackgroundType["image"] = "image";
1751
- })(BackgroundType || (BackgroundType = {}));
1752
- /**
1753
- * 多媒体资源类型
1754
- * @since 2.1.0
1755
- */ var MultimediaType;
1756
- (function(MultimediaType) {
1757
- MultimediaType["video"] = "video";
1758
- MultimediaType["audio"] = "audio";
1759
- })(MultimediaType || (MultimediaType = {}));
1760
-
1761
1803
  var index$1 = /*#__PURE__*/Object.freeze({
1762
1804
  __proto__: null,
1763
1805
  get RenderLevel () { return RenderLevel; },
1764
1806
  get BlendingMode () { return BlendingMode; },
1765
1807
  get SideMode () { return SideMode; },
1766
1808
  get MaskMode () { return MaskMode; },
1767
- get ShapeType () { return ShapeType; },
1809
+ get ParticleEmitterShapeType () { return ParticleEmitterShapeType; },
1768
1810
  get PluginType () { return PluginType; },
1769
1811
  get InteractType () { return InteractType; },
1770
1812
  get InteractBehavior () { return InteractBehavior; },
@@ -1802,14 +1844,17 @@ var index$1 = /*#__PURE__*/Object.freeze({
1802
1844
  get TextAlignment () { return TextAlignment; },
1803
1845
  get TextWeight () { return TextWeight; },
1804
1846
  get FontStyle () { return FontStyle; },
1847
+ BuiltinObjectGUID: BuiltinObjectGUID,
1848
+ get ShapePrimitiveType () { return ShapePrimitiveType; },
1849
+ get ShapeConnectType () { return ShapeConnectType; },
1850
+ get ShapePointType () { return ShapePointType; },
1851
+ get BackgroundType () { return BackgroundType; },
1852
+ get MultimediaType () { return MultimediaType; },
1805
1853
  get DataType () { return DataType; },
1806
1854
  get GeometryType () { return GeometryType; },
1807
1855
  get VertexFormatType () { return VertexFormatType; },
1808
1856
  get IndexFormatType () { return IndexFormatType; },
1809
- get VertexBufferSemantic () { return VertexBufferSemantic; },
1810
- BuiltinObjectGUID: BuiltinObjectGUID,
1811
- get BackgroundType () { return BackgroundType; },
1812
- get MultimediaType () { return MultimediaType; }
1857
+ get VertexBufferSemantic () { return VertexBufferSemantic; }
1813
1858
  });
1814
1859
 
1815
1860
  function _defineProperties(target, props) {
@@ -1897,15 +1942,23 @@ function getDirectStore(target) {
1897
1942
  this.engine.addInstance(this);
1898
1943
  }
1899
1944
  var _proto = EffectsObject.prototype;
1900
- _proto.getInstanceId = function getInstanceId() {
1945
+ /**
1946
+ *
1947
+ * @returns
1948
+ */ _proto.getInstanceId = function getInstanceId() {
1901
1949
  return this.guid;
1902
1950
  };
1903
- _proto.setInstanceId = function setInstanceId(guid) {
1951
+ /**
1952
+ *
1953
+ * @param guid
1954
+ */ _proto.setInstanceId = function setInstanceId(guid) {
1904
1955
  this.engine.removeInstance(this.guid);
1905
1956
  this.guid = guid;
1906
1957
  this.engine.addInstance(this);
1907
1958
  };
1908
- _proto.toData = function toData() {};
1959
+ /**
1960
+ *
1961
+ */ _proto.toData = function toData() {};
1909
1962
  /**
1910
1963
  * 反序列化函数
1911
1964
  *
@@ -1915,8 +1968,14 @@ function getDirectStore(target) {
1915
1968
  this.setInstanceId(data.id);
1916
1969
  }
1917
1970
  };
1918
- _proto.dispose = function dispose() {};
1919
- EffectsObject.is = function is(obj) {
1971
+ /**
1972
+ *
1973
+ */ _proto.dispose = function dispose() {};
1974
+ /**
1975
+ *
1976
+ * @param obj
1977
+ * @returns
1978
+ */ EffectsObject.is = function is(obj) {
1920
1979
  return _instanceof1(obj, EffectsObject) && "guid" in obj;
1921
1980
  };
1922
1981
  return EffectsObject;
@@ -1996,7 +2055,7 @@ function getDirectStore(target) {
1996
2055
  this.onAwake();
1997
2056
  this.isAwakeCalled = true;
1998
2057
  }
1999
- if (item.getVisible() && this.enabled) {
2058
+ if (item.isActive && this.enabled) {
2000
2059
  this.start();
2001
2060
  this.enable();
2002
2061
  }
@@ -2041,7 +2100,7 @@ function getDirectStore(target) {
2041
2100
  get: /**
2042
2101
  * 组件是否可以更新,true 更新,false 不更新
2043
2102
  */ function get() {
2044
- return this.item.getVisible() && this.enabled;
2103
+ return this.item.isActive && this.enabled;
2045
2104
  }
2046
2105
  },
2047
2106
  {
@@ -2109,6 +2168,14 @@ __decorate([
2109
2168
  Component.prototype.setVFXItem.call(this, item);
2110
2169
  this.item.rendererComponents.push(this);
2111
2170
  };
2171
+ _proto.onEnable = function onEnable() {
2172
+ var _this_item_composition;
2173
+ (_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.renderFrame.addMeshToDefaultRenderPass(this);
2174
+ };
2175
+ _proto.onDisable = function onDisable() {
2176
+ var _this_item_composition;
2177
+ (_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.renderFrame.removeMeshFromDefaultRenderPass(this);
2178
+ };
2112
2179
  _proto.fromData = function fromData(data) {
2113
2180
  Component.prototype.fromData.call(this, data);
2114
2181
  };
@@ -3670,7 +3737,9 @@ Vector3.ZERO = new Vector3(0.0, 0.0, 0.0);
3670
3737
  */ Vector4.ONE = new Vector4(1.0, 1.0, 1.0, 1.0);
3671
3738
  Vector4.ZERO = new Vector4(0.0, 0.0, 0.0, 0.0);
3672
3739
 
3673
- var MeshComponent = /*#__PURE__*/ function(RendererComponent) {
3740
+ /**
3741
+ * Mesh 组件
3742
+ */ var MeshComponent = /*#__PURE__*/ function(RendererComponent) {
3674
3743
  _inherits(MeshComponent, RendererComponent);
3675
3744
  function MeshComponent() {
3676
3745
  var _this;
@@ -3680,7 +3749,9 @@ var MeshComponent = /*#__PURE__*/ function(RendererComponent) {
3680
3749
  */ _this.meshCollider = new MeshCollider();
3681
3750
  // TODO 点击测试后续抽象一个 Collider 组件
3682
3751
  _this.getHitTestParams = function(force) {
3683
- var area = _this.getBoundingBox();
3752
+ var worldMatrix = _this.transform.getWorldMatrix();
3753
+ _this.meshCollider.setGeometry(_this.geometry, worldMatrix);
3754
+ var area = _this.meshCollider.getBoundingBoxData();
3684
3755
  if (area) {
3685
3756
  return {
3686
3757
  type: area.type,
@@ -3700,8 +3771,8 @@ var MeshComponent = /*#__PURE__*/ function(RendererComponent) {
3700
3771
  _proto.getBoundingBox = function getBoundingBox() {
3701
3772
  var worldMatrix = this.transform.getWorldMatrix();
3702
3773
  this.meshCollider.setGeometry(this.geometry, worldMatrix);
3703
- var boundingBoxData = this.meshCollider.getBoundingBoxData();
3704
- return boundingBoxData;
3774
+ var boundingBox = this.meshCollider.getBoundingBox();
3775
+ return boundingBox;
3705
3776
  };
3706
3777
  return MeshComponent;
3707
3778
  }(RendererComponent);
@@ -3739,24 +3810,29 @@ EffectComponent = __decorate([
3739
3810
 
3740
3811
  var PostProcessVolume = /*#__PURE__*/ function(Behaviour) {
3741
3812
  _inherits(PostProcessVolume, Behaviour);
3742
- function PostProcessVolume() {
3813
+ function PostProcessVolume(engine) {
3743
3814
  var _this;
3744
- _this = Behaviour.apply(this, arguments) || this;
3745
- // Bloom
3746
- _this.bloomEnabled = true;
3747
- _this.threshold = 1.0;
3748
- _this.bloomIntensity = 1.0;
3749
- // ColorAdjustments
3750
- _this.brightness = 1.0;
3751
- _this.saturation = 1.0;
3752
- _this.contrast = 1.0;
3753
- // Vignette
3754
- _this.vignetteIntensity = 0.2;
3755
- _this.vignetteSmoothness = 0.4;
3756
- _this.vignetteRoundness = 1.0;
3757
- // ToneMapping
3758
- _this.toneMappingEnabled = true // 1: true, 0: false
3759
- ;
3815
+ _this = Behaviour.call(this, engine) || this;
3816
+ _this.bloom = {
3817
+ threshold: 0,
3818
+ intensity: 0,
3819
+ active: false
3820
+ };
3821
+ _this.vignette = {
3822
+ intensity: 0,
3823
+ smoothness: 0,
3824
+ roundness: 0,
3825
+ active: false
3826
+ };
3827
+ _this.tonemapping = {
3828
+ active: false
3829
+ };
3830
+ _this.colorAdjustments = {
3831
+ brightness: 0,
3832
+ saturation: 0,
3833
+ contrast: 0,
3834
+ active: false
3835
+ };
3760
3836
  return _this;
3761
3837
  }
3762
3838
  var _proto = PostProcessVolume.prototype;
@@ -3770,36 +3846,18 @@ var PostProcessVolume = /*#__PURE__*/ function(Behaviour) {
3770
3846
  }(Behaviour);
3771
3847
  __decorate([
3772
3848
  serialize()
3773
- ], PostProcessVolume.prototype, "bloomEnabled", void 0);
3774
- __decorate([
3775
- serialize()
3776
- ], PostProcessVolume.prototype, "threshold", void 0);
3777
- __decorate([
3778
- serialize()
3779
- ], PostProcessVolume.prototype, "bloomIntensity", void 0);
3780
- __decorate([
3781
- serialize()
3782
- ], PostProcessVolume.prototype, "brightness", void 0);
3783
- __decorate([
3784
- serialize()
3785
- ], PostProcessVolume.prototype, "saturation", void 0);
3786
- __decorate([
3787
- serialize()
3788
- ], PostProcessVolume.prototype, "contrast", void 0);
3789
- __decorate([
3790
- serialize()
3791
- ], PostProcessVolume.prototype, "vignetteIntensity", void 0);
3849
+ ], PostProcessVolume.prototype, "bloom", void 0);
3792
3850
  __decorate([
3793
3851
  serialize()
3794
- ], PostProcessVolume.prototype, "vignetteSmoothness", void 0);
3852
+ ], PostProcessVolume.prototype, "vignette", void 0);
3795
3853
  __decorate([
3796
3854
  serialize()
3797
- ], PostProcessVolume.prototype, "vignetteRoundness", void 0);
3855
+ ], PostProcessVolume.prototype, "tonemapping", void 0);
3798
3856
  __decorate([
3799
3857
  serialize()
3800
- ], PostProcessVolume.prototype, "toneMappingEnabled", void 0);
3858
+ ], PostProcessVolume.prototype, "colorAdjustments", void 0);
3801
3859
  PostProcessVolume = __decorate([
3802
- effectsClass("PostProcessVolume")
3860
+ effectsClass(DataType.PostProcessVolume)
3803
3861
  ], PostProcessVolume);
3804
3862
 
3805
3863
  function _assert_this_initialized(self) {
@@ -6886,6 +6944,7 @@ var MaterialRenderType;
6886
6944
  _this.enabledMacros = {};
6887
6945
  _this.destroyed = false;
6888
6946
  _this.initialized = false;
6947
+ _this.shaderDirty = true;
6889
6948
  if (props) {
6890
6949
  var _props_name = props.name, name = _props_name === void 0 ? "Material" + seed$9++ : _props_name, _props_renderType = props.renderType, renderType = _props_renderType === void 0 ? 0 : _props_renderType, shader = props.shader, uniformSemantics = props.uniformSemantics;
6891
6950
  _this.name = name;
@@ -6913,6 +6972,41 @@ var MaterialRenderType;
6913
6972
  // OVERRIDE
6914
6973
  };
6915
6974
  _create_class(Material, [
6975
+ {
6976
+ key: "shader",
6977
+ get: function get() {
6978
+ return this._shader;
6979
+ },
6980
+ set: function set(value) {
6981
+ if (this._shader === value) {
6982
+ return;
6983
+ }
6984
+ this._shader = value;
6985
+ this.shaderDirty = true;
6986
+ }
6987
+ },
6988
+ {
6989
+ key: "mainTexture",
6990
+ get: /**
6991
+ * 材质的主纹理
6992
+ */ function get() {
6993
+ return this.getTexture("_MainTex");
6994
+ },
6995
+ set: function set(value) {
6996
+ this.setTexture("_MainTex", value);
6997
+ }
6998
+ },
6999
+ {
7000
+ key: "color",
7001
+ get: /**
7002
+ * 材质的主颜色
7003
+ */ function get() {
7004
+ return this.getColor("_Color");
7005
+ },
7006
+ set: function set(value) {
7007
+ this.setColor("_Color", value);
7008
+ }
7009
+ },
6916
7010
  {
6917
7011
  key: "blending",
6918
7012
  set: /******** effects-core 中会调用 引擎必须实现 ***********************/ /**
@@ -10049,7 +10143,7 @@ var integrate = "float calculateMovement(float t,vec2 p1,vec2 p2,vec2 p3,vec2 p4
10049
10143
 
10050
10144
  var itemVert = "precision highp float;attribute vec2 atlasOffset;attribute vec3 aPos;varying vec2 vTexCoord;varying vec3 vParams;varying vec4 vColor;uniform vec2 _Size;uniform vec4 _Color;uniform vec4 _TexParams;uniform vec4 _TexOffset;uniform mat4 effects_MatrixVP;uniform mat4 effects_MatrixInvV;uniform mat4 effects_ObjectToWorld;\n#ifdef ENV_EDITOR\nuniform vec4 uEditorTransform;\n#endif\nvoid main(){vec4 texParams=_TexParams;vTexCoord=vec2(atlasOffset.xy*_TexOffset.zw+_TexOffset.xy);vColor=_Color;vParams=vec3(0.0,texParams.y,texParams.x);vec4 pos=vec4(aPos.xy*_Size,aPos.z,1.0);gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;\n#ifdef ENV_EDITOR\ngl_Position=vec4(gl_Position.xy*uEditorTransform.xy+uEditorTransform.zw*gl_Position.w,gl_Position.zw);\n#endif\n}";
10051
10145
 
10052
- var itemFrag = "precision highp float;varying vec4 vColor;varying vec2 vTexCoord;varying vec3 vParams;uniform sampler2D uSampler0;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}void main(){vec4 color=vec4(0.);vec4 texColor=texture2D(uSampler0,vTexCoord.xy);color=blendColor(texColor,vColor,floor(0.5+vParams.y));if(vParams.z==0.&&color.a<0.04){discard;}color.a=clamp(color.a,0.0,1.0);gl_FragColor=color;}";
10146
+ var itemFrag = "precision highp float;varying vec4 vColor;varying vec2 vTexCoord;varying vec3 vParams;uniform sampler2D _MainTex;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}void main(){vec4 color=vec4(0.);vec4 texColor=texture2D(_MainTex,vTexCoord.xy);color=blendColor(texColor,vColor,floor(0.5+vParams.y));if(vParams.z==0.&&color.a<0.04){discard;}color.a=clamp(color.a,0.0,1.0);gl_FragColor=color;}";
10053
10147
 
10054
10148
  var particleFrag = "#version 100\nprecision mediump float;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}\n#define PATICLE_SHADER 1\nvarying float vLife;varying vec2 vTexCoord;varying vec4 vColor;uniform vec3 emissionColor;uniform float emissionIntensity;uniform sampler2D uMaskTex;uniform vec4 uColorParams;uniform vec2 uTexOffset;\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\n#ifdef USE_SPRITE\nvarying vec4 vTexCoordBlend;\n#endif\nvarying float vSeed;\n#ifdef PREVIEW_BORDER\nuniform vec4 uPreviewColor;\n#endif\n#ifdef USE_SPRITE\nvec4 getTextureColor(sampler2D tex,vec2 texCoord){if(vTexCoordBlend.w>0.){return mix(texture2D(tex,texCoord),texture2D(tex,vTexCoordBlend.xy+texCoord),vTexCoordBlend.z);}return texture2D(tex,texCoord);}\n#else\n#define getTextureColor texture2D\n#endif\n#ifndef WEBGL2\n#define round(a) floor(0.5+a)\n#endif\n#ifdef PREVIEW_BORDER\nvoid main(){gl_FragColor=uPreviewColor;}\n#else\nvoid main(){vec4 color=vec4(1.0);vec4 tempColor=vColor;vec2 texOffset=uTexOffset;if(vLife<0.){discard;}if(uColorParams.x>0.0){color=getTextureColor(uMaskTex,vTexCoord);}\n#ifdef COLOR_OVER_LIFETIME\n#ifndef ENABLE_VERTEX_TEXTURE\ntempColor*=texture2D(uColorOverLifetime,vec2(vLife,0.));\n#endif\n#endif\ncolor=blendColor(color,tempColor,round(uColorParams.y));if(color.a<=0.01&&uColorParams.w>0.){float _at=texture2D(uMaskTex,vTexCoord+texOffset).a+texture2D(uMaskTex,vTexCoord+texOffset*-1.).a;if(_at<=0.02){discard;}}vec3 emission=emissionColor*pow(2.0,emissionIntensity);color=vec4(pow(pow(color.rgb,vec3(2.2))+emission,vec3(1.0/2.2)),color.a);gl_FragColor=color;}\n#endif\n";
10055
10149
 
@@ -10280,15 +10374,15 @@ var BloomThresholdPass = /*#__PURE__*/ function(RenderPass) {
10280
10374
  renderer.setFramebuffer(this.framebuffer);
10281
10375
  };
10282
10376
  _proto.execute = function execute(renderer) {
10283
- var _renderer_renderingData_currentFrame_globalVolume;
10377
+ var _renderer_renderingData_currentFrame_globalVolume_bloom, _renderer_renderingData_currentFrame_globalVolume;
10284
10378
  renderer.clear({
10285
10379
  colorAction: TextureStoreAction.clear,
10286
10380
  depthAction: TextureStoreAction.clear,
10287
10381
  stencilAction: TextureStoreAction.clear
10288
10382
  });
10289
10383
  this.screenMesh.material.setTexture("_MainTex", this.mainTexture);
10290
- var _renderer_renderingData_currentFrame_globalVolume_threshold;
10291
- var threshold = (_renderer_renderingData_currentFrame_globalVolume_threshold = (_renderer_renderingData_currentFrame_globalVolume = renderer.renderingData.currentFrame.globalVolume) == null ? void 0 : _renderer_renderingData_currentFrame_globalVolume.threshold) != null ? _renderer_renderingData_currentFrame_globalVolume_threshold : 1.0;
10384
+ var _renderer_renderingData_currentFrame_globalVolume_bloom_threshold;
10385
+ var threshold = (_renderer_renderingData_currentFrame_globalVolume_bloom_threshold = (_renderer_renderingData_currentFrame_globalVolume = renderer.renderingData.currentFrame.globalVolume) == null ? void 0 : (_renderer_renderingData_currentFrame_globalVolume_bloom = _renderer_renderingData_currentFrame_globalVolume.bloom) == null ? void 0 : _renderer_renderingData_currentFrame_globalVolume_bloom.threshold) != null ? _renderer_renderingData_currentFrame_globalVolume_bloom_threshold : 1.0;
10292
10386
  this.screenMesh.material.setFloat("_Threshold", threshold);
10293
10387
  renderer.renderMeshes([
10294
10388
  this.screenMesh
@@ -10501,25 +10595,44 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
10501
10595
  depthAction: TextureStoreAction.clear,
10502
10596
  stencilAction: TextureStoreAction.clear
10503
10597
  });
10504
- var _renderer_renderingData_currentFrame_globalVolume;
10505
- var _ref = (_renderer_renderingData_currentFrame_globalVolume = renderer.renderingData.currentFrame.globalVolume) != null ? _renderer_renderingData_currentFrame_globalVolume : {}, _ref_bloomEnabled = _ref.bloomEnabled, bloomEnabled = _ref_bloomEnabled === void 0 ? false : _ref_bloomEnabled, _ref_bloomIntensity = _ref.bloomIntensity, bloomIntensity = _ref_bloomIntensity === void 0 ? 1.0 : _ref_bloomIntensity, _ref_brightness = _ref.brightness, brightness = _ref_brightness === void 0 ? 1.0 : _ref_brightness, _ref_saturation = _ref.saturation, saturation = _ref_saturation === void 0 ? 1.0 : _ref_saturation, _ref_contrast = _ref.contrast, contrast = _ref_contrast === void 0 ? 1.0 : _ref_contrast, _ref_toneMappingEnabled = _ref.toneMappingEnabled, toneMappingEnabled = _ref_toneMappingEnabled === void 0 ? true : _ref_toneMappingEnabled, _ref_vignetteIntensity = _ref.vignetteIntensity, vignetteIntensity = _ref_vignetteIntensity === void 0 ? 0.2 : _ref_vignetteIntensity, _ref_vignetteSmoothness = _ref.vignetteSmoothness, vignetteSmoothness = _ref_vignetteSmoothness === void 0 ? 0.4 : _ref_vignetteSmoothness, _ref_vignetteRoundness = _ref.vignetteRoundness, vignetteRoundness = _ref_vignetteRoundness === void 0 ? 1.0 : _ref_vignetteRoundness;
10598
+ var globalVolume = renderer.renderingData.currentFrame.globalVolume;
10599
+ var bloom = _extends({
10600
+ threshold: 0,
10601
+ intensity: 0,
10602
+ active: false
10603
+ }, globalVolume == null ? void 0 : globalVolume.bloom);
10604
+ var vignette = _extends({
10605
+ intensity: 0,
10606
+ smoothness: 0,
10607
+ roundness: 0,
10608
+ active: false
10609
+ }, globalVolume == null ? void 0 : globalVolume.vignette);
10610
+ var colorAdjustments = _extends({
10611
+ brightness: 0,
10612
+ saturation: 0,
10613
+ contrast: 0,
10614
+ active: false
10615
+ }, globalVolume == null ? void 0 : globalVolume.colorAdjustments);
10616
+ var tonemapping = _extends({
10617
+ active: false
10618
+ }, globalVolume == null ? void 0 : globalVolume.tonemapping);
10506
10619
  this.screenMesh.material.setTexture("_SceneTex", this.sceneTextureHandle.texture);
10507
- this.screenMesh.material.setFloat("_Brightness", brightness);
10508
- this.screenMesh.material.setFloat("_Saturation", saturation);
10509
- this.screenMesh.material.setFloat("_Contrast", contrast);
10510
- this.screenMesh.material.setInt("_UseBloom", Number(bloomEnabled));
10511
- if (bloomEnabled) {
10620
+ this.screenMesh.material.setFloat("_Brightness", Math.pow(2, colorAdjustments.brightness));
10621
+ this.screenMesh.material.setFloat("_Saturation", colorAdjustments.saturation * 0.01 + 1);
10622
+ this.screenMesh.material.setFloat("_Contrast", colorAdjustments.contrast * 0.01 + 1);
10623
+ this.screenMesh.material.setInt("_UseBloom", Number(bloom.active));
10624
+ if (bloom.active) {
10512
10625
  this.screenMesh.material.setTexture("_GaussianTex", this.mainTexture);
10513
- this.screenMesh.material.setFloat("_BloomIntensity", bloomIntensity);
10626
+ this.screenMesh.material.setFloat("_BloomIntensity", bloom.intensity);
10514
10627
  }
10515
- if (vignetteIntensity > 0) {
10516
- this.screenMesh.material.setFloat("_VignetteIntensity", vignetteIntensity);
10517
- this.screenMesh.material.setFloat("_VignetteSmoothness", vignetteSmoothness);
10518
- this.screenMesh.material.setFloat("_VignetteRoundness", vignetteRoundness);
10628
+ if (vignette.intensity > 0) {
10629
+ this.screenMesh.material.setFloat("_VignetteIntensity", vignette.intensity);
10630
+ this.screenMesh.material.setFloat("_VignetteSmoothness", vignette.smoothness);
10631
+ this.screenMesh.material.setFloat("_VignetteRoundness", vignette.roundness);
10519
10632
  this.screenMesh.material.setVector2("_VignetteCenter", new Vector2(0.5, 0.5));
10520
10633
  this.screenMesh.material.setVector3("_VignetteColor", new Vector3(0.0, 0.0, 0.0));
10521
10634
  }
10522
- this.screenMesh.material.setInt("_UseToneMapping", Number(toneMappingEnabled));
10635
+ this.screenMesh.material.setInt("_UseToneMapping", Number(tonemapping.active));
10523
10636
  renderer.renderMeshes([
10524
10637
  this.screenMesh
10525
10638
  ]);
@@ -10559,6 +10672,9 @@ var seed$6 = 1;
10559
10672
  this.renderer = renderer;
10560
10673
  if (postProcessingEnabled) {
10561
10674
  var enableHDR = true;
10675
+ if (!this.renderer.engine.gpuCapability.detail.halfFloatTexture) {
10676
+ throw new Error("Half float texture is not supported.");
10677
+ }
10562
10678
  // 使用HDR浮点纹理,FLOAT在IOS上报错,使用HALF_FLOAT
10563
10679
  var textureType = enableHDR ? glContext.HALF_FLOAT : glContext.UNSIGNED_BYTE;
10564
10680
  attachments = [
@@ -10580,16 +10696,16 @@ var seed$6 = 1;
10580
10696
  depthAction: TextureLoadAction.clear
10581
10697
  };
10582
10698
  }
10583
- // 创建 drawObjectPass
10699
+ this.drawObjectPass = new RenderPass(renderer, {
10700
+ name: RENDER_PASS_NAME_PREFIX,
10701
+ priority: RenderPassPriorityNormal,
10702
+ meshOrder: OrderType.ascending,
10703
+ depthStencilAttachment: depthStencilAttachment,
10704
+ attachments: attachments,
10705
+ clearAction: drawObjectPassClearAction
10706
+ });
10584
10707
  var renderPasses = [
10585
- new RenderPass(renderer, {
10586
- name: RENDER_PASS_NAME_PREFIX,
10587
- priority: RenderPassPriorityNormal,
10588
- meshOrder: OrderType.ascending,
10589
- depthStencilAttachment: depthStencilAttachment,
10590
- attachments: attachments,
10591
- clearAction: drawObjectPassClearAction
10592
- })
10708
+ this.drawObjectPass
10593
10709
  ];
10594
10710
  this.setRenderPasses(renderPasses);
10595
10711
  if (postProcessingEnabled) {
@@ -10711,216 +10827,15 @@ var seed$6 = 1;
10711
10827
  * 根据 Mesh 优先级添加到 RenderPass
10712
10828
  * @param mesh - 要添加的 Mesh 对象
10713
10829
  */ _proto.addMeshToDefaultRenderPass = function addMeshToDefaultRenderPass(mesh) {
10714
- if (!mesh) {
10715
- return;
10716
- }
10717
- this.renderPasses[0].addMesh(mesh);
10718
- // const renderPasses = this.renderPasses;
10719
- // const infoMap = this.renderPassInfoMap;
10720
- // const { priority } = mesh;
10721
- // for (let i = 1; i < renderPasses.length; i++) {
10722
- // const renderPass = renderPasses[i - 1];
10723
- // const info = infoMap.get(renderPasses[i])!;
10724
- // if (info && info.listStart > priority && (priority > infoMap.get(renderPass)!.listEnd || i === 1)) {
10725
- // return this.addToRenderPass(renderPass, mesh);
10726
- // }
10727
- // }
10728
- // // TODO: diff逻辑待优化,有时会添加进找不到的元素
10729
- // let last = renderPasses[renderPasses.length - 1];
10730
- // // TODO: 是否添加mesh到pass的判断方式需要优化,先通过长度判断是否有postprocess
10731
- // for (const pass of renderPasses) {
10732
- // if (!(pass instanceof HQGaussianDownSamplePass
10733
- // || pass instanceof BloomThresholdPass
10734
- // || pass instanceof ToneMappingPass
10735
- // || pass instanceof HQGaussianUpSamplePass
10736
- // || pass.name === 'mars-final-copy')) {
10737
- // last = pass;
10738
- // }
10739
- // }
10740
- // // if (priority > infoMap.get(last)!.listStart || renderPasses.length === 1) {
10741
- // // return this.addToRenderPass(last, mesh);
10742
- // // }
10743
- // return this.addToRenderPass(last, mesh);
10744
- // if (false) {
10745
- // throw Error('render pass not found');
10746
- // }
10830
+ this.drawObjectPass.addMesh(mesh);
10747
10831
  };
10748
10832
  /**
10749
10833
  * 把 Mesh 从 RenderPass 中移除,
10750
10834
  * 如果 renderPass 中没有 mesh,此 renderPass 会被删除
10751
10835
  * @param mesh - 要删除的 Mesh 对象
10752
10836
  */ _proto.removeMeshFromDefaultRenderPass = function removeMeshFromDefaultRenderPass(mesh) {
10753
- // const renderPasses = this.renderPasses;
10754
- // const infoMap = this.renderPassInfoMap;
10755
- // for (let i = renderPasses.length - 1; i >= 0; i--) {
10756
- // const renderPass = renderPasses[i];
10757
- // const info = infoMap.get(renderPass)!;
10758
- // // 只有渲染场景物体的pass才有 info
10759
- // if (!info) {
10760
- // continue;
10761
- // }
10762
- // if (info.listStart <= mesh.priority && info.listEnd >= mesh.priority) {
10763
- // const idx = renderPass.meshes.indexOf(mesh);
10764
- // if (idx === -1) {
10765
- // return;
10766
- // }
10767
- // // TODO hack: 现在的除了rp1和finalcopy pass,所有renderpass的meshes是一个copy加上一个filter mesh,这里的判断当filter mesh被删除后当前pass需不需要删除,
10768
- // // 判断需要更鲁棒。
10769
- // const shouldRestoreRenderPass = idx === 1 && renderPass.meshes[0].name === MARS_COPY_MESH_NAME;
10770
- // renderPass.removeMesh(mesh);
10771
- // if (shouldRestoreRenderPass) {
10772
- // const nextRenderPass = renderPasses[i + 1];
10773
- // const meshes = renderPass.meshes;
10774
- // if (!info.intermedia) {
10775
- // info.preRenderPass?.resetColorAttachments([]);
10776
- // //this.renderer.extension.resetColorAttachments?.(info.preRenderPass, []);
10777
- // }
10778
- // for (let j = 1; j < meshes.length; j++) {
10779
- // info.preRenderPass?.addMesh(meshes[j]);
10780
- // }
10781
- // const cp = renderPass.attachments[0]?.texture;
10782
- // const keepColor = cp === this.resource.color_a || cp === this.resource.color_b;
10783
- // renderPass.dispose({
10784
- // meshes: DestroyOptions.keep,
10785
- // colorAttachment: keepColor ? RenderPassDestroyAttachmentType.keep : RenderPassDestroyAttachmentType.destroy,
10786
- // depthStencilAttachment: RenderPassDestroyAttachmentType.keep,
10787
- // });
10788
- // removeItem(renderPasses, renderPass);
10789
- // this.removeRenderPass(renderPass);
10790
- // infoMap.delete(renderPass);
10791
- // if (nextRenderPass) {
10792
- // this.updateRenderInfo(nextRenderPass);
10793
- // }
10794
- // if (info.preRenderPass) {
10795
- // this.updateRenderInfo(info.preRenderPass);
10796
- // }
10797
- // if (info.prePasses) {
10798
- // info.prePasses.forEach(rp => {
10799
- // this.removeRenderPass(rp.pass);
10800
- // if (rp?.destroyOptions !== false) {
10801
- // rp.pass.attachments.forEach(c => {
10802
- // if (c.texture !== this.resource.color_b || c.texture !== this.resource.color_a) {
10803
- // c.texture.dispose();
10804
- // }
10805
- // });
10806
- // const options: RenderPassDestroyOptions = {
10807
- // ...(rp?.destroyOptions ? rp.destroyOptions as RenderPassDestroyOptions : {}),
10808
- // depthStencilAttachment: RenderPassDestroyAttachmentType.keep,
10809
- // };
10810
- // rp.pass.dispose(options);
10811
- // }
10812
- // });
10813
- // }
10814
- // this.resetRenderPassDefaultAttachment(renderPasses, Math.max(i - 1, 0));
10815
- // if (renderPasses.length === 1) {
10816
- // renderPasses[0].resetColorAttachments([]);
10817
- // //this.renderer.extension.resetColorAttachments?.(renderPasses[0], []);
10818
- // this.removeRenderPass(this.resource.finalCopyRP);
10819
- // }
10820
- // }
10821
- // return this.resetClearActions();
10822
- // }
10823
- // }
10837
+ this.drawObjectPass.removeMesh(mesh);
10824
10838
  };
10825
- // /**
10826
- // * 将 Mesh 所有在 RenderPass 进行切分
10827
- // * @param mesh - 目标 Mesh 对象
10828
- // * @param options - 切分选项,包含 RenderPass 相关的 Attachment 等数据
10829
- // */
10830
- // splitDefaultRenderPassByMesh (mesh: Mesh, options: RenderPassSplitOptions): RenderPass {
10831
- // const index = this.findMeshRenderPassIndex(mesh);
10832
- // const renderPass = this.renderPasses[index];
10833
- // if (false) {
10834
- // if (!renderPass) {
10835
- // throw Error('RenderPassNotFound');
10836
- // }
10837
- // }
10838
- // this.createResource();
10839
- // const meshIndex = renderPass.meshes.indexOf(mesh);
10840
- // const ms0 = renderPass.meshes.slice(0, meshIndex);
10841
- // const ms1 = renderPass.meshes.slice(meshIndex);
10842
- // const infoMap = this.renderPassInfoMap;
10843
- // // TODO 为什么要加这个判断?
10844
- // // if (renderPass.attachments[0] && this.renderPasses[index + 1] !== this.resource.finalCopyRP) {
10845
- // // throw Error('not implement');
10846
- // // } else {
10847
- // if (!options.attachments?.length) {
10848
- // throw Error('should include at least one color attachment');
10849
- // }
10850
- // const defRPS = this.renderPasses;
10851
- // const defIndex = defRPS.indexOf(renderPass);
10852
- // const lastDefRP = defRPS[defIndex - 1];
10853
- // removeItem(defRPS, renderPass);
10854
- // const lastInfo = infoMap.get(renderPass);
10855
- // infoMap.delete(renderPass);
10856
- // const filter = GPUCapability.getInstance().level === 2 ? glContext.LINEAR : glContext.NEAREST;
10857
- // const rp0 = new RenderPass({
10858
- // name: RENDER_PASS_NAME_PREFIX + defIndex,
10859
- // priority: renderPass.priority,
10860
- // attachments: [{
10861
- // texture: {
10862
- // sourceType: TextureSourceType.framebuffer,
10863
- // format: glContext.RGBA,
10864
- // name: 'frame_a',
10865
- // minFilter: filter,
10866
- // magFilter: filter,
10867
- // },
10868
- // }],
10869
- // clearAction: renderPass.clearAction || { colorAction: TextureLoadAction.clear },
10870
- // storeAction: renderPass.storeAction,
10871
- // depthStencilAttachment: this.resource.depthStencil,
10872
- // meshes: ms0,
10873
- // meshOrder: OrderType.ascending,
10874
- // });
10875
- // ms1.unshift(this.createCopyMesh());
10876
- // const renderPasses = this.renderPasses;
10877
- // renderPasses[index] = rp0;
10878
- // const prePasses: RenderPass[] = [];
10879
- // const restMeshes = ms1.slice();
10880
- // if (options.prePasses) {
10881
- // options.prePasses.forEach((pass, i) => {
10882
- // pass.priority = renderPass.priority + 1 + i;
10883
- // pass.setMeshes(ms1);
10884
- // prePasses.push(pass);
10885
- // });
10886
- // renderPasses.splice(index + 1, 0, ...prePasses);
10887
- // restMeshes.splice(0, 2);
10888
- // }
10889
- // const copyRP = this.resource.finalCopyRP;
10890
- // if (!renderPasses.includes(copyRP)) {
10891
- // renderPasses.push(copyRP);
10892
- // }
10893
- // // let sourcePass = (prePasses.length && !options.useLastDefaultPassColor) ? prePasses[prePasses.length - 1] : rp0;
10894
- // const finalFilterPass = prePasses[prePasses.length - 1];
10895
- // finalFilterPass.initialize(this.renderer);
10896
- // // 不切RT,接着上一个pass的渲染结果渲染
10897
- // const rp1 = new RenderPass({
10898
- // name: RENDER_PASS_NAME_PREFIX + (defIndex + 1),
10899
- // priority: renderPass.priority + 1 + (options.prePasses?.length || 0),
10900
- // meshes: restMeshes,
10901
- // meshOrder: OrderType.ascending,
10902
- // depthStencilAttachment: this.resource.depthStencil,
10903
- // storeAction: options.storeAction,
10904
- // clearAction: {
10905
- // depthAction: TextureLoadAction.whatever,
10906
- // stencilAction: TextureLoadAction.whatever,
10907
- // colorAction: TextureLoadAction.whatever,
10908
- // },
10909
- // });
10910
- // renderPasses.splice(index + 1 + (options.prePasses?.length || 0), 0, rp1);
10911
- // this.setRenderPasses(renderPasses);
10912
- // this.updateRenderInfo(finalFilterPass);
10913
- // this.updateRenderInfo(rp0);
10914
- // this.updateRenderInfo(rp1);
10915
- // // 目的是删除滤镜元素后,把之前滤镜用到的prePass给删除,逻辑有些复杂,考虑优化
10916
- // infoMap.get(rp0)!.prePasses = lastInfo!.prePasses;
10917
- // prePasses.pop();
10918
- // infoMap.get(finalFilterPass)!.prePasses = prePasses.map((pass, i) => {
10919
- // return { pass, destroyOptions: false };
10920
- // });
10921
- // this.resetClearActions();
10922
- // return finalFilterPass;
10923
- // }
10924
10839
  /**
10925
10840
  * 销毁 RenderFrame
10926
10841
  * @param options - 可以有选择销毁一些对象
@@ -11040,45 +10955,6 @@ var seed$6 = 1;
11040
10955
  this.clearAction.colorAction = TextureLoadAction.whatever;
11041
10956
  }
11042
10957
  };
11043
- // protected updateRenderInfo (renderPass: RenderPass): RenderPassInfo {
11044
- // const map = this.renderPassInfoMap;
11045
- // const passes = this.renderPasses;
11046
- // let info: RenderPassInfo;
11047
- // if (!map.has(renderPass)) {
11048
- // info = {
11049
- // intermedia: false,
11050
- // renderPass: renderPass,
11051
- // listStart: 0,
11052
- // listEnd: 0,
11053
- // };
11054
- // map.set(renderPass, info);
11055
- // } else {
11056
- // info = map.get(renderPass)!;
11057
- // }
11058
- // info.intermedia = renderPass.attachments.length > 0;
11059
- // const meshes = renderPass.meshes;
11060
- // if (meshes[0]) {
11061
- // info.listStart = (meshes[0].name === MARS_COPY_MESH_NAME ? meshes[1] : meshes[0]).priority;
11062
- // info.listEnd = meshes[meshes.length - 1].priority;
11063
- // } else {
11064
- // info.listStart = 0;
11065
- // info.listEnd = 0;
11066
- // }
11067
- // const index = passes.indexOf(renderPass);
11068
- // const depthStencilActon = index === 0 ? TextureLoadAction.clear : TextureLoadAction.whatever;
11069
- // if (index === 0) {
11070
- // renderPass.clearAction.colorAction = TextureLoadAction.clear;
11071
- // }
11072
- // renderPass.clearAction.depthAction = depthStencilActon;
11073
- // renderPass.clearAction.stencilAction = depthStencilActon;
11074
- // if (index > -1) {
11075
- // renderPass.semantics.setSemantic('EDITOR_TRANSFORM', () => this.editorTransform);
11076
- // } else {
11077
- // renderPass.semantics.setSemantic('EDITOR_TRANSFORM', undefined);
11078
- // }
11079
- // info.preRenderPass = passes[index - 1];
11080
- // return info;
11081
- // }
11082
10958
  /**
11083
10959
  * 设置 RenderPass 数组,直接修改内部的 RenderPass 数组
11084
10960
  * @param passes - RenderPass 数组
@@ -11279,7 +11155,7 @@ var FinalCopyRP = /*#__PURE__*/ function(RenderPass) {
11279
11155
  var GlobalUniforms = function GlobalUniforms() {
11280
11156
  this.floats = {};
11281
11157
  this.ints = {};
11282
- // vector3s: Record<string, vec3> = {};
11158
+ this.vector3s = {};
11283
11159
  this.vector4s = {};
11284
11160
  this.matrices = {};
11285
11161
  //...
@@ -11520,6 +11396,9 @@ var Renderer = /*#__PURE__*/ function() {
11520
11396
  _proto.setGlobalVector4 = function setGlobalVector4(name, value) {
11521
11397
  // OVERRIDE
11522
11398
  };
11399
+ _proto.setGlobalVector3 = function setGlobalVector3(name, value) {
11400
+ // OVERRIDE
11401
+ };
11523
11402
  _proto.setGlobalMatrix = function setGlobalMatrix(name, value) {
11524
11403
  // OVERRIDE
11525
11404
  };
@@ -13185,10 +13064,10 @@ var Vector4Curve = /*#__PURE__*/ function(ValueGetter) {
13185
13064
  }
13186
13065
  var _proto = Vector4Curve.prototype;
13187
13066
  _proto.onCreate = function onCreate(arg) {
13188
- this.xCurve = createValueGetter(arg.x);
13189
- this.yCurve = createValueGetter(arg.y);
13190
- this.zCurve = createValueGetter(arg.z);
13191
- this.wCurve = createValueGetter(arg.w);
13067
+ this.xCurve = createValueGetter(arg[0]);
13068
+ this.yCurve = createValueGetter(arg[1]);
13069
+ this.zCurve = createValueGetter(arg[2]);
13070
+ this.wCurve = createValueGetter(arg[3]);
13192
13071
  };
13193
13072
  _proto.getValue = function getValue(t) {
13194
13073
  var x = this.xCurve.getValue(t);
@@ -13208,8 +13087,8 @@ var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0 = "PRE_MAIN_COLOR_0";
13208
13087
  var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_MAIN_COLOR_SIZE_0";
13209
13088
  var PLAYER_OPTIONS_ENV_EDITOR = "editor";
13210
13089
  var HELP_LINK = {
13211
- "Item duration can't be less than 0": "https://galacean.antgroup.com/effects/user/gasrv4ka5sacrwpg#AOnQS",
13212
- "ValueType: 21/22 is not supported": "https://galacean.antgroup.com/effects/user/gasrv4ka5sacrwpg#smO1b"
13090
+ "Item duration can't be less than 0": "https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#AOnQS",
13091
+ "ValueType: 21/22 is not supported": "https://www.galacean.com/effects/user/gasrv4ka5sacrwpg#smO1b"
13213
13092
  };
13214
13093
 
13215
13094
  var _obj$4;
@@ -13288,10 +13167,10 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
13288
13167
  }
13289
13168
  var _proto = ColorCurve.prototype;
13290
13169
  _proto.onCreate = function onCreate(arg) {
13291
- this.rCurve = createValueGetter(arg.r);
13292
- this.gCurve = createValueGetter(arg.g);
13293
- this.bCurve = createValueGetter(arg.b);
13294
- this.aCurve = createValueGetter(arg.a);
13170
+ this.rCurve = createValueGetter(arg[0]);
13171
+ this.gCurve = createValueGetter(arg[1]);
13172
+ this.bCurve = createValueGetter(arg[2]);
13173
+ this.aCurve = createValueGetter(arg[3]);
13295
13174
  };
13296
13175
  _proto.getValue = function getValue(t) {
13297
13176
  var r = this.rCurve.getValue(t);
@@ -13304,7 +13183,9 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
13304
13183
  return ColorCurve;
13305
13184
  }(ValueGetter);
13306
13185
 
13307
- var BaseRenderComponent = /*#__PURE__*/ function(RendererComponent) {
13186
+ /**
13187
+ * @since 2.1.0
13188
+ */ var BaseRenderComponent = /*#__PURE__*/ function(RendererComponent) {
13308
13189
  _inherits(BaseRenderComponent, RendererComponent);
13309
13190
  function BaseRenderComponent(engine) {
13310
13191
  var _this;
@@ -13391,7 +13272,7 @@ var BaseRenderComponent = /*#__PURE__*/ function(RendererComponent) {
13391
13272
  * @param texture - 纹理对象
13392
13273
  */ _proto.setTexture = function setTexture(texture) {
13393
13274
  this.renderer.texture = texture;
13394
- this.material.setTexture("uSampler0", texture);
13275
+ this.material.setTexture("_MainTex", texture);
13395
13276
  };
13396
13277
  /**
13397
13278
  * @internal
@@ -13470,51 +13351,60 @@ var BaseRenderComponent = /*#__PURE__*/ function(RendererComponent) {
13470
13351
  geometry.setIndexData(indexData);
13471
13352
  geometry.setAttributeData("atlasOffset", attributes.atlasOffset);
13472
13353
  geometry.setDrawCount(data.index.length);
13473
- for(var i = 0; i < textures.length; i++){
13474
- var texture1 = textures[i];
13475
- material.setTexture("uSampler" + i, texture1);
13476
- }
13477
- // FIXME: 内存泄漏的临时方案,后面再调整
13478
- var emptyTexture = this.emptyTexture;
13479
- for(var k = textures.length; k < maxSpriteMeshItemCount; k++){
13480
- material.setTexture("uSampler" + k, emptyTexture);
13481
- }
13354
+ material.setTexture("_MainTex", texture);
13482
13355
  };
13483
13356
  _proto.getItemGeometryData = function getItemGeometryData() {
13484
- this.geometry.setAttributeData("aPos", new Float32Array([
13485
- -0.5,
13486
- 0.5,
13487
- 0,
13488
- -0.5,
13489
- -0.5,
13490
- 0,
13491
- 0.5,
13492
- 0.5,
13493
- 0,
13494
- 0.5,
13495
- -0.5,
13496
- 0
13497
- ]));
13498
- return {
13499
- index: [
13500
- 0,
13501
- 1,
13502
- 2,
13503
- 2,
13504
- 1,
13505
- 3
13506
- ],
13507
- atlasOffset: [
13357
+ var renderer = this.renderer;
13358
+ if (renderer.shape) {
13359
+ var _renderer_shape = renderer.shape, _renderer_shape_index = _renderer_shape.index, index = _renderer_shape_index === void 0 ? [] : _renderer_shape_index, _renderer_shape_aPoint = _renderer_shape.aPoint, aPoint = _renderer_shape_aPoint === void 0 ? [] : _renderer_shape_aPoint;
13360
+ var point = new Float32Array(aPoint);
13361
+ var position = [];
13362
+ var atlasOffset = [];
13363
+ for(var i = 0; i < point.length; i += 6){
13364
+ atlasOffset.push(aPoint[i + 2], aPoint[i + 3]);
13365
+ position.push(point[i], point[i + 1], 0.0);
13366
+ }
13367
+ this.geometry.setAttributeData("aPos", new Float32Array(position));
13368
+ return {
13369
+ index: index,
13370
+ atlasOffset: atlasOffset
13371
+ };
13372
+ } else {
13373
+ this.geometry.setAttributeData("aPos", new Float32Array([
13374
+ -0.5,
13375
+ 0.5,
13508
13376
  0,
13509
- 1,
13377
+ -0.5,
13378
+ -0.5,
13510
13379
  0,
13380
+ 0.5,
13381
+ 0.5,
13511
13382
  0,
13512
- 1,
13513
- 1,
13514
- 1,
13383
+ 0.5,
13384
+ -0.5,
13515
13385
  0
13516
- ]
13517
- };
13386
+ ]));
13387
+ return {
13388
+ index: [
13389
+ 0,
13390
+ 1,
13391
+ 2,
13392
+ 2,
13393
+ 1,
13394
+ 3
13395
+ ],
13396
+ atlasOffset: [
13397
+ 0,
13398
+ 1,
13399
+ 0,
13400
+ 0,
13401
+ 1,
13402
+ 1,
13403
+ 1,
13404
+ 0
13405
+ ]
13406
+ };
13407
+ }
13518
13408
  };
13519
13409
  _proto.createGeometry = function createGeometry(mode) {
13520
13410
  return Geometry.create(this.engine, {
@@ -13579,7 +13469,7 @@ var BaseRenderComponent = /*#__PURE__*/ function(RendererComponent) {
13579
13469
  setBlendMode(material, states.blendMode);
13580
13470
  setMaskMode(material, states.maskMode);
13581
13471
  setSideMode(material, states.side);
13582
- material.shader.shaderData.properties = 'uSampler0("uSampler0",2D) = "white" {}';
13472
+ material.shader.shaderData.properties = '_MainTex("_MainTex",2D) = "white" {}';
13583
13473
  if (!material.hasUniform("_Color")) {
13584
13474
  material.setVector4("_Color", new Vector4(0, 0, 0, 1));
13585
13475
  }
@@ -15173,6 +15063,473 @@ function recursive(x1, y1, x2, y2, x3, y3, x4, y4, points, distanceTolerance, le
15173
15063
  return Ellipse;
15174
15064
  }(ShapePrimitive);
15175
15065
 
15066
+ var StarType;
15067
+ (function(StarType) {
15068
+ StarType[StarType["Star"] = 0] = "Star";
15069
+ StarType[StarType["Polygon"] = 1] = "Polygon";
15070
+ })(StarType || (StarType = {}));
15071
+ var PolyStar = /*#__PURE__*/ function(ShapePrimitive) {
15072
+ _inherits(PolyStar, ShapePrimitive);
15073
+ function PolyStar(pointCount, outerRadius, innerRadius, outerRoundness, innerRoundness, starType) {
15074
+ if (pointCount === void 0) pointCount = 0;
15075
+ if (outerRadius === void 0) outerRadius = 0;
15076
+ if (innerRadius === void 0) innerRadius = 0;
15077
+ if (outerRoundness === void 0) outerRoundness = 0;
15078
+ if (innerRoundness === void 0) innerRoundness = 0;
15079
+ if (starType === void 0) starType = 0;
15080
+ var _this;
15081
+ _this = ShapePrimitive.call(this) || this;
15082
+ _this.pointCount = pointCount;
15083
+ _this.outerRadius = outerRadius;
15084
+ _this.innerRadius = innerRadius;
15085
+ _this.outerRoundness = outerRoundness;
15086
+ _this.innerRoundness = innerRoundness;
15087
+ _this.starType = starType;
15088
+ _this.v = [];
15089
+ _this.in = [];
15090
+ _this.out = [];
15091
+ return _this;
15092
+ }
15093
+ var _proto = PolyStar.prototype;
15094
+ _proto.clone = function clone() {
15095
+ var polyStar = new PolyStar(this.pointCount, this.outerRadius, this.innerRadius, this.outerRoundness, this.innerRoundness, this.starType);
15096
+ return polyStar;
15097
+ };
15098
+ _proto.copyFrom = function copyFrom(source) {
15099
+ this.pointCount = source.pointCount;
15100
+ this.outerRadius = source.outerRadius;
15101
+ this.innerRadius = source.innerRadius;
15102
+ this.outerRoundness = source.outerRoundness;
15103
+ this.innerRoundness = source.innerRoundness;
15104
+ this.starType = source.starType;
15105
+ };
15106
+ _proto.copyTo = function copyTo(destination) {
15107
+ destination.copyFrom(this);
15108
+ };
15109
+ _proto.build = function build(points) {
15110
+ switch(this.starType){
15111
+ case 0:
15112
+ {
15113
+ this.buildStarPath();
15114
+ break;
15115
+ }
15116
+ case 1:
15117
+ {
15118
+ this.buildPolygonPath();
15119
+ break;
15120
+ }
15121
+ }
15122
+ var smoothness = 1;
15123
+ for(var i = 0; i < this.v.length - 2; i += 2){
15124
+ buildAdaptiveBezier(points, this.v[i], this.v[i + 1], this.out[i], this.out[i + 1], this.in[i + 2], this.in[i + 3], this.v[i + 2], this.v[i + 3], smoothness);
15125
+ }
15126
+ // draw last curve
15127
+ var lastIndex = this.v.length - 1;
15128
+ buildAdaptiveBezier(points, this.v[lastIndex - 1], this.v[lastIndex], this.out[lastIndex - 1], this.out[lastIndex], this.in[0], this.in[1], this.v[0], this.v[1], smoothness);
15129
+ };
15130
+ _proto.triangulate = function triangulate1(points, vertices, verticesOffset, indices, indicesOffset) {
15131
+ var triangles = triangulate([
15132
+ points
15133
+ ]);
15134
+ for(var i = 0; i < triangles.length; i++){
15135
+ vertices[verticesOffset + i] = triangles[i];
15136
+ }
15137
+ var vertexCount = triangles.length / 2;
15138
+ for(var i1 = 0; i1 < vertexCount; i1++){
15139
+ indices[indicesOffset + i1] = i1;
15140
+ }
15141
+ };
15142
+ _proto.buildStarPath = function buildStarPath() {
15143
+ this.v = [];
15144
+ this.in = [];
15145
+ this.out = [];
15146
+ var numPts = Math.floor(this.pointCount) * 2;
15147
+ var angle = Math.PI * 2 / numPts;
15148
+ var longFlag = true;
15149
+ var longRad = this.outerRadius;
15150
+ var shortRad = this.innerRadius;
15151
+ var longRound = this.outerRoundness / 100;
15152
+ var shortRound = this.innerRoundness / 100;
15153
+ var longPerimSegment = 2 * Math.PI * longRad / (numPts * 2);
15154
+ var shortPerimSegment = 2 * Math.PI * shortRad / (numPts * 2);
15155
+ var i;
15156
+ var rad;
15157
+ var roundness;
15158
+ var perimSegment;
15159
+ var currentAng = -Math.PI / 2;
15160
+ var dir = 1;
15161
+ for(i = 0; i < numPts; i++){
15162
+ rad = longFlag ? longRad : shortRad;
15163
+ roundness = longFlag ? longRound : shortRound;
15164
+ perimSegment = longFlag ? longPerimSegment : shortPerimSegment;
15165
+ var x = rad * Math.cos(currentAng);
15166
+ var y = rad * Math.sin(currentAng);
15167
+ var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
15168
+ var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
15169
+ var offset = i * 2;
15170
+ this.v[offset] = x;
15171
+ this.v[offset + 1] = y;
15172
+ this.in[offset] = x + ox * perimSegment * roundness * dir;
15173
+ this.in[offset + 1] = y + oy * perimSegment * roundness * dir;
15174
+ this.out[offset] = x - ox * perimSegment * roundness * dir;
15175
+ this.out[offset + 1] = y - oy * perimSegment * roundness * dir;
15176
+ longFlag = !longFlag;
15177
+ currentAng += angle * dir;
15178
+ }
15179
+ };
15180
+ _proto.buildPolygonPath = function buildPolygonPath() {
15181
+ this.v = [];
15182
+ this.in = [];
15183
+ this.out = [];
15184
+ var numPts = Math.floor(this.pointCount);
15185
+ var angle = Math.PI * 2 / numPts;
15186
+ var rad = this.outerRadius;
15187
+ var roundness = this.outerRoundness / 100;
15188
+ var perimSegment = 2 * Math.PI * rad / (numPts * 4);
15189
+ var i;
15190
+ var currentAng = -Math.PI * 0.5;
15191
+ var dir = 1;
15192
+ for(i = 0; i < numPts; i++){
15193
+ var x = rad * Math.cos(currentAng);
15194
+ var y = rad * Math.sin(currentAng);
15195
+ var ox = x === 0 && y === 0 ? 0 : y / Math.sqrt(x * x + y * y);
15196
+ var oy = x === 0 && y === 0 ? 0 : -x / Math.sqrt(x * x + y * y);
15197
+ var offset = i * 2;
15198
+ this.v[offset] = x;
15199
+ this.v[offset + 1] = y;
15200
+ this.in[offset] = x + ox * perimSegment * roundness * dir;
15201
+ this.in[offset + 1] = y + oy * perimSegment * roundness * dir;
15202
+ this.out[offset] = x - ox * perimSegment * roundness * dir;
15203
+ this.out[offset + 1] = y - oy * perimSegment * roundness * dir;
15204
+ currentAng += angle * dir;
15205
+ }
15206
+ };
15207
+ return PolyStar;
15208
+ }(ShapePrimitive);
15209
+
15210
+ // const tempPoints = [new Point(), new Point(), new Point(), new Point()];
15211
+ /**
15212
+ * The `Rectangle` object is an area defined by its position, as indicated by its upper-left corner
15213
+ * point (`x`, `y`) and by its `width` and its `height`.
15214
+ */ var Rectangle$1 = /*#__PURE__*/ function(ShapePrimitive) {
15215
+ _inherits(Rectangle, ShapePrimitive);
15216
+ function Rectangle(x, y, width, height) {
15217
+ if (x === void 0) x = 0;
15218
+ if (y === void 0) y = 0;
15219
+ if (width === void 0) width = 0;
15220
+ if (height === void 0) height = 0;
15221
+ var _this;
15222
+ _this = ShapePrimitive.call(this) || this;
15223
+ _this.x = Number(x);
15224
+ _this.y = Number(y);
15225
+ _this.width = Number(width);
15226
+ _this.height = Number(height);
15227
+ return _this;
15228
+ }
15229
+ var _proto = Rectangle.prototype;
15230
+ /** Determines whether the Rectangle is empty. */ _proto.isEmpty = function isEmpty() {
15231
+ return this.left === this.right || this.top === this.bottom;
15232
+ };
15233
+ /**
15234
+ * Creates a clone of this Rectangle
15235
+ * @returns a copy of the rectangle
15236
+ */ _proto.clone = function clone() {
15237
+ return new Rectangle(this.x, this.y, this.width, this.height);
15238
+ };
15239
+ /**
15240
+ * Converts a Bounds object to a Rectangle object.
15241
+ * @param bounds - The bounds to copy and convert to a rectangle.
15242
+ * @returns Returns itself.
15243
+ */ // copyFromBounds (bounds: Bounds): this {
15244
+ // this.x = bounds.minX;
15245
+ // this.y = bounds.minY;
15246
+ // this.width = bounds.maxX - bounds.minX;
15247
+ // this.height = bounds.maxY - bounds.minY;
15248
+ // return this;
15249
+ // }
15250
+ /**
15251
+ * Copies another rectangle to this one.
15252
+ * @param rectangle - The rectangle to copy from.
15253
+ * @returns Returns itself.
15254
+ */ _proto.copyFrom = function copyFrom(rectangle) {
15255
+ this.x = rectangle.x;
15256
+ this.y = rectangle.y;
15257
+ this.width = rectangle.width;
15258
+ this.height = rectangle.height;
15259
+ return this;
15260
+ };
15261
+ /**
15262
+ * Copies this rectangle to another one.
15263
+ * @param rectangle - The rectangle to copy to.
15264
+ * @returns Returns given parameter.
15265
+ */ _proto.copyTo = function copyTo(rectangle) {
15266
+ rectangle.copyFrom(this);
15267
+ return rectangle;
15268
+ };
15269
+ /**
15270
+ * Checks whether the x and y coordinates given are contained within this Rectangle
15271
+ * @param x - The X coordinate of the point to test
15272
+ * @param y - The Y coordinate of the point to test
15273
+ * @returns Whether the x/y coordinates are within this Rectangle
15274
+ */ _proto.contains = function contains(x, y) {
15275
+ if (this.width <= 0 || this.height <= 0) {
15276
+ return false;
15277
+ }
15278
+ if (x >= this.x && x < this.x + this.width) {
15279
+ if (y >= this.y && y < this.y + this.height) {
15280
+ return true;
15281
+ }
15282
+ }
15283
+ return false;
15284
+ };
15285
+ /**
15286
+ * Checks whether the x and y coordinates given are contained within this rectangle including the stroke.
15287
+ * @param x - The X coordinate of the point to test
15288
+ * @param y - The Y coordinate of the point to test
15289
+ * @param strokeWidth - The width of the line to check
15290
+ * @returns Whether the x/y coordinates are within this rectangle
15291
+ */ _proto.strokeContains = function strokeContains(x, y, strokeWidth) {
15292
+ var _this = this, width = _this.width, height = _this.height;
15293
+ if (width <= 0 || height <= 0) {
15294
+ return false;
15295
+ }
15296
+ var _x = this.x;
15297
+ var _y = this.y;
15298
+ var outerLeft = _x - strokeWidth / 2;
15299
+ var outerRight = _x + width + strokeWidth / 2;
15300
+ var outerTop = _y - strokeWidth / 2;
15301
+ var outerBottom = _y + height + strokeWidth / 2;
15302
+ var innerLeft = _x + strokeWidth / 2;
15303
+ var innerRight = _x + width - strokeWidth / 2;
15304
+ var innerTop = _y + strokeWidth / 2;
15305
+ var innerBottom = _y + height - strokeWidth / 2;
15306
+ return x >= outerLeft && x <= outerRight && y >= outerTop && y <= outerBottom && !(x > innerLeft && x < innerRight && y > innerTop && y < innerBottom);
15307
+ };
15308
+ /**
15309
+ * Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.
15310
+ * Returns true only if the area of the intersection is >0, this means that Rectangles
15311
+ * sharing a side are not overlapping. Another side effect is that an arealess rectangle
15312
+ * (width or height equal to zero) can't intersect any other rectangle.
15313
+ * @param {Rectangle} other - The Rectangle to intersect with `this`.
15314
+ * @param {Matrix} transform - The transformation matrix of `other`.
15315
+ * @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`.
15316
+ */ // intersects (other: Rectangle, transform?: Matrix4): boolean {
15317
+ // if (!transform) {
15318
+ // const x0 = this.x < other.x ? other.x : this.x;
15319
+ // const x1 = this.right > other.right ? other.right : this.right;
15320
+ // if (x1 <= x0) {
15321
+ // return false;
15322
+ // }
15323
+ // const y0 = this.y < other.y ? other.y : this.y;
15324
+ // const y1 = this.bottom > other.bottom ? other.bottom : this.bottom;
15325
+ // return y1 > y0;
15326
+ // }
15327
+ // const x0 = this.left;
15328
+ // const x1 = this.right;
15329
+ // const y0 = this.top;
15330
+ // const y1 = this.bottom;
15331
+ // if (x1 <= x0 || y1 <= y0) {
15332
+ // return false;
15333
+ // }
15334
+ // const lt = tempPoints[0].set(other.left, other.top);
15335
+ // const lb = tempPoints[1].set(other.left, other.bottom);
15336
+ // const rt = tempPoints[2].set(other.right, other.top);
15337
+ // const rb = tempPoints[3].set(other.right, other.bottom);
15338
+ // if (rt.x <= lt.x || lb.y <= lt.y) {
15339
+ // return false;
15340
+ // }
15341
+ // const s = Math.sign((transform.a * transform.d) - (transform.b * transform.c));
15342
+ // if (s === 0) {
15343
+ // return false;
15344
+ // }
15345
+ // transform.apply(lt, lt);
15346
+ // transform.apply(lb, lb);
15347
+ // transform.apply(rt, rt);
15348
+ // transform.apply(rb, rb);
15349
+ // if (Math.max(lt.x, lb.x, rt.x, rb.x) <= x0
15350
+ // || Math.min(lt.x, lb.x, rt.x, rb.x) >= x1
15351
+ // || Math.max(lt.y, lb.y, rt.y, rb.y) <= y0
15352
+ // || Math.min(lt.y, lb.y, rt.y, rb.y) >= y1) {
15353
+ // return false;
15354
+ // }
15355
+ // const nx = s * (lb.y - lt.y);
15356
+ // const ny = s * (lt.x - lb.x);
15357
+ // const n00 = (nx * x0) + (ny * y0);
15358
+ // const n10 = (nx * x1) + (ny * y0);
15359
+ // const n01 = (nx * x0) + (ny * y1);
15360
+ // const n11 = (nx * x1) + (ny * y1);
15361
+ // if (Math.max(n00, n10, n01, n11) <= (nx * lt.x) + (ny * lt.y)
15362
+ // || Math.min(n00, n10, n01, n11) >= (nx * rb.x) + (ny * rb.y)) {
15363
+ // return false;
15364
+ // }
15365
+ // const mx = s * (lt.y - rt.y);
15366
+ // const my = s * (rt.x - lt.x);
15367
+ // const m00 = (mx * x0) + (my * y0);
15368
+ // const m10 = (mx * x1) + (my * y0);
15369
+ // const m01 = (mx * x0) + (my * y1);
15370
+ // const m11 = (mx * x1) + (my * y1);
15371
+ // if (Math.max(m00, m10, m01, m11) <= (mx * lt.x) + (my * lt.y)
15372
+ // || Math.min(m00, m10, m01, m11) >= (mx * rb.x) + (my * rb.y)) {
15373
+ // return false;
15374
+ // }
15375
+ // return true;
15376
+ // }
15377
+ /**
15378
+ * Pads the rectangle making it grow in all directions.
15379
+ * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
15380
+ * @param paddingX - The horizontal padding amount.
15381
+ * @param paddingY - The vertical padding amount.
15382
+ * @returns Returns itself.
15383
+ */ _proto.pad = function pad(paddingX, paddingY) {
15384
+ if (paddingX === void 0) paddingX = 0;
15385
+ if (paddingY === void 0) paddingY = paddingX;
15386
+ this.x -= paddingX;
15387
+ this.y -= paddingY;
15388
+ this.width += paddingX * 2;
15389
+ this.height += paddingY * 2;
15390
+ return this;
15391
+ };
15392
+ /**
15393
+ * Fits this rectangle around the passed one.
15394
+ * @param rectangle - The rectangle to fit.
15395
+ * @returns Returns itself.
15396
+ */ _proto.fit = function fit(rectangle) {
15397
+ var x1 = Math.max(this.x, rectangle.x);
15398
+ var x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width);
15399
+ var y1 = Math.max(this.y, rectangle.y);
15400
+ var y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);
15401
+ this.x = x1;
15402
+ this.width = Math.max(x2 - x1, 0);
15403
+ this.y = y1;
15404
+ this.height = Math.max(y2 - y1, 0);
15405
+ return this;
15406
+ };
15407
+ /**
15408
+ * Enlarges rectangle that way its corners lie on grid
15409
+ * @param resolution - resolution
15410
+ * @param eps - precision
15411
+ * @returns Returns itself.
15412
+ */ _proto.ceil = function ceil(resolution, eps) {
15413
+ if (resolution === void 0) resolution = 1;
15414
+ if (eps === void 0) eps = 0.001;
15415
+ var x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution;
15416
+ var y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution;
15417
+ this.x = Math.floor((this.x + eps) * resolution) / resolution;
15418
+ this.y = Math.floor((this.y + eps) * resolution) / resolution;
15419
+ this.width = x2 - this.x;
15420
+ this.height = y2 - this.y;
15421
+ return this;
15422
+ };
15423
+ /**
15424
+ * Enlarges this rectangle to include the passed rectangle.
15425
+ * @param rectangle - The rectangle to include.
15426
+ * @returns Returns itself.
15427
+ */ _proto.enlarge = function enlarge(rectangle) {
15428
+ var x1 = Math.min(this.x, rectangle.x);
15429
+ var x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width);
15430
+ var y1 = Math.min(this.y, rectangle.y);
15431
+ var y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);
15432
+ this.x = x1;
15433
+ this.width = x2 - x1;
15434
+ this.y = y1;
15435
+ this.height = y2 - y1;
15436
+ return this;
15437
+ };
15438
+ /**
15439
+ * Returns the framing rectangle of the rectangle as a Rectangle object
15440
+ * @param out - optional rectangle to store the result
15441
+ * @returns The framing rectangle
15442
+ */ _proto.getBounds = function getBounds(out) {
15443
+ out = out || new Rectangle();
15444
+ out.copyFrom(this);
15445
+ return out;
15446
+ };
15447
+ _proto.getX = function getX() {
15448
+ return this.x;
15449
+ };
15450
+ _proto.getY = function getY() {
15451
+ return this.y;
15452
+ };
15453
+ _proto.build = function build(points) {
15454
+ var x = this.x;
15455
+ var y = this.y;
15456
+ var width = this.width;
15457
+ var height = this.height;
15458
+ if (!(width >= 0 && height >= 0)) {
15459
+ return points;
15460
+ }
15461
+ points[0] = x;
15462
+ points[1] = y;
15463
+ points[2] = x + width;
15464
+ points[3] = y;
15465
+ points[4] = x + width;
15466
+ points[5] = y + height;
15467
+ points[6] = x;
15468
+ points[7] = y + height;
15469
+ return points;
15470
+ };
15471
+ _proto.triangulate = function triangulate(points, vertices, verticesOffset, indices, indicesOffset) {
15472
+ var count = 0;
15473
+ var verticesStride = 2;
15474
+ verticesOffset *= verticesStride;
15475
+ vertices[verticesOffset + count] = points[0];
15476
+ vertices[verticesOffset + count + 1] = points[1];
15477
+ count += verticesStride;
15478
+ vertices[verticesOffset + count] = points[2];
15479
+ vertices[verticesOffset + count + 1] = points[3];
15480
+ count += verticesStride;
15481
+ vertices[verticesOffset + count] = points[6];
15482
+ vertices[verticesOffset + count + 1] = points[7];
15483
+ count += verticesStride;
15484
+ vertices[verticesOffset + count] = points[4];
15485
+ vertices[verticesOffset + count + 1] = points[5];
15486
+ count += verticesStride;
15487
+ var verticesIndex = verticesOffset / verticesStride;
15488
+ // triangle 1
15489
+ indices[indicesOffset++] = verticesIndex;
15490
+ indices[indicesOffset++] = verticesIndex + 1;
15491
+ indices[indicesOffset++] = verticesIndex + 2;
15492
+ // triangle 2
15493
+ indices[indicesOffset++] = verticesIndex + 1;
15494
+ indices[indicesOffset++] = verticesIndex + 3;
15495
+ indices[indicesOffset++] = verticesIndex + 2;
15496
+ };
15497
+ _create_class(Rectangle, [
15498
+ {
15499
+ key: "left",
15500
+ get: /** Returns the left edge of the rectangle. */ function get() {
15501
+ return this.x;
15502
+ }
15503
+ },
15504
+ {
15505
+ key: "right",
15506
+ get: /** Returns the right edge of the rectangle. */ function get() {
15507
+ return this.x + this.width;
15508
+ }
15509
+ },
15510
+ {
15511
+ key: "top",
15512
+ get: /** Returns the top edge of the rectangle. */ function get() {
15513
+ return this.y;
15514
+ }
15515
+ },
15516
+ {
15517
+ key: "bottom",
15518
+ get: /** Returns the bottom edge of the rectangle. */ function get() {
15519
+ return this.y + this.height;
15520
+ }
15521
+ }
15522
+ ], [
15523
+ {
15524
+ key: "EMPTY",
15525
+ get: /** A constant empty rectangle. This is a new object every time the property is accessed */ function get() {
15526
+ return new Rectangle(0, 0, 0, 0);
15527
+ }
15528
+ }
15529
+ ]);
15530
+ return Rectangle;
15531
+ }(ShapePrimitive);
15532
+
15176
15533
  var ShapePath = /*#__PURE__*/ function() {
15177
15534
  function ShapePath(graphicsPath) {
15178
15535
  this.graphicsPath = graphicsPath;
@@ -15204,6 +15561,16 @@ var ShapePath = /*#__PURE__*/ function() {
15204
15561
  this.ellipse(data[0], data[1], data[2], data[3], data[4]);
15205
15562
  break;
15206
15563
  }
15564
+ case "polyStar":
15565
+ {
15566
+ this.polyStar(data[0], data[1], data[2], data[3], data[4], data[5], data[6]);
15567
+ break;
15568
+ }
15569
+ case "rect":
15570
+ {
15571
+ this.rect(data[0], data[1], data[2], data[3], data[4]);
15572
+ break;
15573
+ }
15207
15574
  }
15208
15575
  }
15209
15576
  this.endPoly();
@@ -15244,6 +15611,22 @@ var ShapePath = /*#__PURE__*/ function() {
15244
15611
  this.drawShape(new Ellipse(x, y, radiusX, radiusY), transform);
15245
15612
  return this;
15246
15613
  };
15614
+ _proto.polyStar = function polyStar(pointCount, outerRadius, innerRadius, outerRoundness, innerRoundness, starType, transform) {
15615
+ this.drawShape(new PolyStar(pointCount, outerRadius, innerRadius, outerRoundness, innerRoundness, starType), transform);
15616
+ return this;
15617
+ };
15618
+ /**
15619
+ * Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
15620
+ * @param x - The x-coordinate of the upper-left corner of the rectangle.
15621
+ * @param y - The y-coordinate of the upper-left corner of the rectangle.
15622
+ * @param w - The width of the rectangle.
15623
+ * @param h - The height of the rectangle.
15624
+ * @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
15625
+ * @returns The instance of the current object for chaining.
15626
+ */ _proto.rect = function rect(x, y, w, h, transform) {
15627
+ this.drawShape(new Rectangle$1(x, y, w, h), transform);
15628
+ return this;
15629
+ };
15247
15630
  /**
15248
15631
  * Draws a given shape on the canvas.
15249
15632
  * This is a generic method that can draw any type of shape specified by the `ShapePrimitive` parameter.
@@ -15380,8 +15763,8 @@ var GraphicsPath = /*#__PURE__*/ function() {
15380
15763
  };
15381
15764
  /**
15382
15765
  * Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
15383
- * @param x - The x-coordinate of the top-left corner of the rectangle.
15384
- * @param y - The y-coordinate of the top-left corner of the rectangle.
15766
+ * @param x - The x-coordinate of the upper-left corner of the rectangle.
15767
+ * @param y - The y-coordinate of the upper-left corner of the rectangle.
15385
15768
  * @param w - The width of the rectangle.
15386
15769
  * @param h - The height of the rectangle.
15387
15770
  * @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
@@ -15400,6 +15783,22 @@ var GraphicsPath = /*#__PURE__*/ function() {
15400
15783
  this.dirty = true;
15401
15784
  return this;
15402
15785
  };
15786
+ _proto.polyStar = function polyStar(pointCount, outerRadius, innerRadius, outerRoundness, innerRoundness, starType, transform) {
15787
+ this.instructions.push({
15788
+ action: "polyStar",
15789
+ data: [
15790
+ pointCount,
15791
+ outerRadius,
15792
+ innerRadius,
15793
+ outerRoundness,
15794
+ innerRoundness,
15795
+ starType,
15796
+ transform
15797
+ ]
15798
+ });
15799
+ this.dirty = true;
15800
+ return this;
15801
+ };
15403
15802
  _proto.clear = function clear() {
15404
15803
  this.instructions.length = 0;
15405
15804
  this.dirty = true;
@@ -15435,7 +15834,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15435
15834
  _this.curveValues = [];
15436
15835
  _this.animated = true;
15437
15836
  _this.vert = "\nprecision highp float;\n\nattribute vec3 aPos;//x y\n\nuniform mat4 effects_MatrixVP;\nuniform mat4 effects_MatrixInvV;\nuniform mat4 effects_ObjectToWorld;\n\nvoid main() {\n vec4 pos = vec4(aPos.xyz, 1.0);\n gl_Position = effects_MatrixVP * effects_ObjectToWorld * pos;\n}\n";
15438
- _this.frag = "\nprecision highp float;\n\nuniform vec4 _Color;\n\nvoid main() {\n vec4 color = _Color;\n gl_FragColor = color;\n}\n";
15837
+ _this.frag = "\nprecision highp float;\n\nuniform vec4 _Color;\n\nvoid main() {\n vec4 color = _Color;\n color.rgb *= color.a;\n gl_FragColor = color;\n}\n";
15439
15838
  if (!_this.geometry) {
15440
15839
  _this.geometry = Geometry.create(engine, {
15441
15840
  attributes: {
@@ -15477,7 +15876,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15477
15876
  };
15478
15877
  _this.material = Material.create(engine, materialProps);
15479
15878
  _this.material.setColor("_Color", new Color(1, 1, 1, 1));
15480
- _this.material.depthMask = true;
15879
+ _this.material.depthMask = false;
15481
15880
  _this.material.depthTest = true;
15482
15881
  _this.material.blending = true;
15483
15882
  }
@@ -15542,16 +15941,18 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15542
15941
  };
15543
15942
  _proto.buildPath = function buildPath(data) {
15544
15943
  this.path.clear();
15545
- switch(data.type){
15546
- case 0:
15944
+ var shapeData = data;
15945
+ switch(shapeData.type){
15946
+ case ShapePrimitiveType.Custom:
15547
15947
  {
15548
- var customData = data;
15549
- var points = customData.param.points;
15550
- var easingIns = customData.param.easingIn;
15551
- var easingOuts = customData.param.easingOut;
15948
+ var customData = shapeData;
15949
+ var points = customData.points;
15950
+ var easingIns = customData.easingIns;
15951
+ var easingOuts = customData.easingOuts;
15552
15952
  this.curveValues = [];
15553
- for(var _iterator = _create_for_of_iterator_helper_loose(customData.param.shapes), _step; !(_step = _iterator()).done;){
15953
+ for(var _iterator = _create_for_of_iterator_helper_loose(customData.shapes), _step; !(_step = _iterator()).done;){
15554
15954
  var shape = _step.value;
15955
+ this.setFillColor(shape.fill);
15555
15956
  var indices = shape.indexes;
15556
15957
  for(var i = 1; i < indices.length; i++){
15557
15958
  var pointIndex = indices[i];
@@ -15579,46 +15980,185 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
15579
15980
  }
15580
15981
  break;
15581
15982
  }
15582
- case 2:
15983
+ case ShapePrimitiveType.Ellipse:
15984
+ {
15985
+ var ellipseData = shapeData;
15986
+ this.path.ellipse(0, 0, ellipseData.xRadius, ellipseData.yRadius);
15987
+ this.setFillColor(ellipseData.fill);
15988
+ break;
15989
+ }
15990
+ case ShapePrimitiveType.Rectangle:
15991
+ {
15992
+ var rectangleData = shapeData;
15993
+ this.path.rect(-rectangleData.width / 2, -rectangleData.height / 2, rectangleData.width, rectangleData.height);
15994
+ this.setFillColor(rectangleData.fill);
15995
+ break;
15996
+ }
15997
+ case ShapePrimitiveType.Star:
15583
15998
  {
15584
- var ellipseData = data;
15585
- var ellipseParam = ellipseData.param;
15586
- this.path.ellipse(0, 0, ellipseParam.xRadius, ellipseParam.yRadius);
15999
+ var starData = shapeData;
16000
+ this.path.polyStar(starData.pointCount, starData.outerRadius, starData.innerRadius, starData.outerRoundness, starData.innerRoundness, StarType.Star);
16001
+ this.setFillColor(starData.fill);
16002
+ break;
16003
+ }
16004
+ case ShapePrimitiveType.Polygon:
16005
+ {
16006
+ var polygonData = shapeData;
16007
+ this.path.polyStar(polygonData.pointCount, polygonData.radius, polygonData.radius, polygonData.roundness, polygonData.roundness, StarType.Polygon);
16008
+ this.setFillColor(polygonData.fill);
15587
16009
  break;
15588
16010
  }
15589
16011
  }
15590
16012
  };
16013
+ _proto.setFillColor = function setFillColor(fill) {
16014
+ if (fill) {
16015
+ var color = fill.color;
16016
+ this.material.setColor("_Color", new Color(color.r, color.g, color.b, color.a));
16017
+ }
16018
+ };
15591
16019
  _proto.fromData = function fromData(data) {
15592
16020
  MeshComponent.prototype.fromData.call(this, data);
15593
16021
  this.data = data;
16022
+ var material = this.material;
16023
+ //@ts-expect-error // TODO 新版蒙版上线后重构
16024
+ material.stencilRef = data.renderer.mask !== undefined ? [
16025
+ data.renderer.mask,
16026
+ data.renderer.mask
16027
+ ] : undefined;
16028
+ //@ts-expect-error // TODO 新版蒙版上线后重构
16029
+ setMaskMode(material, data.renderer.maskMode);
15594
16030
  };
15595
16031
  return ShapeComponent;
15596
16032
  }(MeshComponent);
15597
16033
  ShapeComponent = __decorate([
15598
16034
  effectsClass("ShapeComponent")
15599
16035
  ], ShapeComponent);
15600
- var ComponentShapeType;
15601
- (function(ComponentShapeType) {
15602
- /**
15603
- * 自定义图形
15604
- */ ComponentShapeType[ComponentShapeType["CUSTOM"] = 0] = "CUSTOM";
15605
- /**
15606
- * 矩形
15607
- */ ComponentShapeType[ComponentShapeType["RECTANGLE"] = 1] = "RECTANGLE";
15608
- /**
15609
- * 椭圆
15610
- */ ComponentShapeType[ComponentShapeType["ELLIPSE"] = 2] = "ELLIPSE";
15611
- /**
15612
- * 多边形
15613
- */ ComponentShapeType[ComponentShapeType["POLYGON"] = 3] = "POLYGON";
15614
- /**
15615
- * 星形
15616
- */ ComponentShapeType[ComponentShapeType["STAR"] = 4] = "STAR";
15617
- })(ComponentShapeType || (ComponentShapeType = {}));
15618
- var ShapeConnectType;
15619
- (function(ShapeConnectType) {})(ShapeConnectType || (ShapeConnectType = {}));
15620
- var ShapePointType;
15621
- (function(ShapePointType) {})(ShapePointType || (ShapePointType = {}));
16036
+
16037
+ var Fake3DComponent = /*#__PURE__*/ function(Component) {
16038
+ _inherits(Fake3DComponent, Component);
16039
+ function Fake3DComponent() {
16040
+ var _this;
16041
+ _this = Component.apply(this, arguments) || this;
16042
+ _this.loop = false;
16043
+ _this.amountOfMotion = 1.0;
16044
+ _this.animationLength = 2.0;
16045
+ _this.mode = 1;
16046
+ _this.startPositionX = 0;
16047
+ _this.startPositionY = 0;
16048
+ _this.startPositionZ = 0;
16049
+ _this.endPositionX = 0;
16050
+ _this.endPositionY = 0;
16051
+ _this.endPositionZ = 0;
16052
+ _this.amplitudeX = 0;
16053
+ _this.amplitudeY = 0;
16054
+ _this.amplitudeZ = 0;
16055
+ _this.phaseX = 0;
16056
+ _this.phaseY = 0;
16057
+ _this.phaseZ = 0;
16058
+ return _this;
16059
+ }
16060
+ var _proto = Fake3DComponent.prototype;
16061
+ _proto.onStart = function onStart() {
16062
+ this.effectComponent = this.item.getComponent(EffectComponent);
16063
+ };
16064
+ _proto.onUpdate = function onUpdate(dt) {
16065
+ this.updateFake3D();
16066
+ };
16067
+ _proto.updateFake3D = function updateFake3D() {
16068
+ if (!this.effectComponent) {
16069
+ return;
16070
+ }
16071
+ var time = this.item.time % this.animationLength / this.animationLength;
16072
+ var _PosX = 0;
16073
+ var _PosY = 0;
16074
+ var _PosZ = 0;
16075
+ switch(this.mode){
16076
+ case 0:
16077
+ {
16078
+ var PI = Math.PI;
16079
+ _PosX = Math.sin(2.0 * PI * (time + this.phaseX)) * this.amplitudeX;
16080
+ _PosY = Math.sin(2.0 * PI * (time + this.phaseY)) * this.amplitudeY;
16081
+ _PosZ = Math.sin(2.0 * PI * (time + this.phaseZ)) * this.amplitudeZ;
16082
+ break;
16083
+ }
16084
+ case 1:
16085
+ {
16086
+ var localTime = time;
16087
+ if (this.loop) {
16088
+ if (localTime > 0.5) {
16089
+ localTime = 1 - localTime;
16090
+ }
16091
+ localTime *= 2;
16092
+ }
16093
+ _PosX = this.startPositionX * (1 - localTime) + localTime * this.endPositionX;
16094
+ _PosY = this.startPositionY * (1 - localTime) + localTime * this.endPositionY;
16095
+ _PosZ = this.startPositionZ * (1 - localTime) + localTime * this.endPositionZ;
16096
+ break;
16097
+ }
16098
+ }
16099
+ var material = this.effectComponent.material;
16100
+ material.setFloat("_PosX", _PosX * this.amountOfMotion);
16101
+ material.setFloat("_PosY", _PosY * this.amountOfMotion);
16102
+ material.setFloat("_PosZ", _PosZ * this.amountOfMotion);
16103
+ };
16104
+ return Fake3DComponent;
16105
+ }(Component);
16106
+ __decorate([
16107
+ serialize()
16108
+ ], Fake3DComponent.prototype, "loop", void 0);
16109
+ __decorate([
16110
+ serialize()
16111
+ ], Fake3DComponent.prototype, "amountOfMotion", void 0);
16112
+ __decorate([
16113
+ serialize()
16114
+ ], Fake3DComponent.prototype, "animationLength", void 0);
16115
+ __decorate([
16116
+ serialize()
16117
+ ], Fake3DComponent.prototype, "mode", void 0);
16118
+ __decorate([
16119
+ serialize()
16120
+ ], Fake3DComponent.prototype, "startPositionX", void 0);
16121
+ __decorate([
16122
+ serialize()
16123
+ ], Fake3DComponent.prototype, "startPositionY", void 0);
16124
+ __decorate([
16125
+ serialize()
16126
+ ], Fake3DComponent.prototype, "startPositionZ", void 0);
16127
+ __decorate([
16128
+ serialize()
16129
+ ], Fake3DComponent.prototype, "endPositionX", void 0);
16130
+ __decorate([
16131
+ serialize()
16132
+ ], Fake3DComponent.prototype, "endPositionY", void 0);
16133
+ __decorate([
16134
+ serialize()
16135
+ ], Fake3DComponent.prototype, "endPositionZ", void 0);
16136
+ __decorate([
16137
+ serialize()
16138
+ ], Fake3DComponent.prototype, "amplitudeX", void 0);
16139
+ __decorate([
16140
+ serialize()
16141
+ ], Fake3DComponent.prototype, "amplitudeY", void 0);
16142
+ __decorate([
16143
+ serialize()
16144
+ ], Fake3DComponent.prototype, "amplitudeZ", void 0);
16145
+ __decorate([
16146
+ serialize()
16147
+ ], Fake3DComponent.prototype, "phaseX", void 0);
16148
+ __decorate([
16149
+ serialize()
16150
+ ], Fake3DComponent.prototype, "phaseY", void 0);
16151
+ __decorate([
16152
+ serialize()
16153
+ ], Fake3DComponent.prototype, "phaseZ", void 0);
16154
+ Fake3DComponent = __decorate([
16155
+ effectsClass("Fake3DComponent")
16156
+ ], Fake3DComponent);
16157
+ var Fake3DAnimationMode;
16158
+ (function(Fake3DAnimationMode) {
16159
+ Fake3DAnimationMode[Fake3DAnimationMode["Circular"] = 0] = "Circular";
16160
+ Fake3DAnimationMode[Fake3DAnimationMode["Linear"] = 1] = "Linear";
16161
+ })(Fake3DAnimationMode || (Fake3DAnimationMode = {}));
15622
16162
 
15623
16163
  var CameraController = /*#__PURE__*/ function(Behaviour) {
15624
16164
  _inherits(CameraController, Behaviour);
@@ -15990,8 +16530,8 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
15990
16530
  0
15991
16531
  ]
15992
16532
  };
16533
+ _this.duringPlay = false;
15993
16534
  /** 是否响应点击和拖拽交互事件 */ _this._interactive = true;
15994
- _this.hasBeenAddedToComposition = false;
15995
16535
  _this.getHitTestParams = function(force) {
15996
16536
  if (!_this.clickable) {
15997
16537
  return;
@@ -16028,7 +16568,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
16028
16568
  ];
16029
16569
  };
16030
16570
  _proto.onStart = function onStart() {
16031
- var _this = this;
16032
16571
  var options = this.item.props.content.options;
16033
16572
  var env = this.item.engine.renderer.env;
16034
16573
  var composition = this.item.composition;
@@ -16051,33 +16590,38 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
16051
16590
  this.previewContent.mesh.item = this.item;
16052
16591
  this.materials = this.previewContent.mesh.materials;
16053
16592
  }
16054
- this.item.getHitTestParams = this.getHitTestParams;
16055
- this.item.onEnd = function() {
16056
- if (_this.item && _this.item.composition) {
16057
- var _this_previewContent;
16058
- _this.item.composition.removeInteractiveItem(_this.item, _this.item.props.content.options.type);
16059
- _this.clickable = false;
16060
- _this.hasBeenAddedToComposition = false;
16061
- (_this_previewContent = _this.previewContent) == null ? void 0 : _this_previewContent.mesh.dispose();
16062
- _this.endDragTarget();
16063
- }
16064
- };
16593
+ this.item.getHitTestParams = this.getHitTestParams;
16594
+ };
16595
+ _proto.onDisable = function onDisable() {
16596
+ RendererComponent.prototype.onDisable.call(this);
16597
+ if (this.item && this.item.composition) {
16598
+ var _this_previewContent;
16599
+ if (this.duringPlay && !this.item.transform.getValid()) {
16600
+ this.item.composition.removeInteractiveItem(this.item, this.item.props.content.options.type);
16601
+ this.duringPlay = false;
16602
+ }
16603
+ this.clickable = false;
16604
+ (_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.mesh.dispose();
16605
+ this.endDragTarget();
16606
+ }
16607
+ };
16608
+ _proto.onEnable = function onEnable() {
16609
+ RendererComponent.prototype.onEnable.call(this);
16610
+ var type = this.interactData.options.type;
16611
+ if (type === InteractType.CLICK) {
16612
+ this.clickable = true;
16613
+ }
16065
16614
  };
16066
16615
  _proto.onUpdate = function onUpdate(dt) {
16067
16616
  var _this_previewContent;
16068
- if (!this.isActiveAndEnabled) {
16069
- return;
16070
- }
16071
- (_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.updateMesh();
16072
- if (!this.hasBeenAddedToComposition && this.item.composition) {
16073
- var type = this.interactData.options.type;
16074
- if (type === InteractType.CLICK) {
16075
- this.clickable = true;
16076
- }
16617
+ this.duringPlay = true;
16618
+ // trigger messageBegin when item enter
16619
+ if (this.item.time > 0 && this.item.time - dt / 1000 <= 0) {
16620
+ var _this_item_composition;
16077
16621
  var options = this.item.props.content.options;
16078
- this.item.composition.addInteractiveItem(this.item, options.type);
16079
- this.hasBeenAddedToComposition = true;
16622
+ (_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.addInteractiveItem(this.item, options.type);
16080
16623
  }
16624
+ (_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.updateMesh();
16081
16625
  if (!this.dragEvent || !this.bouncingArg) {
16082
16626
  return;
16083
16627
  }
@@ -16245,7 +16789,9 @@ function shouldIgnoreBouncing(arg, mul) {
16245
16789
  return arg && Math.abs(arg.vx || 0) < threshold && Math.abs(arg.vy || 0) < threshold;
16246
16790
  }
16247
16791
 
16248
- var MeshCollider = /*#__PURE__*/ function() {
16792
+ /**
16793
+ *
16794
+ */ var MeshCollider = /*#__PURE__*/ function() {
16249
16795
  function MeshCollider() {
16250
16796
  this.triangles = [];
16251
16797
  }
@@ -16253,6 +16799,38 @@ var MeshCollider = /*#__PURE__*/ function() {
16253
16799
  _proto.getBoundingBoxData = function getBoundingBoxData() {
16254
16800
  return this.boundingBoxData;
16255
16801
  };
16802
+ _proto.getBoundingBox = function getBoundingBox() {
16803
+ var maxX = -Number.MAX_VALUE;
16804
+ var maxY = -Number.MAX_VALUE;
16805
+ var minX = Number.MAX_VALUE;
16806
+ var minY = Number.MAX_VALUE;
16807
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.boundingBoxData.area), _step; !(_step = _iterator()).done;){
16808
+ var triangle = _step.value;
16809
+ maxX = Math.max(triangle.p0.x, triangle.p1.x, triangle.p2.x, maxX);
16810
+ maxY = Math.max(triangle.p0.y, triangle.p1.y, triangle.p2.y, maxY);
16811
+ minX = Math.min(triangle.p0.x, triangle.p1.x, triangle.p2.x, minX);
16812
+ minY = Math.min(triangle.p0.y, triangle.p1.y, triangle.p2.y, minY);
16813
+ }
16814
+ var area = [];
16815
+ var point0 = new Vector3(minX, maxY, 0);
16816
+ var point1 = new Vector3(maxX, maxY, 0);
16817
+ var point2 = new Vector3(maxX, minY, 0);
16818
+ var point3 = new Vector3(minX, minY, 0);
16819
+ area.push({
16820
+ p0: point0,
16821
+ p1: point1,
16822
+ p2: point2
16823
+ });
16824
+ area.push({
16825
+ p0: point0,
16826
+ p1: point2,
16827
+ p2: point3
16828
+ });
16829
+ return {
16830
+ type: HitTestType.triangle,
16831
+ area: area
16832
+ };
16833
+ };
16256
16834
  _proto.setGeometry = function setGeometry(geometry, worldMatrix) {
16257
16835
  if (this.geometry !== geometry) {
16258
16836
  this.triangles = this.geometryToTriangles(geometry);
@@ -16457,6 +17035,7 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
16457
17035
  if (inputCount === void 0) inputCount = 0;
16458
17036
  this.onPlayablePlayFlag = true;
16459
17037
  this.onPlayablePauseFlag = false;
17038
+ this.duration = 0;
16460
17039
  this.destroyed = false;
16461
17040
  this.inputs = [];
16462
17041
  this.inputOuputPorts = [];
@@ -16549,6 +17128,12 @@ var SpriteLoader = /*#__PURE__*/ function(AbstractPlugin) {
16549
17128
  _proto.getTime = function getTime() {
16550
17129
  return this.time;
16551
17130
  };
17131
+ _proto.setDuration = function setDuration(duration) {
17132
+ this.duration = duration;
17133
+ };
17134
+ _proto.getDuration = function getDuration() {
17135
+ return this.duration;
17136
+ };
16552
17137
  _proto.getPlayState = function getPlayState() {
16553
17138
  return this.playState;
16554
17139
  };
@@ -16700,7 +17285,9 @@ var PlayableTraversalMode;
16700
17285
  var tempQuat$1 = new Quaternion();
16701
17286
  var seed$4 = 1;
16702
17287
  // TODO 继承 Component
16703
- var Transform = /*#__PURE__*/ function() {
17288
+ /**
17289
+ *
17290
+ */ var Transform = /*#__PURE__*/ function() {
16704
17291
  function Transform(props, parent) {
16705
17292
  if (props === void 0) props = {};
16706
17293
  this.taggedProperties = {};
@@ -17165,7 +17752,11 @@ var Transform = /*#__PURE__*/ function() {
17165
17752
  return Transform;
17166
17753
  }();
17167
17754
 
17168
- var EventEmitter = function EventEmitter() {
17755
+ /**
17756
+ *
17757
+ */ /**
17758
+ * 事件监听器
17759
+ */ var EventEmitter = function EventEmitter() {
17169
17760
  var _this = this;
17170
17761
  var _this1 = this;
17171
17762
  this.listeners = {};
@@ -17259,17 +17850,15 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
17259
17850
  /**
17260
17851
  * 元素动画结束时行为(如何处理元素)
17261
17852
  */ _this.endBehavior = EndBehavior.forward;
17262
- /**
17263
- * 元素是否可用
17264
- */ _this.ended = false;
17265
- _this.reusable = false;
17266
17853
  _this.type = ItemType.base;
17267
17854
  _this.isDuringPlay = false;
17268
17855
  _this.components = [];
17269
17856
  _this.rendererComponents = [];
17270
17857
  /**
17271
- * 元素可见性,该值的改变会触发 `handleVisibleChanged` 回调
17272
- * @protected
17858
+ * 元素是否激活
17859
+ */ _this.active = true;
17860
+ /**
17861
+ * 元素组件是否显示,用于批量开关元素组件
17273
17862
  */ _this.visible = true;
17274
17863
  /**
17275
17864
  * 元素动画的速度
@@ -17400,12 +17989,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
17400
17989
  }
17401
17990
  };
17402
17991
  /**
17403
- * 元素动画结束播放时回调函数
17404
- * @override
17405
- */ _proto.onEnd = function onEnd() {
17406
- // OVERRIDE
17407
- };
17408
- /**
17409
17992
  * 通过指定 r、g、b、a 值设置元素的颜色
17410
17993
  * @param {number} r
17411
17994
  * @param {number} g
@@ -17418,17 +18001,27 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
17418
18001
  * @param opacity - 透明度值,范围 [0,1]
17419
18002
  */ _proto.setOpacity = function setOpacity(opacity) {};
17420
18003
  /**
17421
- * 获取元素显隐属性
17422
- */ _proto.getVisible = function getVisible() {
17423
- return this.visible;
18004
+ * 激活或停用 VFXItem
18005
+ */ _proto.setActive = function setActive(value) {
18006
+ if (this.active !== value) {
18007
+ this.active = !!value;
18008
+ this.onActiveChanged();
18009
+ }
17424
18010
  };
17425
18011
  /**
17426
- * 设置元素显隐属性 会触发 `handleVisibleChanged` 回调
18012
+ * 设置元素的显隐,该设置会批量开关元素组件
17427
18013
  */ _proto.setVisible = function setVisible(visible) {
17428
- if (this.visible !== visible) {
17429
- this.visible = !!visible;
17430
- this.onActiveChanged();
18014
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.components), _step; !(_step = _iterator()).done;){
18015
+ var component = _step.value;
18016
+ component.enabled = visible;
17431
18017
  }
18018
+ this.visible = visible;
18019
+ };
18020
+ /**
18021
+ * 元素组件显隐状态
18022
+ * @deprecated use isVisible instead
18023
+ */ _proto.getVisible = function getVisible() {
18024
+ return this.visible;
17432
18025
  };
17433
18026
  /**
17434
18027
  * 获取元素变换包括位置、旋转、缩放
@@ -17510,14 +18103,6 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
17510
18103
  this.transform.assignWorldTRS(pos);
17511
18104
  return pos;
17512
18105
  };
17513
- /**
17514
- * 是否到达元素的结束时间
17515
- * @param now
17516
- * @returns
17517
- */ _proto.isEnded = function isEnded(now) {
17518
- // at least 1 ms
17519
- return now - this.duration > 0.001;
17520
- };
17521
18106
  _proto.find = function find(name) {
17522
18107
  var _queue;
17523
18108
  if (this.name === name) {
@@ -17541,7 +18126,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
17541
18126
  * @internal
17542
18127
  */ _proto.beginPlay = function beginPlay() {
17543
18128
  this.isDuringPlay = true;
17544
- if (this.composition && this.visible && !this.isEnabled) {
18129
+ if (this.composition && this.active && !this.isEnabled) {
17545
18130
  this.onEnable();
17546
18131
  }
17547
18132
  for(var _iterator = _create_for_of_iterator_helper_loose(this.children), _step; !(_step = _iterator()).done;){
@@ -17635,7 +18220,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
17635
18220
  options: {}
17636
18221
  };
17637
18222
  }
17638
- if (duration <= 0) {
18223
+ if (duration < 0) {
17639
18224
  throw new Error("Item duration can't be less than 0, see " + HELP_LINK["Item duration can't be less than 0"] + ".");
17640
18225
  }
17641
18226
  this.rendererComponents.length = 0;
@@ -17725,25 +18310,54 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
17725
18310
  // }
17726
18311
  // }
17727
18312
  };
17728
- VFXItem.isComposition = function isComposition(item) {
18313
+ /**
18314
+ *
18315
+ * @param item
18316
+ * @returns
18317
+ */ VFXItem.isComposition = function isComposition(item) {
17729
18318
  return item.type === ItemType.composition;
17730
18319
  };
17731
- VFXItem.isSprite = function isSprite(item) {
18320
+ /**
18321
+ *
18322
+ * @param item
18323
+ * @returns
18324
+ */ VFXItem.isSprite = function isSprite(item) {
17732
18325
  return item.type === ItemType.sprite;
17733
18326
  };
17734
- VFXItem.isParticle = function isParticle(item) {
18327
+ /**
18328
+ *
18329
+ * @param item
18330
+ * @returns
18331
+ */ VFXItem.isParticle = function isParticle(item) {
17735
18332
  return item.type === ItemType.particle;
17736
18333
  };
17737
- VFXItem.isNull = function isNull(item) {
18334
+ /**
18335
+ *
18336
+ * @param item
18337
+ * @returns
18338
+ */ VFXItem.isNull = function isNull(item) {
17738
18339
  return item.type === ItemType.null;
17739
18340
  };
17740
- VFXItem.isTree = function isTree(item) {
18341
+ /**
18342
+ *
18343
+ * @param item
18344
+ * @returns
18345
+ */ VFXItem.isTree = function isTree(item) {
17741
18346
  return item.type === ItemType.tree;
17742
18347
  };
17743
- VFXItem.isCamera = function isCamera(item) {
18348
+ /**
18349
+ *
18350
+ * @param item
18351
+ * @returns
18352
+ */ VFXItem.isCamera = function isCamera(item) {
17744
18353
  return item.type === ItemType.camera;
17745
18354
  };
17746
- VFXItem.isAncestor = function isAncestor(ancestorCandidate, descendantCandidate) {
18355
+ /**
18356
+ *
18357
+ * @param ancestorCandidate
18358
+ * @param descendantCandidate
18359
+ * @returns
18360
+ */ VFXItem.isAncestor = function isAncestor(ancestorCandidate, descendantCandidate) {
17747
18361
  var current = descendantCandidate.parent;
17748
18362
  while(current){
17749
18363
  if (current === ancestorCandidate) {
@@ -17788,6 +18402,22 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
17788
18402
  }
17789
18403
  }
17790
18404
  }
18405
+ },
18406
+ {
18407
+ key: "isActive",
18408
+ get: /**
18409
+ * 当前 VFXItem 是否激活
18410
+ */ function get() {
18411
+ return this.active;
18412
+ }
18413
+ },
18414
+ {
18415
+ key: "isVisible",
18416
+ get: /**
18417
+ * 元素组件显隐状态
18418
+ */ function get() {
18419
+ return this.visible;
18420
+ }
17791
18421
  }
17792
18422
  ]);
17793
18423
  return VFXItem;
@@ -17951,6 +18581,16 @@ var SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
17951
18581
  }
17952
18582
  var life = Math.min(Math.max(time / duration, 0.0), 1.0);
17953
18583
  var ta = this.textureSheetAnimation;
18584
+ var video = this.renderer.texture.source.video;
18585
+ if (video) {
18586
+ if (time === 0) {
18587
+ video.pause();
18588
+ } else {
18589
+ video.play().catch(function(e) {
18590
+ _this.engine.renderErrors.add(e);
18591
+ });
18592
+ }
18593
+ }
17954
18594
  if (ta) {
17955
18595
  var _this_material_getVector4;
17956
18596
  var total = ta.total || ta.row * ta.col;
@@ -18005,21 +18645,20 @@ var SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
18005
18645
  dy
18006
18646
  ]);
18007
18647
  }
18008
- var video = this.renderer.texture.source.video;
18009
- if (video) {
18010
- if (time === 0 || time === this.item.duration) {
18011
- video.pause();
18012
- } else {
18013
- video.play().catch(function(e) {
18014
- _this.engine.renderErrors.add(e);
18015
- });
18016
- }
18017
- }
18018
18648
  };
18019
18649
  _proto.onDestroy = function onDestroy() {
18650
+ var textures = this.getTextures();
18020
18651
  if (this.item && this.item.composition) {
18021
- this.item.composition.destroyTextures(this.getTextures());
18652
+ this.item.composition.destroyTextures(textures);
18022
18653
  }
18654
+ textures.forEach(function(texture) {
18655
+ var source = texture.source;
18656
+ if (source.sourceType === TextureSourceType.video && (source == null ? void 0 : source.video)) {
18657
+ source.video.pause();
18658
+ source.video.src = "";
18659
+ source.video.load();
18660
+ }
18661
+ });
18023
18662
  };
18024
18663
  _proto.createGeometry = function createGeometry(mode) {
18025
18664
  var maxVertex = 12 * this.splits.length;
@@ -18458,7 +19097,7 @@ var ShapeNone = /*#__PURE__*/ function() {
18458
19097
  return ShapeNone;
18459
19098
  }();
18460
19099
  var _obj$3;
18461
- var map = (_obj$3 = {}, _obj$3[ShapeType.NONE] = ShapeNone, _obj$3[ShapeType.CONE] = Cone, _obj$3[ShapeType.SPHERE] = Sphere, _obj$3[ShapeType.HEMISPHERE] = Hemisphere, _obj$3[ShapeType.CIRCLE] = Circle, _obj$3[ShapeType.DONUT] = Donut, _obj$3[ShapeType.RECTANGLE] = Rectangle, _obj$3[ShapeType.EDGE] = Edge, _obj$3[ShapeType.RECTANGLE_EDGE] = RectangleEdge, _obj$3[ShapeType.TEXTURE] = TextureShape, _obj$3);
19100
+ var map = (_obj$3 = {}, _obj$3[ParticleEmitterShapeType.NONE] = ShapeNone, _obj$3[ParticleEmitterShapeType.CONE] = Cone, _obj$3[ParticleEmitterShapeType.SPHERE] = Sphere, _obj$3[ParticleEmitterShapeType.HEMISPHERE] = Hemisphere, _obj$3[ParticleEmitterShapeType.CIRCLE] = Circle, _obj$3[ParticleEmitterShapeType.DONUT] = Donut, _obj$3[ParticleEmitterShapeType.RECTANGLE] = Rectangle, _obj$3[ParticleEmitterShapeType.EDGE] = Edge, _obj$3[ParticleEmitterShapeType.RECTANGLE_EDGE] = RectangleEdge, _obj$3[ParticleEmitterShapeType.TEXTURE] = TextureShape, _obj$3);
18462
19101
  function createShape(shapeOptions) {
18463
19102
  if (!shapeOptions) {
18464
19103
  return new ShapeNone();
@@ -18475,7 +19114,7 @@ function createShape(shapeOptions) {
18475
19114
  throw new Error("Invalid shape: " + type + ".");
18476
19115
  }
18477
19116
  var ctrl = new Ctrl(options);
18478
- if (type !== ShapeType.NONE) {
19117
+ if (type !== ParticleEmitterShapeType.NONE) {
18479
19118
  var alignSpeedDirection = shapeOptions.alignSpeedDirection, _shapeOptions_upDirection = shapeOptions.upDirection, upDirection = _shapeOptions_upDirection === void 0 ? [
18480
19119
  0,
18481
19120
  0,
@@ -22552,6 +23191,7 @@ var TrackAsset = /*#__PURE__*/ function(PlayableAsset) {
22552
23191
  for(var _iterator = _create_for_of_iterator_helper_loose(timelineClips), _step; !(_step = _iterator()).done;){
22553
23192
  var timelineClip = _step.value;
22554
23193
  var clipPlayable = this.createClipPlayable(graph, timelineClip);
23194
+ clipPlayable.setDuration(timelineClip.duration);
22555
23195
  var clip = new RuntimeClip(timelineClip, clipPlayable, mixer, this);
22556
23196
  runtimeClips.push(clip);
22557
23197
  mixer.addInput(clipPlayable, 0);
@@ -22655,14 +23295,6 @@ var RuntimeClip = /*#__PURE__*/ function() {
22655
23295
  this.playable.setTime(clipTime);
22656
23296
  // 判断动画是否结束
22657
23297
  if (ended) {
22658
- if (_instanceof1(boundObject, VFXItem) && !boundObject.ended) {
22659
- boundObject.ended = true;
22660
- boundObject.onEnd();
22661
- if (!boundObject.compositionReusable && !boundObject.reusable) {
22662
- boundObject.dispose();
22663
- this.playable.dispose();
22664
- }
22665
- }
22666
23298
  if (this.playable.getPlayState() === PlayState.Playing) {
22667
23299
  this.playable.pause();
22668
23300
  }
@@ -22705,26 +23337,10 @@ var ActivationMixerPlayable = /*#__PURE__*/ function(Playable) {
22705
23337
  }
22706
23338
  if (hasInput) {
22707
23339
  boundItem.transform.setValid(true);
22708
- this.showRendererComponents(boundItem);
23340
+ boundItem.setActive(true);
22709
23341
  } else {
22710
23342
  boundItem.transform.setValid(false);
22711
- this.hideRendererComponents(boundItem);
22712
- }
22713
- };
22714
- _proto.hideRendererComponents = function hideRendererComponents(item) {
22715
- for(var _iterator = _create_for_of_iterator_helper_loose(item.rendererComponents), _step; !(_step = _iterator()).done;){
22716
- var rendererComponent = _step.value;
22717
- if (rendererComponent.enabled) {
22718
- rendererComponent.enabled = false;
22719
- }
22720
- }
22721
- };
22722
- _proto.showRendererComponents = function showRendererComponents(item) {
22723
- for(var _iterator = _create_for_of_iterator_helper_loose(item.rendererComponents), _step; !(_step = _iterator()).done;){
22724
- var rendererComponent = _step.value;
22725
- if (!rendererComponent.enabled) {
22726
- rendererComponent.enabled = true;
22727
- }
23343
+ boundItem.setActive(false);
22728
23344
  }
22729
23345
  };
22730
23346
  return ActivationMixerPlayable;
@@ -22752,7 +23368,7 @@ var PropertyClipPlayable = /*#__PURE__*/ function(Playable) {
22752
23368
  }
22753
23369
  var _proto = PropertyClipPlayable.prototype;
22754
23370
  _proto.processFrame = function processFrame(context) {
22755
- this.value = this.curve.getValue(this.time);
23371
+ this.value = this.curve.getValue(this.time / this.getDuration());
22756
23372
  };
22757
23373
  return PropertyClipPlayable;
22758
23374
  }(Playable);
@@ -23270,9 +23886,6 @@ var SerializationHelper = /*#__PURE__*/ function() {
23270
23886
  var track = _step.value;
23271
23887
  var boundObject = track.boundObject;
23272
23888
  if (_instanceof1(boundObject, VFXItem)) {
23273
- if (_instanceof1(track, ObjectBindingTrack)) {
23274
- boundObject.reusable = value;
23275
- }
23276
23889
  var subCompositionComponent = boundObject.getComponent(CompositionComponent);
23277
23890
  if (subCompositionComponent) {
23278
23891
  subCompositionComponent.setReusable(value);
@@ -23317,16 +23930,16 @@ var SerializationHelper = /*#__PURE__*/ function() {
23317
23930
  }
23318
23931
  }
23319
23932
  };
23320
- _proto.showItems = function showItems() {
23933
+ _proto.onEnable = function onEnable() {
23321
23934
  for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
23322
23935
  var item = _step.value;
23323
- item.setVisible(true);
23936
+ item.setActive(true);
23324
23937
  }
23325
23938
  };
23326
- _proto.hideItems = function hideItems() {
23939
+ _proto.onDisable = function onDisable() {
23327
23940
  for(var _iterator = _create_for_of_iterator_helper_loose(this.items), _step; !(_step = _iterator()).done;){
23328
23941
  var item = _step.value;
23329
- item.setVisible(false);
23942
+ item.setActive(false);
23330
23943
  }
23331
23944
  };
23332
23945
  _proto.onDestroy = function onDestroy() {
@@ -23342,7 +23955,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
23342
23955
  _proto.hitTest = function hitTest(ray, x, y, regions, force, options) {
23343
23956
  var _this, _loop = function(i) {
23344
23957
  var item = _this.items[i];
23345
- if (item.getVisible() && item.transform.getValid() && !VFXItem.isComposition(item) && !skip(item)) {
23958
+ if (item.isActive && item.transform.getValid() && !VFXItem.isComposition(item) && !skip(item)) {
23346
23959
  var hitParams = item.getHitTestParams(force);
23347
23960
  if (hitParams) {
23348
23961
  var success = false;
@@ -23431,9 +24044,9 @@ var SerializationHelper = /*#__PURE__*/ function() {
23431
24044
  var sceneBinding = _step.value;
23432
24045
  sceneBinding.key.boundObject = sceneBinding.value;
23433
24046
  }
23434
- // 未了通过帧对比,需要保证和原有的 update 时机一致。
24047
+ // 为了通过帧对比,需要保证和原有的 update 时机一致。
23435
24048
  // 因此这边更新一次对象绑定,后续 timeline playable 中 sort tracks 的排序才能和原先的版本对上。
23436
- // 如果不需要严格保证和之前的 updata 时机一致,这边的更新和 timeline playable 中的 sortTracks 都能去掉。
24049
+ // 如果不需要严格保证和之前的 updata 时机一致,这边的更新和 timeline asset 中的 sortTracks 都能去掉。
23437
24050
  for(var _iterator1 = _create_for_of_iterator_helper_loose(this.timelineAsset.tracks), _step1; !(_step1 = _iterator1()).done;){
23438
24051
  var masterTrack = _step1.value;
23439
24052
  this.updateTrackAnimatedObject(masterTrack);
@@ -23484,9 +24097,9 @@ var SubCompositionMixerPlayable = /*#__PURE__*/ function(Playable) {
23484
24097
  }
23485
24098
  }
23486
24099
  if (hasInput) {
23487
- compositionComponent.showItems();
24100
+ compositionComponent.item.setActive(true);
23488
24101
  } else {
23489
- compositionComponent.hideItems();
24102
+ compositionComponent.item.setActive(false);
23490
24103
  }
23491
24104
  };
23492
24105
  return SubCompositionMixerPlayable;
@@ -23537,6 +24150,51 @@ var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
23537
24150
  return Vector4PropertyMixerPlayable;
23538
24151
  }(Playable);
23539
24152
 
24153
+ var ColorPropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
24154
+ _inherits(ColorPropertyMixerPlayable, Playable);
24155
+ function ColorPropertyMixerPlayable() {
24156
+ var _this;
24157
+ _this = Playable.apply(this, arguments) || this;
24158
+ _this.propertyName = "";
24159
+ return _this;
24160
+ }
24161
+ var _proto = ColorPropertyMixerPlayable.prototype;
24162
+ _proto.processFrame = function processFrame(context) {
24163
+ var boundObject = context.output.getUserData();
24164
+ if (!boundObject) {
24165
+ return;
24166
+ }
24167
+ var hasInput = false;
24168
+ var value = boundObject[this.propertyName];
24169
+ if (!_instanceof1(value, Color)) {
24170
+ return;
24171
+ }
24172
+ value.setZero();
24173
+ // evaluate the curve
24174
+ for(var i = 0; i < this.getInputCount(); i++){
24175
+ var weight = this.getInputWeight(i);
24176
+ if (weight > 0) {
24177
+ var propertyClipPlayable = this.getInput(i);
24178
+ if (!_instanceof1(propertyClipPlayable, PropertyClipPlayable)) {
24179
+ console.error("ColorPropertyMixerPlayable received incompatible input");
24180
+ continue;
24181
+ }
24182
+ var curveValue = propertyClipPlayable.value;
24183
+ value.r += curveValue.r * weight;
24184
+ value.g += curveValue.g * weight;
24185
+ value.b += curveValue.b * weight;
24186
+ value.a += curveValue.a * weight;
24187
+ hasInput = true;
24188
+ }
24189
+ }
24190
+ // set value
24191
+ if (hasInput) {
24192
+ boundObject[this.propertyName] = value;
24193
+ }
24194
+ };
24195
+ return ColorPropertyMixerPlayable;
24196
+ }(Playable);
24197
+
23540
24198
  var PropertyTrack = /*#__PURE__*/ function(TrackAsset) {
23541
24199
  _inherits(PropertyTrack, TrackAsset);
23542
24200
  function PropertyTrack() {
@@ -23696,7 +24354,7 @@ var ColorPropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
23696
24354
  }
23697
24355
  var _proto = ColorPropertyTrack.prototype;
23698
24356
  _proto.createTrackMixer = function createTrackMixer(graph) {
23699
- var mixer = new FloatPropertyMixerPlayable(graph);
24357
+ var mixer = new ColorPropertyMixerPlayable(graph);
23700
24358
  var propertyNames = this.propertyNames;
23701
24359
  if (propertyNames.length > 0) {
23702
24360
  var propertyName = propertyNames[propertyNames.length - 1];
@@ -23710,6 +24368,27 @@ ColorPropertyTrack = __decorate([
23710
24368
  effectsClass(DataType.ColorPropertyTrack)
23711
24369
  ], ColorPropertyTrack);
23712
24370
 
24371
+ var ColorPropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
24372
+ _inherits(ColorPropertyPlayableAsset, PlayableAsset);
24373
+ function ColorPropertyPlayableAsset() {
24374
+ return PlayableAsset.apply(this, arguments);
24375
+ }
24376
+ var _proto = ColorPropertyPlayableAsset.prototype;
24377
+ _proto.createPlayable = function createPlayable(graph) {
24378
+ var clipPlayable = new PropertyClipPlayable(graph);
24379
+ clipPlayable.curve = createValueGetter(this.curveData);
24380
+ clipPlayable.value = clipPlayable.curve.getValue(0);
24381
+ return clipPlayable;
24382
+ };
24383
+ return ColorPropertyPlayableAsset;
24384
+ }(PlayableAsset);
24385
+ __decorate([
24386
+ serialize()
24387
+ ], ColorPropertyPlayableAsset.prototype, "curveData", void 0);
24388
+ ColorPropertyPlayableAsset = __decorate([
24389
+ effectsClass(DataType.ColorPropertyPlayableAsset)
24390
+ ], ColorPropertyPlayableAsset);
24391
+
23713
24392
  var FloatPropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
23714
24393
  _inherits(FloatPropertyPlayableAsset, PlayableAsset);
23715
24394
  function FloatPropertyPlayableAsset() {
@@ -23769,6 +24448,7 @@ var TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
23769
24448
  var _this;
23770
24449
  _this = PlayableAsset.apply(this, arguments) || this;
23771
24450
  _this.tracks = [];
24451
+ _this.cacheFlattenedTracks = null;
23772
24452
  return _this;
23773
24453
  }
23774
24454
  var _proto = TimelineAsset.prototype;
@@ -23781,16 +24461,62 @@ var TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
23781
24461
  track.create(this);
23782
24462
  }
23783
24463
  }
23784
- timelinePlayable.compileTracks(graph, this.tracks);
24464
+ this.sortTracks(this.tracks);
24465
+ timelinePlayable.compileTracks(graph, this.flattenedTracks);
23785
24466
  return timelinePlayable;
23786
24467
  };
23787
24468
  _proto.createTrack = function createTrack(classConstructor, parent, name) {
23788
24469
  var newTrack = new classConstructor(this.engine);
23789
24470
  newTrack.name = name ? name : classConstructor.name;
23790
24471
  parent.addChild(newTrack);
24472
+ this.invalidate();
23791
24473
  return newTrack;
23792
24474
  };
24475
+ /**
24476
+ * Invalidates the asset, called when tracks data changed
24477
+ */ _proto.invalidate = function invalidate() {
24478
+ this.cacheFlattenedTracks = null;
24479
+ };
24480
+ _proto.addSubTracksRecursive = function addSubTracksRecursive(track, allTracks) {
24481
+ for(var _iterator = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step; !(_step = _iterator()).done;){
24482
+ var subTrack = _step.value;
24483
+ allTracks.push(subTrack);
24484
+ }
24485
+ for(var _iterator1 = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step1; !(_step1 = _iterator1()).done;){
24486
+ var subTrack1 = _step1.value;
24487
+ this.addSubTracksRecursive(subTrack1, allTracks);
24488
+ }
24489
+ };
24490
+ _proto.sortTracks = function sortTracks(tracks) {
24491
+ var sortedTracks = [];
24492
+ for(var i = 0; i < tracks.length; i++){
24493
+ sortedTracks.push(new TrackSortWrapper(tracks[i], i));
24494
+ }
24495
+ sortedTracks.sort(compareTracks);
24496
+ tracks.length = 0;
24497
+ for(var _iterator = _create_for_of_iterator_helper_loose(sortedTracks), _step; !(_step = _iterator()).done;){
24498
+ var trackWrapper = _step.value;
24499
+ tracks.push(trackWrapper.track);
24500
+ }
24501
+ };
23793
24502
  _proto.fromData = function fromData(data) {};
24503
+ _create_class(TimelineAsset, [
24504
+ {
24505
+ key: "flattenedTracks",
24506
+ get: function get() {
24507
+ if (!this.cacheFlattenedTracks) {
24508
+ this.cacheFlattenedTracks = [];
24509
+ // flatten track tree
24510
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.tracks), _step; !(_step = _iterator()).done;){
24511
+ var masterTrack = _step.value;
24512
+ this.cacheFlattenedTracks.push(masterTrack);
24513
+ this.addSubTracksRecursive(masterTrack, this.cacheFlattenedTracks);
24514
+ }
24515
+ }
24516
+ return this.cacheFlattenedTracks;
24517
+ }
24518
+ }
24519
+ ]);
23794
24520
  return TimelineAsset;
23795
24521
  }(PlayableAsset);
23796
24522
  __decorate([
@@ -23823,18 +24549,11 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
23823
24549
  }
23824
24550
  };
23825
24551
  _proto.compileTracks = function compileTracks(graph, tracks) {
23826
- this.sortTracks(tracks);
23827
- var outputTrack = [];
23828
- // flatten track tree
23829
- for(var _iterator = _create_for_of_iterator_helper_loose(tracks), _step; !(_step = _iterator()).done;){
23830
- var masterTrack = _step.value;
23831
- outputTrack.push(masterTrack);
23832
- this.addSubTracksRecursive(masterTrack, outputTrack);
23833
- }
24552
+ var outputTrack = tracks;
23834
24553
  // map for searching track instance with track asset guid
23835
24554
  var trackInstanceMap = {};
23836
- for(var _iterator1 = _create_for_of_iterator_helper_loose(outputTrack), _step1; !(_step1 = _iterator1()).done;){
23837
- var track = _step1.value;
24555
+ for(var _iterator = _create_for_of_iterator_helper_loose(outputTrack), _step; !(_step = _iterator()).done;){
24556
+ var track = _step.value;
23838
24557
  // create track mixer and track output
23839
24558
  var trackMixPlayable = track.createPlayableGraph(graph, this.clips);
23840
24559
  this.addInput(trackMixPlayable, 0);
@@ -23850,11 +24569,11 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
23850
24569
  }
23851
24570
  }
23852
24571
  // build trackInstance tree
23853
- for(var _iterator2 = _create_for_of_iterator_helper_loose(outputTrack), _step2; !(_step2 = _iterator2()).done;){
23854
- var track1 = _step2.value;
24572
+ for(var _iterator1 = _create_for_of_iterator_helper_loose(outputTrack), _step1; !(_step1 = _iterator1()).done;){
24573
+ var track1 = _step1.value;
23855
24574
  var trackInstance1 = trackInstanceMap[track1.getInstanceId()];
23856
- for(var _iterator3 = _create_for_of_iterator_helper_loose(track1.getChildTracks()), _step3; !(_step3 = _iterator3()).done;){
23857
- var child = _step3.value;
24575
+ for(var _iterator2 = _create_for_of_iterator_helper_loose(track1.getChildTracks()), _step2; !(_step2 = _iterator2()).done;){
24576
+ var child = _step2.value;
23858
24577
  var childTrackInstance = trackInstanceMap[child.getInstanceId()];
23859
24578
  trackInstance1.addChild(childTrackInstance);
23860
24579
  }
@@ -23871,28 +24590,6 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
23871
24590
  this.updateTrackAnimatedObject(trackInstance.children);
23872
24591
  }
23873
24592
  };
23874
- _proto.sortTracks = function sortTracks(tracks) {
23875
- var sortedTracks = [];
23876
- for(var i = 0; i < tracks.length; i++){
23877
- sortedTracks.push(new TrackSortWrapper(tracks[i], i));
23878
- }
23879
- sortedTracks.sort(compareTracks);
23880
- tracks.length = 0;
23881
- for(var _iterator = _create_for_of_iterator_helper_loose(sortedTracks), _step; !(_step = _iterator()).done;){
23882
- var trackWrapper = _step.value;
23883
- tracks.push(trackWrapper.track);
23884
- }
23885
- };
23886
- _proto.addSubTracksRecursive = function addSubTracksRecursive(track, allTracks) {
23887
- for(var _iterator = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step; !(_step = _iterator()).done;){
23888
- var subTrack = _step.value;
23889
- allTracks.push(subTrack);
23890
- }
23891
- for(var _iterator1 = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step1; !(_step1 = _iterator1()).done;){
23892
- var subTrack1 = _step1.value;
23893
- this.addSubTracksRecursive(subTrack1, allTracks);
23894
- }
23895
- };
23896
24593
  return TimelinePlayable;
23897
24594
  }(Playable);
23898
24595
  var TrackSortWrapper = function TrackSortWrapper(track, originalIndex) {
@@ -23914,6 +24611,27 @@ function compareTracks(a, b) {
23914
24611
  }
23915
24612
  }
23916
24613
 
24614
+ var Vector4PropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
24615
+ _inherits(Vector4PropertyPlayableAsset, PlayableAsset);
24616
+ function Vector4PropertyPlayableAsset() {
24617
+ return PlayableAsset.apply(this, arguments);
24618
+ }
24619
+ var _proto = Vector4PropertyPlayableAsset.prototype;
24620
+ _proto.createPlayable = function createPlayable(graph) {
24621
+ var clipPlayable = new PropertyClipPlayable(graph);
24622
+ clipPlayable.curve = createValueGetter(this.curveData);
24623
+ clipPlayable.value = clipPlayable.curve.getValue(0);
24624
+ return clipPlayable;
24625
+ };
24626
+ return Vector4PropertyPlayableAsset;
24627
+ }(PlayableAsset);
24628
+ __decorate([
24629
+ serialize()
24630
+ ], Vector4PropertyPlayableAsset.prototype, "curveData", void 0);
24631
+ Vector4PropertyPlayableAsset = __decorate([
24632
+ effectsClass("Vector4PropertyPlayableAsset")
24633
+ ], Vector4PropertyPlayableAsset);
24634
+
23917
24635
  var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
23918
24636
  _inherits(ObjectBindingTrack, TrackAsset1);
23919
24637
  function ObjectBindingTrack() {
@@ -23951,7 +24669,7 @@ var TextLayout = /*#__PURE__*/ function() {
23951
24669
  function TextLayout(options) {
23952
24670
  this.width = 0;
23953
24671
  this.height = 0;
23954
- var _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.display : _options_textOverflow, _options_textBaseline = options.textBaseline, textBaseline = _options_textBaseline === void 0 ? TextBaseline.top : _options_textBaseline, _options_textAlign = options.textAlign, textAlign = _options_textAlign === void 0 ? TextAlignment.left : _options_textAlign, text = options.text, _options_letterSpace = options.letterSpace, letterSpace = _options_letterSpace === void 0 ? 0 : _options_letterSpace, _options_autoWidth = options.autoWidth, autoWidth = _options_autoWidth === void 0 ? false : _options_autoWidth, fontSize = options.fontSize, _options_lineHeight = options.lineHeight, lineHeight = _options_lineHeight === void 0 ? fontSize : _options_lineHeight;
24672
+ var _options_textHeight = options.textHeight, textHeight = _options_textHeight === void 0 ? 100 : _options_textHeight, _options_textWidth = options.textWidth, textWidth = _options_textWidth === void 0 ? 100 : _options_textWidth, _options_textOverflow = options.textOverflow, textOverflow = _options_textOverflow === void 0 ? TextOverflow.display : _options_textOverflow, _options_textBaseline = options.textBaseline, textBaseline = _options_textBaseline === void 0 ? TextBaseline.top : _options_textBaseline, _options_textAlign = options.textAlign, textAlign = _options_textAlign === void 0 ? TextAlignment.left : _options_textAlign, _options_text = options.text, text = _options_text === void 0 ? " " : _options_text, _options_letterSpace = options.letterSpace, letterSpace = _options_letterSpace === void 0 ? 0 : _options_letterSpace, _options_autoWidth = options.autoWidth, autoWidth = _options_autoWidth === void 0 ? false : _options_autoWidth, fontSize = options.fontSize, _options_lineHeight = options.lineHeight, lineHeight = _options_lineHeight === void 0 ? fontSize : _options_lineHeight;
23955
24673
  var tempWidth = fontSize + letterSpace;
23956
24674
  this.autoWidth = autoWidth;
23957
24675
  this.maxTextWidth = text.length * tempWidth;
@@ -24151,6 +24869,8 @@ var TextComponent = /*#__PURE__*/ function(BaseRenderComponent) {
24151
24869
  /**
24152
24870
  * 文本行数
24153
24871
  */ _this.lineCount = 0;
24872
+ _this.SCALE_FACTOR = 0.1;
24873
+ _this.ALPHA_FIX_VALUE = 1 / 255;
24154
24874
  _this.name = "MText" + seed$2++;
24155
24875
  _this.geometry = _this.createGeometry(glContext.TRIANGLES);
24156
24876
  if (props) {
@@ -24516,7 +25236,7 @@ var TextComponentBase = /*#__PURE__*/ function() {
24516
25236
  }
24517
25237
  //与 toDataURL() 两种方式都需要像素读取操作
24518
25238
  var imageData = context.getImageData(0, 0, this.canvas.width, this.canvas.height);
24519
- this.material.setTexture("uSampler0", Texture.createWithData(this.engine, {
25239
+ this.material.setTexture("_MainTex", Texture.createWithData(this.engine, {
24520
25240
  data: new Uint8Array(imageData.data),
24521
25241
  width: imageData.width,
24522
25242
  height: imageData.height
@@ -25844,13 +26564,13 @@ function getStandardParticleContent(particle) {
25844
26564
  var options = particle.options;
25845
26565
  var transform = particle.transform;
25846
26566
  var shape = {
25847
- type: ShapeType.NONE
26567
+ type: ParticleEmitterShapeType.NONE
25848
26568
  };
25849
26569
  if (particle.shape) {
25850
26570
  var _particle_shape_shape;
25851
26571
  var shapeType = (_particle_shape_shape = particle.shape.shape) == null ? void 0 : _particle_shape_shape.replace(/([A-Z])/g, "_$1").toUpperCase().replace(/^_/, "");
25852
26572
  shape = _extends({}, particle.shape, {
25853
- type: ShapeType[shapeType]
26573
+ type: ParticleEmitterShapeType[shapeType]
25854
26574
  });
25855
26575
  if (particle.shape.upDirection) {
25856
26576
  var _particle_shape_upDirection = particle.shape.upDirection, x = _particle_shape_upDirection[0], y = _particle_shape_upDirection[1], z = _particle_shape_upDirection[2];
@@ -27714,7 +28434,8 @@ var listOrder = 0;
27714
28434
  var itemProps = sourceItemData;
27715
28435
  if (passRenderLevel(sourceItemData.renderLevel, this.renderLevel)) {
27716
28436
  itemProps.listIndex = listOrder++;
27717
- if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle) {
28437
+ if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle || itemProps.type === ItemType.spine || //@ts-expect-error
28438
+ itemProps.type === ItemType.shape) {
27718
28439
  for(var _iterator2 = _create_for_of_iterator_helper_loose(itemProps.components), _step2; !(_step2 = _iterator2()).done;){
27719
28440
  var componentPath = _step2.value;
27720
28441
  var componentData = componentMap[componentPath.id];
@@ -27754,8 +28475,10 @@ var listOrder = 0;
27754
28475
  shapeData = shape;
27755
28476
  }
27756
28477
  if (shapeData !== undefined) {
27757
- // @ts-expect-error 类型转换问题
27758
- renderContent.renderer.shape = getGeometryByShape(shapeData, split);
28478
+ if (!("aPoint" in shapeData && "index" in shapeData)) {
28479
+ // @ts-expect-error 类型转换问题
28480
+ renderContent.renderer.shape = getGeometryByShape(shapeData, split);
28481
+ }
27759
28482
  }
27760
28483
  }
27761
28484
  if ("trails" in renderContent && renderContent.trails !== undefined) {
@@ -27810,13 +28533,18 @@ var listOrder = 0;
27810
28533
  return CompositionSourceManager;
27811
28534
  }();
27812
28535
 
27813
- var SceneTicking = /*#__PURE__*/ function() {
28536
+ /**
28537
+ *
28538
+ */ var SceneTicking = /*#__PURE__*/ function() {
27814
28539
  function SceneTicking() {
27815
28540
  this.update = new UpdateTickData();
27816
28541
  this.lateUpdate = new LateUpdateTickData();
27817
28542
  }
27818
28543
  var _proto = SceneTicking.prototype;
27819
- _proto.addComponent = function addComponent(obj) {
28544
+ /**
28545
+ *
28546
+ * @param obj
28547
+ */ _proto.addComponent = function addComponent(obj) {
27820
28548
  if (obj.onUpdate !== Component.prototype.onUpdate) {
27821
28549
  this.update.addComponent(obj);
27822
28550
  }
@@ -27824,7 +28552,10 @@ var SceneTicking = /*#__PURE__*/ function() {
27824
28552
  this.lateUpdate.addComponent(obj);
27825
28553
  }
27826
28554
  };
27827
- _proto.removeComponent = function removeComponent(obj) {
28555
+ /**
28556
+ *
28557
+ * @param obj
28558
+ */ _proto.removeComponent = function removeComponent(obj) {
27828
28559
  if (obj.onUpdate !== Component.prototype.onUpdate) {
27829
28560
  this.update.removeComponent(obj);
27830
28561
  }
@@ -27832,7 +28563,9 @@ var SceneTicking = /*#__PURE__*/ function() {
27832
28563
  this.lateUpdate.removeComponent(obj);
27833
28564
  }
27834
28565
  };
27835
- _proto.clear = function clear() {
28566
+ /**
28567
+ *
28568
+ */ _proto.clear = function clear() {
27836
28569
  this.update.clear();
27837
28570
  this.lateUpdate.clear();
27838
28571
  };
@@ -27923,11 +28656,16 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
27923
28656
  var _this;
27924
28657
  var _scene_jsonScene_renderSettings;
27925
28658
  _this = EventEmitter.call(this) || this;
27926
- _this.sceneTicking = new SceneTicking();
28659
+ /**
28660
+ *
28661
+ */ _this.sceneTicking = new SceneTicking();
27927
28662
  /**
27928
28663
  * 动画播放速度
27929
28664
  */ _this.speed = 1;
27930
28665
  /**
28666
+ * 合成是否结束
28667
+ */ _this.isEnded = false;
28668
+ /**
27931
28669
  * 用于保存与当前合成相关的插件数据
27932
28670
  */ _this.loaderData = {};
27933
28671
  /**
@@ -27949,6 +28687,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
27949
28687
  * 合成暂停/播放 标识
27950
28688
  */ _this.paused = false;
27951
28689
  _this.lastVideoUpdateTime = 0;
28690
+ _this.isEndCalled = false;
27952
28691
  var _props_reusable = props.reusable, reusable = _props_reusable === void 0 ? false : _props_reusable, _props_speed = props.speed, speed = _props_speed === void 0 ? 1 : _props_speed, _props_baseRenderOrder = props.baseRenderOrder, baseRenderOrder = _props_baseRenderOrder === void 0 ? 0 : _props_baseRenderOrder, renderer = props.renderer, event = props.event, width = props.width, height = props.height, handleItemMessage = props.handleItemMessage;
27953
28692
  _this.compositionSourceManager = new CompositionSourceManager(scene, renderer.engine);
27954
28693
  if (reusable) {
@@ -28038,7 +28777,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
28038
28777
  * @param visible - 是否可见
28039
28778
  */ _proto.setVisible = function setVisible(visible) {
28040
28779
  this.items.forEach(function(item) {
28041
- item.setVisible(visible);
28780
+ item.setActive(visible);
28042
28781
  });
28043
28782
  };
28044
28783
  /**
@@ -28048,7 +28787,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
28048
28787
  return this.speed;
28049
28788
  };
28050
28789
  _proto.play = function play() {
28051
- if (this.rootItem.ended && this.reusable) {
28790
+ if (this.isEnded && this.reusable) {
28052
28791
  this.restart();
28053
28792
  }
28054
28793
  if (this.rootComposition.isStartCalled) {
@@ -28106,16 +28845,15 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
28106
28845
  if (pause) {
28107
28846
  this.resume();
28108
28847
  }
28109
- if (!this.rootComposition.isStartCalled) {
28110
- this.rootComposition.onStart();
28111
- this.rootComposition.isStartCalled = true;
28112
- }
28113
28848
  this.setSpeed(1);
28114
28849
  this.forwardTime(time + this.startTime);
28115
28850
  this.setSpeed(speed);
28116
28851
  if (pause) {
28117
28852
  this.pause();
28118
28853
  }
28854
+ this.emit("goto", {
28855
+ time: time
28856
+ });
28119
28857
  };
28120
28858
  _proto.addItem = function addItem(item) {
28121
28859
  this.items.push(item);
@@ -28139,37 +28877,24 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
28139
28877
  * 重置状态函数
28140
28878
  */ _proto.reset = function reset() {
28141
28879
  this.rendererOptions = null;
28142
- this.rootItem.ended = false;
28880
+ this.isEnded = false;
28881
+ this.isEndCalled = false;
28143
28882
  this.rootComposition.time = 0;
28144
28883
  this.pluginSystem.resetComposition(this, this.renderFrame);
28145
28884
  };
28146
28885
  _proto.prepareRender = function prepareRender() {
28147
28886
  var _this = this;
28148
28887
  var frame = this.renderFrame;
28149
- frame._renderPasses[0].meshes.length = 0;
28150
28888
  this.postLoaders.length = 0;
28151
28889
  this.pluginSystem.plugins.forEach(function(loader) {
28152
28890
  if (loader.prepareRenderFrame(_this, frame)) {
28153
28891
  _this.postLoaders.push(loader);
28154
28892
  }
28155
28893
  });
28156
- this.gatherRendererComponent(this.rootItem, frame);
28157
28894
  this.postLoaders.forEach(function(loader) {
28158
28895
  return loader.postProcessFrame(_this, frame);
28159
28896
  });
28160
28897
  };
28161
- _proto.gatherRendererComponent = function gatherRendererComponent(vfxItem, renderFrame) {
28162
- for(var _iterator = _create_for_of_iterator_helper_loose(vfxItem.rendererComponents), _step; !(_step = _iterator()).done;){
28163
- var rendererComponent = _step.value;
28164
- if (rendererComponent.isActiveAndEnabled) {
28165
- renderFrame.addMeshToDefaultRenderPass(rendererComponent);
28166
- }
28167
- }
28168
- for(var _iterator1 = _create_for_of_iterator_helper_loose(vfxItem.children), _step1; !(_step1 = _iterator1()).done;){
28169
- var item = _step1.value;
28170
- this.gatherRendererComponent(item, renderFrame);
28171
- }
28172
- };
28173
28898
  /**
28174
28899
  * 合成更新,针对所有 item 的更新
28175
28900
  * @param deltaTime - 更新的时间步长
@@ -28191,12 +28916,18 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
28191
28916
  this.sceneTicking.lateUpdate.tick(dt);
28192
28917
  this.updateCamera();
28193
28918
  this.prepareRender();
28919
+ if (this.isEnded && !this.isEndCalled) {
28920
+ this.isEndCalled = true;
28921
+ this.emit("end", {
28922
+ composition: this
28923
+ });
28924
+ }
28194
28925
  if (this.shouldDispose()) {
28195
28926
  this.dispose();
28196
28927
  }
28197
28928
  };
28198
28929
  _proto.shouldDispose = function shouldDispose() {
28199
- return this.rootItem.ended && this.rootItem.endBehavior === EndBehavior.destroy && !this.reusable;
28930
+ return this.isEnded && this.rootItem.endBehavior === EndBehavior.destroy && !this.reusable;
28200
28931
  };
28201
28932
  _proto.getUpdateTime = function getUpdateTime(t) {
28202
28933
  var startTimeInMs = this.startTime * 1000;
@@ -28287,11 +29018,11 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
28287
29018
  */ _proto.updateRootComposition = function updateRootComposition(deltaTime) {
28288
29019
  if (this.rootComposition.isActiveAndEnabled) {
28289
29020
  var localTime = this.time + deltaTime - this.rootItem.start;
28290
- var ended = false;
29021
+ var isEnded = false;
28291
29022
  var duration = this.rootItem.duration;
28292
29023
  var endBehavior = this.rootItem.endBehavior;
28293
29024
  if (localTime - duration > 0.001) {
28294
- ended = true;
29025
+ isEnded = true;
28295
29026
  switch(endBehavior){
28296
29027
  case EndBehavior.restart:
28297
29028
  {
@@ -28315,11 +29046,14 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
28315
29046
  }
28316
29047
  }
28317
29048
  this.rootComposition.time = localTime;
28318
- if (ended && !this.rootItem.ended) {
28319
- this.rootItem.ended = true;
28320
- this.emit("end", {
28321
- composition: this
28322
- });
29049
+ // end state changed, handle onEnd flags
29050
+ if (this.isEnded !== isEnded) {
29051
+ if (isEnded) {
29052
+ this.isEnded = true;
29053
+ } else {
29054
+ this.isEnded = false;
29055
+ this.isEndCalled = false;
29056
+ }
28323
29057
  }
28324
29058
  }
28325
29059
  };
@@ -30645,7 +31379,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
30645
31379
  registerPlugin("particle", ParticleLoader, VFXItem, true);
30646
31380
  registerPlugin("cal", CalculateLoader, VFXItem, true);
30647
31381
  registerPlugin("interact", InteractLoader, VFXItem, true);
30648
- var version$1 = "2.1.0-alpha.9";
31382
+ var version$1 = "2.1.0";
30649
31383
  logger.info("Core version: " + version$1 + ".");
30650
31384
 
30651
31385
  var _obj;
@@ -30681,22 +31415,7 @@ var _obj3;
30681
31415
  * 必须初始化的 uniform 的 map 对象(THREE 必须在初始化的时候赋值)
30682
31416
  */ var TEXTURE_UNIFORM_MAP = [
30683
31417
  "uMaskTex",
30684
- "uSampler0",
30685
- "uSampler1",
30686
- "uSampler2",
30687
- "uSampler3",
30688
- "uSampler4",
30689
- "uSampler5",
30690
- "uSampler6",
30691
- "uSampler7",
30692
- "uSampler8",
30693
- "uSampler9",
30694
- "uSampler10",
30695
- "uSampler11",
30696
- "uSampler12",
30697
- "uSampler13",
30698
- "uSampler14",
30699
- "uSampler15",
31418
+ "_MainTex",
30700
31419
  "uColorOverLifetime",
30701
31420
  "uColorOverTrail"
30702
31421
  ];
@@ -30727,9 +31446,7 @@ var _obj3;
30727
31446
  vertex: (_shader_vertex = shader == null ? void 0 : shader.vertex) != null ? _shader_vertex : "",
30728
31447
  fragment: (_shader_fragment = shader == null ? void 0 : shader.fragment) != null ? _shader_fragment : ""
30729
31448
  });
30730
- for(var i = 0; i < maxSpriteMeshItemCount; i++){
30731
- _this.uniforms["uSampler" + i] = new THREE.Uniform(null);
30732
- }
31449
+ _this.uniforms["_MainTex"] = new THREE.Uniform(null);
30733
31450
  _this.uniforms["uEditorTransform"] = new THREE.Uniform([
30734
31451
  1,
30735
31452
  1,
@@ -32289,8 +33006,8 @@ setMaxSpriteMeshItemCount(8);
32289
33006
  */ Mesh.create = function(engine, props) {
32290
33007
  return new ThreeMesh(engine, props);
32291
33008
  };
32292
- var version = "2.1.0-alpha.9";
33009
+ var version = "2.1.0";
32293
33010
  logger.info("THREEJS plugin version: " + version + ".");
32294
33011
 
32295
- export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyTrack, Component, ComponentShapeType, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventEmitter, EventSystem, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, PropertyTrack, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, ShapeConnectType, ShapePointType, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector4Curve, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
33012
+ export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, PropertyTrack, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector4Curve, Vector4PropertyPlayableAsset, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
32296
33013
  //# sourceMappingURL=index.mjs.map