@galacean/engine-core 1.2.0-beta.3 → 1.2.0-beta.5
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/LICENSE +2 -2
- package/dist/main.js +1345 -1244
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +1345 -1244
- package/dist/module.js +1345 -1244
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Deprecated.d.ts +101 -0
- package/types/Entity.d.ts +1 -1
- package/types/RenderPipeline/RenderPass.d.ts +55 -0
- package/types/RenderPipeline/batcher/MeshBuffer.d.ts +1 -0
- package/types/clone/ComponentCloner.d.ts +1 -1
- package/types/mesh/Skin.d.ts +25 -9
- package/types/mesh/SkinnedMeshRenderer.d.ts +15 -24
- package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +6 -0
- package/types/texture/enums/PixelFormat.d.ts +73 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.2.0-beta.
|
|
3
|
+
"version": "1.2.0-beta.5",
|
|
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-beta.
|
|
18
|
+
"@galacean/engine-math": "1.2.0-beta.5"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.2.0-beta.
|
|
21
|
+
"@galacean/engine-design": "1.2.0-beta.5"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Please use `PixelFormat` instead.
|
|
3
|
+
* Defines various pixel formats.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum TextureFormat {
|
|
6
|
+
/** RGB format, 8 bits per channel. */
|
|
7
|
+
R8G8B8 = 0,
|
|
8
|
+
/** RGBA format, 8 bits per channel. */
|
|
9
|
+
R8G8B8A8 = 1,
|
|
10
|
+
/** RGBA format, 4 bits per channel. */
|
|
11
|
+
R4G4B4A4 = 2,
|
|
12
|
+
/** RGBA format, 5 bits in R channel, 5 bits in G channel, 5 bits in B channel, 1 bit in A channel. */
|
|
13
|
+
R5G5B5A1 = 3,
|
|
14
|
+
/** RGB format, 5 bits in R channel, 6 bits in G channel, 5 bits in B channel. */
|
|
15
|
+
R5G6B5 = 4,
|
|
16
|
+
/** Transparent format, 8 bits. */
|
|
17
|
+
Alpha8 = 5,
|
|
18
|
+
/** Luminance/alpha in RGB channel, alpha in A channel. */
|
|
19
|
+
LuminanceAlpha = 6,
|
|
20
|
+
/** RGBA format, 16 bits per channel. */
|
|
21
|
+
R16G16B16A16 = 7,
|
|
22
|
+
/** RGBA format, 32 bits per channel. */
|
|
23
|
+
R32G32B32A32 = 8,
|
|
24
|
+
/** RGB compressed format, 4 bits per pixel. */
|
|
25
|
+
BC1 = 9,
|
|
26
|
+
/** RGBA compressed format, 8 bits per pixel. */
|
|
27
|
+
BC3 = 10,
|
|
28
|
+
/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
|
|
29
|
+
BC7 = 11,
|
|
30
|
+
/** RGB compressed format, 4 bits per pixel. */
|
|
31
|
+
ETC1_RGB = 12,
|
|
32
|
+
/** RGB compressed format, 4 bits per pixel. */
|
|
33
|
+
ETC2_RGB = 13,
|
|
34
|
+
/** RGBA compressed format, 5 bits per pixel, 4 bit in RGB, 1 bit in A. */
|
|
35
|
+
ETC2_RGBA5 = 14,
|
|
36
|
+
/** RGB compressed format, 8 bits per pixel. */
|
|
37
|
+
ETC2_RGBA8 = 15,
|
|
38
|
+
/** RGB compressed format, 2 bits per pixel. */
|
|
39
|
+
PVRTC_RGB2 = 16,
|
|
40
|
+
/** RGBA compressed format, 2 bits per pixel. */
|
|
41
|
+
PVRTC_RGBA2 = 17,
|
|
42
|
+
/** RGB compressed format, 4 bits per pixel. */
|
|
43
|
+
PVRTC_RGB4 = 18,
|
|
44
|
+
/** RGBA compressed format, 4 bits per pixel. */
|
|
45
|
+
PVRTC_RGBA4 = 19,
|
|
46
|
+
/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
|
|
47
|
+
ASTC_4x4 = 20,
|
|
48
|
+
/** RGB(A) compressed format, 128 bits per 5x5 pixel block. */
|
|
49
|
+
ASTC_5x5 = 21,
|
|
50
|
+
/** RGB(A) compressed format, 128 bits per 6x6 pixel block. */
|
|
51
|
+
ASTC_6x6 = 22,
|
|
52
|
+
/** RGB(A) compressed format, 128 bits per 8x8 pixel block. */
|
|
53
|
+
ASTC_8x8 = 23,
|
|
54
|
+
/** RGB(A) compressed format, 128 bits per 10x10 pixel block. */
|
|
55
|
+
ASTC_10x10 = 24,
|
|
56
|
+
/** RGB(A) compressed format, 128 bits per 12x12 pixel block. */
|
|
57
|
+
ASTC_12x12 = 25,
|
|
58
|
+
/** Automatic depth format, engine will automatically select the supported precision. */
|
|
59
|
+
Depth = 26,
|
|
60
|
+
/** Render to stencil buffer. */
|
|
61
|
+
Stencil = 27,
|
|
62
|
+
/** Automatic depth stencil format, engine will automatically select the supported precision. */
|
|
63
|
+
DepthStencil = 28,
|
|
64
|
+
/** 16-bit depth format. */
|
|
65
|
+
Depth16 = 29,
|
|
66
|
+
/** 24-bit depth format. */
|
|
67
|
+
Depth24 = 30,
|
|
68
|
+
/** 32-bit depth format. */
|
|
69
|
+
Depth32 = 31,
|
|
70
|
+
/** 16-bit depth + 8-bit stencil format. */
|
|
71
|
+
Depth24Stencil8 = 32,
|
|
72
|
+
/** 32-bit depth + 8-bit stencil format. */
|
|
73
|
+
Depth32Stencil8 = 33,
|
|
74
|
+
/** @deprecated Use `PixelFormat.BC1` instead. */
|
|
75
|
+
DXT1 = 9,
|
|
76
|
+
/** @deprecated Use `PixelFormat.BC3` instead. */
|
|
77
|
+
DXT5 = 10
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated Use `PixelFormat` instead.
|
|
81
|
+
*
|
|
82
|
+
* Render buffer depth format enumeration.
|
|
83
|
+
*/
|
|
84
|
+
export declare enum RenderBufferDepthFormat {
|
|
85
|
+
/** Render to depth buffer,engine will automatically select the supported precision. */
|
|
86
|
+
Depth = 26,
|
|
87
|
+
/** Render to stencil buffer. */
|
|
88
|
+
Stencil = 27,
|
|
89
|
+
/** Render to depth stencil buffer, engine will automatically select the supported precision. */
|
|
90
|
+
DepthStencil = 28,
|
|
91
|
+
/** Force 16-bit depth buffer. */
|
|
92
|
+
Depth16 = 29,
|
|
93
|
+
/** Force 24-bit depth buffer. */
|
|
94
|
+
Depth24 = 30,
|
|
95
|
+
/** Force 32-bit depth buffer. */
|
|
96
|
+
Depth32 = 31,
|
|
97
|
+
/** Force 16-bit depth + 8-bit stencil buffer. */
|
|
98
|
+
Depth24Stencil8 = 32,
|
|
99
|
+
/** Force 32-bit depth + 8-bit stencil buffer. */
|
|
100
|
+
Depth32Stencil8 = 33
|
|
101
|
+
}
|
package/types/Entity.d.ts
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Color } from "@galacean/engine-math";
|
|
2
|
+
import { Camera } from "../Camera";
|
|
3
|
+
import { CameraClearFlags } from "../enums/CameraClearFlags";
|
|
4
|
+
import { Layer } from "../Layer";
|
|
5
|
+
import { Material } from "../material/Material";
|
|
6
|
+
import { RenderTarget } from "../texture/RenderTarget";
|
|
7
|
+
import { RenderQueue } from "./RenderQueue";
|
|
8
|
+
/**
|
|
9
|
+
* RenderPass.
|
|
10
|
+
*/
|
|
11
|
+
declare class RenderPass {
|
|
12
|
+
name: string;
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
priority: number;
|
|
15
|
+
renderTarget: RenderTarget;
|
|
16
|
+
replaceMaterial: Material;
|
|
17
|
+
mask: Layer;
|
|
18
|
+
renderOverride: boolean;
|
|
19
|
+
clearFlags: CameraClearFlags | undefined;
|
|
20
|
+
clearColor: Color | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Create a RenderPass.
|
|
23
|
+
* @param name - Pass name
|
|
24
|
+
* @param priority - Priority, less than 0 before the default pass, greater than 0 after the default pass
|
|
25
|
+
* @param renderTarget - The specified Render Target
|
|
26
|
+
* @param replaceMaterial - Replaced material
|
|
27
|
+
* @param mask - Perform bit and operations with Entity.Layer to filter the objects that this Pass needs to render
|
|
28
|
+
*/
|
|
29
|
+
constructor(name?: string, priority?: number, renderTarget?: any, replaceMaterial?: any, mask?: any);
|
|
30
|
+
/**
|
|
31
|
+
* Rendering callback, will be executed if renderOverride is set to true.
|
|
32
|
+
* @param camera - Camera
|
|
33
|
+
* @param opaqueQueue - Opaque queue
|
|
34
|
+
* @param alphaTestQueue - Alpha test queue
|
|
35
|
+
* @param transparentQueue - Transparent queue
|
|
36
|
+
*/
|
|
37
|
+
render(camera: Camera, opaqueQueue: RenderQueue, alphaTestQueue: RenderQueue, transparentQueue: RenderQueue): void;
|
|
38
|
+
/**
|
|
39
|
+
* Post rendering callback.
|
|
40
|
+
* @param camera - Camera
|
|
41
|
+
* @param opaqueQueue - Opaque queue
|
|
42
|
+
* @param alphaTestQueue - Alpha test queue
|
|
43
|
+
* @param transparentQueue - Transparent queue
|
|
44
|
+
*/
|
|
45
|
+
preRender(camera: Camera, opaqueQueue: RenderQueue, alphaTestQueue: RenderQueue, transparentQueue: RenderQueue): void;
|
|
46
|
+
/**
|
|
47
|
+
* Post rendering callback.
|
|
48
|
+
* @param camera - Camera
|
|
49
|
+
* @param opaqueQueue - Opaque queue
|
|
50
|
+
* @param alphaTestQueue - Alpha test queue
|
|
51
|
+
* @param transparentQueue - Transparent queue
|
|
52
|
+
*/
|
|
53
|
+
postRender(camera: Camera, opaqueQueue: RenderQueue, alphaTestQueue: RenderQueue, transparentQueue: RenderQueue): void;
|
|
54
|
+
}
|
|
55
|
+
export { RenderPass };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,5 +13,5 @@ export declare class ComponentCloner {
|
|
|
13
13
|
* @param source - Clone source
|
|
14
14
|
* @param target - Clone target
|
|
15
15
|
*/
|
|
16
|
-
static cloneComponent(source: Component, target: Component, srcRoot: Entity, targetRoot: Entity): void;
|
|
16
|
+
static cloneComponent(source: Component, target: Component, srcRoot: Entity, targetRoot: Entity, deepInstanceMap: Map<Object, Object>): void;
|
|
17
17
|
}
|
package/types/mesh/Skin.d.ts
CHANGED
|
@@ -1,19 +1,35 @@
|
|
|
1
1
|
import { Matrix } from "@galacean/engine-math";
|
|
2
|
-
import { EngineObject } from "../base/EngineObject";
|
|
3
2
|
import { Entity } from "../Entity";
|
|
3
|
+
import { EngineObject } from "../base/EngineObject";
|
|
4
|
+
import { IComponentCustomClone } from "../clone/ComponentCloner";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* Skin used for skinned mesh renderer.
|
|
6
7
|
*/
|
|
7
|
-
export declare class Skin extends EngineObject {
|
|
8
|
+
export declare class Skin extends EngineObject implements IComponentCustomClone {
|
|
8
9
|
name: string;
|
|
10
|
+
/** Inverse bind matrices. */
|
|
9
11
|
inverseBindMatrices: Matrix[];
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
_bones: Entity[];
|
|
12
|
+
private _rootBone;
|
|
13
|
+
private _bones;
|
|
14
|
+
private _updateMark;
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @param name - name
|
|
16
|
+
* Root bone.
|
|
17
17
|
*/
|
|
18
|
+
get rootBone(): Entity;
|
|
19
|
+
set rootBone(value: Entity);
|
|
20
|
+
/**
|
|
21
|
+
* Bones of the skin.
|
|
22
|
+
*/
|
|
23
|
+
get bones(): ReadonlyArray<Entity>;
|
|
24
|
+
set bones(value: ReadonlyArray<Entity>);
|
|
18
25
|
constructor(name: string);
|
|
26
|
+
/** @deprecated Please use `bones` instead. */
|
|
27
|
+
joints: string[];
|
|
28
|
+
/** @deprecated Please use `rootBone` instead. */
|
|
29
|
+
get skeleton(): string;
|
|
30
|
+
set skeleton(value: string);
|
|
31
|
+
}
|
|
32
|
+
export declare enum SkinUpdateFlag {
|
|
33
|
+
BoneCountChanged = 0,
|
|
34
|
+
RootBoneChanged = 1
|
|
19
35
|
}
|
|
@@ -14,10 +14,13 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
|
|
|
14
14
|
private _jointDataCreateCache;
|
|
15
15
|
private _blendShapeWeights;
|
|
16
16
|
private _maxVertexUniformVectors;
|
|
17
|
-
private _rootBone;
|
|
18
|
-
private _jointMatrices;
|
|
19
17
|
private _jointTexture;
|
|
20
|
-
private
|
|
18
|
+
private _skin;
|
|
19
|
+
/**
|
|
20
|
+
* Skin of the SkinnedMeshRenderer.
|
|
21
|
+
*/
|
|
22
|
+
get skin(): Skin;
|
|
23
|
+
set skin(value: Skin);
|
|
21
24
|
/**
|
|
22
25
|
* The weights of the BlendShapes.
|
|
23
26
|
* @remarks Array index is BlendShape index.
|
|
@@ -29,31 +32,19 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
|
|
|
29
32
|
*/
|
|
30
33
|
get localBounds(): BoundingBox;
|
|
31
34
|
set localBounds(value: BoundingBox);
|
|
35
|
+
_updateShaderData(context: RenderContext, onlyMVP: boolean): void;
|
|
36
|
+
private _checkBlendShapeWeightLength;
|
|
37
|
+
private _onLocalBoundsChanged;
|
|
38
|
+
private _onSkinUpdated;
|
|
39
|
+
private _applySkin;
|
|
32
40
|
/**
|
|
33
|
-
*
|
|
41
|
+
* @deprecated use {@link SkinnedMeshRenderer.skin.rootBone} instead.
|
|
34
42
|
*/
|
|
35
43
|
get rootBone(): Entity;
|
|
36
44
|
set rootBone(value: Entity);
|
|
37
45
|
/**
|
|
38
|
-
*
|
|
46
|
+
* @deprecated use {@link SkinnedMeshRenderer.skin.bones} instead.
|
|
39
47
|
*/
|
|
40
|
-
get bones():
|
|
41
|
-
set bones(value:
|
|
42
|
-
_updateShaderData(context: RenderContext, onlyMVP: boolean): void;
|
|
43
|
-
private _checkBlendShapeWeightLength;
|
|
44
|
-
private _onLocalBoundsChanged;
|
|
45
|
-
private _getEntityHierarchyPath;
|
|
46
|
-
private _skin;
|
|
47
|
-
/**
|
|
48
|
-
* @deprecated
|
|
49
|
-
* Skin Object.
|
|
50
|
-
*
|
|
51
|
-
* If you want get `skeleton`, use {@link SkinnedMeshRenderer.rootBone} instead.
|
|
52
|
-
* If you want get `bones`, use {@link SkinnedMeshRenderer.bones} instead.
|
|
53
|
-
* `inverseBindMatrices` will migrate to mesh in the future.
|
|
54
|
-
*
|
|
55
|
-
* @remarks `rootBone` and `bones` will not update when `skin` changed.
|
|
56
|
-
*/
|
|
57
|
-
get skin(): Skin;
|
|
58
|
-
set skin(value: Skin);
|
|
48
|
+
get bones(): Readonly<Entity[]>;
|
|
49
|
+
set bones(value: Readonly<Entity[]>);
|
|
59
50
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines various pixel formats.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum PixelFormat {
|
|
5
|
+
/** RGB format, 8 bits per channel. */
|
|
6
|
+
R8G8B8 = 0,
|
|
7
|
+
/** RGBA format, 8 bits per channel. */
|
|
8
|
+
R8G8B8A8 = 1,
|
|
9
|
+
/** RGBA format, 4 bits per channel. */
|
|
10
|
+
R4G4B4A4 = 2,
|
|
11
|
+
/** RGBA format, 5 bits in R channel, 5 bits in G channel, 5 bits in B channel, 1 bit in A channel. */
|
|
12
|
+
R5G5B5A1 = 3,
|
|
13
|
+
/** RGB format, 5 bits in R channel, 6 bits in G channel, 5 bits in B channel. */
|
|
14
|
+
R5G6B5 = 4,
|
|
15
|
+
/** Transparent format, 8 bits. */
|
|
16
|
+
Alpha8 = 5,
|
|
17
|
+
/** Luminance/alpha in RGB channel, alpha in A channel. */
|
|
18
|
+
LuminanceAlpha = 6,
|
|
19
|
+
/** RGBA format, 16 bits per channel. */
|
|
20
|
+
R16G16B16A16 = 7,
|
|
21
|
+
/** RGBA format, 32 bits per channel. */
|
|
22
|
+
R32G32B32A32 = 8,
|
|
23
|
+
/** RGB compressed format, 4 bits per pixel. */
|
|
24
|
+
BC1 = 9,
|
|
25
|
+
/** RGBA compressed format, 8 bits per pixel. */
|
|
26
|
+
BC3 = 10,
|
|
27
|
+
/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
|
|
28
|
+
BC7 = 11,
|
|
29
|
+
/** RGB compressed format, 4 bits per pixel. */
|
|
30
|
+
ETC1_RGB = 12,
|
|
31
|
+
/** RGB compressed format, 4 bits per pixel. */
|
|
32
|
+
ETC2_RGB = 13,
|
|
33
|
+
/** RGBA compressed format, 5 bits per pixel, 4 bit in RGB, 1 bit in A. */
|
|
34
|
+
ETC2_RGBA5 = 14,
|
|
35
|
+
/** RGB compressed format, 8 bits per pixel. */
|
|
36
|
+
ETC2_RGBA8 = 15,
|
|
37
|
+
/** RGB compressed format, 2 bits per pixel. */
|
|
38
|
+
PVRTC_RGB2 = 16,
|
|
39
|
+
/** RGBA compressed format, 2 bits per pixel. */
|
|
40
|
+
PVRTC_RGBA2 = 17,
|
|
41
|
+
/** RGB compressed format, 4 bits per pixel. */
|
|
42
|
+
PVRTC_RGB4 = 18,
|
|
43
|
+
/** RGBA compressed format, 4 bits per pixel. */
|
|
44
|
+
PVRTC_RGBA4 = 19,
|
|
45
|
+
/** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
|
|
46
|
+
ASTC_4x4 = 20,
|
|
47
|
+
/** RGB(A) compressed format, 128 bits per 5x5 pixel block. */
|
|
48
|
+
ASTC_5x5 = 21,
|
|
49
|
+
/** RGB(A) compressed format, 128 bits per 6x6 pixel block. */
|
|
50
|
+
ASTC_6x6 = 22,
|
|
51
|
+
/** RGB(A) compressed format, 128 bits per 8x8 pixel block. */
|
|
52
|
+
ASTC_8x8 = 23,
|
|
53
|
+
/** RGB(A) compressed format, 128 bits per 10x10 pixel block. */
|
|
54
|
+
ASTC_10x10 = 24,
|
|
55
|
+
/** RGB(A) compressed format, 128 bits per 12x12 pixel block. */
|
|
56
|
+
ASTC_12x12 = 25,
|
|
57
|
+
/** Automatic depth format, engine will automatically select the supported precision. */
|
|
58
|
+
Depth = 26,
|
|
59
|
+
/** Render to stencil buffer. */
|
|
60
|
+
Stencil = 27,
|
|
61
|
+
/** Automatic depth stencil format, engine will automatically select the supported precision. */
|
|
62
|
+
DepthStencil = 28,
|
|
63
|
+
/** 16-bit depth format. */
|
|
64
|
+
Depth16 = 29,
|
|
65
|
+
/** 24-bit depth format. */
|
|
66
|
+
Depth24 = 30,
|
|
67
|
+
/** 32-bit depth format. */
|
|
68
|
+
Depth32 = 31,
|
|
69
|
+
/** 16-bit depth + 8-bit stencil format. */
|
|
70
|
+
Depth24Stencil8 = 32,
|
|
71
|
+
/** 32-bit depth + 8-bit stencil format. */
|
|
72
|
+
Depth32Stencil8 = 33
|
|
73
|
+
}
|