@galacean/effects-core 2.8.0-alpha.2 → 2.8.0-alpha.4
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 +279 -135
- package/dist/asset-manager.d.ts +1 -1
- package/dist/components/effect-component.d.ts +2 -1
- package/dist/components/mesh-component.d.ts +7 -1
- package/dist/index.js +829 -808
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +829 -808
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-system.d.ts +4 -4
- package/dist/plugins/cal/calculate-loader.d.ts +2 -2
- package/dist/plugins/camera/camera-vfx-item-loader.d.ts +2 -2
- package/dist/plugins/interact/interact-loader.d.ts +2 -2
- package/dist/plugins/particle/particle-loader.d.ts +2 -2
- package/dist/plugins/particle/particle-system.d.ts +2 -1
- package/dist/plugins/plugin.d.ts +24 -19
- package/dist/plugins/sprite/sprite-item.d.ts +0 -1
- package/dist/plugins/sprite/sprite-loader.d.ts +2 -2
- package/dist/plugins/text/text-item.d.ts +21 -1
- package/dist/plugins/text/text-loader.d.ts +2 -2
- package/dist/render/post-process-pass.d.ts +9 -24
- package/dist/render/renderer.d.ts +8 -0
- package/package.json +1 -1
package/dist/plugin-system.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Composition } from './composition';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Plugin, PluginConstructor } from './plugins';
|
|
3
3
|
import type { Scene, SceneLoadOptions } from './scene';
|
|
4
4
|
import type { Engine } from './engine';
|
|
5
5
|
export declare const pluginLoaderMap: Record<string, PluginConstructor>;
|
|
@@ -16,10 +16,10 @@ export declare function registerPlugin(name: string, pluginClass: PluginConstruc
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function unregisterPlugin(name: string): void;
|
|
18
18
|
export declare class PluginSystem {
|
|
19
|
-
static getPlugins():
|
|
19
|
+
static getPlugins(): Plugin[];
|
|
20
20
|
static initializeComposition(composition: Composition, scene: Scene): void;
|
|
21
21
|
static destroyComposition(comp: Composition): void;
|
|
22
|
-
static
|
|
23
|
-
static
|
|
22
|
+
static onAssetsLoadStart(scene: Scene, options?: SceneLoadOptions): Promise<void[]>;
|
|
23
|
+
static onAssetsLoadFinish(scene: Scene, options: SceneLoadOptions, engine: Engine): void;
|
|
24
24
|
}
|
|
25
25
|
export declare function getPluginUsageInfo(name: string): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class CalculateLoader extends
|
|
1
|
+
import { Plugin } from '../plugin';
|
|
2
|
+
export declare class CalculateLoader extends Plugin {
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class CameraVFXItemLoader extends
|
|
1
|
+
import { Plugin } from '../plugin';
|
|
2
|
+
export declare class CameraVFXItemLoader extends Plugin {
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class InteractLoader extends
|
|
1
|
+
import { Plugin } from '../plugin';
|
|
2
|
+
export declare class InteractLoader extends Plugin {
|
|
3
3
|
}
|
|
@@ -183,7 +183,8 @@ export declare class ParticleSystem extends Component implements Maskable {
|
|
|
183
183
|
reset(): void;
|
|
184
184
|
onStart(): void;
|
|
185
185
|
onUpdate(dt: number): void;
|
|
186
|
-
|
|
186
|
+
simulate(time: number): void;
|
|
187
|
+
private update;
|
|
187
188
|
drawStencilMask(renderer: Renderer): void;
|
|
188
189
|
onDestroy(): void;
|
|
189
190
|
getParticleBoxes(): {
|
package/dist/plugins/plugin.d.ts
CHANGED
|
@@ -2,35 +2,40 @@ import type { Scene, SceneLoadOptions } from '../scene';
|
|
|
2
2
|
import type { Composition } from '../composition';
|
|
3
3
|
import type { Engine } from '../engine';
|
|
4
4
|
export interface PluginConstructor {
|
|
5
|
-
new ():
|
|
5
|
+
new (): Plugin;
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* 抽象插件类
|
|
10
10
|
* 注册合成不同生命周期的回调函数
|
|
11
11
|
*/
|
|
12
|
-
export declare abstract class
|
|
12
|
+
export declare abstract class Plugin {
|
|
13
13
|
order: number;
|
|
14
14
|
name: string;
|
|
15
|
-
initialize(): void;
|
|
16
15
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @param scene
|
|
20
|
-
* @param options
|
|
21
|
-
* @returns
|
|
16
|
+
* 场景加载时触发,用于加载插件所需的自定义资源。
|
|
17
|
+
* 此阶段适合发起异步资源请求。
|
|
18
|
+
* @param scene - 场景对象
|
|
19
|
+
* @param options - 场景加载选项
|
|
22
20
|
*/
|
|
23
|
-
|
|
21
|
+
onAssetsLoadStart(scene: Scene, options?: SceneLoadOptions): Promise<void>;
|
|
24
22
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @param {Scene} scene
|
|
31
|
-
* @param {SceneLoadOptions} options
|
|
23
|
+
* 场景资源加载完成后触发。
|
|
24
|
+
* 此时 JSON 中的图片和二进制已加载完成,可对资源做进一步处理。
|
|
25
|
+
* @param scene - 场景对象
|
|
26
|
+
* @param options - 场景加载选项
|
|
27
|
+
* @param engine - 引擎实例
|
|
32
28
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
onAssetsLoadFinish(scene: Scene, options: SceneLoadOptions, engine: Engine): void;
|
|
30
|
+
/**
|
|
31
|
+
* 合成创建完成后触发。
|
|
32
|
+
* @param composition - 合成对象
|
|
33
|
+
* @param scene - 场景对象
|
|
34
|
+
*/
|
|
35
|
+
onCompositionCreated(composition: Composition, scene: Scene): void;
|
|
36
|
+
/**
|
|
37
|
+
* 合成销毁时触发。
|
|
38
|
+
* @param composition - 合成对象
|
|
39
|
+
*/
|
|
40
|
+
onCompositionDestroy(composition: Composition): void;
|
|
36
41
|
}
|
|
@@ -41,7 +41,6 @@ export declare class ComponentTimePlayable extends Playable {
|
|
|
41
41
|
export declare class SpriteComponent extends MaskableGraphic {
|
|
42
42
|
time: number;
|
|
43
43
|
duration: number;
|
|
44
|
-
loop: boolean;
|
|
45
44
|
protected textureSheetAnimation?: spec.TextureSheetAnimation;
|
|
46
45
|
constructor(engine: Engine, props?: spec.SpriteComponentData);
|
|
47
46
|
onUpdate(dt: number): void;
|
|
@@ -26,6 +26,14 @@ export declare class TextComponent extends MaskableGraphic implements ITextCompo
|
|
|
26
26
|
* 每一行文本的最大宽度
|
|
27
27
|
*/
|
|
28
28
|
protected maxLineWidth: number;
|
|
29
|
+
/**
|
|
30
|
+
* 初始文本宽度,用于计算缩放比例
|
|
31
|
+
*/
|
|
32
|
+
private baseTextWidth;
|
|
33
|
+
/**
|
|
34
|
+
* 初始 `transform.size.x`,用于按比例更新显示宽度
|
|
35
|
+
*/
|
|
36
|
+
private baseScaleX;
|
|
29
37
|
private getDefaultProps;
|
|
30
38
|
constructor(engine: Engine);
|
|
31
39
|
onUpdate(dt: number): void;
|
|
@@ -36,7 +44,7 @@ export declare class TextComponent extends MaskableGraphic implements ITextCompo
|
|
|
36
44
|
/**
|
|
37
45
|
* 根据配置更新文本样式和布局
|
|
38
46
|
*/
|
|
39
|
-
|
|
47
|
+
updateWithOptions(options: spec.TextContentOptions): void;
|
|
40
48
|
getLineCount(text: string): number;
|
|
41
49
|
/**
|
|
42
50
|
* 设置行高
|
|
@@ -88,6 +96,18 @@ export declare class TextComponent extends MaskableGraphic implements ITextCompo
|
|
|
88
96
|
protected updateTexture(flipY?: boolean): void;
|
|
89
97
|
renderText(options: spec.TextContentOptions): void;
|
|
90
98
|
setAutoWidth(value: boolean): void;
|
|
99
|
+
/**
|
|
100
|
+
* 设置文本框宽度
|
|
101
|
+
* 手动设置宽度时会自动关闭 `autoWidth`
|
|
102
|
+
* 同时会按比例更新 `transform.size.x`,让 UI 框宽度也跟着变化
|
|
103
|
+
* @param value - 文本框宽度
|
|
104
|
+
*/
|
|
105
|
+
setTextWidth(value: number): void;
|
|
106
|
+
/**
|
|
107
|
+
* 设置文本框高度
|
|
108
|
+
* @param value - 文本框高度
|
|
109
|
+
*/
|
|
110
|
+
setTextHeight(value: number): void;
|
|
91
111
|
setFontSize(value: number): void;
|
|
92
112
|
setOutlineWidth(value: number): void;
|
|
93
113
|
setShadowBlur(value: number): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare class TextLoader extends
|
|
1
|
+
import { Plugin } from '../index';
|
|
2
|
+
export declare class TextLoader extends Plugin {
|
|
3
3
|
}
|
|
@@ -1,37 +1,22 @@
|
|
|
1
1
|
import type { RenderPassDestroyOptions } from './render-pass';
|
|
2
2
|
import { RenderTargetHandle, RenderPass } from './render-pass';
|
|
3
3
|
import type { Renderer } from './renderer';
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class BloomPass extends RenderPass {
|
|
5
5
|
sceneTextureHandle: RenderTargetHandle;
|
|
6
|
+
private readonly iterationCount;
|
|
7
|
+
private thresholdMaterial;
|
|
8
|
+
private downSampleHMaterial;
|
|
9
|
+
private downSampleVMaterial;
|
|
10
|
+
private upSampleMaterial;
|
|
11
|
+
private tempRTs;
|
|
12
|
+
private thresholdRT;
|
|
6
13
|
private mainTexture;
|
|
7
|
-
|
|
8
|
-
constructor(renderer: Renderer);
|
|
14
|
+
constructor(renderer: Renderer, iterationCount?: number);
|
|
9
15
|
configure(renderer: Renderer): void;
|
|
10
16
|
execute(renderer: Renderer): void;
|
|
11
17
|
onCameraCleanup(renderer: Renderer): void;
|
|
12
18
|
dispose(options?: RenderPassDestroyOptions): void;
|
|
13
19
|
}
|
|
14
|
-
export declare class HQGaussianDownSamplePass extends RenderPass {
|
|
15
|
-
gaussianResult: RenderTargetHandle;
|
|
16
|
-
private mainTexture;
|
|
17
|
-
private screenMesh;
|
|
18
|
-
private readonly type;
|
|
19
|
-
private readonly level;
|
|
20
|
-
constructor(renderer: Renderer, type: 'V' | 'H', level: number);
|
|
21
|
-
configure(renderer: Renderer): void;
|
|
22
|
-
execute(renderer: Renderer): void;
|
|
23
|
-
onCameraCleanup(renderer: Renderer): void;
|
|
24
|
-
}
|
|
25
|
-
export declare class HQGaussianUpSamplePass extends RenderPass {
|
|
26
|
-
gaussianDownSampleResult: RenderTargetHandle;
|
|
27
|
-
private mainTexture;
|
|
28
|
-
private screenMesh;
|
|
29
|
-
private readonly level;
|
|
30
|
-
constructor(renderer: Renderer, level: number);
|
|
31
|
-
configure(renderer: Renderer): void;
|
|
32
|
-
execute(renderer: Renderer): void;
|
|
33
|
-
onCameraCleanup(renderer: Renderer): void;
|
|
34
|
-
}
|
|
35
20
|
export declare class ToneMappingPass extends RenderPass {
|
|
36
21
|
private screenMesh;
|
|
37
22
|
private sceneTextureHandle;
|
|
@@ -9,6 +9,7 @@ import type { RenderFrame, RenderingData } from './render-frame';
|
|
|
9
9
|
import type { RenderPassClearAction } from './render-pass';
|
|
10
10
|
import type { ShaderLibrary } from './shader';
|
|
11
11
|
import { RenderTargetPool } from './render-target-pool';
|
|
12
|
+
import type { Texture } from '../texture';
|
|
12
13
|
export declare class Renderer implements LostHandler, RestoreHandler {
|
|
13
14
|
engine: Engine;
|
|
14
15
|
static create: (engine: Engine) => Renderer;
|
|
@@ -51,5 +52,12 @@ export declare class Renderer implements LostHandler, RestoreHandler {
|
|
|
51
52
|
drawGeometry(geometry: Geometry, matrix: Matrix4, material: Material, subMeshIndex?: number): void;
|
|
52
53
|
getTemporaryRT(name: string, width: number, height: number, depthBuffer: number, filter: FilterMode, format: RenderTextureFormat): Framebuffer;
|
|
53
54
|
releaseTemporaryRT(rt: Framebuffer): void;
|
|
55
|
+
/**
|
|
56
|
+
* 将源纹理复制到目标 Framebuffer,可使用自定义材质进行处理
|
|
57
|
+
* @param source - 源纹理
|
|
58
|
+
* @param destination - 目标 Framebuffer,如果为 null 则渲染到屏幕
|
|
59
|
+
* @param material - 可选的自定义材质,不传则使用默认复制材质
|
|
60
|
+
*/
|
|
61
|
+
blit(source: Texture, destination: Framebuffer | null, material?: Material): void;
|
|
54
62
|
dispose(): void;
|
|
55
63
|
}
|