@galacean/effects-core 2.1.0-alpha.0 → 2.1.0-alpha.10

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.
Files changed (105) hide show
  1. package/dist/animation/color-playable.d.ts +26 -0
  2. package/dist/animation/index.d.ts +1 -0
  3. package/dist/asset-manager.d.ts +15 -11
  4. package/dist/asset.d.ts +4 -0
  5. package/dist/binary-asset.d.ts +2 -2
  6. package/dist/comp-vfx-item.d.ts +4 -5
  7. package/dist/components/base-render-component.d.ts +108 -0
  8. package/dist/components/effect-component.d.ts +3 -34
  9. package/dist/components/fake-3d-component.d.ts +28 -0
  10. package/dist/components/index.d.ts +3 -0
  11. package/dist/components/mesh-component.d.ts +21 -0
  12. package/dist/components/post-process-volume.d.ts +5 -3
  13. package/dist/components/shape-component.d.ts +291 -0
  14. package/dist/composition/scene-ticking.d.ts +15 -1
  15. package/dist/composition-source-manager.d.ts +5 -6
  16. package/dist/composition.d.ts +29 -25
  17. package/dist/downloader.d.ts +0 -3
  18. package/dist/effects-object.d.ts +23 -0
  19. package/dist/engine.d.ts +9 -0
  20. package/dist/events/event-emitter.d.ts +6 -0
  21. package/dist/events/types.d.ts +1 -1
  22. package/dist/index.d.ts +3 -1
  23. package/dist/index.js +22670 -19350
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +22678 -19361
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/math/index.d.ts +1 -1
  28. package/dist/math/translate.d.ts +1 -1
  29. package/dist/math/value-getters/color-curve.d.ts +12 -0
  30. package/dist/math/value-getters/index.d.ts +4 -0
  31. package/dist/math/value-getters/value-getter-map.d.ts +2 -0
  32. package/dist/math/{value-getter.d.ts → value-getters/value-getter.d.ts} +8 -5
  33. package/dist/math/value-getters/vector4-curve.d.ts +12 -0
  34. package/dist/plugin-system.d.ts +7 -5
  35. package/dist/plugins/cal/calculate-item.d.ts +5 -3
  36. package/dist/plugins/cal/calculate-loader.d.ts +1 -1
  37. package/dist/plugins/cal/calculate-vfx-item.d.ts +1 -1
  38. package/dist/plugins/cal/playable-graph.d.ts +1 -2
  39. package/dist/plugins/camera/camera-vfx-item-loader.d.ts +1 -1
  40. package/dist/plugins/index.d.ts +2 -7
  41. package/dist/plugins/interact/interact-item.d.ts +12 -0
  42. package/dist/plugins/interact/interact-loader.d.ts +1 -1
  43. package/dist/plugins/interact/mesh-collider.d.ts +15 -0
  44. package/dist/plugins/particle/burst.d.ts +2 -0
  45. package/dist/plugins/particle/particle-mesh.d.ts +10 -0
  46. package/dist/plugins/particle/particle-system.d.ts +4 -4
  47. package/dist/plugins/plugin.d.ts +14 -3
  48. package/dist/plugins/shape/build-adaptive-bezier.d.ts +1 -0
  49. package/dist/plugins/shape/ellipse.d.ts +79 -0
  50. package/dist/plugins/shape/graphics-path.d.ts +65 -0
  51. package/dist/plugins/shape/point-data.d.ts +6 -0
  52. package/dist/plugins/shape/point-like.d.ts +31 -0
  53. package/dist/plugins/shape/point.d.ts +58 -0
  54. package/dist/plugins/shape/poly-star.d.ts +42 -0
  55. package/dist/plugins/shape/polygon.d.ts +67 -0
  56. package/dist/plugins/shape/rectangle.d.ts +129 -0
  57. package/dist/plugins/shape/shape-path.d.ts +75 -0
  58. package/dist/plugins/shape/shape-primitive.d.ts +15 -0
  59. package/dist/plugins/shape/triangle.d.ts +89 -0
  60. package/dist/plugins/shape/triangulate.d.ts +1 -0
  61. package/dist/plugins/sprite/sprite-item.d.ts +15 -116
  62. package/dist/plugins/sprite/sprite-loader.d.ts +1 -1
  63. package/dist/plugins/sprite/sprite-mesh.d.ts +3 -4
  64. package/dist/plugins/text/text-item.d.ts +15 -5
  65. package/dist/plugins/timeline/index.d.ts +3 -0
  66. package/dist/plugins/timeline/playable-assets/color-property-playable-asset.d.ts +7 -0
  67. package/dist/plugins/timeline/playable-assets/float-property-playable-asset.d.ts +7 -0
  68. package/dist/plugins/timeline/playable-assets/index.d.ts +3 -0
  69. package/dist/plugins/{cal → timeline/playable-assets}/timeline-asset.d.ts +9 -9
  70. package/dist/plugins/timeline/playable-assets/vector4-property-playable-asset.d.ts +7 -0
  71. package/dist/plugins/timeline/playables/color-property-mixer-playable.d.ts +6 -0
  72. package/dist/plugins/timeline/playables/float-property-mixer-playable.d.ts +6 -0
  73. package/dist/plugins/timeline/playables/index.d.ts +7 -0
  74. package/dist/plugins/timeline/playables/property-clip-playable.d.ts +8 -0
  75. package/dist/plugins/timeline/playables/sub-composition-mixer-playable.d.ts +5 -0
  76. package/dist/plugins/timeline/playables/vector4-property-mixer-playable.d.ts +6 -0
  77. package/dist/plugins/timeline/track-instance.d.ts +14 -0
  78. package/dist/plugins/timeline/track.d.ts +6 -4
  79. package/dist/plugins/timeline/tracks/color-property-track.d.ts +5 -0
  80. package/dist/plugins/timeline/tracks/float-property-track.d.ts +6 -0
  81. package/dist/plugins/timeline/tracks/index.d.ts +9 -0
  82. package/dist/plugins/timeline/tracks/material-track.d.ts +5 -0
  83. package/dist/plugins/timeline/tracks/property-track.d.ts +8 -0
  84. package/dist/plugins/timeline/tracks/sub-composition-track.d.ts +3 -1
  85. package/dist/plugins/timeline/tracks/vector4-property-track.d.ts +5 -0
  86. package/dist/render/gpu-capability.d.ts +1 -1
  87. package/dist/render/index.d.ts +0 -1
  88. package/dist/render/mesh.d.ts +1 -1
  89. package/dist/render/render-frame.d.ts +5 -1
  90. package/dist/render/renderer.d.ts +1 -1
  91. package/dist/render/semantic-map.d.ts +1 -1
  92. package/dist/render/shader.d.ts +1 -1
  93. package/dist/scene.d.ts +17 -18
  94. package/dist/serialization-helper.d.ts +3 -3
  95. package/dist/shape/geometry.d.ts +4 -4
  96. package/dist/texture/texture.d.ts +11 -2
  97. package/dist/texture/utils.d.ts +1 -2
  98. package/dist/transform.d.ts +8 -0
  99. package/dist/utils/color.d.ts +4 -5
  100. package/dist/utils/index.d.ts +1 -1
  101. package/dist/vfx-item.d.ts +45 -9
  102. package/package.json +4 -3
  103. package/dist/image-asset.d.ts +0 -5
  104. package/dist/render/global-volume.d.ts +0 -17
  105. /package/dist/plugins/timeline/{playables → playable-assets}/sub-composition-playable-asset.d.ts +0 -0
