@galacean/effects-core 2.0.0-alpha.2 → 2.0.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.
@@ -320,9 +320,9 @@ export declare abstract class Material extends EffectsObject implements Disposab
320
320
  */
321
321
  abstract hasUniform(name: string): boolean;
322
322
  /******** 预留接口,暂时不用实现 ***********************/
323
- abstract enableKeyword(keyword: string): void;
324
- abstract disableKeyword(keyword: string): void;
325
- abstract isKeywordEnabled(keyword: string): boolean;
323
+ abstract enableMacro(keyword: string): void;
324
+ abstract disableMacro(keyword: string): void;
325
+ abstract isMacroEnabled(keyword: string): boolean;
326
326
  /***************************************************/
327
327
  /**
328
328
  * Material 的克隆方法(不接入滤镜,本方法可以不做实现)
@@ -3,12 +3,12 @@ import type * as spec from '@galacean/effects-specification';
3
3
  import type { ValueGetter } from '../../math';
4
4
  import { AnimationPlayable } from './animation-playable';
5
5
  import type { ItemBasicTransform, ItemLinearVelOverLifetime } from './calculate-item';
6
- import { Playable } from './playable-graph';
6
+ import { Playable, PlayableAsset } from './playable-graph';
7
7
  /**
8
8
  * @since 2.0.0
9
9
  * @internal
10
10
  */
