@galacean/engine-core 0.0.0-experimental-double11.13 → 0.0.0-experimental-shaderlab.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.
Files changed (40) hide show
  1. package/dist/main.js +7388 -7075
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +7388 -7075
  4. package/dist/module.js +7389 -7076
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/2d/atlas/types.d.ts +3 -0
  8. package/types/2d/enums/SpriteModifyFlags.d.ts +2 -1
  9. package/types/animation/AnimatorLayerMask.d.ts +45 -0
  10. package/types/animation/LayerPathMask.d.ts +16 -0
  11. package/types/animation/animationCurve/AnimationStringCurve.d.ts +7 -0
  12. package/types/asset/AssetPromise.d.ts +1 -0
  13. package/types/asset/ResourceManager.d.ts +0 -1
  14. package/types/mesh/SkinnedMeshRenderer.d.ts +1 -1
  15. package/types/particle/modules/EmissionModule.d.ts +0 -1
  16. package/types/particle/modules/MainModule.d.ts +0 -1
  17. package/types/particle/modules/ParticleGradient.d.ts +38 -18
  18. package/types/shader/Shader.d.ts +16 -3
  19. package/types/xr/XRManager.d.ts +5 -0
  20. package/types/2d/enums/SpriteDirtyFlag.d.ts +0 -13
  21. package/types/ListenerUpdateFlag.d.ts +0 -12
  22. package/types/animation/AnimatorStateTransition.d.ts +0 -12
  23. package/types/animation/AnimatorTransitionBase.d.ts +0 -10
  24. package/types/animation/enums/StateMachineState.d.ts +0 -13
  25. package/types/animation/internal/AnimatorPlayableObject.d.ts +0 -23
  26. package/types/animation/internal/AnimatorStateInfo.d.ts +0 -1
  27. package/types/animation/internal/AnimatorStateMachineData.d.ts +0 -1
  28. package/types/animation/internal/CrossCurveData.d.ts +0 -1
  29. package/types/fog/EXP2Fog.d.ts +0 -15
  30. package/types/fog/Fog.d.ts +0 -14
  31. package/types/fog/LinearFog.d.ts +0 -22
  32. package/types/fog/index.d.ts +0 -3
  33. package/types/shadow/enum/ShadowMode.d.ts +0 -13
  34. /package/types/animation/internal/animationCurveOwner/{Assembler → assembler}/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +0 -0
  35. /package/types/animation/internal/animationCurveOwner/{Assembler → assembler}/IAnimationCurveOwnerAssembler.d.ts +0 -0
  36. /package/types/animation/internal/animationCurveOwner/{Assembler → assembler}/PositionAnimationCurveOwnerAssembler.d.ts +0 -0
  37. /package/types/animation/internal/animationCurveOwner/{Assembler → assembler}/RotationAnimationCurveOwnerAssembler.d.ts +0 -0
  38. /package/types/animation/internal/animationCurveOwner/{Assembler → assembler}/ScaleAnimationCurveOwnerAssembler.d.ts +0 -0
  39. /package/types/animation/internal/animationCurveOwner/{Assembler → assembler}/UniversalAnimationCurveOwnerAssembler.d.ts +0 -0
  40. /package/types/{animation/AnimatorStatePlayData.d.ts → enums/CameraType.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "0.0.0-experimental-double11.13",
3
+ "version": "0.0.0-experimental-shaderlab.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -15,10 +15,10 @@
15
15
  "types/**/*"
16
16
  ],
17
17
  "dependencies": {
18
- "@galacean/engine-math": "0.0.0-experimental-double11.13"
18
+ "@galacean/engine-math": "0.0.0-experimental-shaderlab.0"
19
19
  },