@@ -5,13 +5,12 @@ import type { PluginSystem } from './plugin-system';
5
5
  import type { Scene, SceneRenderLevel } from './scene';
6
6
  import type { Texture } from './texture';
7
7
  import type { Disposable } from './utils';
8
- import type { VFXItemProps } from './vfx-item';
9
8
  export interface ContentOptions {
10
9
  id: string;
11
10
  duration: number;
12
11
  name: string;
13
12
  endBehavior: spec.EndBehavior;
14
- items: VFXItemProps[];
13
+ items: spec.DataPath[];
15
14
  camera: spec.CameraOptions;
16
15
  startTime: number;
17
16
  timelineAsset: spec.DataPath;
@@ -22,17 +21,17 @@ export interface ContentOptions {
22
21
  */
23
22
  export declare class CompositionSourceManager implements Disposable {
24
23
  composition?: spec.CompositionData;
25
- refCompositions: Map<string, spec.CompositionData>;
26
- sourceContent?: ContentOptions;
27
- refCompositionProps: Map<string, VFXItemProps>;
24
+ sourceContent?: spec.CompositionData;
25
+ refCompositionProps: Map<string, spec.CompositionData>;
28
26
  renderLevel?: SceneRenderLevel;
29
27
  pluginSystem?: PluginSystem;
30
28
  totalTime: number;
31
- imgUsage: Record<string, number[]>;
29
+ imgUsage: Record<string, number>;
32
30
  textures: Texture[];
33
31
  jsonScene?: spec.JSONScene;
34
32
  mask: number;
35
33
  engine: Engine;
34
+ private refCompositions;
36
35
  constructor(scene: Scene, engine: Engine);
37
36
  private getContent;
38
37
  private assembleItems;
@@ -1,6 +1,5 @@
1
1
  import * as spec from '@galacean/effects-specification';
2
2
  import type { Ray } from '@galacean/effects-math/es/core/ray';
3
- import type { Vector3 } from '@galacean/effects-math/es/core/vector3';
4
3
  import type { Matrix4 } from '@galacean/effects-math/es/core/matrix4';
5
4
  import { Camera } from './camera';
6
5
  import { CompositionComponent } from './comp-vfx-item';
@@ -9,33 +8,38 @@ import type { PluginSystem } from './plugin-system';
9
8
  import type { EventSystem, Plugin, Region } from './plugins';
10
9
  import type { MeshRendererOptions, Renderer } from './render';
11
10
  import { RenderFrame } from './render';
12
- import type { Scene, SceneType } from './scene';
11
+ import type { Scene } from './scene';
13
12
  import type { Texture } from './texture';
14
13
  import type { Disposable, LostHandler } from './utils';
15
- import type { VFXItemProps } from './vfx-item';
16
14
  import { VFXItem } from './vfx-item';
17
15
  import type { CompositionEvent } from './events';
18
16
  import { EventEmitter } from './events';
19
- import type { PostProcessVolume } from './components/post-process-volume';
17
+ import type { PostProcessVolume } from './components';
20
18
  import { SceneTicking } from './composition/scene-ticking';
19
+ /**
20
+ * 合成统计信息
21
+ */
21
22
  export interface CompositionStatistic {
22
- loadTime: number;
23
23
  loadStart: number;
24
+ loadTime: number;
25
+ /**
26
+ * Shader 编译耗时
27
+ */
28
+ compileTime: number;
29
+ /**
30
+ * 从加载到渲染第一帧的时间(含 Shader 编译)
31
+ */
24
32
  firstFrameTime: number;
25
- precompileTime: number;
26
33
  }
34
+ /**
35
+ * 合成消息对象
36
+ */
27
37
  export interface MessageItem {
28
38
  id: string;
29
39
  name: string;
30
40
  phrase: number;
31
41
  compositionId: string;
32
42
  }
33
- export interface CompItemClickedData {
34
- name: string;
35
- id: string;
36
- hitPositions: Vector3[];
37
- position: Vector3;
38
- }
39
43
  /**
40
44
  *
41
45
  */
@@ -44,6 +48,9 @@ export interface CompositionHitTestOptions {
44
48
  stop?: (region: Region) => boolean;
45
49
  skip?: (item: VFXItem) => boolean;
46
50
  }
51
+ /**
52
+ *
53
+ */
47
54
  export interface CompositionProps {
48
55
  reusable?: boolean;
49
56
  baseRenderOrder?: number;
@@ -61,6 +68,9 @@ export interface CompositionProps {
61
68
  */
62
69
  export declare class Composition extends EventEmitter<CompositionEvent<Composition>> implements Disposable, LostHandler {
63
70
  renderer: Renderer;
71
+ /**
72
+ *
73
+ */
64
74
  sceneTicking: SceneTicking;
65
75
  /**
66
76
  * 当前帧的渲染数据对象
@@ -87,7 +97,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
87
97
  * 是否播放完成后销毁 texture 对象
88
98
  */
89
99
  keepResource: boolean;
90
- extraCamera: VFXItem;
91
100
  /**
92
101
  * 合成内的元素否允许点击、拖拽交互
93
102
  * @since 1.6.0
@@ -117,7 +126,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
117
126
  /**
118
127
  * 是否在合成结束时自动销毁引用的纹理,合成重播时不销毁
119
128
  */
120
- autoRefTex: boolean;
129
+ readonly autoRefTex: boolean;
121
130
  /**
122
131
  * 当前合成名称
123
132
  */
@@ -133,7 +142,7 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
133
142
  /**
134
143
  * 合成对应的 url 或者 JSON
135
144
  */
136
- readonly url: SceneType;
145
+ readonly url: Scene.LoadType;
137
146
  /**
138
147
  * 合成根元素
139
148
  */
@@ -145,19 +154,19 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
145
154
  /**
146
155
  * 预合成的合成属性,在 content 中会被其元素属性覆盖
147
156
  */
148
- refCompositionProps: Map<string, VFXItemProps>;
157
+ readonly refCompositionProps: Map<string, spec.CompositionData>;
149
158
  /**
150
159
  * 合成的相机对象
151
160
  */
152
161
  readonly camera: Camera;
153
162
  /**
154
- * 合成全局时间
163
+ * 后处理渲染配置
155
164
  */
156
- globalTime: number;
165
+ globalVolume?: PostProcessVolume;
157
166
  /**
158
- * 后处理渲染配置
167
+ * 是否开启后处理
159
168
  */
160
- globalVolume: PostProcessVolume;
169
+ postProcessingEnabled: boolean;
161
170
  protected rendererOptions: MeshRendererOptions | null;
162
171
  protected assigned: boolean;
163
172
  /**
@@ -187,7 +196,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
187
196
  * @param compositionSourceManager
188
197
  */
189
198
  constructor(props: CompositionProps, scene: Scene);
190
- initializeSceneTicking(item: VFXItem): void;
191
199
  /**
192
200
  * 所有合成 Item 的根变换
193
201
  */
@@ -281,7 +289,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
281
289
  /**
282
290
  * 前进合成到指定时间
283
291
  * @param time - 相对0时刻的时间
284
- * @param skipRender - 是否跳过渲染
285
292
  */
286
293
  private forwardTime;
287
294
  /**
@@ -293,10 +300,8 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
293
300
  /**
294
301
  * 合成更新,针对所有 item 的更新
295
302
  * @param deltaTime - 更新的时间步长
296
- * @param skipRender - 是否需要渲染
297
303
  */
298
304
  update(deltaTime: number): void;
299
- private toLocalTime;
300
305
  private shouldDispose;
301
306
  private getUpdateTime;
302
307
  private callAwake;
@@ -304,7 +309,6 @@ export declare class Composition extends EventEmitter<CompositionEvent<Compositi
304
309
  * 构建父子树,同时保存到 itemCacheMap 中便于查找
305
310
  */
306
311
  private buildItemTree;
307
- private getParentIdWithoutSuffix;
308
312
  /**
309
313
  * 更新视频数据到纹理
310
314
  * @override
@@ -1,8 +1,5 @@
1
1
  type SuccessHandler<T> = (data: T) => void;
2
2
  type ErrorHandler = (status: number, responseText: string) => void;
3
- /**
4
- *
5
- */
6
3
  /**
7
4
  * JSON 值,它可以是字符串、数字、布尔值、对象或者 JSON 值的数组。
8
5
  *
@@ -5,15 +5,35 @@ import type { Engine } from './engine';
5
5
  */
6
6
  export declare abstract class EffectsObject {
7
7
  engine: Engine;
8
+ /**
9
+ *
10
+ * @param obj
11
+ * @returns
12
+ */
8
13
  static is(obj: unknown): obj is EffectsObject;
9
14
  protected guid: string;
10
15
  /**
11
16
  * 存储需要序列化的数据
12
17
  */
13
18
  readonly taggedProperties: Record<string, any>;
19
+ /**
20
+ *
21
+ * @param engine
22
+ */
14
23
  constructor(engine: Engine);
24
+ /**
25
+ *
26
+ * @returns
27
+ */
15
28
  getInstanceId(): string;
29
+ /**
30
+ *
31
+ * @param guid
32
+ */
16
33
  setInstanceId(guid: string): void;
34
+ /**
35
+ *
36
+ */
17
37
  toData(): void;
18
38
  /**
19
39
  * 反序列化函数
@@ -21,5 +41,8 @@ export declare abstract class EffectsObject {
21
41
  * @param data - 对象的序列化的数据
22
42
  */
23
43
  fromData(data: spec.EffectsObjectData): void;
44
+ /**
45
+ *
46
+ */
24
47
  dispose(): void;
25
48
  }
package/dist/engine.d.ts CHANGED
@@ -11,9 +11,15 @@ import type { Disposable } from './utils';
11
11
  * Engine 基类,负责维护所有 GPU 资源的管理及销毁
12
12
  */
13
13
  export declare class Engine implements Disposable {
14
+ /**
15
+ * 渲染器
16
+ */
14
17
  renderer: Renderer;
15
18
  emptyTexture: Texture;
16
19
  transparentTexture: Texture;
20
+ /**
21
+ * GPU 能力
22
+ */
17
23
  gpuCapability: GPUCapability;
18
24
  jsonSceneData: SceneData;
19
25
  objectInstance: Record<string, EffectsObject>;
@@ -29,6 +35,9 @@ export declare class Engine implements Disposable {
29
35
  protected geometries: Geometry[];
30
36
  protected meshes: Mesh[];
31
37
  protected renderPasses: RenderPass[];
38
+ /**
39
+ *
40
+ */
32
41
  constructor();
33
42
  /**
34
43
  * 创建 Engine 对象。
@@ -1,3 +1,6 @@
1
+ /**
2
+ *
3
+ */
1
4
  export type EventEmitterListener<P extends any[]> = (...callbackArgs: P) => void;
2
5
  /**
3
6
  * 事件监听器选项
@@ -8,6 +11,9 @@ export type EventEmitterOptions = {
8
11
  */
9
12
  once?: boolean;
10
13
  };
14
+ /**
15
+ * 事件监听器
16
+ */
11
17
  export declare class EventEmitter<T extends Record<string, any[]>> {
12
18
  private listeners;
13
19
  /**
@@ -14,7 +14,7 @@ export type ItemEvent = {
14
14
  ['message']: [message: Omit<MessageItem, 'compositionId'>];
15
15
  };
16
16
  /**
17
- * Compositio 可以绑定的事件
17
+ * Composition 可以绑定的事件
18
18
  */
19
19
  export type CompositionEvent<C> = {
20
20
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export * as math from '@galacean/effects-math/es/core/index';
2
2
  export * as spec from '@galacean/effects-specification';
3
+ export * from './asset';
4
+ export * from './binary-asset';
3
5
  export * from './asset-loader';
4
6
  export * from './asset-manager';
5
7
  export * from './camera';
@@ -32,8 +34,8 @@ export * from './ticker';
32
34
  export * from './transform';
33
35
  export * from './utils';
34
36
  export * from './vfx-item';
35
- export * from './binary-asset';
36
37
  export * from './effects-object';
37
38
  export * from './effects-package';
38
39
  export * from './events';
40
+ export * from './pass-render-level';
39
41
  export declare const version: string;