@galacean/engine-core 1.4.0-alpha.1 → 1.4.0-alpha.3

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 (36) hide show
  1. package/dist/main.js +1616 -855
  2. package/dist/main.js.map +1 -1
  3. package/dist/module.js +1606 -855
  4. package/dist/module.js.map +1 -1
  5. package/package.json +3 -3
  6. package/types/Camera.d.ts +4 -0
  7. package/types/Engine.d.ts +12 -0
  8. package/types/RenderPipeline/BasicRenderPipeline.d.ts +1 -0
  9. package/types/RenderPipeline/Blitter.d.ts +28 -0
  10. package/types/RenderPipeline/index.d.ts +2 -1
  11. package/types/Scene.d.ts +3 -0
  12. package/types/asset/AssetType.d.ts +3 -1
  13. package/types/material/BaseMaterial.d.ts +4 -2
  14. package/types/material/PBRMaterial.d.ts +70 -5
  15. package/types/material/enums/Refraction.d.ts +9 -0
  16. package/types/material/index.d.ts +1 -0
  17. package/types/physics/CharacterController.d.ts +2 -2
  18. package/types/physics/Collision.d.ts +18 -0
  19. package/types/physics/ContactPoint.d.ts +14 -0
  20. package/types/physics/DynamicCollider.d.ts +8 -2
  21. package/types/physics/PhysicsMaterial.d.ts +4 -0
  22. package/types/physics/index.d.ts +2 -0
  23. package/types/physics/joint/Joint.d.ts +7 -6
  24. package/types/physics/joint/JointLimits.d.ts +2 -2
  25. package/types/physics/shape/ColliderShape.d.ts +9 -2
  26. package/types/physics/shape/PlaneColliderShape.d.ts +2 -0
  27. package/types/postProcess/PostProcess.d.ts +60 -0
  28. package/types/postProcess/PostProcessEffect.d.ts +26 -0
  29. package/types/postProcess/PostProcessEffectParameter.d.ts +25 -0
  30. package/types/postProcess/PostProcessManager.d.ts +37 -1
  31. package/types/postProcess/PostProcessPass.d.ts +50 -0
  32. package/types/postProcess/PostProcessUberPass.d.ts +25 -0
  33. package/types/postProcess/effects/BloomEffect.d.ts +22 -64
  34. package/types/postProcess/effects/TonemappingEffect.d.ts +6 -16
  35. package/types/postProcess/index.d.ts +6 -2
  36. package/types/shader/Shader.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "1.4.0-alpha.1",
3
+ "version": "1.4.0-alpha.3",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -18,10 +18,10 @@
18
18
  "types/**/*"
19
19
  ],
20
20
  "dependencies": {
21
- "@galacean/engine-math": "1.4.0-alpha.1"
21
+ "@galacean/engine-math": "1.4.0-alpha.3"
22
22
  },
23
23
  "devDependencies": {
24
- "@galacean/engine-design": "1.4.0-alpha.1"
24
+ "@galacean/engine-design": "1.4.0-alpha.3"
25
25
  },
