@galacean/effects-core 2.3.3 → 2.4.0-beta.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/components/base-render-component.d.ts +34 -58
- package/dist/components/shape-component.d.ts +2 -2
- package/dist/composition.d.ts +5 -9
- package/dist/engine.d.ts +10 -1
- package/dist/fallback/migration.d.ts +4 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +22750 -22928
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22732 -22916
- package/dist/index.mjs.map +1 -1
- package/dist/material/index.d.ts +1 -0
- package/dist/material/mask-ref-manager.d.ts +15 -0
- package/dist/material/types.d.ts +32 -0
- package/dist/material/utils.d.ts +3 -2
- package/dist/plugins/index.d.ts +6 -0
- package/dist/plugins/interact/mesh-collider.d.ts +2 -2
- package/dist/plugins/particle/particle-system.d.ts +18 -4
- package/dist/plugins/sprite/sprite-item.d.ts +8 -10
- package/dist/plugins/sprite/sprite-mesh.d.ts +1 -8
- package/dist/plugins/text/text-item.d.ts +5 -6
- package/dist/render/shader.d.ts +1 -27
- package/dist/vfx-item.d.ts +1 -1
- package/package.json +2 -2
- package/dist/composition-source-manager.d.ts +0 -40
|
@@ -1,62 +1,41 @@
|
|
|
1
|
+
import { Color } from '@galacean/effects-math/es/core/color';
|
|
1
2
|
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
3
|
-
import { RendererComponent } from './renderer-component';
|
|
4
|
-
import { Texture } from '../texture';
|
|
5
|
-
import type { GeometryDrawMode, Renderer } from '../render';
|
|
6
|
-
import { Geometry } from '../render';
|
|
7
3
|
import type { Engine } from '../engine';
|
|
4
|
+
import type { Maskable } from '../material';
|
|
5
|
+
import { MaskMode, MaskProcessor } from '../material';
|
|
8
6
|
import type { BoundingBoxTriangle, HitTestTriangleParams } from '../plugins';
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
7
|
+
import { MeshCollider } from '../plugins';
|
|
8
|
+
import type { Renderer } from '../render';
|
|
9
|
+
import { Geometry } from '../render';
|
|
10
|
+
import { type GeometryFromShape } from '../shape';
|
|
11
|
+
import { Texture } from '../texture';
|
|
12
|
+
import { RendererComponent } from './renderer-component';
|
|
12
13
|
/**
|
|
13
14
|
* 图层元素渲染属性, 经过处理后的 spec.SpriteContent.renderer
|
|
14
15
|
*/
|
|
15
|
-
export interface ItemRenderer extends Required<Omit<spec.RendererOptions, 'texture' | 'shape' | 'anchor' | 'particleOrigin'>> {
|
|
16
|
-
order: number;
|
|
17
|
-
mask: number;
|
|
16
|
+
export interface ItemRenderer extends Required<Omit<spec.RendererOptions, 'texture' | 'shape' | 'anchor' | 'particleOrigin' | 'mask'>> {
|
|
18
17
|
texture: Texture;
|
|
19
|
-
shape?: GeometryFromShape;
|
|
20
|
-
anchor?: spec.vec2;
|
|
21
|
-
particleOrigin?: spec.ParticleOrigin;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* 图层的渲染属性,用于 Mesh 的合并判断
|
|
25
|
-
*/
|
|
26
|
-
export interface ItemRenderInfo {
|
|
27
|
-
side: number;
|
|
28
|
-
occlusion: boolean;
|
|
29
|
-
blending: number;
|
|
30
|
-
cachePrefix: string;
|
|
31
18
|
mask: number;
|
|
32
|
-
maskMode:
|
|
33
|
-
|
|
34
|
-
wireframe?: boolean;
|
|
19
|
+
maskMode: MaskMode;
|
|
20
|
+
shape?: GeometryFromShape;
|
|
35
21
|
}
|
|
36
22
|
/**
|
|
37
23
|
* @since 2.1.0
|
|
38
24
|
*/
|
|
39
|
-
export declare class BaseRenderComponent extends RendererComponent {
|
|
25
|
+
export declare class BaseRenderComponent extends RendererComponent implements Maskable {
|
|
40
26
|
interaction?: {
|
|
41
27
|
behavior: spec.InteractBehavior;
|
|
42
28
|
};
|
|
43
|
-
cachePrefix: string;
|
|
44
|
-
geoData: {
|
|
45
|
-
atlasOffset: number[] | spec.TypedArray;
|
|
46
|
-
index: number[] | spec.TypedArray;
|
|
47
|
-
};
|
|
48
|
-
anchor?: spec.vec2;
|
|
49
29
|
renderer: ItemRenderer;
|
|
50
|
-
|
|
51
|
-
color: spec.vec4;
|
|
52
|
-
worldMatrix: Matrix4;
|
|
30
|
+
color: Color;
|
|
53
31
|
geometry: Geometry;
|
|
54
|
-
|
|
55
|
-
protected readonly wireframe?: boolean;
|
|
32
|
+
readonly maskManager: MaskProcessor;
|
|
56
33
|
protected preMultiAlpha: number;
|
|
57
34
|
protected visible: boolean;
|
|
58
|
-
|
|
59
|
-
|
|
35
|
+
/**
|
|
36
|
+
* 用于点击测试的碰撞器
|
|
37
|
+
*/
|
|
38
|
+
protected meshCollider: MeshCollider;
|
|
60
39
|
/**
|
|
61
40
|
*
|
|
62
41
|
* @param engine
|
|
@@ -65,12 +44,21 @@ export declare class BaseRenderComponent extends RendererComponent {
|
|
|
65
44
|
/**
|
|
66
45
|
* 设置当前 Mesh 的可见性。
|
|
67
46
|
* @param visible - true:可见,false:不可见
|
|
47
|
+
* @deprecated 2.4.0 Please use enabled instead
|
|
68
48
|
*/
|
|
69
49
|
setVisible(visible: boolean): void;
|
|
70
50
|
/**
|
|
71
51
|
* 获取当前 Mesh 的可见性。
|
|
52
|
+
* @deprecated 2.4.0 Please use enabled instead
|
|
72
53
|
*/
|
|
73
54
|
getVisible(): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* 设置当前图层的颜色
|
|
57
|
+
* > Tips: 透明度也属于颜色的一部分,当有透明度/颜色 K 帧变化时,该 API 会失效
|
|
58
|
+
* @since 2.4.0
|
|
59
|
+
* @param color - 颜色值
|
|
60
|
+
*/
|
|
61
|
+
setColor(color: Color): void;
|
|
74
62
|
/**
|
|
75
63
|
* 设置当前图层的颜色
|
|
76
64
|
* > Tips: 透明度也属于颜色的一部分,当有透明度/颜色 K 帧变化时,该 API 会失效
|
|
@@ -92,25 +80,13 @@ export declare class BaseRenderComponent extends RendererComponent {
|
|
|
92
80
|
setTexture(input: string): Promise<void>;
|
|
93
81
|
render(renderer: Renderer): void;
|
|
94
82
|
onStart(): void;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
index: number[];
|
|
99
|
-
};
|
|
100
|
-
protected setItem(): void;
|
|
101
|
-
protected getItemGeometryData(): {
|
|
83
|
+
getHitTestParams: (force?: boolean) => HitTestTriangleParams | undefined;
|
|
84
|
+
getBoundingBox(): BoundingBoxTriangle;
|
|
85
|
+
protected getItemGeometryData(geometry: Geometry): {
|
|
102
86
|
index: number[];
|
|
103
87
|
atlasOffset: number[];
|
|
104
88
|
};
|
|
105
|
-
protected createGeometry(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
getTextures(): Texture[];
|
|
109
|
-
/**
|
|
110
|
-
* 获取图层包围盒的类型和世界坐标
|
|
111
|
-
* @returns
|
|
112
|
-
*/
|
|
113
|
-
getBoundingBox(): BoundingBoxTriangle | void;
|
|
114
|
-
getHitTestParams: (force?: boolean) => HitTestTriangleParams | undefined;
|
|
89
|
+
protected createGeometry(): Geometry;
|
|
90
|
+
private configureMaterial;
|
|
91
|
+
fromData(data: unknown): void;
|
|
115
92
|
}
|
|
116
|
-
export declare function getImageItemRenderInfo(item: BaseRenderComponent): ItemRenderInfo;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as spec from '@galacean/effects-specification';
|
|
2
2
|
import type { Engine } from '../engine';
|
|
3
|
-
import {
|
|
3
|
+
import { BaseRenderComponent } from './base-render-component';
|
|
4
4
|
interface ShapeAttribute {
|
|
5
5
|
/**
|
|
6
6
|
* 矢量图形类型
|
|
@@ -90,7 +90,7 @@ export interface PolygonAttribute extends ShapeAttribute {
|
|
|
90
90
|
* 图形组件
|
|
91
91
|
* @since 2.1.0
|
|
92
92
|
*/
|
|
93
|
-
export declare class ShapeComponent extends
|
|
93
|
+
export declare class ShapeComponent extends BaseRenderComponent {
|
|
94
94
|
private hasStroke;
|
|
95
95
|
private hasFill;
|
|
96
96
|
private shapeDirty;
|
package/dist/composition.d.ts
CHANGED
|
@@ -3,12 +3,11 @@ import type { Ray } from '@galacean/effects-math/es/core/ray';
|
|
|
3
3
|
import type { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
|
|
4
4
|
import { Camera } from './camera';
|
|
5
5
|
import { CompositionComponent } from './comp-vfx-item';
|
|
6
|
-
import { CompositionSourceManager } from './composition-source-manager';
|
|
7
6
|
import type { PluginSystem } from './plugin-system';
|
|
8
7
|
import type { EventSystem, Plugin, Region } from './plugins';
|
|
9
8
|
import type { MeshRendererOptions, Renderer } from './render';
|
|
10
9
|
import { RenderFrame } from './render';
|
|
11
|
-
import type { Scene } from './scene';
|
|
10
|
+
import type { Scene, SceneRenderLevel } from './scene';
|
|
12
11
|
import type { Texture } from './texture';
|
|
13
12
|
import type { Disposable, LostHandler } from './utils';
|
|
14
13
|
import { VFXItem } from './vfx-item';
|
|
@@ -16,6 +15,7 @@ import type { CompositionEvent } from './events';
|
|
|
16
15
|
import { EventEmitter } from './events';
|
|
17
16
|
import type { PostProcessVolume } from './components';
|
|
18
17
|
import { SceneTicking } from './composition/scene-ticking';
|
|
18
|
+
import type { Engine } from './engine';
|
|
19
19
|
/**
|
|
20
20
|
* 合成统计信息
|
|
21
21
|
*/
|
|
@@ -160,7 +160,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
160
160
|
* 合成是否结束
|
|
161
161
|
*/
|
|
162
162
|
isEnded: boolean;
|
|
163
|
-
compositionSourceManager: CompositionSourceManager;
|
|
164
163
|
/**
|
|
165
164
|
* 合成id
|
|
166
165
|
*/
|
|
@@ -181,10 +180,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
181
180
|
* 插件系统,保存当前加载的插件对象,负责插件事件和创建插件的 Item 对象
|
|
182
181
|
*/
|
|
183
182
|
readonly pluginSystem: PluginSystem;
|
|
184
|
-
/**
|
|
185
|
-
* 是否在合成结束时自动销毁引用的纹理,合成重播时不销毁
|
|
186
|
-
*/
|
|
187
|
-
readonly autoRefTex: boolean;
|
|
188
183
|
/**
|
|
189
184
|
* 当前合成名称
|
|
190
185
|
*/
|
|
@@ -239,7 +234,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
239
234
|
private paused;
|
|
240
235
|
private lastVideoUpdateTime;
|
|
241
236
|
private isEndCalled;
|
|
242
|
-
private
|
|
237
|
+
private _textures;
|
|
243
238
|
/**
|
|
244
239
|
* 合成中消息元素创建/销毁时触发的回调
|
|
245
240
|
*/
|
|
@@ -405,7 +400,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
405
400
|
* 获取 engine 对象
|
|
406
401
|
* @returns
|
|
407
402
|
*/
|
|
408
|
-
getEngine():
|
|
403
|
+
getEngine(): Engine;
|
|
409
404
|
/**
|
|
410
405
|
* Item 求交测试,返回求交结果列表,x 和 y 是归一化到[-1, 1]区间的值,原点在左上角
|
|
411
406
|
* @param x - 鼠标或触点的 x,已经归一化到[-1, 1]
|
|
@@ -478,3 +473,4 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
|
|
|
478
473
|
*/
|
|
479
474
|
reloadTexture(): Promise<void>;
|
|
480
475
|
}
|
|
476
|
+
export declare function filterItemsByRenderLevel(composition: spec.CompositionData, engine: Engine, renderLevel?: SceneRenderLevel): spec.CompositionData;
|
package/dist/engine.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import type { Database, SceneData } from './asset-loader';
|
|
|
3
3
|
import { AssetLoader } from './asset-loader';
|
|
4
4
|
import type { EffectsObject } from './effects-object';
|
|
5
5
|
import type { Material } from './material';
|
|
6
|
+
import { MaskRefManager } from './material';
|
|
6
7
|
import type { GPUCapability, Geometry, Mesh, RenderPass, Renderer, ShaderLibrary } from './render';
|
|
7
|
-
import type { Scene } from './scene';
|
|
8
|
+
import type { Scene, SceneRenderLevel } from './scene';
|
|
8
9
|
import type { Texture } from './texture';
|
|
9
10
|
import type { Disposable } from './utils';
|
|
10
11
|
/**
|
|
@@ -15,6 +16,10 @@ export declare class Engine implements Disposable {
|
|
|
15
16
|
* 渲染器
|
|
16
17
|
*/
|
|
17
18
|
renderer: Renderer;
|
|
19
|
+
/**
|
|
20
|
+
* 渲染等级
|
|
21
|
+
*/
|
|
22
|
+
renderLevel?: SceneRenderLevel;
|
|
18
23
|
emptyTexture: Texture;
|
|
19
24
|
transparentTexture: Texture;
|
|
20
25
|
/**
|
|
@@ -29,6 +34,10 @@ export declare class Engine implements Disposable {
|
|
|
29
34
|
* 渲染过程中错误队列
|
|
30
35
|
*/
|
|
31
36
|
renderErrors: Set<Error>;
|
|
37
|
+
/**
|
|
38
|
+
* maskRef 值分配
|
|
39
|
+
*/
|
|
40
|
+
maskRefManager: MaskRefManager;
|
|
32
41
|
protected destroyed: boolean;
|
|
33
42
|
protected textures: Texture[];
|
|
34
43
|
protected materials: Material[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as spec from '@galacean/effects-specification';
|
|
1
2
|
import type { BaseContent, BinaryFile, JSONScene, JSONSceneLegacy, SpineResource, SpineContent } from '@galacean/effects-specification';
|
|
2
3
|
/**
|
|
3
4
|
* 2.1 以下版本数据适配(mars-player@2.4.0 及以上版本支持 2.1 以下数据的适配)
|
|
@@ -12,6 +13,9 @@ export declare function version22Migration(json: JSONSceneLegacy): JSONSceneLega
|
|
|
12
13
|
* - 富文本插件名称的适配
|
|
13
14
|
*/
|
|
14
15
|
export declare function version31Migration(json: JSONScene): JSONScene;
|
|
16
|
+
export declare function version32Migration(json: JSONScene): JSONScene;
|
|
17
|
+
export declare function processContent(composition: spec.CompositionData): void;
|
|
18
|
+
export declare function processMask(renderContent: any): void;
|
|
15
19
|
/**
|
|
16
20
|
* 3.0 以下版本数据适配(runtime 2.0及以上版本支持)
|
|
17
21
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export * from './canvas-pool';
|
|
|
10
10
|
export * from './comp-vfx-item';
|
|
11
11
|
export * from './components';
|
|
12
12
|
export * from './composition';
|
|
13
|
-
export * from './composition-source-manager';
|
|
14
13
|
export * from './config';
|
|
15
14
|
export * from './constants';
|
|
16
15
|
export * from './decorators';
|