@galacean/effects-threejs 2.1.0-beta.0 → 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/README.md +1 -1
- package/dist/index.js +278 -391
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +279 -392
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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
|
|
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
|
|
1096
|
-
(function(
|
|
1095
|
+
*/ var ParticleEmitterShapeType;
|
|
1096
|
+
(function(ParticleEmitterShapeType) {
|
|
1097
1097
|
/**
|
|
1098
1098
|
* 没有类型
|
|
1099
|
-
*/
|
|
1099
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["NONE"] = 0] = "NONE";
|
|
1100
1100
|
/**
|
|
1101
1101
|
* 圆球
|
|
1102
|
-
*/
|
|
1102
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["SPHERE"] = 1] = "SPHERE";
|
|
1103
1103
|
/**
|
|
1104
1104
|
* 圆锥
|
|
1105
|
-
*/
|
|
1105
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["CONE"] = 2] = "CONE";
|
|
1106
1106
|
/**
|
|
1107
1107
|
* 半球
|
|
1108
|
-
*/
|
|
1108
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["HEMISPHERE"] = 3] = "HEMISPHERE";
|
|
1109
1109
|
/**
|
|
1110
1110
|
* 圆
|
|
1111
|
-
*/
|
|
1111
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["CIRCLE"] = 4] = "CIRCLE";
|
|
1112
1112
|
/**
|
|
1113
1113
|
* 圆环
|
|
1114
|
-
*/
|
|
1114
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["DONUT"] = 5] = "DONUT";
|
|
1115
1115
|
/**
|
|
1116
1116
|
* 矩形
|
|
1117
|
-
*/
|
|
1117
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE"] = 6] = "RECTANGLE";
|
|
1118
1118
|
/**
|
|
1119
1119
|
* 矩形框
|
|
1120
|
-
*/
|
|
1120
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE_EDGE"] = 7] = "RECTANGLE_EDGE";
|
|
1121
1121
|
/**
|
|
1122
1122
|
* 直线
|
|
1123
|
-
*/
|
|
1123
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["EDGE"] = 8] = "EDGE";
|
|
1124
1124
|
/**
|
|
1125
1125
|
* 贴图
|
|
1126
|
-
*/
|
|
1127
|
-
})(
|
|
1126
|
+
*/ ParticleEmitterShapeType[ParticleEmitterShapeType["TEXTURE"] = 9] = "TEXTURE";
|
|
1127
|
+
})(ParticleEmitterShapeType || (ParticleEmitterShapeType = {}));
|
|
1128
1128
|
/**
|
|
1129
1129
|
* 插件类型
|
|
1130
1130
|
*/ var PluginType;
|
|
@@ -1620,6 +1620,34 @@ var BuiltinObjectGUID = {
|
|
|
1620
1620
|
UnlitShader: "unlit000000000000000000000000000"
|
|
1621
1621
|
};
|
|
1622
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
|
+
|
|
1623
1651
|
/**
|
|
1624
1652
|
* 动态换图类型
|
|
1625
1653
|
* @since 1.1.0
|
|
@@ -1650,6 +1678,7 @@ var DataType;
|
|
|
1650
1678
|
DataType["PostProcessVolume"] = "PostProcessVolume";
|
|
1651
1679
|
DataType["Geometry"] = "Geometry";
|
|
1652
1680
|
DataType["Texture"] = "Texture";
|
|
1681
|
+
DataType["Image"] = "Image";
|
|
1653
1682
|
DataType["AnimationClip"] = "AnimationClip";
|
|
1654
1683
|
DataType["TextComponent"] = "TextComponent";
|
|
1655
1684
|
DataType["BinaryAsset"] = "BinaryAsset";
|
|
@@ -1681,6 +1710,8 @@ var DataType;
|
|
|
1681
1710
|
DataType["VideoComponent"] = "VideoComponent";
|
|
1682
1711
|
DataType["AudioComponent"] = "AudioComponent";
|
|
1683
1712
|
DataType["RichTextComponent"] = "RichTextComponent";
|
|
1713
|
+
DataType["OrientationComponent"] = "OrientationComponent";
|
|
1714
|
+
DataType["ShapeComponent"] = "ShapeComponent";
|
|
1684
1715
|
// Non-EffectObject
|
|
1685
1716
|
DataType["TimelineClip"] = "TimelineClip";
|
|
1686
1717
|
})(DataType || (DataType = {}));
|
|
@@ -1775,7 +1806,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
1775
1806
|
get BlendingMode () { return BlendingMode; },
|
|
1776
1807
|
get SideMode () { return SideMode; },
|
|
1777
1808
|
get MaskMode () { return MaskMode; },
|
|
1778
|
-
get
|
|
1809
|
+
get ParticleEmitterShapeType () { return ParticleEmitterShapeType; },
|
|
1779
1810
|
get PluginType () { return PluginType; },
|
|
1780
1811
|
get InteractType () { return InteractType; },
|
|
1781
1812
|
get InteractBehavior () { return InteractBehavior; },
|
|
@@ -1814,6 +1845,9 @@ var index$1 = /*#__PURE__*/Object.freeze({
|
|
|
1814
1845
|
get TextWeight () { return TextWeight; },
|
|
1815
1846
|
get FontStyle () { return FontStyle; },
|
|
1816
1847
|
BuiltinObjectGUID: BuiltinObjectGUID,
|
|
1848
|
+
get ShapePrimitiveType () { return ShapePrimitiveType; },
|
|
1849
|
+
get ShapeConnectType () { return ShapeConnectType; },
|
|
1850
|
+
get ShapePointType () { return ShapePointType; },
|
|
1817
1851
|
get BackgroundType () { return BackgroundType; },
|
|
1818
1852
|
get MultimediaType () { return MultimediaType; },
|
|
1819
1853
|
get DataType () { return DataType; },
|
|
@@ -2134,6 +2168,14 @@ __decorate([
|
|
|
2134
2168
|
Component.prototype.setVFXItem.call(this, item);
|
|
2135
2169
|
this.item.rendererComponents.push(this);
|
|
2136
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
|
+
};
|
|
2137
2179
|
_proto.fromData = function fromData(data) {
|
|
2138
2180
|
Component.prototype.fromData.call(this, data);
|
|
2139
2181
|
};
|
|
@@ -10654,16 +10696,16 @@ var seed$6 = 1;
|
|
|
10654
10696
|
depthAction: TextureLoadAction.clear
|
|
10655
10697
|
};
|
|
10656
10698
|
}
|
|
10657
|
-
|
|
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
|
+
});
|
|
10658
10707
|
var renderPasses = [
|
|
10659
|
-
|
|
10660
|
-
name: RENDER_PASS_NAME_PREFIX,
|
|
10661
|
-
priority: RenderPassPriorityNormal,
|
|
10662
|
-
meshOrder: OrderType.ascending,
|
|
10663
|
-
depthStencilAttachment: depthStencilAttachment,
|
|
10664
|
-
attachments: attachments,
|
|
10665
|
-
clearAction: drawObjectPassClearAction
|
|
10666
|
-
})
|
|
10708
|
+
this.drawObjectPass
|
|
10667
10709
|
];
|
|
10668
10710
|
this.setRenderPasses(renderPasses);
|
|
10669
10711
|
if (postProcessingEnabled) {
|
|
@@ -10785,216 +10827,15 @@ var seed$6 = 1;
|
|
|
10785
10827
|
* 根据 Mesh 优先级添加到 RenderPass
|
|
10786
10828
|
* @param mesh - 要添加的 Mesh 对象
|
|
10787
10829
|
*/ _proto.addMeshToDefaultRenderPass = function addMeshToDefaultRenderPass(mesh) {
|
|
10788
|
-
|
|
10789
|
-
return;
|
|
10790
|
-
}
|
|
10791
|
-
this.renderPasses[0].addMesh(mesh);
|
|
10792
|
-
// const renderPasses = this.renderPasses;
|
|
10793
|
-
// const infoMap = this.renderPassInfoMap;
|
|
10794
|
-
// const { priority } = mesh;
|
|
10795
|
-
// for (let i = 1; i < renderPasses.length; i++) {
|
|
10796
|
-
// const renderPass = renderPasses[i - 1];
|
|
10797
|
-
// const info = infoMap.get(renderPasses[i])!;
|
|
10798
|
-
// if (info && info.listStart > priority && (priority > infoMap.get(renderPass)!.listEnd || i === 1)) {
|
|
10799
|
-
// return this.addToRenderPass(renderPass, mesh);
|
|
10800
|
-
// }
|
|
10801
|
-
// }
|
|
10802
|
-
// // TODO: diff逻辑待优化,有时会添加进找不到的元素
|
|
10803
|
-
// let last = renderPasses[renderPasses.length - 1];
|
|
10804
|
-
// // TODO: 是否添加mesh到pass的判断方式需要优化,先通过长度判断是否有postprocess
|
|
10805
|
-
// for (const pass of renderPasses) {
|
|
10806
|
-
// if (!(pass instanceof HQGaussianDownSamplePass
|
|
10807
|
-
// || pass instanceof BloomThresholdPass
|
|
10808
|
-
// || pass instanceof ToneMappingPass
|
|
10809
|
-
// || pass instanceof HQGaussianUpSamplePass
|
|
10810
|
-
// || pass.name === 'mars-final-copy')) {
|
|
10811
|
-
// last = pass;
|
|
10812
|
-
// }
|
|
10813
|
-
// }
|
|
10814
|
-
// // if (priority > infoMap.get(last)!.listStart || renderPasses.length === 1) {
|
|
10815
|
-
// // return this.addToRenderPass(last, mesh);
|
|
10816
|
-
// // }
|
|
10817
|
-
// return this.addToRenderPass(last, mesh);
|
|
10818
|
-
// if (false) {
|
|
10819
|
-
// throw Error('render pass not found');
|
|
10820
|
-
// }
|
|
10830
|
+
this.drawObjectPass.addMesh(mesh);
|
|
10821
10831
|
};
|
|
10822
10832
|
/**
|
|
10823
10833
|
* 把 Mesh 从 RenderPass 中移除,
|
|
10824
10834
|
* 如果 renderPass 中没有 mesh,此 renderPass 会被删除
|
|
10825
10835
|
* @param mesh - 要删除的 Mesh 对象
|
|
10826
10836
|
*/ _proto.removeMeshFromDefaultRenderPass = function removeMeshFromDefaultRenderPass(mesh) {
|
|
10827
|
-
|
|
10828
|
-
// const infoMap = this.renderPassInfoMap;
|
|
10829
|
-
// for (let i = renderPasses.length - 1; i >= 0; i--) {
|
|
10830
|
-
// const renderPass = renderPasses[i];
|
|
10831
|
-
// const info = infoMap.get(renderPass)!;
|
|
10832
|
-
// // 只有渲染场景物体的pass才有 info
|
|
10833
|
-
// if (!info) {
|
|
10834
|
-
// continue;
|
|
10835
|
-
// }
|
|
10836
|
-
// if (info.listStart <= mesh.priority && info.listEnd >= mesh.priority) {
|
|
10837
|
-
// const idx = renderPass.meshes.indexOf(mesh);
|
|
10838
|
-
// if (idx === -1) {
|
|
10839
|
-
// return;
|
|
10840
|
-
// }
|
|
10841
|
-
// // TODO hack: 现在的除了rp1和finalcopy pass,所有renderpass的meshes是一个copy加上一个filter mesh,这里的判断当filter mesh被删除后当前pass需不需要删除,
|
|
10842
|
-
// // 判断需要更鲁棒。
|
|
10843
|
-
// const shouldRestoreRenderPass = idx === 1 && renderPass.meshes[0].name === MARS_COPY_MESH_NAME;
|
|
10844
|
-
// renderPass.removeMesh(mesh);
|
|
10845
|
-
// if (shouldRestoreRenderPass) {
|
|
10846
|
-
// const nextRenderPass = renderPasses[i + 1];
|
|
10847
|
-
// const meshes = renderPass.meshes;
|
|
10848
|
-
// if (!info.intermedia) {
|
|
10849
|
-
// info.preRenderPass?.resetColorAttachments([]);
|
|
10850
|
-
// //this.renderer.extension.resetColorAttachments?.(info.preRenderPass, []);
|
|
10851
|
-
// }
|
|
10852
|
-
// for (let j = 1; j < meshes.length; j++) {
|
|
10853
|
-
// info.preRenderPass?.addMesh(meshes[j]);
|
|
10854
|
-
// }
|
|
10855
|
-
// const cp = renderPass.attachments[0]?.texture;
|
|
10856
|
-
// const keepColor = cp === this.resource.color_a || cp === this.resource.color_b;
|
|
10857
|
-
// renderPass.dispose({
|
|
10858
|
-
// meshes: DestroyOptions.keep,
|
|
10859
|
-
// colorAttachment: keepColor ? RenderPassDestroyAttachmentType.keep : RenderPassDestroyAttachmentType.destroy,
|
|
10860
|
-
// depthStencilAttachment: RenderPassDestroyAttachmentType.keep,
|
|
10861
|
-
// });
|
|
10862
|
-
// removeItem(renderPasses, renderPass);
|
|
10863
|
-
// this.removeRenderPass(renderPass);
|
|
10864
|
-
// infoMap.delete(renderPass);
|
|
10865
|
-
// if (nextRenderPass) {
|
|
10866
|
-
// this.updateRenderInfo(nextRenderPass);
|
|
10867
|
-
// }
|
|
10868
|
-
// if (info.preRenderPass) {
|
|
10869
|
-
// this.updateRenderInfo(info.preRenderPass);
|
|
10870
|
-
// }
|
|
10871
|
-
// if (info.prePasses) {
|
|
10872
|
-
// info.prePasses.forEach(rp => {
|
|
10873
|
-
// this.removeRenderPass(rp.pass);
|
|
10874
|
-
// if (rp?.destroyOptions !== false) {
|
|
10875
|
-
// rp.pass.attachments.forEach(c => {
|
|
10876
|
-
// if (c.texture !== this.resource.color_b || c.texture !== this.resource.color_a) {
|
|
10877
|
-
// c.texture.dispose();
|
|
10878
|
-
// }
|
|
10879
|
-
// });
|
|
10880
|
-
// const options: RenderPassDestroyOptions = {
|
|
10881
|
-
// ...(rp?.destroyOptions ? rp.destroyOptions as RenderPassDestroyOptions : {}),
|
|
10882
|
-
// depthStencilAttachment: RenderPassDestroyAttachmentType.keep,
|
|
10883
|
-
// };
|
|
10884
|
-
// rp.pass.dispose(options);
|
|
10885
|
-
// }
|
|
10886
|
-
// });
|
|
10887
|
-
// }
|
|
10888
|
-
// this.resetRenderPassDefaultAttachment(renderPasses, Math.max(i - 1, 0));
|
|
10889
|
-
// if (renderPasses.length === 1) {
|
|
10890
|
-
// renderPasses[0].resetColorAttachments([]);
|
|
10891
|
-
// //this.renderer.extension.resetColorAttachments?.(renderPasses[0], []);
|
|
10892
|
-
// this.removeRenderPass(this.resource.finalCopyRP);
|
|
10893
|
-
// }
|
|
10894
|
-
// }
|
|
10895
|
-
// return this.resetClearActions();
|
|
10896
|
-
// }
|
|
10897
|
-
// }
|
|
10837
|
+
this.drawObjectPass.removeMesh(mesh);
|
|
10898
10838
|
};
|
|
10899
|
-
// /**
|
|
10900
|
-
// * 将 Mesh 所有在 RenderPass 进行切分
|
|
10901
|
-
// * @param mesh - 目标 Mesh 对象
|
|
10902
|
-
// * @param options - 切分选项,包含 RenderPass 相关的 Attachment 等数据
|
|
10903
|
-
// */
|
|
10904
|
-
// splitDefaultRenderPassByMesh (mesh: Mesh, options: RenderPassSplitOptions): RenderPass {
|
|
10905
|
-
// const index = this.findMeshRenderPassIndex(mesh);
|
|
10906
|
-
// const renderPass = this.renderPasses[index];
|
|
10907
|
-
// if (false) {
|
|
10908
|
-
// if (!renderPass) {
|
|
10909
|
-
// throw Error('RenderPassNotFound');
|
|
10910
|
-
// }
|
|
10911
|
-
// }
|
|
10912
|
-
// this.createResource();
|
|
10913
|
-
// const meshIndex = renderPass.meshes.indexOf(mesh);
|
|
10914
|
-
// const ms0 = renderPass.meshes.slice(0, meshIndex);
|
|
10915
|
-
// const ms1 = renderPass.meshes.slice(meshIndex);
|
|
10916
|
-
// const infoMap = this.renderPassInfoMap;
|
|
10917
|
-
// // TODO 为什么要加这个判断?
|
|
10918
|
-
// // if (renderPass.attachments[0] && this.renderPasses[index + 1] !== this.resource.finalCopyRP) {
|
|
10919
|
-
// // throw Error('not implement');
|
|
10920
|
-
// // } else {
|
|
10921
|
-
// if (!options.attachments?.length) {
|
|
10922
|
-
// throw Error('should include at least one color attachment');
|
|
10923
|
-
// }
|
|
10924
|
-
// const defRPS = this.renderPasses;
|
|
10925
|
-
// const defIndex = defRPS.indexOf(renderPass);
|
|
10926
|
-
// const lastDefRP = defRPS[defIndex - 1];
|
|
10927
|
-
// removeItem(defRPS, renderPass);
|
|
10928
|
-
// const lastInfo = infoMap.get(renderPass);
|
|
10929
|
-
// infoMap.delete(renderPass);
|
|
10930
|
-
// const filter = GPUCapability.getInstance().level === 2 ? glContext.LINEAR : glContext.NEAREST;
|
|
10931
|
-
// const rp0 = new RenderPass({
|
|
10932
|
-
// name: RENDER_PASS_NAME_PREFIX + defIndex,
|
|
10933
|
-
// priority: renderPass.priority,
|
|
10934
|
-
// attachments: [{
|
|
10935
|
-
// texture: {
|
|
10936
|
-
// sourceType: TextureSourceType.framebuffer,
|
|
10937
|
-
// format: glContext.RGBA,
|
|
10938
|
-
// name: 'frame_a',
|
|
10939
|
-
// minFilter: filter,
|
|
10940
|
-
// magFilter: filter,
|
|
10941
|
-
// },
|
|
10942
|
-
// }],
|
|
10943
|
-
// clearAction: renderPass.clearAction || { colorAction: TextureLoadAction.clear },
|
|
10944
|
-
// storeAction: renderPass.storeAction,
|
|
10945
|
-
// depthStencilAttachment: this.resource.depthStencil,
|
|
10946
|
-
// meshes: ms0,
|
|
10947
|
-
// meshOrder: OrderType.ascending,
|
|
10948
|
-
// });
|
|
10949
|
-
// ms1.unshift(this.createCopyMesh());
|
|
10950
|
-
// const renderPasses = this.renderPasses;
|
|
10951
|
-
// renderPasses[index] = rp0;
|
|
10952
|
-
// const prePasses: RenderPass[] = [];
|
|
10953
|
-
// const restMeshes = ms1.slice();
|
|
10954
|
-
// if (options.prePasses) {
|
|
10955
|
-
// options.prePasses.forEach((pass, i) => {
|
|
10956
|
-
// pass.priority = renderPass.priority + 1 + i;
|
|
10957
|
-
// pass.setMeshes(ms1);
|
|
10958
|
-
// prePasses.push(pass);
|
|
10959
|
-
// });
|
|
10960
|
-
// renderPasses.splice(index + 1, 0, ...prePasses);
|
|
10961
|
-
// restMeshes.splice(0, 2);
|
|
10962
|
-
// }
|
|
10963
|
-
// const copyRP = this.resource.finalCopyRP;
|
|
10964
|
-
// if (!renderPasses.includes(copyRP)) {
|
|
10965
|
-
// renderPasses.push(copyRP);
|
|
10966
|
-
// }
|
|
10967
|
-
// // let sourcePass = (prePasses.length && !options.useLastDefaultPassColor) ? prePasses[prePasses.length - 1] : rp0;
|
|
10968
|
-
// const finalFilterPass = prePasses[prePasses.length - 1];
|
|
10969
|
-
// finalFilterPass.initialize(this.renderer);
|
|
10970
|
-
// // 不切RT,接着上一个pass的渲染结果渲染
|
|
10971
|
-
// const rp1 = new RenderPass({
|
|
10972
|
-
// name: RENDER_PASS_NAME_PREFIX + (defIndex + 1),
|
|
10973
|
-
// priority: renderPass.priority + 1 + (options.prePasses?.length || 0),
|
|
10974
|
-
// meshes: restMeshes,
|
|
10975
|
-
// meshOrder: OrderType.ascending,
|
|
10976
|
-
// depthStencilAttachment: this.resource.depthStencil,
|
|
10977
|
-
// storeAction: options.storeAction,
|
|
10978
|
-
// clearAction: {
|
|
10979
|
-
// depthAction: TextureLoadAction.whatever,
|
|
10980
|
-
// stencilAction: TextureLoadAction.whatever,
|
|
10981
|
-
// colorAction: TextureLoadAction.whatever,
|
|
10982
|
-
// },
|
|
10983
|
-
// });
|
|
10984
|
-
// renderPasses.splice(index + 1 + (options.prePasses?.length || 0), 0, rp1);
|
|
10985
|
-
// this.setRenderPasses(renderPasses);
|
|
10986
|
-
// this.updateRenderInfo(finalFilterPass);
|
|
10987
|
-
// this.updateRenderInfo(rp0);
|
|
10988
|
-
// this.updateRenderInfo(rp1);
|
|
10989
|
-
// // 目的是删除滤镜元素后,把之前滤镜用到的prePass给删除,逻辑有些复杂,考虑优化
|
|
10990
|
-
// infoMap.get(rp0)!.prePasses = lastInfo!.prePasses;
|
|
10991
|
-
// prePasses.pop();
|
|
10992
|
-
// infoMap.get(finalFilterPass)!.prePasses = prePasses.map((pass, i) => {
|
|
10993
|
-
// return { pass, destroyOptions: false };
|
|
10994
|
-
// });
|
|
10995
|
-
// this.resetClearActions();
|
|
10996
|
-
// return finalFilterPass;
|
|
10997
|
-
// }
|
|
10998
10839
|
/**
|
|
10999
10840
|
* 销毁 RenderFrame
|
|
11000
10841
|
* @param options - 可以有选择销毁一些对象
|
|
@@ -11114,45 +10955,6 @@ var seed$6 = 1;
|
|
|
11114
10955
|
this.clearAction.colorAction = TextureLoadAction.whatever;
|
|
11115
10956
|
}
|
|
11116
10957
|
};
|
|
11117
|
-
// protected updateRenderInfo (renderPass: RenderPass): RenderPassInfo {
|
|
11118
|
-
// const map = this.renderPassInfoMap;
|
|
11119
|
-
// const passes = this.renderPasses;
|
|
11120
|
-
// let info: RenderPassInfo;
|
|
11121
|
-
// if (!map.has(renderPass)) {
|
|
11122
|
-
// info = {
|
|
11123
|
-
// intermedia: false,
|
|
11124
|
-
// renderPass: renderPass,
|
|
11125
|
-
// listStart: 0,
|
|
11126
|
-
// listEnd: 0,
|
|
11127
|
-
// };
|
|
11128
|
-
// map.set(renderPass, info);
|
|
11129
|
-
// } else {
|
|
11130
|
-
// info = map.get(renderPass)!;
|
|
11131
|
-
// }
|
|
11132
|
-
// info.intermedia = renderPass.attachments.length > 0;
|
|
11133
|
-
// const meshes = renderPass.meshes;
|
|
11134
|
-
// if (meshes[0]) {
|
|
11135
|
-
// info.listStart = (meshes[0].name === MARS_COPY_MESH_NAME ? meshes[1] : meshes[0]).priority;
|
|
11136
|
-
// info.listEnd = meshes[meshes.length - 1].priority;
|
|
11137
|
-
// } else {
|
|
11138
|
-
// info.listStart = 0;
|
|
11139
|
-
// info.listEnd = 0;
|
|
11140
|
-
// }
|
|
11141
|
-
// const index = passes.indexOf(renderPass);
|
|
11142
|
-
// const depthStencilActon = index === 0 ? TextureLoadAction.clear : TextureLoadAction.whatever;
|
|
11143
|
-
// if (index === 0) {
|
|
11144
|
-
// renderPass.clearAction.colorAction = TextureLoadAction.clear;
|
|
11145
|
-
// }
|
|
11146
|
-
// renderPass.clearAction.depthAction = depthStencilActon;
|
|
11147
|
-
// renderPass.clearAction.stencilAction = depthStencilActon;
|
|
11148
|
-
// if (index > -1) {
|
|
11149
|
-
// renderPass.semantics.setSemantic('EDITOR_TRANSFORM', () => this.editorTransform);
|
|
11150
|
-
// } else {
|
|
11151
|
-
// renderPass.semantics.setSemantic('EDITOR_TRANSFORM', undefined);
|
|
11152
|
-
// }
|
|
11153
|
-
// info.preRenderPass = passes[index - 1];
|
|
11154
|
-
// return info;
|
|
11155
|
-
// }
|
|
11156
10958
|
/**
|
|
11157
10959
|
* 设置 RenderPass 数组,直接修改内部的 RenderPass 数组
|
|
11158
10960
|
* @param passes - RenderPass 数组
|
|
@@ -11353,7 +11155,7 @@ var FinalCopyRP = /*#__PURE__*/ function(RenderPass) {
|
|
|
11353
11155
|
var GlobalUniforms = function GlobalUniforms() {
|
|
11354
11156
|
this.floats = {};
|
|
11355
11157
|
this.ints = {};
|
|
11356
|
-
|
|
11158
|
+
this.vector3s = {};
|
|
11357
11159
|
this.vector4s = {};
|
|
11358
11160
|
this.matrices = {};
|
|
11359
11161
|
//...
|
|
@@ -11594,6 +11396,9 @@ var Renderer = /*#__PURE__*/ function() {
|
|
|
11594
11396
|
_proto.setGlobalVector4 = function setGlobalVector4(name, value) {
|
|
11595
11397
|
// OVERRIDE
|
|
11596
11398
|
};
|
|
11399
|
+
_proto.setGlobalVector3 = function setGlobalVector3(name, value) {
|
|
11400
|
+
// OVERRIDE
|
|
11401
|
+
};
|
|
11597
11402
|
_proto.setGlobalMatrix = function setGlobalMatrix(name, value) {
|
|
11598
11403
|
// OVERRIDE
|
|
11599
11404
|
};
|
|
@@ -13259,10 +13064,10 @@ var Vector4Curve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13259
13064
|
}
|
|
13260
13065
|
var _proto = Vector4Curve.prototype;
|
|
13261
13066
|
_proto.onCreate = function onCreate(arg) {
|
|
13262
|
-
this.xCurve = createValueGetter(arg
|
|
13263
|
-
this.yCurve = createValueGetter(arg
|
|
13264
|
-
this.zCurve = createValueGetter(arg
|
|
13265
|
-
this.wCurve = createValueGetter(arg
|
|
13067
|
+
this.xCurve = createValueGetter(arg[0]);
|
|
13068
|
+
this.yCurve = createValueGetter(arg[1]);
|
|
13069
|
+
this.zCurve = createValueGetter(arg[2]);
|
|
13070
|
+
this.wCurve = createValueGetter(arg[3]);
|
|
13266
13071
|
};
|
|
13267
13072
|
_proto.getValue = function getValue(t) {
|
|
13268
13073
|
var x = this.xCurve.getValue(t);
|
|
@@ -13282,8 +13087,8 @@ var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0 = "PRE_MAIN_COLOR_0";
|
|
|
13282
13087
|
var SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0 = "PRE_MAIN_COLOR_SIZE_0";
|
|
13283
13088
|
var PLAYER_OPTIONS_ENV_EDITOR = "editor";
|
|
13284
13089
|
var HELP_LINK = {
|
|
13285
|
-
"Item duration can't be less than 0": "https://galacean.
|
|
13286
|
-
"ValueType: 21/22 is not supported": "https://galacean.
|
|
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"
|
|
13287
13092
|
};
|
|
13288
13093
|
|
|
13289
13094
|
var _obj$4;
|
|
@@ -13362,10 +13167,10 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13362
13167
|
}
|
|
13363
13168
|
var _proto = ColorCurve.prototype;
|
|
13364
13169
|
_proto.onCreate = function onCreate(arg) {
|
|
13365
|
-
this.rCurve = createValueGetter(arg
|
|
13366
|
-
this.gCurve = createValueGetter(arg
|
|
13367
|
-
this.bCurve = createValueGetter(arg
|
|
13368
|
-
this.aCurve = createValueGetter(arg
|
|
13170
|
+
this.rCurve = createValueGetter(arg[0]);
|
|
13171
|
+
this.gCurve = createValueGetter(arg[1]);
|
|
13172
|
+
this.bCurve = createValueGetter(arg[2]);
|
|
13173
|
+
this.aCurve = createValueGetter(arg[3]);
|
|
13369
13174
|
};
|
|
13370
13175
|
_proto.getValue = function getValue(t) {
|
|
13371
13176
|
var r = this.rCurve.getValue(t);
|
|
@@ -15404,7 +15209,7 @@ var PolyStar = /*#__PURE__*/ function(ShapePrimitive) {
|
|
|
15404
15209
|
|
|
15405
15210
|
// const tempPoints = [new Point(), new Point(), new Point(), new Point()];
|
|
15406
15211
|
/**
|
|
15407
|
-
* The `Rectangle` object is an area defined by its position, as indicated by its
|
|
15212
|
+
* The `Rectangle` object is an area defined by its position, as indicated by its upper-left corner
|
|
15408
15213
|
* point (`x`, `y`) and by its `width` and its `height`.
|
|
15409
15214
|
*/ var Rectangle$1 = /*#__PURE__*/ function(ShapePrimitive) {
|
|
15410
15215
|
_inherits(Rectangle, ShapePrimitive);
|
|
@@ -15812,8 +15617,8 @@ var ShapePath = /*#__PURE__*/ function() {
|
|
|
15812
15617
|
};
|
|
15813
15618
|
/**
|
|
15814
15619
|
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
15815
|
-
* @param x - The x-coordinate of the
|
|
15816
|
-
* @param y - The y-coordinate of the
|
|
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.
|
|
15817
15622
|
* @param w - The width of the rectangle.
|
|
15818
15623
|
* @param h - The height of the rectangle.
|
|
15819
15624
|
* @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
|
|
@@ -15958,8 +15763,8 @@ var GraphicsPath = /*#__PURE__*/ function() {
|
|
|
15958
15763
|
};
|
|
15959
15764
|
/**
|
|
15960
15765
|
* Draws a rectangle shape. This method adds a new rectangle path to the current drawing.
|
|
15961
|
-
* @param x - The x-coordinate of the
|
|
15962
|
-
* @param y - The y-coordinate of the
|
|
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.
|
|
15963
15768
|
* @param w - The width of the rectangle.
|
|
15964
15769
|
* @param h - The height of the rectangle.
|
|
15965
15770
|
* @param transform - An optional `Matrix` object to apply a transformation to the rectangle.
|
|
@@ -16029,7 +15834,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16029
15834
|
_this.curveValues = [];
|
|
16030
15835
|
_this.animated = true;
|
|
16031
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";
|
|
16032
|
-
_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";
|
|
16033
15838
|
if (!_this.geometry) {
|
|
16034
15839
|
_this.geometry = Geometry.create(engine, {
|
|
16035
15840
|
attributes: {
|
|
@@ -16138,7 +15943,7 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16138
15943
|
this.path.clear();
|
|
16139
15944
|
var shapeData = data;
|
|
16140
15945
|
switch(shapeData.type){
|
|
16141
|
-
case
|
|
15946
|
+
case ShapePrimitiveType.Custom:
|
|
16142
15947
|
{
|
|
16143
15948
|
var customData = shapeData;
|
|
16144
15949
|
var points = customData.points;
|
|
@@ -16175,28 +15980,28 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16175
15980
|
}
|
|
16176
15981
|
break;
|
|
16177
15982
|
}
|
|
16178
|
-
case
|
|
15983
|
+
case ShapePrimitiveType.Ellipse:
|
|
16179
15984
|
{
|
|
16180
15985
|
var ellipseData = shapeData;
|
|
16181
15986
|
this.path.ellipse(0, 0, ellipseData.xRadius, ellipseData.yRadius);
|
|
16182
15987
|
this.setFillColor(ellipseData.fill);
|
|
16183
15988
|
break;
|
|
16184
15989
|
}
|
|
16185
|
-
case
|
|
15990
|
+
case ShapePrimitiveType.Rectangle:
|
|
16186
15991
|
{
|
|
16187
15992
|
var rectangleData = shapeData;
|
|
16188
|
-
this.path.rect(-rectangleData.width / 2, rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
15993
|
+
this.path.rect(-rectangleData.width / 2, -rectangleData.height / 2, rectangleData.width, rectangleData.height);
|
|
16189
15994
|
this.setFillColor(rectangleData.fill);
|
|
16190
15995
|
break;
|
|
16191
15996
|
}
|
|
16192
|
-
case
|
|
15997
|
+
case ShapePrimitiveType.Star:
|
|
16193
15998
|
{
|
|
16194
15999
|
var starData = shapeData;
|
|
16195
16000
|
this.path.polyStar(starData.pointCount, starData.outerRadius, starData.innerRadius, starData.outerRoundness, starData.innerRoundness, StarType.Star);
|
|
16196
16001
|
this.setFillColor(starData.fill);
|
|
16197
16002
|
break;
|
|
16198
16003
|
}
|
|
16199
|
-
case
|
|
16004
|
+
case ShapePrimitiveType.Polygon:
|
|
16200
16005
|
{
|
|
16201
16006
|
var polygonData = shapeData;
|
|
16202
16007
|
this.path.polyStar(polygonData.pointCount, polygonData.radius, polygonData.radius, polygonData.roundness, polygonData.roundness, StarType.Polygon);
|
|
@@ -16228,28 +16033,6 @@ var ShapeComponent = /*#__PURE__*/ function(MeshComponent) {
|
|
|
16228
16033
|
ShapeComponent = __decorate([
|
|
16229
16034
|
effectsClass("ShapeComponent")
|
|
16230
16035
|
], ShapeComponent);
|
|
16231
|
-
var ShapePrimitiveType;
|
|
16232
|
-
(function(ShapePrimitiveType) {
|
|
16233
|
-
/**
|
|
16234
|
-
* 自定义图形
|
|
16235
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Custom"] = 0] = "Custom";
|
|
16236
|
-
/**
|
|
16237
|
-
* 矩形
|
|
16238
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Rectangle"] = 1] = "Rectangle";
|
|
16239
|
-
/**
|
|
16240
|
-
* 椭圆
|
|
16241
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Ellipse"] = 2] = "Ellipse";
|
|
16242
|
-
/**
|
|
16243
|
-
* 多边形
|
|
16244
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Polygon"] = 3] = "Polygon";
|
|
16245
|
-
/**
|
|
16246
|
-
* 星形
|
|
16247
|
-
*/ ShapePrimitiveType[ShapePrimitiveType["Star"] = 4] = "Star";
|
|
16248
|
-
})(ShapePrimitiveType || (ShapePrimitiveType = {}));
|
|
16249
|
-
var ShapeConnectType;
|
|
16250
|
-
(function(ShapeConnectType) {})(ShapeConnectType || (ShapeConnectType = {}));
|
|
16251
|
-
var ShapePointType;
|
|
16252
|
-
(function(ShapePointType) {})(ShapePointType || (ShapePointType = {}));
|
|
16253
16036
|
|
|
16254
16037
|
var Fake3DComponent = /*#__PURE__*/ function(Component) {
|
|
16255
16038
|
_inherits(Fake3DComponent, Component);
|
|
@@ -16810,6 +16593,7 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16810
16593
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
16811
16594
|
};
|
|
16812
16595
|
_proto.onDisable = function onDisable() {
|
|
16596
|
+
RendererComponent.prototype.onDisable.call(this);
|
|
16813
16597
|
if (this.item && this.item.composition) {
|
|
16814
16598
|
var _this_previewContent;
|
|
16815
16599
|
if (this.duringPlay && !this.item.transform.getValid()) {
|
|
@@ -16822,6 +16606,7 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
16822
16606
|
}
|
|
16823
16607
|
};
|
|
16824
16608
|
_proto.onEnable = function onEnable() {
|
|
16609
|
+
RendererComponent.prototype.onEnable.call(this);
|
|
16825
16610
|
var type = this.interactData.options.type;
|
|
16826
16611
|
if (type === InteractType.CLICK) {
|
|
16827
16612
|
this.clickable = true;
|
|
@@ -18435,7 +18220,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
18435
18220
|
options: {}
|
|
18436
18221
|
};
|
|
18437
18222
|
}
|
|
18438
|
-
if (duration
|
|
18223
|
+
if (duration < 0) {
|
|
18439
18224
|
throw new Error("Item duration can't be less than 0, see " + HELP_LINK["Item duration can't be less than 0"] + ".");
|
|
18440
18225
|
}
|
|
18441
18226
|
this.rendererComponents.length = 0;
|
|
@@ -18796,6 +18581,16 @@ var SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
18796
18581
|
}
|
|
18797
18582
|
var life = Math.min(Math.max(time / duration, 0.0), 1.0);
|
|
18798
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
|
+
}
|
|
18799
18594
|
if (ta) {
|
|
18800
18595
|
var _this_material_getVector4;
|
|
18801
18596
|
var total = ta.total || ta.row * ta.col;
|
|
@@ -18850,21 +18645,20 @@ var SpriteComponent = /*#__PURE__*/ function(BaseRenderComponent) {
|
|
|
18850
18645
|
dy
|
|
18851
18646
|
]);
|
|
18852
18647
|
}
|
|
18853
|
-
var video = this.renderer.texture.source.video;
|
|
18854
|
-
if (video) {
|
|
18855
|
-
if (time === 0 || time === this.item.duration) {
|
|
18856
|
-
video.pause();
|
|
18857
|
-
} else {
|
|
18858
|
-
video.play().catch(function(e) {
|
|
18859
|
-
_this.engine.renderErrors.add(e);
|
|
18860
|
-
});
|
|
18861
|
-
}
|
|
18862
|
-
}
|
|
18863
18648
|
};
|
|
18864
18649
|
_proto.onDestroy = function onDestroy() {
|
|
18650
|
+
var textures = this.getTextures();
|
|
18865
18651
|
if (this.item && this.item.composition) {
|
|
18866
|
-
this.item.composition.destroyTextures(
|
|
18652
|
+
this.item.composition.destroyTextures(textures);
|
|
18867
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
|
+
});
|
|
18868
18662
|
};
|
|
18869
18663
|
_proto.createGeometry = function createGeometry(mode) {
|
|
18870
18664
|
var maxVertex = 12 * this.splits.length;
|
|
@@ -19303,7 +19097,7 @@ var ShapeNone = /*#__PURE__*/ function() {
|
|
|
19303
19097
|
return ShapeNone;
|
|
19304
19098
|
}();
|
|
19305
19099
|
var _obj$3;
|
|
19306
|
-
var map = (_obj$3 = {}, _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);
|
|
19307
19101
|
function createShape(shapeOptions) {
|
|
19308
19102
|
if (!shapeOptions) {
|
|
19309
19103
|
return new ShapeNone();
|
|
@@ -19320,7 +19114,7 @@ function createShape(shapeOptions) {
|
|
|
19320
19114
|
throw new Error("Invalid shape: " + type + ".");
|
|
19321
19115
|
}
|
|
19322
19116
|
var ctrl = new Ctrl(options);
|
|
19323
|
-
if (type !==
|
|
19117
|
+
if (type !== ParticleEmitterShapeType.NONE) {
|
|
19324
19118
|
var alignSpeedDirection = shapeOptions.alignSpeedDirection, _shapeOptions_upDirection = shapeOptions.upDirection, upDirection = _shapeOptions_upDirection === void 0 ? [
|
|
19325
19119
|
0,
|
|
19326
19120
|
0,
|
|
@@ -24250,9 +24044,9 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
24250
24044
|
var sceneBinding = _step.value;
|
|
24251
24045
|
sceneBinding.key.boundObject = sceneBinding.value;
|
|
24252
24046
|
}
|
|
24253
|
-
//
|
|
24047
|
+
// 为了通过帧对比,需要保证和原有的 update 时机一致。
|
|
24254
24048
|
// 因此这边更新一次对象绑定,后续 timeline playable 中 sort tracks 的排序才能和原先的版本对上。
|
|
24255
|
-
// 如果不需要严格保证和之前的 updata 时机一致,这边的更新和 timeline
|
|
24049
|
+
// 如果不需要严格保证和之前的 updata 时机一致,这边的更新和 timeline asset 中的 sortTracks 都能去掉。
|
|
24256
24050
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(this.timelineAsset.tracks), _step1; !(_step1 = _iterator1()).done;){
|
|
24257
24051
|
var masterTrack = _step1.value;
|
|
24258
24052
|
this.updateTrackAnimatedObject(masterTrack);
|
|
@@ -24356,6 +24150,51 @@ var Vector4PropertyMixerPlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24356
24150
|
return Vector4PropertyMixerPlayable;
|
|
24357
24151
|
}(Playable);
|
|
24358
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
|
+
|
|
24359
24198
|
var PropertyTrack = /*#__PURE__*/ function(TrackAsset) {
|
|
24360
24199
|
_inherits(PropertyTrack, TrackAsset);
|
|
24361
24200
|
function PropertyTrack() {
|
|
@@ -24515,7 +24354,7 @@ var ColorPropertyTrack = /*#__PURE__*/ function(PropertyTrack) {
|
|
|
24515
24354
|
}
|
|
24516
24355
|
var _proto = ColorPropertyTrack.prototype;
|
|
24517
24356
|
_proto.createTrackMixer = function createTrackMixer(graph) {
|
|
24518
|
-
var mixer = new
|
|
24357
|
+
var mixer = new ColorPropertyMixerPlayable(graph);
|
|
24519
24358
|
var propertyNames = this.propertyNames;
|
|
24520
24359
|
if (propertyNames.length > 0) {
|
|
24521
24360
|
var propertyName = propertyNames[propertyNames.length - 1];
|
|
@@ -24529,6 +24368,27 @@ ColorPropertyTrack = __decorate([
|
|
|
24529
24368
|
effectsClass(DataType.ColorPropertyTrack)
|
|
24530
24369
|
], ColorPropertyTrack);
|
|
24531
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
|
+
|
|
24532
24392
|
var FloatPropertyPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
24533
24393
|
_inherits(FloatPropertyPlayableAsset, PlayableAsset);
|
|
24534
24394
|
function FloatPropertyPlayableAsset() {
|
|
@@ -24588,6 +24448,7 @@ var TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
24588
24448
|
var _this;
|
|
24589
24449
|
_this = PlayableAsset.apply(this, arguments) || this;
|
|
24590
24450
|
_this.tracks = [];
|
|
24451
|
+
_this.cacheFlattenedTracks = null;
|
|
24591
24452
|
return _this;
|
|
24592
24453
|
}
|
|
24593
24454
|
var _proto = TimelineAsset.prototype;
|
|
@@ -24600,16 +24461,62 @@ var TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
|
|
|
24600
24461
|
track.create(this);
|
|
24601
24462
|
}
|
|
24602
24463
|
}
|
|
24603
|
-
|
|
24464
|
+
this.sortTracks(this.tracks);
|
|
24465
|
+
timelinePlayable.compileTracks(graph, this.flattenedTracks);
|
|
24604
24466
|
return timelinePlayable;
|
|
24605
24467
|
};
|
|
24606
24468
|
_proto.createTrack = function createTrack(classConstructor, parent, name) {
|
|
24607
24469
|
var newTrack = new classConstructor(this.engine);
|
|
24608
24470
|
newTrack.name = name ? name : classConstructor.name;
|
|
24609
24471
|
parent.addChild(newTrack);
|
|
24472
|
+
this.invalidate();
|
|
24610
24473
|
return newTrack;
|
|
24611
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
|
+
};
|
|
24612
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
|
+
]);
|
|
24613
24520
|
return TimelineAsset;
|
|
24614
24521
|
}(PlayableAsset);
|
|
24615
24522
|
__decorate([
|
|
@@ -24642,18 +24549,11 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24642
24549
|
}
|
|
24643
24550
|
};
|
|
24644
24551
|
_proto.compileTracks = function compileTracks(graph, tracks) {
|
|
24645
|
-
|
|
24646
|
-
var outputTrack = [];
|
|
24647
|
-
// flatten track tree
|
|
24648
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(tracks), _step; !(_step = _iterator()).done;){
|
|
24649
|
-
var masterTrack = _step.value;
|
|
24650
|
-
outputTrack.push(masterTrack);
|
|
24651
|
-
this.addSubTracksRecursive(masterTrack, outputTrack);
|
|
24652
|
-
}
|
|
24552
|
+
var outputTrack = tracks;
|
|
24653
24553
|
// map for searching track instance with track asset guid
|
|
24654
24554
|
var trackInstanceMap = {};
|
|
24655
|
-
for(var
|
|
24656
|
-
var track =
|
|
24555
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(outputTrack), _step; !(_step = _iterator()).done;){
|
|
24556
|
+
var track = _step.value;
|
|
24657
24557
|
// create track mixer and track output
|
|
24658
24558
|
var trackMixPlayable = track.createPlayableGraph(graph, this.clips);
|
|
24659
24559
|
this.addInput(trackMixPlayable, 0);
|
|
@@ -24669,11 +24569,11 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24669
24569
|
}
|
|
24670
24570
|
}
|
|
24671
24571
|
// build trackInstance tree
|
|
24672
|
-
for(var
|
|
24673
|
-
var track1 =
|
|
24572
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(outputTrack), _step1; !(_step1 = _iterator1()).done;){
|
|
24573
|
+
var track1 = _step1.value;
|
|
24674
24574
|
var trackInstance1 = trackInstanceMap[track1.getInstanceId()];
|
|
24675
|
-
for(var
|
|
24676
|
-
var child =
|
|
24575
|
+
for(var _iterator2 = _create_for_of_iterator_helper_loose(track1.getChildTracks()), _step2; !(_step2 = _iterator2()).done;){
|
|
24576
|
+
var child = _step2.value;
|
|
24677
24577
|
var childTrackInstance = trackInstanceMap[child.getInstanceId()];
|
|
24678
24578
|
trackInstance1.addChild(childTrackInstance);
|
|
24679
24579
|
}
|
|
@@ -24690,28 +24590,6 @@ var TimelinePlayable = /*#__PURE__*/ function(Playable) {
|
|
|
24690
24590
|
this.updateTrackAnimatedObject(trackInstance.children);
|
|
24691
24591
|
}
|
|
24692
24592
|
};
|
|
24693
|
-
_proto.sortTracks = function sortTracks(tracks) {
|
|
24694
|
-
var sortedTracks = [];
|
|
24695
|
-
for(var i = 0; i < tracks.length; i++){
|
|
24696
|
-
sortedTracks.push(new TrackSortWrapper(tracks[i], i));
|
|
24697
|
-
}
|
|
24698
|
-
sortedTracks.sort(compareTracks);
|
|
24699
|
-
tracks.length = 0;
|
|
24700
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(sortedTracks), _step; !(_step = _iterator()).done;){
|
|
24701
|
-
var trackWrapper = _step.value;
|
|
24702
|
-
tracks.push(trackWrapper.track);
|
|
24703
|
-
}
|
|
24704
|
-
};
|
|
24705
|
-
_proto.addSubTracksRecursive = function addSubTracksRecursive(track, allTracks) {
|
|
24706
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step; !(_step = _iterator()).done;){
|
|
24707
|
-
var subTrack = _step.value;
|
|
24708
|
-
allTracks.push(subTrack);
|
|
24709
|
-
}
|
|
24710
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(track.getChildTracks()), _step1; !(_step1 = _iterator1()).done;){
|
|
24711
|
-
var subTrack1 = _step1.value;
|
|
24712
|
-
this.addSubTracksRecursive(subTrack1, allTracks);
|
|
24713
|
-
}
|
|
24714
|
-
};
|
|
24715
24593
|
return TimelinePlayable;
|
|
24716
24594
|
}(Playable);
|
|
24717
24595
|
var TrackSortWrapper = function TrackSortWrapper(track, originalIndex) {
|
|
@@ -24733,6 +24611,27 @@ function compareTracks(a, b) {
|
|
|
24733
24611
|
}
|
|
24734
24612
|
}
|
|
24735
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
|
+
|
|
24736
24635
|
var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
|
|
24737
24636
|
_inherits(ObjectBindingTrack, TrackAsset1);
|
|
24738
24637
|
function ObjectBindingTrack() {
|
|
@@ -24770,7 +24669,7 @@ var TextLayout = /*#__PURE__*/ function() {
|
|
|
24770
24669
|
function TextLayout(options) {
|
|
24771
24670
|
this.width = 0;
|
|
24772
24671
|
this.height = 0;
|
|
24773
|
-
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,
|
|
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;
|
|
24774
24673
|
var tempWidth = fontSize + letterSpace;
|
|
24775
24674
|
this.autoWidth = autoWidth;
|
|
24776
24675
|
this.maxTextWidth = text.length * tempWidth;
|
|
@@ -26665,13 +26564,13 @@ function getStandardParticleContent(particle) {
|
|
|
26665
26564
|
var options = particle.options;
|
|
26666
26565
|
var transform = particle.transform;
|
|
26667
26566
|
var shape = {
|
|
26668
|
-
type:
|
|
26567
|
+
type: ParticleEmitterShapeType.NONE
|
|
26669
26568
|
};
|
|
26670
26569
|
if (particle.shape) {
|
|
26671
26570
|
var _particle_shape_shape;
|
|
26672
26571
|
var shapeType = (_particle_shape_shape = particle.shape.shape) == null ? void 0 : _particle_shape_shape.replace(/([A-Z])/g, "_$1").toUpperCase().replace(/^_/, "");
|
|
26673
26572
|
shape = _extends({}, particle.shape, {
|
|
26674
|
-
type:
|
|
26573
|
+
type: ParticleEmitterShapeType[shapeType]
|
|
26675
26574
|
});
|
|
26676
26575
|
if (particle.shape.upDirection) {
|
|
26677
26576
|
var _particle_shape_upDirection = particle.shape.upDirection, x = _particle_shape_upDirection[0], y = _particle_shape_upDirection[1], z = _particle_shape_upDirection[2];
|
|
@@ -28535,7 +28434,8 @@ var listOrder = 0;
|
|
|
28535
28434
|
var itemProps = sourceItemData;
|
|
28536
28435
|
if (passRenderLevel(sourceItemData.renderLevel, this.renderLevel)) {
|
|
28537
28436
|
itemProps.listIndex = listOrder++;
|
|
28538
|
-
if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle || itemProps.type === ItemType.spine
|
|
28437
|
+
if (itemProps.type === ItemType.sprite || itemProps.type === ItemType.particle || itemProps.type === ItemType.spine || //@ts-expect-error
|
|
28438
|
+
itemProps.type === ItemType.shape) {
|
|
28539
28439
|
for(var _iterator2 = _create_for_of_iterator_helper_loose(itemProps.components), _step2; !(_step2 = _iterator2()).done;){
|
|
28540
28440
|
var componentPath = _step2.value;
|
|
28541
28441
|
var componentData = componentMap[componentPath.id];
|
|
@@ -28575,8 +28475,10 @@ var listOrder = 0;
|
|
|
28575
28475
|
shapeData = shape;
|
|
28576
28476
|
}
|
|
28577
28477
|
if (shapeData !== undefined) {
|
|
28578
|
-
|
|
28579
|
-
|
|
28478
|
+
if (!("aPoint" in shapeData && "index" in shapeData)) {
|
|
28479
|
+
// @ts-expect-error 类型转换问题
|
|
28480
|
+
renderContent.renderer.shape = getGeometryByShape(shapeData, split);
|
|
28481
|
+
}
|
|
28580
28482
|
}
|
|
28581
28483
|
}
|
|
28582
28484
|
if ("trails" in renderContent && renderContent.trails !== undefined) {
|
|
@@ -28943,16 +28845,15 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28943
28845
|
if (pause) {
|
|
28944
28846
|
this.resume();
|
|
28945
28847
|
}
|
|
28946
|
-
if (!this.rootComposition.isStartCalled) {
|
|
28947
|
-
this.rootComposition.onStart();
|
|
28948
|
-
this.rootComposition.isStartCalled = true;
|
|
28949
|
-
}
|
|
28950
28848
|
this.setSpeed(1);
|
|
28951
28849
|
this.forwardTime(time + this.startTime);
|
|
28952
28850
|
this.setSpeed(speed);
|
|
28953
28851
|
if (pause) {
|
|
28954
28852
|
this.pause();
|
|
28955
28853
|
}
|
|
28854
|
+
this.emit("goto", {
|
|
28855
|
+
time: time
|
|
28856
|
+
});
|
|
28956
28857
|
};
|
|
28957
28858
|
_proto.addItem = function addItem(item) {
|
|
28958
28859
|
this.items.push(item);
|
|
@@ -28984,30 +28885,16 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
|
|
|
28984
28885
|
_proto.prepareRender = function prepareRender() {
|
|
28985
28886
|
var _this = this;
|
|
28986
28887
|
var frame = this.renderFrame;
|
|
28987
|
-
frame._renderPasses[0].meshes.length = 0;
|
|
28988
28888
|
this.postLoaders.length = 0;
|
|
28989
28889
|
this.pluginSystem.plugins.forEach(function(loader) {
|
|
28990
28890
|
if (loader.prepareRenderFrame(_this, frame)) {
|
|
28991
28891
|
_this.postLoaders.push(loader);
|
|
28992
28892
|
}
|
|
28993
28893
|
});
|
|
28994
|
-
this.gatherRendererComponent(this.rootItem, frame);
|
|
28995
28894
|
this.postLoaders.forEach(function(loader) {
|
|
28996
28895
|
return loader.postProcessFrame(_this, frame);
|
|
28997
28896
|
});
|
|
28998
28897
|
};
|
|
28999
|
-
_proto.gatherRendererComponent = function gatherRendererComponent(vfxItem, renderFrame) {
|
|
29000
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(vfxItem.rendererComponents), _step; !(_step = _iterator()).done;){
|
|
29001
|
-
var rendererComponent = _step.value;
|
|
29002
|
-
if (rendererComponent.isActiveAndEnabled) {
|
|
29003
|
-
renderFrame.addMeshToDefaultRenderPass(rendererComponent);
|
|
29004
|
-
}
|
|
29005
|
-
}
|
|
29006
|
-
for(var _iterator1 = _create_for_of_iterator_helper_loose(vfxItem.children), _step1; !(_step1 = _iterator1()).done;){
|
|
29007
|
-
var item = _step1.value;
|
|
29008
|
-
this.gatherRendererComponent(item, renderFrame);
|
|
29009
|
-
}
|
|
29010
|
-
};
|
|
29011
28898
|
/**
|
|
29012
28899
|
* 合成更新,针对所有 item 的更新
|
|
29013
28900
|
* @param deltaTime - 更新的时间步长
|
|
@@ -31492,7 +31379,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
31492
31379
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
31493
31380
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
31494
31381
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
31495
|
-
var version$1 = "2.1.0
|
|
31382
|
+
var version$1 = "2.1.0";
|
|
31496
31383
|
logger.info("Core version: " + version$1 + ".");
|
|
31497
31384
|
|
|
31498
31385
|
var _obj;
|
|
@@ -33119,8 +33006,8 @@ setMaxSpriteMeshItemCount(8);
|
|
|
33119
33006
|
*/ Mesh.create = function(engine, props) {
|
|
33120
33007
|
return new ThreeMesh(engine, props);
|
|
33121
33008
|
};
|
|
33122
|
-
var version = "2.1.0
|
|
33009
|
+
var version = "2.1.0";
|
|
33123
33010
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
33124
33011
|
|
|
33125
|
-
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, 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,
|
|
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 };
|
|
33126
33013
|
//# sourceMappingURL=index.mjs.map
|