@galacean/engine-core 1.2.0-alpha.13 → 1.2.0-alpha.14
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 +10180 -10006
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +10180 -10006
- package/dist/module.js +10181 -10006
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Camera.d.ts +38 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -30
- package/types/RenderPipeline/RenderQueue.d.ts +1 -2
- package/types/RenderPipeline/index.d.ts +0 -1
- package/types/Renderer.d.ts +4 -1
- package/types/animation/AnimatorLayerMask.d.ts +1 -1
- package/types/index.d.ts +2 -0
- package/types/mesh/SkinnedMeshRenderer.d.ts +2 -0
- package/types/renderingHardwareInterface/IPlatformRenderTarget.d.ts +2 -2
- package/types/shader/state/DepthState.d.ts +2 -2
- package/types/texture/RenderTarget.d.ts +5 -4
- package/types/texture/enums/RenderBufferDepthFormat.d.ts +11 -9
- package/types/texture/enums/TextureFormat.d.ts +10 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.14",
|
|
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.2.0-alpha.
|
|
18
|
+
"@galacean/engine-math": "1.2.0-alpha.14"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.2.0-alpha.
|
|
21
|
+
"@galacean/engine-design": "1.2.0-alpha.14"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
package/types/Camera.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { Component } from "./Component";
|
|
|
3
3
|
import { Layer } from "./Layer";
|
|
4
4
|
import { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
5
5
|
import { DepthTextureMode } from "./enums/DepthTextureMode";
|
|
6
|
+
import { Downsampling } from "./enums/Downsampling";
|
|
7
|
+
import { MSAASamples } from "./enums/MSAASamples";
|
|
6
8
|
import { Shader } from "./shader/Shader";
|
|
7
9
|
import { ShaderData } from "./shader/ShaderData";
|
|
8
10
|
import { ShaderTagKey } from "./shader/ShaderTagKey";
|
|
@@ -22,6 +24,7 @@ export declare class Camera extends Component {
|
|
|
22
24
|
enableFrustumCulling: boolean;
|
|
23
25
|
/**
|
|
24
26
|
* Determining what to clear when rendering by a Camera.
|
|
27
|
+
*
|
|
25
28
|
* @defaultValue `CameraClearFlags.All`
|
|
26
29
|
*/
|
|
27
30
|
clearFlags: CameraClearFlags;
|
|
@@ -32,9 +35,23 @@ export declare class Camera extends Component {
|
|
|
32
35
|
cullingMask: Layer;
|
|
33
36
|
/**
|
|
34
37
|
* Depth texture mode.
|
|
38
|
+
* If `DepthTextureMode.PrePass` is used, the depth texture can be accessed in the shader using `camera_DepthTexture`.
|
|
39
|
+
*
|
|
35
40
|
* @defaultValue `DepthTextureMode.None`
|
|
36
41
|
*/
|
|
37
42
|
depthTextureMode: DepthTextureMode;
|
|
43
|
+
/**
|
|
44
|
+
* Opacity texture down sampling.
|
|
45
|
+
*
|
|
46
|
+
* @defaultValue `Downsampling.TwoX`
|
|
47
|
+
*/
|
|
48
|
+
opaqueTextureDownsampling: Downsampling;
|
|
49
|
+
/**
|
|
50
|
+
* Multi-sample anti-aliasing samples when use independent canvas mode.
|
|
51
|
+
*
|
|
52
|
+
* @remarks The `independentCanvasEnabled` property should be `true` to take effect, otherwise it will be invalid.
|
|
53
|
+
*/
|
|
54
|
+
msaaSamples: MSAASamples;
|
|
38
55
|
private _priority;
|
|
39
56
|
private _shaderData;
|
|
40
57
|
private _isCustomViewMatrix;
|
|
@@ -46,6 +63,8 @@ export declare class Camera extends Component {
|
|
|
46
63
|
private _customAspectRatio;
|
|
47
64
|
private _renderTarget;
|
|
48
65
|
private _depthBufferParams;
|
|
66
|
+
private _customIndependentCanvas;
|
|
67
|
+
private _opaqueTextureEnabled;
|
|
49
68
|
private _frustumChangeFlag;
|
|
50
69
|
private _transform;
|
|
51
70
|
private _isViewMatrixDirty;
|
|
@@ -54,6 +73,23 @@ export declare class Camera extends Component {
|
|
|
54
73
|
private _pixelViewport;
|
|
55
74
|
private _inverseProjectionMatrix;
|
|
56
75
|
private _invViewProjMat;
|
|
76
|
+
/**
|
|
77
|
+
* Whether to enable opaque texture.
|
|
78
|
+
* If enabled, the opaque texture can be accessed in the shader using `camera_OpaqueTexture`.
|
|
79
|
+
*
|
|
80
|
+
* @defaultValue `false`
|
|
81
|
+
*
|
|
82
|
+
* @remarks If enabled, the `independentCanvasEnabled` property will be forced to be true.
|
|
83
|
+
*/
|
|
84
|
+
get opaqueTextureEnabled(): boolean;
|
|
85
|
+
set opaqueTextureEnabled(value: boolean);
|
|
86
|
+
/**
|
|
87
|
+
* Whether to use an independent canvas in viewport area.
|
|
88
|
+
*
|
|
89
|
+
* @remarks If true, the msaa in viewport can turn or off independently by `msaaSamples` property.
|
|
90
|
+
*/
|
|
91
|
+
get independentCanvasEnabled(): boolean;
|
|
92
|
+
set independentCanvasEnabled(value: boolean);
|
|
57
93
|
/**
|
|
58
94
|
* Shader data.
|
|
59
95
|
*/
|
|
@@ -252,5 +288,7 @@ export declare class Camera extends Component {
|
|
|
252
288
|
* The inverse of the projection matrix.
|
|
253
289
|
*/
|
|
254
290
|
private _getInverseProjectionMatrix;
|
|
291
|
+
private _forceUseInternalCanvas;
|
|
255
292
|
private _onPixelViewportChanged;
|
|
293
|
+
private _checkMainCanvasAntialiasWaste;
|
|
256
294
|
}
|
|
@@ -1,49 +1,23 @@
|
|
|
1
1
|
import { Camera } from "../Camera";
|
|
2
|
-
import { Layer } from "../Layer";
|
|
3
2
|
import { CameraClearFlags } from "../enums/CameraClearFlags";
|
|
4
|
-
import {
|
|
5
|
-
import { RenderTarget, TextureCubeFace } from "../texture";
|
|
3
|
+
import { TextureCubeFace } from "../texture";
|
|
6
4
|
import { RenderContext } from "./RenderContext";
|
|
7
5
|
import { RenderData } from "./RenderData";
|
|
8
|
-
import { RenderPass } from "./RenderPass";
|
|
9
6
|
/**
|
|
10
7
|
* Basic render pipeline.
|
|
11
8
|
*/
|
|
12
9
|
export declare class BasicRenderPipeline {
|
|
13
10
|
private _camera;
|
|
14
|
-
private _defaultPass;
|
|
15
|
-
private _renderPassArray;
|
|
16
11
|
private _lastCanvasSize;
|
|
17
|
-
private
|
|
12
|
+
private _internalColorTarget;
|
|
13
|
+
private _cascadedShadowCasterPass;
|
|
18
14
|
private _depthOnlyPass;
|
|
15
|
+
private _opaqueTexturePass;
|
|
19
16
|
/**
|
|
20
17
|
* Create a basic render pipeline.
|
|
21
18
|
* @param camera - Camera
|
|
22
19
|
*/
|
|
23
20
|
constructor(camera: Camera);
|
|
24
|
-
/**
|
|
25
|
-
* Default render pass.
|
|
26
|
-
*/
|
|
27
|
-
get defaultRenderPass(): RenderPass;
|
|
28
|
-
/**
|
|
29
|
-
* Add render pass.
|
|
30
|
-
* @param nameOrPass - The name of this Pass or RenderPass object. When it is a name, the following parameters need to be provided
|
|
31
|
-
* @param priority - Priority, less than 0 before the default pass, greater than 0 after the default pass
|
|
32
|
-
* @param renderTarget - The specified Render Target
|
|
33
|
-
* @param replaceMaterial - Replaced material
|
|
34
|
-
* @param mask - Perform bit and operations with Entity.Layer to filter the objects that this Pass needs to render
|
|
35
|
-
*/
|
|
36
|
-
addRenderPass(nameOrPass: string | RenderPass, priority?: number, renderTarget?: RenderTarget, replaceMaterial?: Material, mask?: Layer): void;
|
|
37
|
-
/**
|
|
38
|
-
* Remove render pass by name or render pass object.
|
|
39
|
-
* @param nameOrPass - Render pass name or render pass object
|
|
40
|
-
*/
|
|
41
|
-
removeRenderPass(nameOrPass: string | RenderPass): void;
|
|
42
|
-
/**
|
|
43
|
-
* Get render pass by name.
|
|
44
|
-
* @param name - Render pass name
|
|
45
|
-
*/
|
|
46
|
-
getRenderPass(name: string): RenderPass;
|
|
47
21
|
/**
|
|
48
22
|
* Destroy internal resources.
|
|
49
23
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Camera } from "../Camera";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
|
-
import { Layer } from "../Layer";
|
|
4
3
|
import { RenderQueueType } from "../shader";
|
|
5
4
|
import { RenderElement } from "./RenderElement";
|
|
6
5
|
/**
|
|
@@ -15,7 +14,7 @@ export declare class RenderQueue {
|
|
|
15
14
|
* Push a render element.
|
|
16
15
|
*/
|
|
17
16
|
pushRenderElement(element: RenderElement): void;
|
|
18
|
-
render(camera: Camera,
|
|
17
|
+
render(camera: Camera, pipelineStageTagValue: string): void;
|
|
19
18
|
/**
|
|
20
19
|
* Clear collection.
|
|
21
20
|
*/
|
package/types/Renderer.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BoundingBox, Vector4 } from "@galacean/engine-math";
|
|
1
|
+
import { BoundingBox, Matrix, Vector4 } from "@galacean/engine-math";
|
|
2
2
|
import { Component } from "./Component";
|
|
3
|
+
import { RenderContext } from "./RenderPipeline/RenderContext";
|
|
3
4
|
import { IComponentCustomClone } from "./clone/ComponentCloner";
|
|
4
5
|
import { Material } from "./material";
|
|
5
6
|
import { ShaderData } from "./shader/ShaderData";
|
|
@@ -110,5 +111,7 @@ export declare class Renderer extends Component implements IComponentCustomClone
|
|
|
110
111
|
*/
|
|
111
112
|
setMaterials(materials: Material[]): void;
|
|
112
113
|
update(deltaTime: number): void;
|
|
114
|
+
protected _updateTransformShaderData(context: RenderContext, worldMatrix: Matrix): void;
|
|
115
|
+
protected _updateMVPShaderData(context: RenderContext, worldMatrix: Matrix): void;
|
|
113
116
|
private _setMaterial;
|
|
114
117
|
}
|
|
@@ -27,7 +27,7 @@ export declare class AnimatorLayerMask {
|
|
|
27
27
|
* Removes a path mask from the AnimatorLayerMask.
|
|
28
28
|
* @param path - The path of the mask to remove
|
|
29
29
|
*/
|
|
30
|
-
removePathMask(path:
|
|
30
|
+
removePathMask(path: string): void;
|
|
31
31
|
/**
|
|
32
32
|
* Get a path mask based on the given path.
|
|
33
33
|
* @param path - The path of the mask to get
|
package/types/index.d.ts
CHANGED
|
@@ -30,6 +30,8 @@ export { DepthTextureMode } from "./enums/DepthTextureMode";
|
|
|
30
30
|
export { FogMode } from "./enums/FogMode";
|
|
31
31
|
export { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
32
32
|
export { CameraType } from "./enums/CameraType";
|
|
33
|
+
export { MSAASamples } from "./enums/MSAASamples";
|
|
34
|
+
export { Downsampling } from "./enums/Downsampling";
|
|
33
35
|
export { ColorSpace } from "./enums/ColorSpace";
|
|
34
36
|
export { BackgroundTextureFillMode } from "./enums/BackgroundTextureFillMode";
|
|
35
37
|
export { XRManager } from "./xr/XRManager";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BoundingBox } from "@galacean/engine-math";
|
|
2
2
|
import { Entity } from "../Entity";
|
|
3
|
+
import { RenderContext } from "../RenderPipeline/RenderContext";
|
|
3
4
|
import { MeshRenderer } from "./MeshRenderer";
|
|
4
5
|
import { Skin } from "./Skin";
|
|
5
6
|
/**
|
|
@@ -38,6 +39,7 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
|
|
|
38
39
|
*/
|
|
39
40
|
get bones(): ReadonlyArray<Entity>;
|
|
40
41
|
set bones(value: ReadonlyArray<Entity>);
|
|
42
|
+
_updateShaderData(context: RenderContext, onlyMVP: boolean): void;
|
|
41
43
|
private _checkBlendShapeWeightLength;
|
|
42
44
|
private _onLocalBoundsChanged;
|
|
43
45
|
private _getEntityHierarchyPath;
|
|
@@ -5,10 +5,10 @@ import { TextureCubeFace } from "../texture";
|
|
|
5
5
|
export interface IPlatformRenderTarget {
|
|
6
6
|
/**
|
|
7
7
|
* Set which face and mipLevel of the cube texture to render to.
|
|
8
|
-
* @param faceIndex - Cube texture face
|
|
9
8
|
* @param mipLevel - Set mip level the data want to write
|
|
9
|
+
* @param faceIndex - Cube texture face
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
activeRenderTarget(mipLevel: number, faceIndex?: TextureCubeFace): void;
|
|
12
12
|
/**
|
|
13
13
|
* Blit FBO.
|
|
14
14
|
*/
|
|
@@ -6,9 +6,9 @@ export declare class DepthState {
|
|
|
6
6
|
private static _getGLCompareFunction;
|
|
7
7
|
/** Whether to enable the depth test. */
|
|
8
8
|
enabled: boolean;
|
|
9
|
-
/** Whether the depth value can be written.*/
|
|
10
|
-
writeEnabled: boolean;
|
|
11
9
|
/** Depth comparison function. */
|
|
12
10
|
compareFunction: CompareFunction;
|
|
11
|
+
/** Whether the depth value can be written.*/
|
|
12
|
+
writeEnabled: boolean;
|
|
13
13
|
private _platformApply;
|
|
14
14
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GraphicsResource } from "../asset/GraphicsResource";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
3
|
import { RenderBufferDepthFormat } from "./enums/RenderBufferDepthFormat";
|
|
4
|
+
import { TextureFormat } from "./enums/TextureFormat";
|
|
4
5
|
import { Texture } from "./Texture";
|
|
5
6
|
/**
|
|
6
7
|
* The render target used for off-screen rendering.
|
|
@@ -43,10 +44,10 @@ export declare class RenderTarget extends GraphicsResource {
|
|
|
43
44
|
* @param width - Render target width
|
|
44
45
|
* @param height - Render target height
|
|
45
46
|
* @param colorTexture - Render color texture
|
|
46
|
-
* @param depthFormat - Depth format. default
|
|
47
|
+
* @param depthFormat - Depth format. default TextureFormat.Depth, engine will automatically select the supported precision
|
|
47
48
|
* @param antiAliasing - Anti-aliasing level, default is 1
|
|
48
49
|
*/
|
|
49
|
-
constructor(engine: Engine, width: number, height: number, colorTexture: Texture, depthFormat?:
|
|
50
|
+
constructor(engine: Engine, width: number, height: number, colorTexture: Texture, depthFormat?: TextureFormat | null | RenderBufferDepthFormat, antiAliasing?: number);
|
|
50
51
|
/**
|
|
51
52
|
* Create a render target through color texture and depth format.
|
|
52
53
|
* @remarks If the color texture is not transmitted, only the depth texture is generated.
|
|
@@ -64,10 +65,10 @@ export declare class RenderTarget extends GraphicsResource {
|
|
|
64
65
|
* @param width - Render target width
|
|
65
66
|
* @param height - Render target height
|
|
66
67
|
* @param colorTextures - Render color texture array
|
|
67
|
-
* @param depthFormat - Depth format. default
|
|
68
|
+
* @param depthFormat - Depth format. default TextureFormat.Depth,engine will automatically select the supported precision
|
|
68
69
|
* @param antiAliasing - Anti-aliasing level, default is 1
|
|
69
70
|
*/
|
|
70
|
-
constructor(engine: Engine, width: number, height: number, colorTextures: Texture[], depthFormat?:
|
|
71
|
+
constructor(engine: Engine, width: number, height: number, colorTextures: Texture[], depthFormat?: TextureFormat | null | RenderBufferDepthFormat, antiAliasing?: number);
|
|
71
72
|
/**
|
|
72
73
|
* Create a render target with color texture array and depth texture.
|
|
73
74
|
* @param engine - Define the engine to use for this off-screen rendering
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @deprecated Please use `TextureFormat` instead.
|
|
3
|
+
*
|
|
2
4
|
* Render buffer depth format enumeration.
|
|
3
5
|
*/
|
|
4
6
|
export declare enum RenderBufferDepthFormat {
|
|
5
7
|
/** Render to depth buffer,engine will automatically select the supported precision. */
|
|
6
|
-
Depth =
|
|
7
|
-
/** Render to depth stencil buffer, engine will automatically select the supported precision. */
|
|
8
|
-
DepthStencil = 1,
|
|
8
|
+
Depth = 27,
|
|
9
9
|
/** Render to stencil buffer. */
|
|
10
|
-
Stencil =
|
|
10
|
+
Stencil = 28,
|
|
11
|
+
/** Render to depth stencil buffer, engine will automatically select the supported precision. */
|
|
12
|
+
DepthStencil = 29,
|
|
11
13
|
/** Force 16-bit depth buffer. */
|
|
12
|
-
Depth16 =
|
|
14
|
+
Depth16 = 30,
|
|
13
15
|
/** Force 24-bit depth buffer. */
|
|
14
|
-
Depth24 =
|
|
16
|
+
Depth24 = 31,
|
|
15
17
|
/** Force 32-bit depth buffer. */
|
|
16
|
-
Depth32 =
|
|
18
|
+
Depth32 = 32,
|
|
17
19
|
/** Force 16-bit depth + 8-bit stencil buffer. */
|
|
18
|
-
Depth24Stencil8 =
|
|
20
|
+
Depth24Stencil8 = 33,
|
|
19
21
|
/** Force 32-bit depth + 8-bit stencil buffer. */
|
|
20
|
-
Depth32Stencil8 =
|
|
22
|
+
Depth32Stencil8 = 34
|
|
21
23
|
}
|
|
@@ -58,20 +58,22 @@ export declare enum TextureFormat {
|
|
|
58
58
|
ASTC_12x12 = 26,
|
|
59
59
|
/** Automatic depth format, engine will automatically select the supported precision. */
|
|
60
60
|
Depth = 27,
|
|
61
|
+
/** Render to stencil buffer. */
|
|
62
|
+
Stencil = 28,
|
|
61
63
|
/** Automatic depth stencil format, engine will automatically select the supported precision. */
|
|
62
|
-
DepthStencil =
|
|
64
|
+
DepthStencil = 29,
|
|
63
65
|
/** 16-bit depth format. */
|
|
64
|
-
Depth16 =
|
|
66
|
+
Depth16 = 30,
|
|
65
67
|
/** 24-bit depth format. */
|
|
66
|
-
Depth24 =
|
|
68
|
+
Depth24 = 31,
|
|
67
69
|
/** 32-bit depth format. */
|
|
68
|
-
Depth32 =
|
|
70
|
+
Depth32 = 32,
|
|
69
71
|
/** 16-bit depth + 8-bit stencil format. */
|
|
70
|
-
Depth24Stencil8 =
|
|
72
|
+
Depth24Stencil8 = 33,
|
|
71
73
|
/** 32-bit depth + 8-bit stencil format. */
|
|
72
|
-
Depth32Stencil8 =
|
|
74
|
+
Depth32Stencil8 = 34,
|
|
73
75
|
/** @deprecated Use `TextureFormat.BC1` instead. */
|
|
74
|
-
DXT1 =
|
|
76
|
+
DXT1 = 10,
|
|
75
77
|
/** @deprecated Use `TextureFormat.BC3` instead. */
|
|
76
|
-
DXT5 =
|
|
78
|
+
DXT5 = 11
|
|
77
79
|
}
|