26
26
  "scripts": {
27
27
  "b:types": "tsc"
package/types/Camera.d.ts CHANGED
@@ -34,6 +34,10 @@ export declare class Camera extends Component {
34
34
  * @remarks Support bit manipulation, corresponding to `Layer`.
35
35
  */
36
36
  cullingMask: Layer;
37
+ /**
38
+ * Determines which PostProcess to use.
39
+ */
40
+ postProcessMask: Layer;
37
41
  /**
38
42
  * Depth texture mode.
39
43
  * If `DepthTextureMode.PrePass` is used, the depth texture can be accessed in the shader using `camera_DepthTexture`.
package/types/Engine.d.ts CHANGED
@@ -9,6 +9,7 @@ import { ColorSpace } from "./enums/ColorSpace";
9
9
  import { InputManager } from "./input";
10
10
  import { ParticleBufferUtils } from "./particle/ParticleBufferUtils";
11
11
  import { PhysicsScene } from "./physics/PhysicsScene";
12
+ import { PostProcessPass } from "./postProcess/PostProcessPass";
12
13
  import { XRManager } from "./xr/XRManager";
13
14
  /**
14
15
  * Engine.
@@ -35,6 +36,8 @@ export declare class Engine extends EventDispatcher {
35
36
  private _waitingDestroy;
36
37
  private _isDeviceLost;
37
38
  private _waitingGC;
39
+ private _postProcessPasses;
40
+ private _activePostProcessPasses;
38
41
  private _animate;
39
42
  /**
40
43
  * Settings of Engine.
@@ -74,6 +77,10 @@ export declare class Engine extends EventDispatcher {
74
77
  */
75
78
  get targetFrameRate(): number;
76
79
  set targetFrameRate(value: number);
80
+ /**
81
+ * All post process passes.
82
+ */
83
+ get postProcessPasses(): ReadonlyArray<PostProcessPass>;
77
84
  /**
78
85
  * Indicates whether the engine is destroyed.
79
86
  */
@@ -111,6 +118,11 @@ export declare class Engine extends EventDispatcher {
111
118
  * @remarks Used to simulate the phenomenon after the real restore of device.
112
119
  */
113
120
  forceRestoreDevice(): void;
121
+ /**
122
+ * Add a post process pass.
123
+ * @param pass - Post process pass to add
124
+ */
125
+ addPostProcessPass(pass: PostProcessPass): void;
114
126
  private _destroy;
115
127
  /**
116
128
  * Destroy engine.
@@ -16,6 +16,7 @@ export declare class BasicRenderPipeline {
16
16
  private _grabTexture;
17
17
  private _canUseBlitFrameBuffer;
18
18
  private _shouldGrabColor;
19
+ private _sourceScaleOffset;
19
20
  /**
20
21
  * Create a basic render pipeline.
21
22
  * @param camera - Camera
@@ -0,0 +1,28 @@
1
+ import { Vector4 } from "@galacean/engine-math";
2
+ import { Engine } from "../Engine";
3
+ import { Material } from "../material";
4
+ import { RenderTarget, Texture2D } from "../texture";
5
+ /**
6
+ * A helper class to blit texture to destination render target.
7
+ */
8
+ export declare class Blitter {
9
+ private static _blitTextureProperty;
10
+ private static _blitMipLevelProperty;
11
+ private static _blitTexelSizeProperty;
12
+ private static _sourceScaleOffsetProperty;
13
+ private static _rendererShaderData;
14
+ private static _texelSize;
15
+ private static _defaultScaleOffset;
16
+ /**
17
+ * Blit texture to destination render target using a triangle.
18
+ * @param engine - Engine
19
+ * @param source - Source texture
20
+ * @param destination - Destination render target
21
+ * @param mipLevel - Mip level to blit
22
+ * @param viewport - Viewport
23
+ * @param material - The material to use when blit
24
+ * @param passIndex - Pass index to use of the provided material
25
+ * @param flipYOfSource - Whether flip Y axis of source texture
26
+ */
27
+ static blitTexture(engine: Engine, source: Texture2D, destination: RenderTarget | null, mipLevel?: number, viewport?: Vector4, material?: Material, passIndex?: number, sourceScaleOffset?: Vector4): void;
28
+ }
@@ -1,3 +1,4 @@
1
1
  export { BasicRenderPipeline } from "./BasicRenderPipeline";
2
- export { RenderQueue } from "./RenderQueue";
2
+ export { Blitter } from "./Blitter";
3
3
  export { PipelineStage } from "./enums/PipelineStage";
4
+ export { RenderQueue } from "./RenderQueue";
package/types/Scene.d.ts CHANGED
@@ -7,6 +7,7 @@ import { FogMode } from "./enums/FogMode";
7
7
  import { DirectLight } from "./lighting";
8
8
  import { AmbientLight } from "./lighting/AmbientLight";
9
9
  import { PhysicsScene } from "./physics/PhysicsScene";
10
+ import { PostProcessManager } from "./postProcess";
10
11
  import { ShaderData } from "./shader/ShaderData";
11
12
  import { ShadowCascadesMode } from "./shadow/enum/ShadowCascadesMode";
12
13
  import { ShadowResolution } from "./shadow/enum/ShadowResolution";
@@ -35,6 +36,8 @@ export declare class Scene extends EngineObject {
35
36
  * @remarks Value 0 is used for no shadow fade.
36
37
  */
37
38
  shadowFadeBorder: number;
39
+ /** Post process manager. */
40
+ readonly postProcessManager: PostProcessManager;
38
41
  private _background;
39
42
  private _shaderData;
40
43
  private _shadowCascades;
@@ -60,5 +60,7 @@ export declare enum AssetType {
60
60
  /** AudioClip, include ogg, wav and mp3. */
61
61
  Audio = "Audio",
62
62
  /** Project asset. */
63
- Project = "project"
63
+ Project = "project",
64
+ /** PhysicsMaterial. */
65
+ PhysicsMaterial = "PhysicsMaterial"
64
66
  }
@@ -16,10 +16,10 @@ export declare class BaseMaterial extends Material {
16
16
  protected static _normalIntensityProp: ShaderProperty;
17
17
  protected static _emissiveColorProp: ShaderProperty;
18
18
  protected static _emissiveTextureProp: ShaderProperty;
19
- private static _alphaCutoffProp;
19
+ protected static _alphaCutoffProp: ShaderProperty;
20
20
  private static _alphaCutoffMacro;
21
21
  private _renderFace;
22
- private _isTransparent;
22
+ protected _isTransparent: boolean;
23
23
  private _blendMode;
24
24
  /**
25
25
  * Shader used by the material.
@@ -83,4 +83,6 @@ export declare class BaseMaterial extends Material {
83
83
  * @param target - target material
84
84
  */
85
85
  cloneTo(target: BaseMaterial): void;
86
+ protected _seIsTransparent(value: boolean): void;
87
+ protected _setAlphaCutoff(value: number): void;
86
88
  }
@@ -1,7 +1,8 @@
1
- import { Vector2, Color } from "@galacean/engine-math";
1
+ import { Color, Vector2 } from "@galacean/engine-math";
2
2
  import { Engine } from "../Engine";
3
3
  import { Texture2D } from "../texture/Texture2D";
4
4
  import { PBRBaseMaterial } from "./PBRBaseMaterial";
5
+ import { RefractionMode } from "./enums/Refraction";
5
6
  /**
6
7
  * PBR (Metallic-Roughness Workflow) Material.
7
8
  */
@@ -12,16 +13,27 @@ export declare class PBRMaterial extends PBRBaseMaterial {
12
13
  private static _iorProp;
13
14
  private static _anisotropyInfoProp;
14
15
  private static _anisotropyTextureProp;
15
- private _anisotropyRotation;
16
16
  private static _iridescenceInfoProp;
17
17
  private static _iridescenceThicknessTextureProp;
18
18
  private static _iridescenceTextureProp;
19
- private _iridescenceRange;
20
- private _sheenEnabled;
21
19
  private static _sheenColorProp;
22
20
  private static _sheenRoughnessProp;
23
21
  private static _sheenTextureProp;
24
22
  private static _sheenRoughnessTextureProp;
23
+ private static _transmissionMacro;
24
+ private static _thicknessMacro;
25
+ private static _thicknessTextureMacro;
26
+ private static _transmissionTextureMacro;
27
+ private static _transmissionProp;
28
+ private static _transmissionTextureProp;
29
+ private static _attenuationColorProp;
30
+ private static _attenuationDistanceProp;
31
+ private static _thicknessProp;
32
+ private static _thicknessTextureProp;
33
+ private _refractionMode;
34
+ private _anisotropyRotation;
35
+ private _iridescenceRange;
36
+ private _sheenEnabled;
25
37
  /**
26
38
  * Index Of Refraction.
27
39
  * @defaultValue `1.5`
@@ -120,14 +132,67 @@ export declare class PBRMaterial extends PBRBaseMaterial {
120
132
  */
121
133
  get sheenRoughnessTexture(): Texture2D;
122
134
  set sheenRoughnessTexture(value: Texture2D);
135
+ /**
136
+ * Refraction switch.
137
+ * @remarks Use refractionMode to set the refraction shape.
138
+ */
139
+ get refractionMode(): RefractionMode;
140
+ set refractionMode(value: RefractionMode);
141
+ /**
142
+ * @inheritdoc
143
+ */
144
+ get isTransparent(): boolean;
145
+ set isTransparent(value: boolean);
146
+ /**
147
+ * @inheritdoc
148
+ */
149
+ get alphaCutoff(): number;
150
+ set alphaCutoff(value: number);
151
+ /**
152
+ * Transmission factor.
153
+ * @defaultValue `0.0`
154
+ */
155
+ get transmission(): number;
156
+ set transmission(value: number);
157
+ /**
158
+ * Transmission texture.
159
+ * @remarks Use red channel, and multiply 'transmission'.
160
+ */
161
+ get transmissionTexture(): Texture2D;
162
+ set transmissionTexture(value: Texture2D);
163
+ /**
164
+ * Attenuation color.
165
+ * @defaultValue `[1,1,1]`
166
+ */
167
+ get attenuationColor(): Color;
168
+ set attenuationColor(value: Color);
169
+ /**
170
+ * Attenuation distance, greater than 0.0.
171
+ * @defaultValue `infinity`
172
+ */
173
+ get attenuationDistance(): number;
174
+ set attenuationDistance(value: number);
175
+ /**
176
+ * Thickness, greater than or equal to 0.0.
177
+ * @defaultValue `0.0`
178
+ */
179
+ get thickness(): number;
180
+ set thickness(value: number);
181
+ /**
182
+ * Thickness texture.
183
+ * @remarks Use green channel, and multiply 'thickness', range is 0.0 to 1.0.
184
+ */
185
+ get thicknessTexture(): Texture2D;
186
+ set thicknessTexture(value: Texture2D);
123
187
  /**
124
188
  * Create a pbr metallic-roughness workflow material instance.
125
189
  * @param engine - Engine to which the material belongs
126
190
  */
127
191
  constructor(engine: Engine);
128
- private _onIridescenceRangeChanged;
129
192
  /**
130
193
  * @inheritdoc
131
194
  */
132
195
  clone(): PBRMaterial;
196
+ private _onIridescenceRangeChanged;
197
+ private _onSheenColorChanged;
133
198
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Refraction mode.
3
+ */
4
+ export declare enum RefractionMode {
5
+ /** Use the sphere refraction model when light passes through the surface. */
6
+ Sphere = 0,
7
+ /** Use the planar refraction model when light passes through the surface. */
8
+ Planar = 1
9
+ }
@@ -8,3 +8,4 @@ export { PBRBaseMaterial } from "./PBRBaseMaterial";
8
8
  export { PBRMaterial } from "./PBRMaterial";
9
9
  export { PBRSpecularMaterial } from "./PBRSpecularMaterial";
10
10
  export { UnlitMaterial } from "./UnlitMaterial";
11
+ export { RefractionMode } from "./enums/Refraction";
@@ -27,8 +27,8 @@ export declare class CharacterController extends Collider {
27
27
  get upDirection(): Vector3;
28
28
  set upDirection(value: Vector3);
29
29
  /**
30
- * The slope limit for the controller, the value is the cosine value of the maximum slope angle.
31
- * @defaultValue 0.707(the cosine value of 45 degrees)
30
+ * The slope limit in degrees for the controller, the value is the cosine value of the maximum slope angle.
31
+ * @defaultValue 45 degrees
32
32
  */
33
33
  get slopeLimit(): number;
34
34
  set slopeLimit(value: number);
@@ -1,4 +1,22 @@
1
+ import { ContactPoint } from "./ContactPoint";
1
2
  import { ColliderShape } from "./shape";
3
+ /**
4
+ * Collision information between two shapes when they collide.
5
+ */
2
6
  export declare class Collision {
7
+ /** The target shape be collided. */
3
8
  shape: ColliderShape;
9
+ /**
10
+ * Count of contact points.
11
+ */
12
+ get contactCount(): number;
13
+ /**
14
+ * Get contact points.
15
+ * @param outContacts - The result of contact points
16
+ * @returns The actual count of contact points
17
+ *
18
+ * @remarks To optimize performance, the engine does not modify the length of the array you pass.
19
+ * You need to obtain the actual number of contact points from the function's return value.
20
+ */
21
+ getContacts(outContacts: ContactPoint[]): number;
4
22
  }
@@ -0,0 +1,14 @@
1
+ import { Vector3 } from "@galacean/engine-math";
2
+ /**
3
+ * Describes a contact point where the collision occurs.
4
+ */
5
+ export declare class ContactPoint {
6
+ /** The position of the contact point between the shapes, in world space. */
7
+ readonly position: Vector3;
8
+ /** The normal of the contacting surfaces at the contact point. The normal direction points from the second shape to the first shape. */
9
+ readonly normal: Vector3;
10
+ /** The impulse applied at the contact point, in world space. Divide by the simulation time step to get a force value. */
11
+ readonly impulse: Vector3;
12
+ /** The separation of the shapes at the contact point. A negative separation denotes a penetration. */
13
+ separation: number;
14
+ }
@@ -14,6 +14,7 @@ export declare class DynamicCollider extends Collider {
14
14
  private _maxAngularVelocity;
15
15
  private _maxDepenetrationVelocity;
16
16
  private _solverIterations;
17
+ private _useGravity;
17
18
  private _isKinematic;
18
19
  private _constraints;
19
20
  private _collisionDetectionMode;
@@ -36,7 +37,7 @@ export declare class DynamicCollider extends Collider {
36
37
  get linearVelocity(): Vector3;
37
38
  set linearVelocity(value: Vector3);
38
39
  /**
39
- * The angular velocity vector of the dynamic collider measured in radians per second.
40
+ * The angular velocity vector of the dynamic collider measured in degrees per second.
40
41
  */
41
42
  get angularVelocity(): Vector3;
42
43
  set angularVelocity(value: Vector3);
@@ -70,7 +71,7 @@ export declare class DynamicCollider extends Collider {
70
71
  get inertiaTensor(): Vector3;
71
72
  set inertiaTensor(value: Vector3);
72
73
  /**
73
- * The maximum angular velocity of the collider measured in radians per second. (Default 7) range { 0, infinity }.
74
+ * The maximum angular velocity of the collider measured in degrees per second.
74
75
  */
75
76
  get maxAngularVelocity(): number;
76
77
  set maxAngularVelocity(value: number);
@@ -89,6 +90,11 @@ export declare class DynamicCollider extends Collider {
89
90
  */
90
91
  get solverIterations(): number;
91
92
  set solverIterations(value: number);
93
+ /**
94
+ * Controls whether gravity affects the dynamic collider.
95
+ */
96
+ get useGravity(): boolean;
97
+ set useGravity(value: boolean);
92
98
  /**
93
99
  * Controls whether physics affects the dynamic collider.
94
100
  */
@@ -35,4 +35,8 @@ export declare class PhysicsMaterial {
35
35
  */
36
36
  get frictionCombine(): PhysicsMaterialCombineMode;
37
37
  set frictionCombine(value: PhysicsMaterialCombineMode);
38
+ /**
39
+ * Destroy the material when the material is no be used by any shape.
40
+ */
41
+ destroy(): void;
38
42
  }
@@ -5,6 +5,8 @@ export { HitResult } from "./HitResult";
5
5
  export { PhysicsMaterial } from "./PhysicsMaterial";
6
6
  export { PhysicsScene } from "./PhysicsScene";
7
7
  export { StaticCollider } from "./StaticCollider";
8
+ export { Collision } from "./Collision";
9
+ export { ContactPoint } from "./ContactPoint";
8
10
  export * from "./enums";
9
11
  export * from "./joint";
10
12
  export * from "./shape";
@@ -15,20 +15,21 @@ export declare abstract class Joint extends Component {
15
15
  private _force;
16
16
  private _torque;
17
17
  private _automaticConnectedAnchor;
18
+ private _updateConnectedActualAnchor;
18
19
  /**
19
20
  * The connected collider.
20
21
  */
21
22
  get connectedCollider(): Collider;
22
23
  set connectedCollider(value: Collider);
23
24
  /**
24
- * The connected anchor position.
25
- * @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
25
+ * The anchor position.
26
26
  */
27
27
  get anchor(): Vector3;
28
28
  set anchor(value: Vector3);
29
29
  /**
30
30
  * The connected anchor position.
31
31
  * @remarks If connectedCollider is set, this anchor is relative offset, or the anchor is world position.
32
+ * The connectedAnchor is automatically calculated, if you want to set it manually, please set automaticConnectedAnchor to false
32
33
  */
33
34
  get connectedAnchor(): Vector3;
34
35
  set connectedAnchor(value: Vector3);
@@ -38,22 +39,22 @@ export declare abstract class Joint extends Component {
38
39
  get automaticConnectedAnchor(): boolean;
39
40
  set automaticConnectedAnchor(value: boolean);
40
41
  /**
41
- * The scale to apply to the inverse mass of collider 0 for resolving this constraint.
42
+ * The scale to apply to the mass of collider 0 for resolving this constraint.
42
43
  */
43
44
  get connectedMassScale(): number;
44
45
  set connectedMassScale(value: number);
45
46
  /**
46
- * The scale to apply to the inverse mass of collider 1 for resolving this constraint.
47
+ * The scale to apply to the mass of collider 1 for resolving this constraint.
47
48
  */
48
49
  get massScale(): number;
49
50
  set massScale(value: number);
50
51
  /**
51
- * The scale to apply to the inverse inertia of collider0 for resolving this constraint.
52
+ * The scale to apply to the inertia of collider0 for resolving this constraint.
52
53
  */
53
54
  get connectedInertiaScale(): number;
54
55
  set connectedInertiaScale(value: number);
55
56
  /**
56
- * The scale to apply to the inverse inertia of collider1 for resolving this constraint.
57
+ * The scale to apply to the inertia of collider1 for resolving this constraint.
57
58
  */
58
59
  get inertiaScale(): number;
59
60
  set inertiaScale(value: number);
@@ -11,12 +11,12 @@ export declare class JointLimits {
11
11
  private _stiffness;
12
12
  private _damping;
13
13
  /**
14
- * The upper angular limit (in radians) of the joint.
14
+ * The upper angular limit (in degrees) of the joint.
15
15
  */
16
16
  get max(): number;
17
17
  set max(value: number);
18
18
  /**
19
- * The lower angular limit (in radians) of the joint.
19
+ * The lower angular limit (in degrees) of the joint.
20
20
  */
21
21
  get min(): number;
22
22
  set min(value: number);
@@ -27,12 +27,12 @@ export declare abstract class ColliderShape implements ICustomClone {
27
27
  get contactOffset(): number;
28
28
  set contactOffset(value: number);
29
29
  /**
30
- * Physical material.
30
+ * Physical material, material can't be null.
31
31
  */
32
32
  get material(): PhysicsMaterial;
33
33
  set material(value: PhysicsMaterial);
34
34
  /**
35
- * The local rotation of this ColliderShape.
35
+ * The local rotation of this ColliderShape, in degrees.
36
36
  */
37
37
  get rotation(): Vector3;
38
38
  set rotation(value: Vector3);
@@ -47,6 +47,13 @@ export declare abstract class ColliderShape implements ICustomClone {
47
47
  get isTrigger(): boolean;
48
48
  set isTrigger(value: boolean);
49
49
  protected constructor();
50
+ /**
51
+ * Get the distance and the closest point on the shape from a point.
52
+ * @param point - Location in world space you want to find the closest point to
53
+ * @param outClosestPoint - The closest point on the shape in world space
54
+ * @returns The distance between the point and the shape
55
+ */
56
+ getClosestPoint(point: Vector3, outClosestPoint: Vector3): number;
50
57
  protected _syncNative(): void;
51
58
  private _setPosition;
52
59
  private _setRotation;
@@ -1,7 +1,9 @@
1
+ import { Vector3 } from "@galacean/engine-math";
1
2
  import { ColliderShape } from "./ColliderShape";
2
3
  /**
3
4
  * Physical collider shape plane.
4
5
  */
5
6
  export declare class PlaneColliderShape extends ColliderShape {
6
7
  constructor();
8
+ getClosestPoint(point: Vector3, closestPoint: Vector3): number;
7
9
  }
@@ -0,0 +1,60 @@
1
+ import { Component } from "../Component";
2
+ import { Layer } from "../Layer";
3
+ import { PostProcessEffect } from "./PostProcessEffect";
4
+ /**
5
+ * Post Process component can be used for global or local post-processing.
6
+ */
7
+ export declare class PostProcess extends Component {
8
+ /**
9
+ * The layer to which the PostProcess belongs.
10
+ */
11
+ layer: Layer;
12
+ /**
13
+ * The outer distance to start blending from, only takes effect when the `isGlobal` is false.
14
+ */
15
+ blendDistance: number;
16
+ private _priority;
17
+ private _isGlobal;
18
+ /**
19
+ * Whether the PostProcess is global.
20
+ * @remarks
21
+ * Specifies whether to apply the PostProcess to the entire Scene or in Colliders.
22
+ * Only support local PostProcess in physics enabled Scenes.
23
+ */
24
+ get isGlobal(): boolean;
25
+ set isGlobal(value: boolean);
26
+ /**
27
+ * A value which determines which PostProcess is being used when PostProcess have an equal amount of influence on the Scene.
28
+ * @remarks
29
+ * PostProcess with a higher priority will override lower ones.
30
+ */
31
+ get priority(): number;
32
+ set priority(value: number);
33
+ /**
34
+ * Get the PostProcessEffect by type.
35
+ * @param type - The type of PostProcessEffect
36
+ * @returns The PostProcessEffect found
37
+ */
38
+ getEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
39
+ /**
40
+ * Add a PostProcessEffect to the PostProcess.
41
+ * @remarks Only one effect of the same type can be added to the PostProcess.
42
+ * @param type - The type of PostProcessEffect
43
+ * @returns The PostProcessEffect added
44
+ */
45
+ addEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
46
+ /**
47
+ * Remove a PostProcessEffect from the PostProcess.
48
+ * @param type - The type of PostProcessEffect
49
+ * @returns The PostProcessEffect removed
50
+ */
51
+ removeEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
52
+ /**
53
+ * @inheritdoc
54
+ */
55
+ _onEnableInScene(): void;
56
+ /**
57
+ * @inheritdoc
58
+ */
59
+ _onDisableInScene(): void;
60
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The base class for post process effect.
3
+ */
4
+ export declare class PostProcessEffect {
5
+ private _enabled;
6
+ private _parameters;
7
+ private _parameterInitialized;
8
+ /**
9
+ * Indicates whether the post process effect is enabled.
10
+ */
11
+ get enabled(): boolean;
12
+ set enabled(value: boolean);
13
+ /**
14
+ * Whether the post process effect is valid.
15
+ * @remarks
16
+ * This method can be overridden to control the effect's real validity.
17
+ */
18
+ isValid(): boolean;
19
+ /**
20
+ * Get all parameters of the post process effect.
21
+ * @remarks
22
+ * Only get the parameters that are initialized in the constructor.
23
+ * It will don't take effect if you add a new parameter after the post process effect is created, such as `effect.** = new PostProcessEffectParameter(1)`
24
+ */
25
+ private _getParameters;
26
+ }
@@ -0,0 +1,25 @@
1
+ import { Color, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
2
+ import { Texture } from "../texture/Texture";
3
+ /**
4
+ * Represents a parameter of a post process effect.
5
+ * @remarks
6
+ * The parameter will be mixed to a final value and be used in post process manager.
7
+ */
8
+ export declare class PostProcessEffectParameter<T extends Number | Boolean | Color | Vector2 | Vector3 | Vector4 | Texture> {
9
+ /**
10
+ * Whether the parameter is enabled.
11
+ */
12
+ enabled: boolean;
13
+ private _value;
14
+ private _needLerp;
15
+ private _min?;
16
+ private _max?;
17
+ /**
18
+ * The value of the parameter.
19
+ */
20
+ get value(): T;
21
+ set value(value: T);
22
+ constructor(value: Exclude<T, number>, needLerp?: boolean);
23
+ constructor(value: Exclude<T, Boolean | Color | Vector2 | Vector3 | Vector4 | Texture>, needLerp?: boolean);
24
+ constructor(value: Exclude<T, Boolean | Color | Vector2 | Vector3 | Vector4 | Texture>, min?: number, max?: number, needLerp?: boolean);
25
+ }
@@ -1 +1,37 @@
1
- export {};
1
+ import { Scene } from "../Scene";
2
+ import { PostProcessEffect } from "./PostProcessEffect";
3
+ /**
4
+ * A global manager of the PostProcess.
5
+ */
6
+ export declare class PostProcessManager {
7
+ readonly scene: Scene;
8
+ private static _tempColliders;
9
+ private static _tempVector3;
10
+ private _activePostProcesses;
11
+ private _swapRenderTarget;
12
+ private _srcRenderTarget;
13
+ private _destRenderTarget;
14
+ private _currentSourceRenderTarget;
15
+ private _currentDestRenderTarget;
16
+ private _blendEffectMap;
17
+ private _defaultEffectMap;
18
+ private _remainActivePassCount;
19
+ /**
20
+ * Create a PostProcessManager.
21
+ * @param scene - Scene to which the current PostProcessManager belongs
22
+ */
23
+ constructor(scene: Scene);
24
+ /**
25
+ * Get the blend effect by type.
26
+ * @remarks
27
+ * The blend effect is a post process effect that is used to blend all result of the effects by the type.
28
+ * @param type - The type of PostProcessEffect
29
+ * @returns The PostProcessEffect instance found
30
+ */
31
+ getBlendEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
32
+ private _sortActivePostProcess;
33
+ private _resetDefaultValue;
34
+ private _initSwapRenderTarget;
35
+ private _swapRT;
36
+ private _getCurrentSourceTexture;
37
+ }