@galacean/engine-core 1.4.0-alpha.0 → 1.4.0-alpha.2
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/dist/main.js +2846 -1091
- package/dist/main.js.map +1 -1
- package/dist/module.js +2833 -1091
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Camera.d.ts +5 -3
- package/types/Engine.d.ts +12 -0
- package/types/Entity.d.ts +15 -3
- package/types/Polyfill.d.ts +1 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -0
- package/types/RenderPipeline/Blitter.d.ts +28 -0
- package/types/RenderPipeline/index.d.ts +2 -1
- package/types/Renderer.d.ts +0 -2
- package/types/Scene.d.ts +3 -0
- package/types/Transform.d.ts +17 -7
- package/types/asset/AssetType.d.ts +6 -2
- package/types/asset/request.d.ts +10 -3
- package/types/audio/AudioClip.d.ts +24 -0
- package/types/audio/AudioManager.d.ts +1 -0
- package/types/audio/AudioSource.d.ts +72 -0
- package/types/audio/index.d.ts +3 -0
- package/types/index.d.ts +2 -0
- package/types/material/BaseMaterial.d.ts +4 -2
- package/types/material/PBRMaterial.d.ts +97 -4
- package/types/material/enums/Refraction.d.ts +9 -0
- package/types/material/index.d.ts +1 -0
- package/types/physics/CharacterController.d.ts +5 -6
- package/types/physics/Collider.d.ts +3 -1
- package/types/physics/Collision.d.ts +18 -0
- package/types/physics/ContactPoint.d.ts +14 -0
- package/types/physics/DynamicCollider.d.ts +33 -4
- package/types/physics/PhysicsMaterial.d.ts +5 -1
- package/types/physics/index.d.ts +2 -0
- package/types/physics/joint/FixedJoint.d.ts +1 -0
- package/types/physics/joint/HingeJoint.d.ts +9 -6
- package/types/physics/joint/Joint.d.ts +29 -10
- package/types/physics/joint/JointLimits.d.ts +34 -10
- package/types/physics/joint/JointMotor.d.ts +27 -8
- package/types/physics/joint/SpringJoint.d.ts +2 -6
- package/types/physics/shape/BoxColliderShape.d.ts +1 -0
- package/types/physics/shape/CapsuleColliderShape.d.ts +1 -0
- package/types/physics/shape/ColliderShape.d.ts +11 -3
- package/types/physics/shape/PlaneColliderShape.d.ts +2 -0
- package/types/physics/shape/SphereColliderShape.d.ts +1 -1
- package/types/postProcess/PostProcess.d.ts +60 -0
- package/types/postProcess/PostProcessEffect.d.ts +26 -0
- package/types/postProcess/PostProcessEffectParameter.d.ts +25 -0
- package/types/postProcess/PostProcessManager.d.ts +37 -1
- package/types/postProcess/PostProcessPass.d.ts +50 -0
- package/types/postProcess/PostProcessUberPass.d.ts +25 -0
- package/types/postProcess/effects/BloomEffect.d.ts +22 -64
- package/types/postProcess/effects/TonemappingEffect.d.ts +6 -16
- package/types/postProcess/index.d.ts +6 -2
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EngineObject } from "../base";
|
|
2
|
+
import { Camera } from "../Camera";
|
|
3
|
+
import { RenderTarget, Texture2D } from "../texture";
|
|
4
|
+
import { PostProcessManager } from "./PostProcessManager";
|
|
5
|
+
/**
|
|
6
|
+
* Controls when the post process pass executes.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum PostProcessPassEvent {
|
|
9
|
+
/** Before the uber pass. */
|
|
10
|
+
BeforeUber = 0,
|
|
11
|
+
/** After the uber pass. */
|
|
12
|
+
AfterUber = 100
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Post process pass.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class PostProcessPass extends EngineObject {
|
|
18
|
+
private _event;
|
|
19
|
+
private _isActive;
|
|
20
|
+
/**
|
|
21
|
+
* When the post process pass is rendered.
|
|
22
|
+
* @remarks
|
|
23
|
+
* Users can also inject pass events in a specific point by doing PostProcessPassEvent + offset.
|
|
24
|
+
*/
|
|
25
|
+
get event(): PostProcessPassEvent;
|
|
26
|
+
set event(value: PostProcessPassEvent);
|
|
27
|
+
/**
|
|
28
|
+
* Whether the post process pass is active.
|
|
29
|
+
*/
|
|
30
|
+
get isActive(): boolean;
|
|
31
|
+
set isActive(value: boolean);
|
|
32
|
+
/**
|
|
33
|
+
* Whether the post process pass is valid in current post process manager.
|
|
34
|
+
* @remarks
|
|
35
|
+
* This method can be overridden to control the pass's real validity.
|
|
36
|
+
* @param postProcessManager - The post process manager
|
|
37
|
+
*/
|
|
38
|
+
isValid(postProcessManager: PostProcessManager): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Execute the post process pass if it is active.
|
|
41
|
+
* @param camera - The camera used to render
|
|
42
|
+
* @param srcTexture - The source texture from last render target
|
|
43
|
+
* @param destTarget - The destination render target
|
|
44
|
+
*/
|
|
45
|
+
abstract onRender(camera: Camera, srcTexture: Texture2D, destTarget: RenderTarget): void;
|
|
46
|
+
/**
|
|
47
|
+
* @inheritdoc
|
|
48
|
+
*/
|
|
49
|
+
_onDestroy(): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Camera } from "../Camera";
|
|
2
|
+
import { Engine } from "../Engine";
|
|
3
|
+
import { RenderTarget, Texture2D } from "../texture";
|
|
4
|
+
import { PostProcessPass } from "./PostProcessPass";
|
|
5
|
+
import { PostProcessManager } from "./PostProcessManager";
|
|
6
|
+
export declare class PostProcessUberPass extends PostProcessPass {
|
|
7
|
+
static readonly UBER_SHADER_NAME = "UberPost";
|
|
8
|
+
private _uberMaterial;
|
|
9
|
+
private _bloomMaterial;
|
|
10
|
+
private _mipDownRT;
|
|
11
|
+
private _mipUpRT;
|
|
12
|
+
constructor(engine: Engine);
|
|
13
|
+
/** @inheritdoc */
|
|
14
|
+
isValid(postProcessManager: PostProcessManager): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @inheritdoc
|
|
17
|
+
*/
|
|
18
|
+
onRender(camera: Camera, srcTexture: Texture2D, destTarget: RenderTarget): void;
|
|
19
|
+
/**
|
|
20
|
+
* @inheritdoc
|
|
21
|
+
*/
|
|
22
|
+
_onDestroy(): void;
|
|
23
|
+
private _setupBloom;
|
|
24
|
+
private _releaseBloomRenderTargets;
|
|
25
|
+
}
|
|
@@ -1,94 +1,52 @@
|
|
|
1
1
|
import { Color } from "@galacean/engine-math";
|
|
2
|
-
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
3
|
-
import { Material } from "../../material";
|
|
4
2
|
import { Texture2D } from "../../texture";
|
|
3
|
+
import { PostProcessEffect } from "../PostProcessEffect";
|
|
4
|
+
import { PostProcessEffectParameter } from "../PostProcessEffectParameter";
|
|
5
5
|
/**
|
|
6
6
|
* This controls the size of the bloom texture.
|
|
7
7
|
*/
|
|
8
8
|
export declare enum BloomDownScaleMode {
|
|
9
|
-
/**
|
|
10
|
-
* Use this to select half size as the starting resolution.
|
|
11
|
-
*/
|
|
9
|
+
/** Use this to select half size as the starting resolution. */
|
|
12
10
|
Half = 0,
|
|
13
|
-
/**
|
|
14
|
-
* Use this to select quarter size as the starting resolution.
|
|
15
|
-
*/
|
|
11
|
+
/** Use this to select quarter size as the starting resolution. */
|
|
16
12
|
Quarter = 1
|
|
17
13
|
}
|
|
18
|
-
export declare class BloomEffect {
|
|
19
|
-
private _uberMaterial;
|
|
14
|
+
export declare class BloomEffect extends PostProcessEffect {
|
|
20
15
|
static readonly SHADER_NAME = "PostProcessEffect Bloom";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
private static _enableMacro;
|
|
27
|
-
private static _bloomTextureProp;
|
|
28
|
-
private static _dirtTextureProp;
|
|
29
|
-
private static _tintProp;
|
|
30
|
-
private static _bloomIntensityParams;
|
|
31
|
-
private static _dirtTilingOffsetProp;
|
|
32
|
-
private _bloomMaterial;
|
|
33
|
-
private _threshold;
|
|
34
|
-
private _scatter;
|
|
35
|
-
private _highQualityFiltering;
|
|
36
|
-
private _mipDownRT;
|
|
37
|
-
private _mipUpRT;
|
|
38
|
-
private _maxIterations;
|
|
39
|
-
private _enabled;
|
|
16
|
+
/**
|
|
17
|
+
* Controls whether to use bicubic sampling instead of bilinear sampling for the upSampling passes.
|
|
18
|
+
* @remarks This is slightly more expensive but helps getting smoother visuals.
|
|
19
|
+
*/
|
|
20
|
+
highQualityFiltering: PostProcessEffectParameter<boolean>;
|
|
40
21
|
/**
|
|
41
22
|
* Controls the starting resolution that this effect begins processing.
|
|
42
23
|
*/
|
|
43
|
-
downScale: BloomDownScaleMode
|
|
24
|
+
downScale: PostProcessEffectParameter<BloomDownScaleMode>;
|
|
44
25
|
/**
|
|
45
|
-
*
|
|
26
|
+
* Specifies a Texture to add smudges or dust to the bloom effect.
|
|
46
27
|
*/
|
|
47
|
-
|
|
48
|
-
set enabled(value: boolean);
|
|
28
|
+
dirtTexture: PostProcessEffectParameter<Texture2D>;
|
|
49
29
|
/**
|
|
50
30
|
* Set the level of brightness to filter out pixels under this level.
|
|
51
31
|
* @remarks This value is expressed in gamma-space.
|
|
52
32
|
*/
|
|
53
|
-
|
|
54
|
-
set threshold(value: number);
|
|
33
|
+
threshold: PostProcessEffectParameter<number>;
|
|
55
34
|
/**
|
|
56
35
|
* Controls the radius of the bloom effect.
|
|
57
36
|
*/
|
|
58
|
-
|
|
59
|
-
set scatter(value: number);
|
|
37
|
+
scatter: PostProcessEffectParameter<number>;
|
|
60
38
|
/**
|
|
61
39
|
* Controls the strength of the bloom effect.
|
|
62
40
|
*/
|
|
63
|
-
|
|
64
|
-
set intensity(value: number);
|
|
65
|
-
/**
|
|
66
|
-
* Specifies the tint of the bloom effect.
|
|
67
|
-
*/
|
|
68
|
-
get tint(): Color;
|
|
69
|
-
set tint(value: Color);
|
|
70
|
-
/**
|
|
71
|
-
* Controls whether to use bicubic sampling instead of bilinear sampling for the upSampling passes.
|
|
72
|
-
* @remarks This is slightly more expensive but helps getting smoother visuals.
|
|
73
|
-
*/
|
|
74
|
-
get highQualityFiltering(): boolean;
|
|
75
|
-
set highQualityFiltering(value: boolean);
|
|
41
|
+
intensity: PostProcessEffectParameter<number>;
|
|
76
42
|
/**
|
|
77
|
-
*
|
|
43
|
+
* Controls the strength of the lens dirt.
|
|
78
44
|
*/
|
|
79
|
-
|
|
80
|
-
set dirtTexture(value: Texture2D);
|
|
45
|
+
dirtIntensity: PostProcessEffectParameter<number>;
|
|
81
46
|
/**
|
|
82
|
-
*
|
|
47
|
+
* Specifies the tint of the bloom effect.
|
|
83
48
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
onRender(context: RenderContext, srcTexture: Texture2D): void;
|
|
88
|
-
private _calculateMipCount;
|
|
89
|
-
private _prefilter;
|
|
90
|
-
private _downsample;
|
|
91
|
-
private _upsample;
|
|
92
|
-
private _setupUber;
|
|
93
|
-
private _releaseRenderTargets;
|
|
49
|
+
tint: PostProcessEffectParameter<Color>;
|
|
50
|
+
/** @inheritdoc */
|
|
51
|
+
isValid(): boolean;
|
|
94
52
|
}
|
|
@@ -1,35 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PostProcessEffect } from "../PostProcessEffect";
|
|
2
|
+
import { PostProcessEffectParameter } from "../PostProcessEffectParameter";
|
|
2
3
|
/**
|
|
3
4
|
* Options to select a tonemapping algorithm to use.
|
|
4
5
|
*/
|
|
5
6
|
export declare enum TonemappingMode {
|
|
6
7
|
/**
|
|
7
|
-
* Neutral tonemapper
|
|
8
|
+
* Neutral tonemapper.
|
|
8
9
|
* @remarks Use this option if you only want range-remapping with minimal impact on color hue and saturation.
|
|
9
10
|
*/
|
|
10
11
|
Neutral = 0,
|
|
11
12
|
/**
|
|
12
|
-
* ACES Filmic reference tonemapper (custom approximation)
|
|
13
|
+
* ACES Filmic reference tonemapper (custom approximation).
|
|
13
14
|
* @remarks
|
|
14
15
|
* Use this option to apply a close approximation of the reference ACES tonemapper for a more filmic look.
|
|
15
16
|
* It is more contrasted than Neutral and has an effect on actual color hue and saturation.
|
|
16
17
|
*/
|
|
17
18
|
ACES = 1
|
|
18
19
|
}
|
|
19
|
-
export declare class TonemappingEffect {
|
|
20
|
-
private _uberMaterial;
|
|
21
|
-
private static _enableMacro;
|
|
22
|
-
private _mode;
|
|
23
|
-
private _enabled;
|
|
24
|
-
/**
|
|
25
|
-
* Indicates whether the post process effect is enabled.
|
|
26
|
-
*/
|
|
27
|
-
get enabled(): boolean;
|
|
28
|
-
set enabled(value: boolean);
|
|
20
|
+
export declare class TonemappingEffect extends PostProcessEffect {
|
|
29
21
|
/**
|
|
30
22
|
* Use this to select a tonemapping algorithm to use.
|
|
31
23
|
*/
|
|
32
|
-
|
|
33
|
-
set mode(value: TonemappingMode);
|
|
34
|
-
constructor(_uberMaterial: Material);
|
|
24
|
+
mode: PostProcessEffectParameter<TonemappingMode>;
|
|
35
25
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { _PostProcessManager } from "./PostProcessManager";
|
|
2
1
|
export * from "./effects";
|
|
3
|
-
export {
|
|
2
|
+
export { PostProcess } from "./PostProcess";
|
|
3
|
+
export { PostProcessEffect } from "./PostProcessEffect";
|
|
4
|
+
export { PostProcessEffectParameter } from "./PostProcessEffectParameter";
|
|
5
|
+
export { PostProcessManager } from "./PostProcessManager";
|
|
6
|
+
export { PostProcessPass, PostProcessPassEvent } from "./PostProcessPass";
|
|
7
|
+
export { PostProcessUberPass } from "./PostProcessUberPass";
|