20
20
  "devDependencies": {
21
- "@galacean/engine-design": "0.0.0-experimental-double11.13"
21
+ "@galacean/engine-design": "0.0.0-experimental-shaderlab.0"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
@@ -1,3 +1,4 @@
1
+ import { AssetType } from "../../asset/AssetType";
1
2
  import { TextureFilterMode, TextureFormat, TextureWrapMode } from "../../texture";
2
3
  /**
3
4
  * The original data type of the atlas.
@@ -16,6 +17,8 @@ export interface AtlasConfig {
16
17
  atlasItems: {
17
18
  /** The url of the sub atlas. */
18
19
  img: string;
20
+ /** Image type. */
21
+ type: AssetType;
19
22
  /** Sprites contained in the sub atlas. */
20
23
  sprites: AtlasSprite[];
21
24
  }[];
@@ -9,5 +9,6 @@ export declare enum SpriteModifyFlags {
9
9
  atlasRegionOffset = 16,
10
10
  region = 32,
11
11
  pivot = 64,
12
- border = 128
12
+ border = 128,
13
+ destroy = 256
13
14
  }
@@ -0,0 +1,45 @@
1
+ import { Entity } from "../Entity";
2
+ import { LayerPathMask } from "./LayerPathMask";
3
+ /**
4
+ * AnimatorLayerMask is used to mask out certain entities from being animated by an AnimatorLayer.
5
+ */
6
+ export declare class AnimatorLayerMask {
7
+ /**
8
+ * Creates an AnimatorLayerMask instance by specifying an entity.
9
+ * This will automatically add path masks for the entity and all its children.
10
+ * @param entity - The root entity to create path masks for
11
+ */
12
+ static createByEntity(entity: Entity): AnimatorLayerMask;
13
+ private static _addPathMaskWithChildren;
14
+ private _pathMasks;
15
+ private _pathMaskMap;
16
+ /**
17
+ * The list of path masks.
18
+ */
19
+ get pathMasks(): Readonly<LayerPathMask[]>;
20
+ /**
21
+ * Adds a path mask to the AnimatorLayerMask, the root path is "".
22
+ * @param path - The path to add a mask for
23
+ * @returns The created or existing LayerPathMask
24
+ */
25
+ addPathMask(path: string): LayerPathMask;
26
+ /**
27
+ * Removes a path mask from the AnimatorLayerMask.
28
+ * @param path - The path of the mask to remove
29
+ */
30
+ removePathMask(path: any): void;
31
+ /**
32
+ * Get a path mask based on the given path.
33
+ * @param path - The path of the mask to get
34
+ * @returns The LayerPathMask for the given path
35
+ */
36
+ getPathMask(path: string): LayerPathMask;
37
+ /**
38
+ * Sets the active state of a path mask.
39
+ * If recursive is true, it also sets the active state of all child path masks.
40
+ * @param path - The path of the mask to modify
41
+ * @param active - The active state to set
42
+ * @param withChildren - Whether to apply the active state recursively to child paths
43
+ */
44
+ setPathMaskActive(path: string, active: boolean, withChildren?: boolean): void;
45
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * LayerPathMask represents a mask for a specific entity in an animation layer.
3
+ * It is used to control the animation whether to be applied to the entity or not.
4
+ */
5
+ export declare class LayerPathMask {
6
+ /**
7
+ * It identifies a particular entity in the hierarchy.
8
+ * Example: "arm/left/hand" could be a path to the left hand of a character.
9
+ */
10
+ path: string;
11
+ /**
12
+ * The active property is indicating whether the animation at this path is active or not.
13
+ * When true, the animation for this path is applied; when false, the animation for this path is ignored.
14
+ */
15
+ active: boolean;
16
+ }
@@ -0,0 +1,7 @@
1
+ import { AnimationCurve } from "./AnimationCurve";
2
+ /**
3
+ * Store a collection of Keyframes that can be evaluated over time.
4
+ */
5
+ export declare class AnimationStringCurve extends AnimationCurve<string> {
6
+ constructor();
7
+ }
@@ -13,6 +13,7 @@ export declare class AssetPromise<T> implements PromiseLike<T> {
13
13
  get [Symbol.toStringTag](): string;
14
14
  private _promise;
15
15
  private _state;
16
+ private _progress;
16
17
  private _onProgressCallback;
17
18
  private _onCancelHandler;
18
19
  private _reject;
@@ -104,7 +104,6 @@ export declare class ResourceManager {
104
104
  private _gc;
105
105
  private _getResolveResource;
106
106
  private _parseURL;
107
- private _getParameterByName;
108
107
  private _parseQueryPath;
109
108
  }
110
109
  /**
@@ -9,11 +9,11 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
9
9
  private static _jointCountProperty;
10
10
  private static _jointSamplerProperty;
11
11
  private static _jointMatrixProperty;
12
+ private _localBounds;
12
13
  private _jointDataCreateCache;
13
14
  private _blendShapeWeights;
14
15
  private _maxVertexUniformVectors;
15
16
  private _rootBone;
16
- private _localBounds;
17
17
  private _jointMatrices;
18
18
  private _jointTexture;
19
19
  private _bones;
@@ -13,7 +13,6 @@ export declare class EmissionModule extends ParticleGeneratorModule {
13
13
  /** The shape of the emitter. */
14
14
  shape: BaseShape;
15
15
  private _bursts;
16
- private _frameRateTime;
17
16
  private _currentBurstIndex;
18
17
  private _burstRand;
19
18
  /**
@@ -54,7 +54,6 @@ export declare class MainModule implements ICustomClone {
54
54
  scalingMode: ParticleScaleMode;
55
55
  /** If set to true, the Particle Generator automatically begins to play on startup. */
56
56
  playOnEnabled: boolean;
57
- private _maxParticles;
58
57
  private _generator;
59
58
  private _gravity;
60
59
  /**
@@ -63,32 +63,52 @@ export declare class ParticleGradient {
63
63
  setKeys(colorKeys: GradientColorKey[], alphaKeys: GradientAlphaKey[]): void;
64
64
  private _addKey;
65
65
  private _removeKey;
66
+ private _setColorTypeArrayDirty;
67
+ private _setAlphaTypeArrayDirty;
66
68
  }
67
69
  /**
68
70
  * The color key of the particle gradient.
69
71
  */
70
72
  export declare class GradientColorKey {
71
- /** The key time. */
72
- time: number;
73
- /** The key color. */
74
- color: Color;
75
- constructor(
76
- /** The key time. */
77
- time: number,
78
- /** The key color. */
79
- color: Color);
73
+ private _time;
74
+ private _color;
75
+ /**
76
+ * The key time.
77
+ */
78
+ get time(): number;
79
+ set time(value: number);
80
+ /**
81
+ * The key color.
82
+ */
83
+ get color(): Color;
84
+ set color(value: Color);
85
+ /**
86
+ * Constructor of GradientColorKey.
87
+ * @param time - The time of the gradient colorKey
88
+ * @param color - The alpha component of the gradient colorKey
89
+ */
90
+ constructor(time: number, color: Color);
80
91
  }
81
92
  /**
82
93
  * The alpha key of the particle gradient.
83
94
  */
84
95
  export declare class GradientAlphaKey {
85
- /** The key time. */
86
- time: number;
87
- /** The key alpha. */
88
- alpha: number;
89
- constructor(
90
- /** The key time. */
91
- time: number,
92
- /** The key alpha. */
93
- alpha: number);
96
+ private _time;
97
+ private _alpha;
98
+ /**
99
+ * The key time.
100
+ */
101
+ get time(): number;
102
+ set time(value: number);
103
+ /**
104
+ * The key alpha.
105
+ */
106
+ get alpha(): number;
107
+ set alpha(value: number);
108
+ /**
109
+ * Constructor of GradientAlphaKey.
110
+ * @param time - The time of the gradient alpha key
111
+ * @param alpha - The alpha component of the gradient alpha key
112
+ */
113
+ constructor(time: number, alpha: number);
94
114
  }
@@ -1,4 +1,5 @@
1
1
  import { Engine } from "../Engine";
2
+ import { IReferable } from "../asset/IReferable";
2
3
  import { ShaderMacro } from "./ShaderMacro";
3
4
  import { ShaderPass } from "./ShaderPass";
4
5
  import { ShaderProperty } from "./ShaderProperty";
@@ -6,7 +7,7 @@ import { SubShader } from "./SubShader";
6
7
  /**
7
8
  * Shader for rendering.
8
9
  */
9
- export declare class Shader {
10
+ export declare class Shader implements IReferable {
10
11
  readonly name: string;
11
12
  private static _shaderMap;
12
13
  /**
@@ -19,7 +20,7 @@ export declare class Shader {
19
20
  * // Import shaderLab
20
21
  * import { ShaderLab } from "@galacean/engine-shader-lab";
21
22
  * // Create engine with shaderLab
22
- * const engine = await WebGLEngine.create({ canvas: "canvas", new ShaderLab() });
23
+ * const engine = await WebGLEngine.create({ canvas: "canvas", shader: new ShaderLab() });
23
24
  * ...
24
25
  * ```
25
26
  *
@@ -57,11 +58,18 @@ export declare class Shader {
57
58
  * @param name - Name of the shader
58
59
  */
59
60
  static find(name: string): Shader;
61
+ private static _applyConstRenderStates;
62
+ private _refCount;
63
+ private _destroyed;
60
64
  private _subShaders;
61
65
  /**
62
66
  * Sub shaders of the shader.
63
67
  */
64
68
  get subShaders(): ReadonlyArray<SubShader>;
69
+ /**
70
+ * Whether it has been destroyed.
71
+ */
72
+ get destroyed(): boolean;
65
73
  private constructor();
66
74
  /**
67
75
  * Compile shader variant by macro name list.
@@ -74,7 +82,12 @@ export declare class Shader {
74
82
  * @returns Is the compiled shader variant valid
75
83
  */
76
84
  compileVariant(engine: Engine, macros: string[]): boolean;
77
- private static _applyConstRenderStates;
85
+ /**
86
+ * Destroy the shader.
87
+ * @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully.
88
+ * @returns Whether the release was successful.
89
+ */
90
+ destroy(force?: boolean): boolean;
78
91
  /**
79
92
  * @deprecated Please use `ShaderMacro.getByName` instead
80
93
  *
@@ -0,0 +1,5 @@
1
+ /**
2
+ * XRManager located in the main package, its implementation logic is XRManagerExtended in the sub-package engine-xr.
3
+ */
4
+ export declare class XRManager {
5
+ }
@@ -1,13 +0,0 @@
1
- /**
2
- * Sprite Property Dirty Flag.
3
- */
4
- export declare enum SpritePropertyDirtyFlag {
5
- texture = 1,
6
- size = 2,
7
- atlasRotate = 4,
8
- atlasRegion = 8,
9
- atlasRegionOffset = 16,
10
- region = 32,
11
- pivot = 64,
12
- border = 128
13
- }
@@ -1,12 +0,0 @@
1
- import { UpdateFlag } from "./UpdateFlag";
2
- /**
3
- * Used to update tags.
4
- */
5
- export declare class ListenerUpdateFlag extends UpdateFlag {
6
- /** Listener. */
7
- listener: Function;
8
- /**
9
- * @inheritdoc
10
- */
11
- dispatch(param?: Object): void;
12
- }
@@ -1,12 +0,0 @@
1
- import { AnimatorTransitionBase } from "./AnimatorTransitionBase";
2
- /**
3
- * Transitions define when and how the state machine switch from one state to another. AnimatorStateTransition always originate from an Animator State and have timing parameters.
4
- */
5
- export declare class AnimatorStateTransition extends AnimatorTransitionBase {
6
- /** The duration of the transition. This is represented in normalized time. */
7
- duration: number;
8
- /** The time at which the destination state will start. This is represented in normalized time. */
9
- offset: number;
10
- /** ExitTime represents the exact time at which the transition can take effect. This is represented in normalized time. */
11
- exitTime: number;
12
- }
@@ -1,10 +0,0 @@
1
- import { AnimatorStateMachine } from "./AnimatorStateMachine";
2
- import { AnimatorState } from "./AnimatorState";
3
- /**
4
- * Base class for animator transitions. Transitions define when and how the state machine switches from one state to another.
5
- */
6
- export declare class AnimatorTransitionBase {
7
- /** The destination state of the transition. */
8
- destinationState?: AnimatorState;
9
- destinationStateMachine?: AnimatorStateMachine;
10
- }
@@ -1,13 +0,0 @@
1
- /**
2
- * StateMachine state.
3
- */
4
- export declare enum StateMachineState {
5
- /** Standby state. */
6
- Standby = 0,
7
- /** Playing state. */
8
- Playing = 1,
9
- /** CrossFading state. */
10
- CrossFading = 2,
11
- /** FixedCrossFading state. */
12
- FixedCrossFading = 3
13
- }
@@ -1,23 +0,0 @@
1
- import { AnimatorStateTransition } from "../AnimatorTransition";
2
- export declare class AnimatorPlayableObject {
3
- private _transitions;
4
- /**
5
- * The transitions that are going out of the object.
6
- */
7
- get transitions(): Readonly<AnimatorStateTransition[]>;
8
- /**
9
- * Add an outgoing transition to the destination object.
10
- * @param transition - The transition
11
- */
12
- addTransition(transition: AnimatorStateTransition): void;
13
- /**
14
- * Remove a transition from the object.
15
- * @param transition - The transition
16
- */
17
- removeTransition(transition: AnimatorStateTransition): void;
18
- /**
19
- * Clears all transitions from the object.
20
- */
21
- clearTransitions(): void;
22
- getDuration(): void;
23
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- import { Entity } from "../Entity";
2
- import { Fog } from "./Fog";
3
- /**
4
- * Exponential fog.
5
- */
6
- export declare class EXP2Fog extends Fog {
7
- private static _densityProperty;
8
- /**
9
- * Density of fog.
10
- */
11
- get density(): number;
12
- set density(value: number);
13
- private _density;
14
- constructor(entity: Entity);
15
- }
@@ -1,14 +0,0 @@
1
- import { Color } from "@oasis-engine/math";
2
- import { Component } from "../Component";
3
- /**
4
- * Fog.
5
- */
6
- export declare class Fog extends Component {
7
- protected static _colorProperty: import("..").ShaderProperty;
8
- /**
9
- * Fog color.
10
- */
11
- get color(): Color;
12
- set color(value: Color);
13
- private _color;
14
- }
@@ -1,22 +0,0 @@
1
- import { Entity } from "../Entity";
2
- import { Fog } from "./Fog";
3
- /**
4
- * Linear fog, according to the distance of the camera linear difference fog density.
5
- */
6
- export declare class LinearFog extends Fog {
7
- private static _nearProperty;
8
- private static _farProperty;
9
- /**
10
- * Start of fog.
11
- */
12
- get near(): number;
13
- set near(value: number);
14
- /**
15
- * End of fog.
16
- */
17
- get far(): number;
18
- set far(value: number);
19
- private _near;
20
- private _far;
21
- constructor(entity: Entity);
22
- }
@@ -1,3 +0,0 @@
1
- export { EXP2Fog } from "./EXP2Fog";
2
- export { Fog } from "./Fog";
3
- export { LinearFog } from "./LinearFog";
@@ -1,13 +0,0 @@
1
- /**
2
- * Determines which type of shadows should be used.
3
- */
4
- export declare enum ShadowMode {
5
- /** Disable Shadows. */
6
- None = 0,
7
- /** Hard Shadows Only. */
8
- Hard = 1,
9
- /** Cast "soft" shadows with low range. */
10
- SoftLow = 2,
11
- /** Cast "soft" shadows with large range. */
12
- SoftHigh = 3
13
- }