@galacean/effects-core 2.4.0-beta.1 → 2.4.0-beta.2
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/components/base-render-component.d.ts +1 -0
- package/dist/index.js +48 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -30
- package/dist/index.mjs.map +1 -1
- package/dist/material/mask-ref-manager.d.ts +4 -1
- package/dist/material/material.d.ts +6 -1
- package/dist/material/types.d.ts +2 -0
- package/dist/plugins/interact/interact-item.d.ts +1 -0
- package/dist/plugins/particle/particle-system-renderer.d.ts +2 -0
- package/dist/plugins/particle/particle-system.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.4.0-beta.
|
|
6
|
+
* Version: v2.4.0-beta.2
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -6125,12 +6125,7 @@ function setMaskMode(material, maskMode, colorMask) {
|
|
|
6125
6125
|
glContext.REPLACE
|
|
6126
6126
|
];
|
|
6127
6127
|
// 关闭/开启蒙版元素的颜色写入
|
|
6128
|
-
material.colorMask =
|
|
6129
|
-
colorMask,
|
|
6130
|
-
colorMask,
|
|
6131
|
-
colorMask,
|
|
6132
|
-
colorMask
|
|
6133
|
-
];
|
|
6128
|
+
material.colorMask = colorMask;
|
|
6134
6129
|
break;
|
|
6135
6130
|
case exports.MaskMode.OBSCURED:
|
|
6136
6131
|
material.stencilTest = true;
|
|
@@ -7602,13 +7597,6 @@ exports.MaterialRenderType = void 0;
|
|
|
7602
7597
|
set: /**
|
|
7603
7598
|
* 设置 Material 的通过 alpha 值决定临时覆盖值计算的开关
|
|
7604
7599
|
* @param value - 是否开启 alpha 抖动
|
|
7605
|
-
*/ function set(value) {}
|
|
7606
|
-
},
|
|
7607
|
-
{
|
|
7608
|
-
key: "colorMask",
|
|
7609
|
-
set: /**
|
|
7610
|
-
* 设置 Material 颜色缓冲区的写入开关
|
|
7611
|
-
* @param value
|
|
7612
7600
|
*/ function set(value) {}
|
|
7613
7601
|
},
|
|
7614
7602
|
{
|
|
@@ -7667,10 +7655,15 @@ var MaskProcessor = /*#__PURE__*/ function() {
|
|
|
7667
7655
|
} else if (mode === ObscuredMode.OBSCURED || mode === ObscuredMode.REVERSE_OBSCURED) {
|
|
7668
7656
|
maskMode = mode === ObscuredMode.OBSCURED ? exports.MaskMode.OBSCURED : exports.MaskMode.REVERSE_OBSCURED;
|
|
7669
7657
|
this.maskRef = ref.maskManager.getRefValue();
|
|
7658
|
+
this.maskable = ref;
|
|
7670
7659
|
}
|
|
7671
7660
|
}
|
|
7672
7661
|
return maskMode;
|
|
7673
7662
|
};
|
|
7663
|
+
_proto.drawStencilMask = function drawStencilMask(renderer) {
|
|
7664
|
+
var _this_maskable;
|
|
7665
|
+
(_this_maskable = this.maskable) == null ? void 0 : _this_maskable.drawStencilMask(renderer);
|
|
7666
|
+
};
|
|
7674
7667
|
return MaskProcessor;
|
|
7675
7668
|
}();
|
|
7676
7669
|
|
|
@@ -12577,17 +12570,16 @@ function getBezier2DValue(out, t, p0, p1, cpx0, cpy0, cpx1, cpy1) {
|
|
|
12577
12570
|
if (!this.getVisible()) {
|
|
12578
12571
|
return;
|
|
12579
12572
|
}
|
|
12580
|
-
|
|
12581
|
-
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12587
|
-
|
|
12588
|
-
|
|
12589
|
-
|
|
12590
|
-
}
|
|
12573
|
+
this.maskManager.drawStencilMask(renderer);
|
|
12574
|
+
this.draw(renderer);
|
|
12575
|
+
};
|
|
12576
|
+
/**
|
|
12577
|
+
* @internal
|
|
12578
|
+
*/ _proto.drawStencilMask = function drawStencilMask(renderer) {
|
|
12579
|
+
var previousColorMask = this.material.colorMask;
|
|
12580
|
+
this.material.colorMask = false;
|
|
12581
|
+
this.draw(renderer);
|
|
12582
|
+
this.material.colorMask = previousColorMask;
|
|
12591
12583
|
};
|
|
12592
12584
|
_proto.onStart = function onStart() {
|
|
12593
12585
|
this.item.getHitTestParams = this.getHitTestParams;
|
|
@@ -12725,6 +12717,19 @@ function getBezier2DValue(out, t, p0, p1, cpx0, cpy0, cpx1, cpy1) {
|
|
|
12725
12717
|
}
|
|
12726
12718
|
return material;
|
|
12727
12719
|
};
|
|
12720
|
+
_proto.draw = function draw(renderer) {
|
|
12721
|
+
if (renderer.renderingData.currentFrame.globalUniforms) {
|
|
12722
|
+
renderer.setGlobalMatrix("effects_ObjectToWorld", this.transform.getWorldMatrix());
|
|
12723
|
+
}
|
|
12724
|
+
for(var i = 0; i < this.materials.length; i++){
|
|
12725
|
+
var material = this.materials[i];
|
|
12726
|
+
material.setVector2("_Size", this.transform.size);
|
|
12727
|
+
if (this.renderer.renderMode === RenderMode.BILLBOARD || this.renderer.renderMode === RenderMode.VERTICAL_BILLBOARD || this.renderer.renderMode === RenderMode.HORIZONTAL_BILLBOARD) {
|
|
12728
|
+
material.setVector3("_Scale", this.transform.scale);
|
|
12729
|
+
}
|
|
12730
|
+
renderer.drawGeometry(this.geometry, material, i);
|
|
12731
|
+
}
|
|
12732
|
+
};
|
|
12728
12733
|
_proto.fromData = function fromData(data) {
|
|
12729
12734
|
RendererComponent.prototype.fromData.call(this, data);
|
|
12730
12735
|
var _data_renderer;
|
|
@@ -15365,6 +15370,7 @@ exports.InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
15365
15370
|
};
|
|
15366
15371
|
_this.duringPlay = false;
|
|
15367
15372
|
/** 是否响应点击和拖拽交互事件 */ _this._interactive = true;
|
|
15373
|
+
_this.lastTime = -1;
|
|
15368
15374
|
_this.getHitTestParams = function(force) {
|
|
15369
15375
|
if (!_this.clickable) {
|
|
15370
15376
|
return;
|
|
@@ -15455,11 +15461,21 @@ exports.InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
15455
15461
|
var _this_previewContent;
|
|
15456
15462
|
this.duringPlay = true;
|
|
15457
15463
|
// trigger messageBegin when item enter
|
|
15458
|
-
if (this.
|
|
15459
|
-
|
|
15460
|
-
|
|
15461
|
-
|
|
15464
|
+
if (this.lastTime <= this.item.time) {
|
|
15465
|
+
if (this.item.time >= 0 && this.lastTime < 0) {
|
|
15466
|
+
var _this_item_composition;
|
|
15467
|
+
var options = this.item.props.content.options;
|
|
15468
|
+
(_this_item_composition = this.item.composition) == null ? void 0 : _this_item_composition.addInteractiveItem(this.item, options.type);
|
|
15469
|
+
}
|
|
15470
|
+
} else {
|
|
15471
|
+
// loop trigger
|
|
15472
|
+
if (this.item.time >= 0) {
|
|
15473
|
+
var _this_item_composition1;
|
|
15474
|
+
var options1 = this.item.props.content.options;
|
|
15475
|
+
(_this_item_composition1 = this.item.composition) == null ? void 0 : _this_item_composition1.addInteractiveItem(this.item, options1.type);
|
|
15476
|
+
}
|
|
15462
15477
|
}
|
|
15478
|
+
this.lastTime = this.item.time;
|
|
15463
15479
|
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.updateMesh();
|
|
15464
15480
|
if (!this.dragEvent || !this.bouncingArg) {
|
|
15465
15481
|
return;
|
|
@@ -18591,6 +18607,7 @@ function modifyMaxKeyframeShader(shader, maxVertex, maxFrag) {
|
|
|
18591
18607
|
this.particleMesh.mesh.material.setVector4("uParams", uParams.set(time, this.item.duration, 0, 0));
|
|
18592
18608
|
};
|
|
18593
18609
|
_proto.render = function render(renderer) {
|
|
18610
|
+
this.maskManager.drawStencilMask(renderer);
|
|
18594
18611
|
for(var _iterator = _create_for_of_iterator_helper_loose(this.meshes), _step; !(_step = _iterator()).done;){
|
|
18595
18612
|
var mesh = _step.value;
|
|
18596
18613
|
mesh.render(renderer);
|
|
@@ -19540,6 +19557,7 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
19540
19557
|
}
|
|
19541
19558
|
this.renderer = new ParticleSystemRenderer(this.engine, particleMeshProps, trailMeshProps);
|
|
19542
19559
|
this.renderer.item = this.item;
|
|
19560
|
+
this.renderer.maskManager = this.maskManager;
|
|
19543
19561
|
this.meshes = this.renderer.meshes;
|
|
19544
19562
|
var interaction = props.interaction;
|
|
19545
19563
|
if (interaction) {
|
|
@@ -31623,7 +31641,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
|
|
|
31623
31641
|
registerPlugin("particle", ParticleLoader, exports.VFXItem);
|
|
31624
31642
|
registerPlugin("cal", CalculateLoader, exports.VFXItem);
|
|
31625
31643
|
registerPlugin("interact", InteractLoader, exports.VFXItem);
|
|
31626
|
-
var version = "2.4.0-beta.
|
|
31644
|
+
var version = "2.4.0-beta.2";
|
|
31627
31645
|
logger.info("Core version: " + version + ".");
|
|
31628
31646
|
|
|
31629
31647
|
exports.AbstractPlugin = AbstractPlugin;
|