@galacean/effects-core 2.4.0 → 2.4.1-alpha.1
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/engine.d.ts +0 -5
- package/dist/index.js +16 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -28
- package/dist/index.mjs.map +1 -1
- package/dist/material/mask-ref-manager.d.ts +1 -6
- package/package.json +1 -1
package/dist/engine.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import * as spec from '@galacean/effects-specification';
|
|
|
2
2
|
import type { Database, SceneData } from './asset-loader';
|
|
3
3
|
import type { EffectsObject } from './effects-object';
|
|
4
4
|
import type { Material } from './material';
|
|
5
|
-
import { MaskRefManager } from './material';
|
|
6
5
|
import type { GPUCapability, Geometry, Mesh, RenderPass, Renderer, ShaderLibrary } from './render';
|
|
7
6
|
import type { Scene, SceneRenderLevel } from './scene';
|
|
8
7
|
import type { Texture } from './texture';
|
|
@@ -32,10 +31,6 @@ export declare class Engine implements Disposable {
|
|
|
32
31
|
* 渲染过程中错误队列
|
|
33
32
|
*/
|
|
34
33
|
renderErrors: Set<Error>;
|
|
35
|
-
/**
|
|
36
|
-
* maskRef 值分配
|
|
37
|
-
*/
|
|
38
|
-
maskRefManager: MaskRefManager;
|
|
39
34
|
protected destroyed: boolean;
|
|
40
35
|
protected textures: Texture[];
|
|
41
36
|
protected materials: Material[];
|
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.
|
|
6
|
+
* Version: v2.4.1-alpha.1
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
'use strict';
|
|
@@ -7621,26 +7621,16 @@ exports.MaterialRenderType = void 0;
|
|
|
7621
7621
|
return Material;
|
|
7622
7622
|
}(EffectsObject);
|
|
7623
7623
|
|
|
7624
|
-
var MaskRefManager = /*#__PURE__*/ function() {
|
|
7625
|
-
function MaskRefManager(initRef) {
|
|
7626
|
-
this.currentRef = initRef || 0;
|
|
7627
|
-
}
|
|
7628
|
-
var _proto = MaskRefManager.prototype;
|
|
7629
|
-
_proto.distributeRef = function distributeRef() {
|
|
7630
|
-
return ++this.currentRef;
|
|
7631
|
-
};
|
|
7632
|
-
return MaskRefManager;
|
|
7633
|
-
}();
|
|
7634
7624
|
var MaskProcessor = /*#__PURE__*/ function() {
|
|
7635
7625
|
function MaskProcessor(engine) {
|
|
7636
7626
|
this.engine = engine;
|
|
7627
|
+
this.stencilClearAction = {
|
|
7628
|
+
stencilAction: exports.TextureLoadAction.clear
|
|
7629
|
+
};
|
|
7637
7630
|
}
|
|
7638
7631
|
var _proto = MaskProcessor.prototype;
|
|
7639
7632
|
_proto.getRefValue = function getRefValue() {
|
|
7640
|
-
|
|
7641
|
-
this.maskRef = this.engine.maskRefManager.distributeRef();
|
|
7642
|
-
}
|
|
7643
|
-
return this.maskRef;
|
|
7633
|
+
return 1;
|
|
7644
7634
|
};
|
|
7645
7635
|
_proto.getMaskMode = function getMaskMode(data) {
|
|
7646
7636
|
var maskMode = exports.MaskMode.NONE;
|
|
@@ -7648,18 +7638,18 @@ var MaskProcessor = /*#__PURE__*/ function() {
|
|
|
7648
7638
|
var _data_mask = data.mask, _data_mask_mask = _data_mask.mask, mask = _data_mask_mask === void 0 ? false : _data_mask_mask, _data_mask_mode = _data_mask.mode, mode = _data_mask_mode === void 0 ? exports.MaskMode.NONE : _data_mask_mode, ref = _data_mask.ref;
|
|
7649
7639
|
if (mask) {
|
|
7650
7640
|
maskMode = exports.MaskMode.MASK;
|
|
7651
|
-
this.getRefValue();
|
|
7652
7641
|
} else if (mode === ObscuredMode.OBSCURED || mode === ObscuredMode.REVERSE_OBSCURED) {
|
|
7653
7642
|
maskMode = mode === ObscuredMode.OBSCURED ? exports.MaskMode.OBSCURED : exports.MaskMode.REVERSE_OBSCURED;
|
|
7654
|
-
this.maskRef = ref.maskManager.getRefValue();
|
|
7655
7643
|
this.maskable = ref;
|
|
7656
7644
|
}
|
|
7657
7645
|
}
|
|
7658
7646
|
return maskMode;
|
|
7659
7647
|
};
|
|
7660
7648
|
_proto.drawStencilMask = function drawStencilMask(renderer) {
|
|
7661
|
-
|
|
7662
|
-
|
|
7649
|
+
if (this.maskable) {
|
|
7650
|
+
renderer.clear(this.stencilClearAction);
|
|
7651
|
+
this.maskable.drawStencilMask(renderer);
|
|
7652
|
+
}
|
|
7663
7653
|
};
|
|
7664
7654
|
return MaskProcessor;
|
|
7665
7655
|
}();
|
|
@@ -19572,10 +19562,12 @@ exports.ParticleSystem = /*#__PURE__*/ function(Component) {
|
|
|
19572
19562
|
var maskMode = exports.MaskMode.NONE;
|
|
19573
19563
|
var maskRef = 0;
|
|
19574
19564
|
if (data.mask) {
|
|
19575
|
-
var
|
|
19576
|
-
|
|
19577
|
-
|
|
19578
|
-
|
|
19565
|
+
var maskProps = data.mask;
|
|
19566
|
+
if (maskProps && maskProps.ref) {
|
|
19567
|
+
maskProps.ref = this.engine.findObject(maskProps.ref);
|
|
19568
|
+
}
|
|
19569
|
+
maskMode = this.maskManager.getMaskMode(data);
|
|
19570
|
+
maskRef = this.maskManager.getRefValue();
|
|
19579
19571
|
}
|
|
19580
19572
|
return {
|
|
19581
19573
|
maskMode: maskMode,
|
|
@@ -31265,9 +31257,6 @@ var FBGeometryDataT = /*#__PURE__*/ function() {
|
|
|
31265
31257
|
/**
|
|
31266
31258
|
* 渲染过程中错误队列
|
|
31267
31259
|
*/ this.renderErrors = new Set();
|
|
31268
|
-
/**
|
|
31269
|
-
* maskRef 值分配
|
|
31270
|
-
*/ this.maskRefManager = new MaskRefManager();
|
|
31271
31260
|
this.destroyed = false;
|
|
31272
31261
|
this.textures = [];
|
|
31273
31262
|
this.materials = [];
|
|
@@ -31638,7 +31627,7 @@ registerPlugin("sprite", SpriteLoader, exports.VFXItem);
|
|
|
31638
31627
|
registerPlugin("particle", ParticleLoader, exports.VFXItem);
|
|
31639
31628
|
registerPlugin("cal", CalculateLoader, exports.VFXItem);
|
|
31640
31629
|
registerPlugin("interact", InteractLoader, exports.VFXItem);
|
|
31641
|
-
var version = "2.4.
|
|
31630
|
+
var version = "2.4.1-alpha.1";
|
|
31642
31631
|
logger.info("Core version: " + version + ".");
|
|
31643
31632
|
|
|
31644
31633
|
exports.AbstractPlugin = AbstractPlugin;
|
|
@@ -31692,7 +31681,6 @@ exports.KTXTexture = KTXTexture;
|
|
|
31692
31681
|
exports.LineSegments = LineSegments;
|
|
31693
31682
|
exports.LinearValue = LinearValue;
|
|
31694
31683
|
exports.MaskProcessor = MaskProcessor;
|
|
31695
|
-
exports.MaskRefManager = MaskRefManager;
|
|
31696
31684
|
exports.Material = Material;
|
|
31697
31685
|
exports.MaterialDataBlock = MaterialDataBlock;
|
|
31698
31686
|
exports.Mesh = Mesh;
|