11
- export declare class AnimationClipPlayable extends AnimationPlayable {
11
+ export declare class TransformAnimationPlayable extends AnimationPlayable {
12
12
  originalTransform: ItemBasicTransform;
13
13
  protected sizeSeparateAxes: boolean;
14
14
  protected sizeXOverLifetime: ValueGetter<number>;
@@ -45,6 +45,11 @@ export declare class AnimationClipPlayable extends AnimationPlayable {
45
45
  private sampleAnimation;
46
46
  fromData(data: TransformAnimationData): void;
47
47
  }
48
+ export declare class TransformAnimationPlayableAsset extends PlayableAsset {
49
+ transformAnimationData: TransformAnimationData;
50
+ createPlayable(): Playable;
51
+ fromData(data: TransformAnimationData): void;
52
+ }
48
53
  export interface TransformAnimationData {
49
54
  /**
50
55
  * 元素大小变化属性
@@ -63,7 +68,7 @@ export interface TransformAnimationData {
63
68
  * @since 2.0.0
64
69
  * @internal
65
70
  */
66
- export declare class ActivationClipPlayable extends Playable {
71
+ export declare class ActivationPlayable extends Playable {
67
72
  onGraphStart(): void;
68
73
  onPlayablePlay(): void;
69
74
  onPlayableDestroy(): void;
@@ -60,3 +60,7 @@ export declare class PlayableOutput {
60
60
  onGraphStart(): void;
61
61
  processFrame(dt: number): void;
62
62
  }
63
+ export declare abstract class PlayableAsset {
64
+ abstract createPlayable(): Playable;
65
+ fromData(data: any): void;
66
+ }
@@ -1,22 +1,21 @@
1
1
  import type { VFXItem, VFXItemContent } from '../../vfx-item';
2
- import { Playable, PlayableOutput } from './playable-graph';
2
+ import { Playable, PlayableAsset, PlayableOutput } from './playable-graph';
3
3
  /**
4
4
  * @since 2.0.0
5
5
  * @internal
6
6
  */
7
- export declare class Track {
7
+ export declare class Track extends PlayableAsset {
8
8
  id: string;
9
9
  name: string;
10
10
  bindingItem: VFXItem<VFXItemContent>;
11
11
  private clips;
12
12
  private clipSeed;
13
- constructor();
14
13
  createOutput(): PlayableOutput;
15
14
  /**
16
15
  * 重写该方法以创建自定义混合器
17
16
  */
18
17
  createMixerPlayable(): Playable;
19
- createPlayebleTree(): Playable;
18
+ createPlayable(): Playable;
20
19
  createClip<T extends Playable>(classConstructor: new () => T, name?: string): TimelineClip;
21
20
  getClips(): TimelineClip[];
22
21
  findClip(name: string): TimelineClip | undefined;
@@ -1,8 +1,8 @@
1
1
  import type * as spec from '@galacean/effects-specification';
2
+ import type { Engine } from '../../engine';
2
3
  import type { MeshRendererOptions } from '../../render';
3
4
  import { Mesh } from '../../render';
4
5
  import type { Transform } from '../../transform';
5
- import type { Engine } from '../../engine';
6
6
  export declare class InteractMesh {
7
7
  private readonly transform;
8
8
  private readonly engine;
@@ -1,12 +1,12 @@
1
- import type * as spec from '@galacean/effects-specification';
2
1
  import type { Matrix4 } from '@galacean/effects-math/es/core/index';
3
2
  import { Vector2, Vector3 } from '@galacean/effects-math/es/core/index';
3
+ import type * as spec from '@galacean/effects-specification';
4
+ import type { Engine } from '../../engine';
4
5
  import type { ValueGetter } from '../../math';
5
- import type { SharedShaderWithSource, GPUCapability } from '../../render';
6
+ import type { GPUCapability, SharedShaderWithSource } from '../../render';
6
7
  import { Geometry, Mesh } from '../../render';
7
8
  import { Texture } from '../../texture';
8
9
  import { Transform } from '../../transform';
9
- import type { Engine } from '../../engine';
10
10
  export type Point = {
11
11
  vel: Vector3;
12
12
  lifetime: number;
@@ -1,12 +1,12 @@
1
- import type * as spec from '@galacean/effects-specification';
2
- import type { vec4, GradientStop } from '@galacean/effects-specification';
3
- import { Vector3 } from '@galacean/effects-math/es/core/index';
4
1
  import type { Matrix4 } from '@galacean/effects-math/es/core/index';
5
- import type { ShaderWithSource, GPUCapability } from '../../render';
6
- import { Geometry, Mesh } from '../../render';
7
- import { Texture } from '../../texture';
2
+ import { Vector3 } from '@galacean/effects-math/es/core/index';
3
+ import type * as spec from '@galacean/effects-specification';
4
+ import type { GradientStop, vec4 } from '@galacean/effects-specification';
8
5
  import type { Engine } from '../../engine';
9
6
  import type { ValueGetter } from '../../math';
7
+ import type { GPUCapability, ShaderWithSource } from '../../render';
8
+ import { Geometry, Mesh } from '../../render';
9
+ import { Texture } from '../../texture';
10
10
  export type TrailMeshProps = {
11
11
  maxTrailCount: number;
12
12
  pointCountPerTrail: number;
@@ -1,3 +1,4 @@
1
+ import type { ShaderData } from '../asset-loader';
1
2
  import { EffectsObject } from '../effects-object';
2
3
  import type { Engine } from '../engine';
3
4
  export type ShaderMarcos = [key: string, value: string | number | boolean][];
@@ -78,16 +79,22 @@ export interface SharedShaderWithSource {
78
79
  cacheId?: string;
79
80
  }
80
81
  export type ShaderWithSource = InstancedShaderWithSource | SharedShaderWithSource;
81
- export declare abstract class Shader extends EffectsObject {
82
+ export declare abstract class ShaderVariant extends EffectsObject {
82
83
  readonly source: ShaderWithSource;
84
+ shader: Shader;
83
85
  constructor(engine: Engine, source: ShaderWithSource);
84
86
  }
87
+ export declare class Shader extends EffectsObject {
88
+ shaderData: ShaderData;
89
+ createVariant(macros?: Record<string, number | boolean>): ShaderVariant;
90
+ fromData(data: ShaderData): void;
91
+ }
85
92
  export interface ShaderLibrary {
86
93
  readonly shaderResults: {
87
94
  [cacheId: string]: ShaderCompileResult;
88
95
  };
89
96
  addShader(shader: ShaderWithSource): void;
90
- createShader(shaderSource: ShaderWithSource): Shader;
97
+ createShader(shaderSource: ShaderWithSource, macros?: ShaderMarcos): ShaderVariant;
91
98
  /**
92
99
  * @param cacheId
93
100
  */
@@ -1,10 +1,10 @@
1
1
  import { Vector3 } from '@galacean/effects-math/es/core/vector3';
2
2
  import * as spec from '@galacean/effects-specification';
3
+ import { type VFXItemData } from './asset-loader';
3
4
  import { RendererComponent } from './components';
4
5
  import type { Component } from './components/component';
5
6
  import { ItemBehaviour } from './components/component';
6
7
  import type { Composition } from './composition';
7
- import { type VFXItemData } from './asset-loader';
8
8
  import { EffectsObject } from './effects-object';
9
9
  import type { Engine } from './engine';
10
10
  import type { BoundingBoxData, CameraController, HitTestBoxParams, HitTestCustomParams, HitTestSphereParams, HitTestTriangleParams, InteractComponent, ParticleSystem, SpriteComponent } from './plugins';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-core",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.4",
4
4
  "description": "Galacean Effects runtime core for the web",
5
5
  "module": "./dist/index.mjs",
6
6
  "main": "./dist/index.js",
@@ -42,7 +42,7 @@
42
42
  "registry": "https://registry.npmjs.org"
43
43
  },
44
44
  "dependencies": {
45
- "@galacean/effects-specification": "1.0.1",
45
+ "@galacean/effects-specification": "2.0.0-alpha.2",
46
46
  "@galacean/effects-math": "1.0.1",
47
47
  "uuid": "9.0.1"
48
48
  },