@galacean/engine-core 1.3.0-alpha.0 → 1.3.0-alpha.1
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 +590 -88
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +590 -88
- package/dist/module.js +588 -89
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Camera.d.ts +11 -3
- package/types/RenderPipeline/PipelinePass.d.ts +1 -1
- package/types/RenderPipeline/enums/RenderBufferStoreAction.d.ts +13 -0
- package/types/RenderPipeline/index.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/postProcess/PostProcessEffect.d.ts +13 -0
- package/types/postProcess/PostProcessManager.d.ts +1 -0
- package/types/postProcess/PostProcessPass.d.ts +55 -0
- package/types/postProcess/effects/BloomEffect.d.ts +94 -0
- package/types/postProcess/effects/TonemappingEffect.d.ts +35 -0
- package/types/postProcess/effects/index.d.ts +2 -0
- package/types/postProcess/index.d.ts +3 -0
- package/types/shader/enums/ShaderPlatformTarget.d.ts +4 -0
- package/types/shader/enums/ShaderType.d.ts +1 -0
- package/types/texture/enums/TextureFormat.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.3.0-alpha.
|
|
3
|
+
"version": "1.3.0-alpha.1",
|
|
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": "1.3.0-alpha.
|
|
18
|
+
"@galacean/engine-math": "1.3.0-alpha.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.3.0-alpha.
|
|
21
|
+
"@galacean/engine-design": "1.3.0-alpha.1"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
package/types/Camera.d.ts
CHANGED
|
@@ -64,6 +64,8 @@ export declare class Camera extends Component {
|
|
|
64
64
|
private _renderTarget;
|
|
65
65
|
private _depthBufferParams;
|
|
66
66
|
private _opaqueTextureEnabled;
|
|
67
|
+
private _enableHDR;
|
|
68
|
+
private _enablePostProcess;
|
|
67
69
|
private _frustumChangeFlag;
|
|
68
70
|
private _transform;
|
|
69
71
|
private _isViewMatrixDirty;
|
|
@@ -77,7 +79,6 @@ export declare class Camera extends Component {
|
|
|
77
79
|
* If enabled, the opaque texture can be accessed in the shader using `camera_OpaqueTexture`.
|
|
78
80
|
*
|
|
79
81
|
* @defaultValue `false`
|
|
80
|
-
*
|
|
81
82
|
* @remarks If enabled, the `independentCanvasEnabled` property will be forced to be true.
|
|
82
83
|
*/
|
|
83
84
|
get opaqueTextureEnabled(): boolean;
|
|
@@ -153,10 +154,18 @@ export declare class Camera extends Component {
|
|
|
153
154
|
set projectionMatrix(value: Matrix);
|
|
154
155
|
/**
|
|
155
156
|
* Whether to enable HDR.
|
|
156
|
-
* @
|
|
157
|
+
* @defaultValue `false`
|
|
158
|
+
* @remarks If enabled, the `independentCanvasEnabled` property will be forced to be true.
|
|
157
159
|
*/
|
|
158
160
|
get enableHDR(): boolean;
|
|
159
161
|
set enableHDR(value: boolean);
|
|
162
|
+
/**
|
|
163
|
+
* Whether to enable post process.
|
|
164
|
+
* @defaultValue `false`
|
|
165
|
+
* @remarks If enabled, the `independentCanvasEnabled` property will be forced to be true.
|
|
166
|
+
*/
|
|
167
|
+
get enablePostProcess(): boolean;
|
|
168
|
+
set enablePostProcess(value: boolean);
|
|
160
169
|
/**
|
|
161
170
|
* RenderTarget. After setting, it will be rendered to the renderTarget. If it is empty, it will be rendered to the main canvas.
|
|
162
171
|
*/
|
|
@@ -286,7 +295,6 @@ export declare class Camera extends Component {
|
|
|
286
295
|
* The inverse of the projection matrix.
|
|
287
296
|
*/
|
|
288
297
|
private _getInverseProjectionMatrix;
|
|
289
|
-
private _forceUseInternalCanvas;
|
|
290
298
|
private _onPixelViewportChanged;
|
|
291
299
|
private _checkMainCanvasAntialiasWaste;
|
|
292
300
|
}
|
|
@@ -5,7 +5,7 @@ import { RenderContext } from "../RenderPipeline/RenderContext";
|
|
|
5
5
|
* PipelinePass is a base class for all pipeline passes.
|
|
6
6
|
*/
|
|
7
7
|
export declare abstract class PipelinePass {
|
|
8
|
-
|
|
8
|
+
readonly engine: Engine;
|
|
9
9
|
constructor(engine: Engine);
|
|
10
10
|
/**
|
|
11
11
|
* Called before rendering a camera, override this method to configure the camera If you need to configure the camera clear flag or render target.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This enum describes what should be done on the render target when the GPU is done rendering into it.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum RenderBufferStoreAction {
|
|
5
|
+
/**
|
|
6
|
+
* Do nothing after rendering.
|
|
7
|
+
*/
|
|
8
|
+
DontCare = 0,
|
|
9
|
+
/**
|
|
10
|
+
* Blit the MSAA render target after rendering.
|
|
11
|
+
*/
|
|
12
|
+
BlitMSAA = 1
|
|
13
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RenderContext } from "../RenderPipeline/RenderContext";
|
|
2
|
+
import { RenderTarget, Texture2D } from "../texture";
|
|
3
|
+
export declare abstract class PostProcessEffect {
|
|
4
|
+
readonly engine: any;
|
|
5
|
+
private _enabled;
|
|
6
|
+
/**
|
|
7
|
+
* Indicates whether the post process effect is enabled.
|
|
8
|
+
*/
|
|
9
|
+
get enabled(): boolean;
|
|
10
|
+
set enabled(value: boolean);
|
|
11
|
+
constructor(engine: any);
|
|
12
|
+
abstract onRender(context: RenderContext, srcTexture: Texture2D, destRenderTarget: RenderTarget): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Engine } from "../Engine";
|
|
2
|
+
import { PipelinePass } from "../RenderPipeline/PipelinePass";
|
|
3
|
+
import { RenderContext } from "../RenderPipeline/RenderContext";
|
|
4
|
+
import { PostProcessEffect } from "./PostProcessEffect";
|
|
5
|
+
export declare class PostProcessPass extends PipelinePass {
|
|
6
|
+
private _isActive;
|
|
7
|
+
private _effects;
|
|
8
|
+
/** The name of pass. */
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Whether to activate current post process.
|
|
12
|
+
*/
|
|
13
|
+
get isActive(): boolean;
|
|
14
|
+
set isActive(value: boolean);
|
|
15
|
+
/**
|
|
16
|
+
* Get the post process effect list.
|
|
17
|
+
*/
|
|
18
|
+
get effects(): ReadonlyArray<PostProcessEffect>;
|
|
19
|
+
/**
|
|
20
|
+
* Create a post process pass.
|
|
21
|
+
* @param engine - The engine the pass belongs to
|
|
22
|
+
* @param name - The pass name if need
|
|
23
|
+
*/
|
|
24
|
+
constructor(engine: Engine, name?: string);
|
|
25
|
+
onRender(context: RenderContext): void;
|
|
26
|
+
/**
|
|
27
|
+
* Get post process effect which match the type.
|
|
28
|
+
* @param type - The type of the post process effect
|
|
29
|
+
* @returns The first post process effect which match type
|
|
30
|
+
*/
|
|
31
|
+
getEffect(type: typeof PostProcessEffect): PostProcessEffect | null;
|
|
32
|
+
/**
|
|
33
|
+
* Get post process effects which match the type.
|
|
34
|
+
* @param type - The type of the post process effect
|
|
35
|
+
* @param results - The effects which match type
|
|
36
|
+
* @returns The effects which match type
|
|
37
|
+
*/
|
|
38
|
+
getEffects(type: typeof PostProcessEffect, results: PostProcessEffect[]): PostProcessEffect[];
|
|
39
|
+
/**
|
|
40
|
+
* Add post process effect.
|
|
41
|
+
* @param effect - The post process effect want to be added
|
|
42
|
+
*/
|
|
43
|
+
addEffect(effect: PostProcessEffect): void;
|
|
44
|
+
/**
|
|
45
|
+
* Add post process at specified index.
|
|
46
|
+
* @param indexOrEffect - Specified index
|
|
47
|
+
* @param effect - The post process effect want to be added
|
|
48
|
+
*/
|
|
49
|
+
addEffect(index: number, effect: PostProcessEffect): void;
|
|
50
|
+
/**
|
|
51
|
+
* Remove post process effect.
|
|
52
|
+
* @param effect - The post process effect want to be removed
|
|
53
|
+
*/
|
|
54
|
+
removeEffect(effect: PostProcessEffect): void;
|
|
55
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Color } from "@galacean/engine-math";
|
|
2
|
+
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
3
|
+
import { Material } from "../../material";
|
|
4
|
+
import { Texture2D } from "../../texture";
|
|
5
|
+
/**
|
|
6
|
+
* This controls the size of the bloom texture.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum BloomDownScaleMode {
|
|
9
|
+
/**
|
|
10
|
+
* Use this to select half size as the starting resolution.
|
|
11
|
+
*/
|
|
12
|
+
Half = 0,
|
|
13
|
+
/**
|
|
14
|
+
* Use this to select quarter size as the starting resolution.
|
|
15
|
+
*/
|
|
16
|
+
Quarter = 1
|
|
17
|
+
}
|
|
18
|
+
export declare class BloomEffect {
|
|
19
|
+
private _uberMaterial;
|
|
20
|
+
static readonly SHADER_NAME = "PostProcessEffect Bloom";
|
|
21
|
+
private static _hqMacro;
|
|
22
|
+
private static _dirtMacro;
|
|
23
|
+
private static _bloomParams;
|
|
24
|
+
private static _lowMipTextureProp;
|
|
25
|
+
private static _lowMipTexelSizeProp;
|
|
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;
|
|
40
|
+
/**
|
|
41
|
+
* Controls the starting resolution that this effect begins processing.
|
|
42
|
+
*/
|
|
43
|
+
downScale: BloomDownScaleMode;
|
|
44
|
+
/**
|
|
45
|
+
* Indicates whether the post process effect is enabled.
|
|
46
|
+
*/
|
|
47
|
+
get enabled(): boolean;
|
|
48
|
+
set enabled(value: boolean);
|
|
49
|
+
/**
|
|
50
|
+
* Set the level of brightness to filter out pixels under this level.
|
|
51
|
+
* @remarks This value is expressed in gamma-space.
|
|
52
|
+
*/
|
|
53
|
+
get threshold(): number;
|
|
54
|
+
set threshold(value: number);
|
|
55
|
+
/**
|
|
56
|
+
* Controls the radius of the bloom effect.
|
|
57
|
+
*/
|
|
58
|
+
get scatter(): number;
|
|
59
|
+
set scatter(value: number);
|
|
60
|
+
/**
|
|
61
|
+
* Controls the strength of the bloom effect.
|
|
62
|
+
*/
|
|
63
|
+
get intensity(): number;
|
|
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);
|
|
76
|
+
/**
|
|
77
|
+
* Specifies a Texture to add smudges or dust to the bloom effect.
|
|
78
|
+
*/
|
|
79
|
+
get dirtTexture(): Texture2D;
|
|
80
|
+
set dirtTexture(value: Texture2D);
|
|
81
|
+
/**
|
|
82
|
+
* Controls the strength of the lens dirt.
|
|
83
|
+
*/
|
|
84
|
+
get dirtIntensity(): number;
|
|
85
|
+
set dirtIntensity(value: number);
|
|
86
|
+
constructor(_uberMaterial: Material);
|
|
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;
|
|
94
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Material } from "../../material";
|
|
2
|
+
/**
|
|
3
|
+
* Options to select a tonemapping algorithm to use.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum TonemappingMode {
|
|
6
|
+
/**
|
|
7
|
+
* Neutral tonemapper
|
|
8
|
+
* @remarks Use this option if you only want range-remapping with minimal impact on color hue and saturation.
|
|
9
|
+
*/
|
|
10
|
+
Neutral = 0,
|
|
11
|
+
/**
|
|
12
|
+
* ACES Filmic reference tonemapper (custom approximation)
|
|
13
|
+
* @remarks
|
|
14
|
+
* Use this option to apply a close approximation of the reference ACES tonemapper for a more filmic look.
|
|
15
|
+
* It is more contrasted than Neutral and has an effect on actual color hue and saturation.
|
|
16
|
+
*/
|
|
17
|
+
ACES = 1
|
|
18
|
+
}
|
|
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);
|
|
29
|
+
/**
|
|
30
|
+
* Use this to select a tonemapping algorithm to use.
|
|
31
|
+
*/
|
|
32
|
+
get mode(): TonemappingMode;
|
|
33
|
+
set mode(value: TonemappingMode);
|
|
34
|
+
constructor(_uberMaterial: Material);
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -22,6 +22,8 @@ export declare enum TextureFormat {
|
|
|
22
22
|
R32G32B32A32 = 8,
|
|
23
23
|
/** RGBA unsigned integer format, 32 bits per channel. */
|
|
24
24
|
R32G32B32A32_UInt = 9,
|
|
25
|
+
/** RGB unsigned float format, 11 bits in R channel, 11 bits in G channel, 10 bits in B channel. */
|
|
26
|
+
R11G11B10_UFloat = 35,
|
|
25
27
|
/** RGB compressed format, 4 bits per pixel. */
|
|
26
28
|
BC1 = 10,
|
|
27
29
|
/** RGBA compressed format, 8 bits per pixel. */
|