@galacean/engine-core 1.2.0-beta.6 → 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 +18802 -16268
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +18802 -16268
- package/dist/module.js +18798 -16269
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/sprite/SpriteMask.d.ts +11 -0
- package/types/2d/sprite/SpriteRenderer.d.ts +6 -3
- package/types/2d/text/TextRenderer.d.ts +10 -4
- package/types/Camera.d.ts +11 -3
- package/types/Deprecated.d.ts +101 -0
- package/types/Engine.d.ts +3 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +11 -5
- package/types/RenderPipeline/BatchUtils.d.ts +1 -0
- package/types/RenderPipeline/BatcherManager.d.ts +1 -12
- package/types/RenderPipeline/Chunk.d.ts +1 -0
- package/types/RenderPipeline/MaskManager.d.ts +1 -0
- package/types/RenderPipeline/PipelinePass.d.ts +1 -1
- package/types/RenderPipeline/PrimitiveChunk.d.ts +1 -0
- package/types/RenderPipeline/PrimitiveChunkManager.d.ts +1 -0
- package/types/RenderPipeline/RenderElement.d.ts +9 -6
- package/types/RenderPipeline/RenderQueue.d.ts +1 -30
- package/types/RenderPipeline/SubPrimitiveChunk.d.ts +1 -0
- package/types/RenderPipeline/SubRenderElement.d.ts +22 -0
- package/types/RenderPipeline/VertexArea.d.ts +1 -0
- package/types/RenderPipeline/batcher/MeshBuffer.d.ts +1 -0
- package/types/RenderPipeline/enums/RenderBufferStoreAction.d.ts +13 -0
- package/types/RenderPipeline/index.d.ts +1 -1
- package/types/Renderer.d.ts +4 -3
- package/types/Scene.d.ts +6 -0
- package/types/animation/Animator.d.ts +35 -6
- package/types/animation/AnimatorCondition.d.ts +13 -0
- package/types/animation/AnimatorController.d.ts +32 -2
- package/types/animation/AnimatorControllerParameter.d.ts +10 -0
- package/types/animation/AnimatorState.d.ts +15 -5
- package/types/animation/AnimatorStateMachine.d.ts +44 -0
- package/types/animation/AnimatorStateTransition.d.ts +51 -0
- package/types/animation/enums/AnimatorConditionMode.d.ts +9 -0
- package/types/animation/index.d.ts +1 -1
- package/types/asset/AssetType.d.ts +2 -0
- package/types/graphic/SubMesh.d.ts +3 -16
- package/types/graphic/SubPrimitive.d.ts +10 -0
- package/types/graphic/index.d.ts +1 -0
- package/types/index.d.ts +2 -1
- package/types/material/BaseMaterial.d.ts +1 -1
- package/types/mesh/SkinnedMeshRenderer.d.ts +1 -1
- package/types/particle/ParticleGenerator.d.ts +20 -0
- package/types/particle/ParticleRenderer.d.ts +3 -1
- package/types/particle/modules/EmissionModule.d.ts +6 -2
- package/types/particle/modules/MainModule.d.ts +49 -15
- package/types/particle/modules/ParticleCompositeCurve.d.ts +35 -10
- package/types/particle/modules/ParticleCurve.d.ts +16 -9
- package/types/particle/modules/ParticleGeneratorModule.d.ts +6 -2
- package/types/particle/modules/SizeOverLifetimeModule.d.ts +27 -8
- package/types/particle/modules/VelocityOverLifetimeModule.d.ts +29 -8
- package/types/particle/modules/shape/BaseShape.d.ts +14 -4
- package/types/particle/modules/shape/BoxShape.d.ts +7 -2
- package/types/particle/modules/shape/CircleShape.d.ts +25 -8
- package/types/particle/modules/shape/ConeShape.d.ts +24 -8
- package/types/particle/modules/shape/HemisphereShape.d.ts +6 -2
- package/types/particle/modules/shape/SphereShape.d.ts +6 -2
- 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/ShaderDataGroup.d.ts +4 -2
- package/types/shader/enums/ShaderPlatformTarget.d.ts +4 -0
- package/types/shader/enums/ShaderType.d.ts +1 -0
- package/types/shader/state/RenderState.d.ts +1 -0
- package/types/texture/enums/PixelFormat.d.ts +73 -0
- package/types/texture/enums/TextureFormat.d.ts +2 -0
- package/types/utils/ClearableObjectPool.d.ts +16 -0
- package/types/utils/ObjectPool.d.ts +16 -0
- package/types/utils/ReturnableObjectPool.d.ts +16 -0
- package/types/utils/index.d.ts +3 -0
- package/types/input/pointer/PointerEvent.d.ts +0 -4
- package/types/input/pointer/PointerEventType.d.ts +0 -7
- package/types/ui/Image.d.ts +0 -41
- package/types/ui/RedBlackTree.d.ts +0 -2
- package/types/ui/UICanvas.d.ts +0 -49
- package/types/ui/UIRenderer.d.ts +0 -20
- package/types/ui/UITransform.d.ts +0 -20
- package/types/ui/enums/BlockingObjects.d.ts +0 -6
- package/types/ui/enums/CanvasRenderMode.d.ts +0 -8
- package/types/ui/enums/ResolutionAdaptationStrategy.d.ts +0 -10
- package/types/ui/index.d.ts +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.
|
|
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.
|
|
18
|
+
"@galacean/engine-math": "1.3.0-alpha.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.
|
|
21
|
+
"@galacean/engine-design": "1.3.0-alpha.1"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { BoundingBox } from "@galacean/engine-math";
|
|
2
|
+
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
1
3
|
import { Renderer } from "../../Renderer";
|
|
2
4
|
import { Sprite } from "./Sprite";
|
|
3
5
|
/**
|
|
@@ -52,6 +54,15 @@ export declare class SpriteMask extends Renderer {
|
|
|
52
54
|
*/
|
|
53
55
|
get alphaCutoff(): number;
|
|
54
56
|
set alphaCutoff(value: number);
|
|
57
|
+
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
58
|
+
/**
|
|
59
|
+
* @inheritdoc
|
|
60
|
+
*/
|
|
61
|
+
protected _render(context: RenderContext): void;
|
|
62
|
+
/**
|
|
63
|
+
* @inheritdoc
|
|
64
|
+
*/
|
|
65
|
+
protected _onDestroy(): void;
|
|
55
66
|
private _calDefaultSize;
|
|
56
67
|
private _onSpriteChange;
|
|
57
68
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Color } from "@galacean/engine-math";
|
|
1
|
+
import { BoundingBox, Color } from "@galacean/engine-math";
|
|
2
|
+
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
2
3
|
import { Renderer } from "../../Renderer";
|
|
3
4
|
import { SpriteDrawMode } from "../enums/SpriteDrawMode";
|
|
4
5
|
import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
|
|
@@ -20,8 +21,6 @@ export declare class SpriteRenderer extends Renderer {
|
|
|
20
21
|
private _customHeight;
|
|
21
22
|
private _flipX;
|
|
22
23
|
private _flipY;
|
|
23
|
-
private _maskLayer;
|
|
24
|
-
private _maskInteraction;
|
|
25
24
|
/**
|
|
26
25
|
* The draw mode of the sprite renderer.
|
|
27
26
|
*/
|
|
@@ -85,7 +84,11 @@ export declare class SpriteRenderer extends Renderer {
|
|
|
85
84
|
*/
|
|
86
85
|
get maskInteraction(): SpriteMaskInteraction;
|
|
87
86
|
set maskInteraction(value: SpriteMaskInteraction);
|
|
87
|
+
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
88
|
+
protected _render(context: RenderContext): void;
|
|
89
|
+
protected _onDestroy(): void;
|
|
88
90
|
private _calDefaultSize;
|
|
89
91
|
private _updateStencilState;
|
|
90
92
|
private _onSpriteChange;
|
|
93
|
+
private _onColorChanged;
|
|
91
94
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BoundingBox, Color } from "@galacean/engine-math";
|
|
2
2
|
import { Entity } from "../../Entity";
|
|
3
|
+
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
3
4
|
import { Renderer } from "../../Renderer";
|
|
4
5
|
import { FontStyle } from "../enums/FontStyle";
|
|
5
6
|
import { SpriteMaskInteraction } from "../enums/SpriteMaskInteraction";
|
|
@@ -10,10 +11,11 @@ import { Font } from "./Font";
|
|
|
10
11
|
* Renders a text for 2D graphics.
|
|
11
12
|
*/
|
|
12
13
|
export declare class TextRenderer extends Renderer {
|
|
13
|
-
private static
|
|
14
|
+
private static _textureProperty;
|
|
14
15
|
private static _tempVec30;
|
|
15
16
|
private static _tempVec31;
|
|
16
|
-
|
|
17
|
+
private static _worldPositions;
|
|
18
|
+
private static _charRenderInfos;
|
|
17
19
|
private _color;
|
|
18
20
|
private _text;
|
|
19
21
|
private _width;
|
|
@@ -27,8 +29,6 @@ export declare class TextRenderer extends Renderer {
|
|
|
27
29
|
private _verticalAlignment;
|
|
28
30
|
private _enableWrapping;
|
|
29
31
|
private _overflowMode;
|
|
30
|
-
private _maskInteraction;
|
|
31
|
-
private _maskLayer;
|
|
32
32
|
/**
|
|
33
33
|
* Rendering color for the Text.
|
|
34
34
|
*/
|
|
@@ -104,9 +104,15 @@ export declare class TextRenderer extends Renderer {
|
|
|
104
104
|
*/
|
|
105
105
|
get bounds(): BoundingBox;
|
|
106
106
|
constructor(entity: Entity);
|
|
107
|
+
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
108
|
+
protected _render(context: RenderContext): void;
|
|
107
109
|
private _updateStencilState;
|
|
108
110
|
private _resetSubFont;
|
|
109
111
|
private _updatePosition;
|
|
112
|
+
private _updateColor;
|
|
110
113
|
private _updateLocalData;
|
|
111
114
|
private _isTextNoVisible;
|
|
115
|
+
private _buildChunk;
|
|
116
|
+
private _freeTextChunks;
|
|
117
|
+
private _onColorChanged;
|
|
112
118
|
}
|
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
|
}
|
|
@@ -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/Engine.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { ResourceManager } from "./asset/ResourceManager";
|
|
|
7
7
|
import { EventDispatcher, Time } from "./base";
|
|
8
8
|
import { ColorSpace } from "./enums/ColorSpace";
|
|
9
9
|
import { InputManager } from "./input";
|
|
10
|
+
import { ParticleBufferUtils } from "./particle/ParticleBufferUtils";
|
|
10
11
|
import { PhysicsScene } from "./physics/PhysicsScene";
|
|
11
12
|
import { XRManager } from "./xr/XRManager";
|
|
12
13
|
/**
|
|
@@ -17,6 +18,7 @@ export declare class Engine extends EventDispatcher {
|
|
|
17
18
|
readonly inputManager: InputManager;
|
|
18
19
|
/** XR manager of Engine. */
|
|
19
20
|
readonly xrManager: XRManager;
|
|
21
|
+
_particleBufferUtils: ParticleBufferUtils;
|
|
20
22
|
private _settings;
|
|
21
23
|
private _resourceManager;
|
|
22
24
|
private _sceneManager;
|
|
@@ -117,6 +119,7 @@ export declare class Engine extends EventDispatcher {
|
|
|
117
119
|
destroy(): void;
|
|
118
120
|
private _createSpriteMaterial;
|
|
119
121
|
private _createSpriteMaskMaterial;
|
|
122
|
+
private _createTextMaterial;
|
|
120
123
|
private _onDeviceLost;
|
|
121
124
|
private _onDeviceRestored;
|
|
122
125
|
private _gc;
|
|
@@ -2,7 +2,7 @@ import { Camera } from "../Camera";
|
|
|
2
2
|
import { CameraClearFlags } from "../enums/CameraClearFlags";
|
|
3
3
|
import { TextureCubeFace } from "../texture";
|
|
4
4
|
import { RenderContext } from "./RenderContext";
|
|
5
|
-
import {
|
|
5
|
+
import { RenderElement } from "./RenderElement";
|
|
6
6
|
/**
|
|
7
7
|
* Basic render pipeline.
|
|
8
8
|
*/
|
|
@@ -34,11 +34,17 @@ export declare class BasicRenderPipeline {
|
|
|
34
34
|
/**
|
|
35
35
|
* Push render data to render queue.
|
|
36
36
|
* @param context - Render context
|
|
37
|
-
* @param
|
|
37
|
+
* @param renderElement - Render element
|
|
38
38
|
*/
|
|
39
|
-
|
|
40
|
-
private
|
|
39
|
+
pushRenderElement(context: RenderContext, renderElement: RenderElement): void;
|
|
40
|
+
private pushRenderElementByType;
|
|
41
41
|
private _drawBackgroundTexture;
|
|
42
42
|
private _prepareRender;
|
|
43
|
-
|
|
43
|
+
}
|
|
44
|
+
export declare enum RenderQueueFlags {
|
|
45
|
+
None = 0,
|
|
46
|
+
Opaque = 1,
|
|
47
|
+
AlphaTest = 2,
|
|
48
|
+
Transparent = 4,
|
|
49
|
+
All = 7
|
|
44
50
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { RenderContext } from "./RenderContext";
|
|
3
|
-
import { RenderData } from "./RenderData";
|
|
4
|
-
import { RenderElement } from "./RenderElement";
|
|
5
|
-
export declare class BatcherManager {
|
|
6
|
-
constructor(engine: Engine);
|
|
7
|
-
destroy(): void;
|
|
8
|
-
commitRenderData(context: RenderContext, data: RenderData): void;
|
|
9
|
-
batch(elements: Array<RenderElement>, batchedElements: Array<RenderElement>): void;
|
|
10
|
-
uploadBuffer(): void;
|
|
11
|
-
clear(): void;
|
|
12
|
-
}
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { IPoolElement } from "../utils/ObjectPool";
|
|
2
|
+
import { RenderQueueFlags } from "./BasicRenderPipeline";
|
|
3
|
+
import { SubRenderElement } from "./SubRenderElement";
|
|
4
4
|
export declare class RenderElement implements IPoolElement {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
priority: number;
|
|
6
|
+
distanceForSort: number;
|
|
7
|
+
subRenderElements: SubRenderElement[];
|
|
8
|
+
renderQueueFlags: RenderQueueFlags;
|
|
9
|
+
set(priority: number, distanceForSort: number): void;
|
|
10
|
+
addSubRenderElement(element: SubRenderElement): void;
|
|
8
11
|
dispose(): void;
|
|
9
12
|
}
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Engine } from "../Engine";
|
|
3
|
-
import { RenderQueueType } from "../shader";
|
|
4
|
-
import { RenderElement } from "./RenderElement";
|
|
5
|
-
/**
|
|
6
|
-
* Render queue.
|
|
7
|
-
*/
|
|
8
|
-
export declare class RenderQueue {
|
|
9
|
-
readonly elements: RenderElement[];
|
|
10
|
-
private _spriteBatcher;
|
|
11
|
-
private readonly _renderQueueType;
|
|
12
|
-
constructor(engine: Engine, renderQueueType: RenderQueueType);
|
|
13
|
-
/**
|
|
14
|
-
* Push a render element.
|
|
15
|
-
*/
|
|
16
|
-
pushRenderElement(element: RenderElement): void;
|
|
17
|
-
render(camera: Camera, pipelineStageTagValue: string): void;
|
|
18
|
-
/**
|
|
19
|
-
* Clear collection.
|
|
20
|
-
*/
|
|
21
|
-
clear(): void;
|
|
22
|
-
/**
|
|
23
|
-
* Destroy internal resources.
|
|
24
|
-
*/
|
|
25
|
-
destroy(): void;
|
|
26
|
-
/**
|
|
27
|
-
* Sort the elements.
|
|
28
|
-
*/
|
|
29
|
-
sort(compareFunc: Function): void;
|
|
30
|
-
}
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Renderer } from "../Renderer";
|
|
2
|
+
import { Primitive, SubMesh } from "../graphic";
|
|
3
|
+
import { Material } from "../material";
|
|
4
|
+
import { ShaderData, ShaderPass } from "../shader";
|
|
5
|
+
import { Texture2D } from "../texture";
|
|
6
|
+
import { IPoolElement } from "../utils/ObjectPool";
|
|
7
|
+
import { RenderQueueFlags } from "./BasicRenderPipeline";
|
|
8
|
+
import { SubPrimitiveChunk } from "./SubPrimitiveChunk";
|
|
9
|
+
export declare class SubRenderElement implements IPoolElement {
|
|
10
|
+
component: Renderer;
|
|
11
|
+
primitive: Primitive;
|
|
12
|
+
material: Material;
|
|
13
|
+
subPrimitive: SubMesh;
|
|
14
|
+
shaderPasses: ReadonlyArray<ShaderPass>;
|
|
15
|
+
shaderData?: ShaderData;
|
|
16
|
+
batched: boolean;
|
|
17
|
+
renderQueueFlags: RenderQueueFlags;
|
|
18
|
+
texture?: Texture2D;
|
|
19
|
+
subChunk?: SubPrimitiveChunk;
|
|
20
|
+
set(component: Renderer, material: Material, primitive: Primitive, subPrimitive: SubMesh, texture?: Texture2D, subChunk?: SubPrimitiveChunk): void;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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/Renderer.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export declare class Renderer extends Component implements IComponentCustomClone
|
|
|
22
22
|
protected _overrideUpdate: boolean;
|
|
23
23
|
protected _materials: Material[];
|
|
24
24
|
protected _dirtyUpdateFlag: number;
|
|
25
|
+
protected _rendererLayer: Vector4;
|
|
25
26
|
private _shaderData;
|
|
26
27
|
private _mvMatrix;
|
|
27
28
|
private _mvpMatrix;
|
|
@@ -30,7 +31,6 @@ export declare class Renderer extends Component implements IComponentCustomClone
|
|
|
30
31
|
private _materialsInstanced;
|
|
31
32
|
private _priority;
|
|
32
33
|
private _receiveShadows;
|
|
33
|
-
protected _rendererLayer: Vector4;
|
|
34
34
|
/**
|
|
35
35
|
* ShaderData related to renderer.
|
|
36
36
|
*/
|
|
@@ -111,7 +111,8 @@ export declare class Renderer extends Component implements IComponentCustomClone
|
|
|
111
111
|
*/
|
|
112
112
|
setMaterials(materials: Material[]): void;
|
|
113
113
|
update(deltaTime: number): void;
|
|
114
|
-
protected
|
|
115
|
-
protected
|
|
114
|
+
protected _updateRendererShaderData(context: RenderContext): void;
|
|
115
|
+
protected _updateWorldViewRelatedShaderData(context: RenderContext, worldMatrix: Matrix, batched: boolean): void;
|
|
116
|
+
protected _updateProjectionRelatedShaderData(context: RenderContext, worldMatrix: Matrix, batched: boolean): void;
|
|
116
117
|
private _setMaterial;
|
|
117
118
|
}
|
package/types/Scene.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare class Scene extends EngineObject {
|
|
|
47
47
|
private _fogParams;
|
|
48
48
|
private _isActive;
|
|
49
49
|
private _sun;
|
|
50
|
+
private _enableTransparentShadow;
|
|
50
51
|
/**
|
|
51
52
|
* Whether the scene is active.
|
|
52
53
|
*/
|
|
@@ -114,6 +115,11 @@ export declare class Scene extends EngineObject {
|
|
|
114
115
|
*/
|
|
115
116
|
get sun(): DirectLight | null;
|
|
116
117
|
set sun(light: DirectLight | null);
|
|
118
|
+
/**
|
|
119
|
+
* Whether to enable transparent shadow.
|
|
120
|
+
*/
|
|
121
|
+
get enableTransparentShadow(): boolean;
|
|
122
|
+
set enableTransparentShadow(value: boolean);
|
|
117
123
|
/**
|
|
118
124
|
* Create scene.
|
|
119
125
|
* @param engine - Engine
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BoolUpdateFlag } from "../BoolUpdateFlag";
|
|
2
2
|
import { Component } from "../Component";
|
|
3
3
|
import { AnimatorController } from "./AnimatorController";
|
|
4
|
+
import { AnimatorControllerLayer } from "./AnimatorControllerLayer";
|
|
5
|
+
import { AnimatorControllerParameter } from "./AnimatorControllerParameter";
|
|
4
6
|
import { AnimatorState } from "./AnimatorState";
|
|
5
7
|
import { AnimatorCullingMode } from "./enums/AnimatorCullingMode";
|
|
6
8
|
/**
|
|
@@ -24,6 +26,14 @@ export declare class Animator extends Component {
|
|
|
24
26
|
*/
|
|
25
27
|
get animatorController(): AnimatorController;
|
|
26
28
|
set animatorController(animatorController: AnimatorController);
|
|
29
|
+
/**
|
|
30
|
+
* The layers in the animator's controller.
|
|
31
|
+
*/
|
|
32
|
+
get layers(): Readonly<AnimatorControllerLayer[]>;
|
|
33
|
+
/**
|
|
34
|
+
* The parameters in the animator's controller.
|
|
35
|
+
*/
|
|
36
|
+
get parameters(): Readonly<AnimatorControllerParameter[]>;
|
|
27
37
|
/**
|
|
28
38
|
* Play a state by name.
|
|
29
39
|
* @param stateName - The state name
|
|
@@ -55,6 +65,16 @@ export declare class Animator extends Component {
|
|
|
55
65
|
* @param layerIndex - The layer index(default -1). If layer is -1, find the first state with the given state name
|
|
56
66
|
*/
|
|
57
67
|
findAnimatorState(stateName: string, layerIndex?: number): AnimatorState;
|
|
68
|
+
/**
|
|
69
|
+
* Get the layer by name.
|
|
70
|
+
* @param name - The layer's name.
|
|
71
|
+
*/
|
|
72
|
+
findLayerByName(name: string): AnimatorControllerLayer;
|
|
73
|
+
/**
|
|
74
|
+
* Get the parameter by name from animatorController.
|
|
75
|
+
* @param name - The name of the parameter
|
|
76
|
+
*/
|
|
77
|
+
getParameter(name: string): AnimatorControllerParameter;
|
|
58
78
|
private _getAnimatorStateInfo;
|
|
59
79
|
private _getAnimatorStateData;
|
|
60
80
|
private _saveAnimatorStateData;
|
|
@@ -68,22 +88,31 @@ export declare class Animator extends Component {
|
|
|
68
88
|
private _prepareDestCrossData;
|
|
69
89
|
private _getAnimatorLayerData;
|
|
70
90
|
private _updateLayer;
|
|
91
|
+
private _updateState;
|
|
71
92
|
private _updatePlayingState;
|
|
72
|
-
private
|
|
73
|
-
private
|
|
93
|
+
private _evaluatePlayingState;
|
|
94
|
+
private _updateCrossFadeState;
|
|
95
|
+
private _evaluateCrossFadeState;
|
|
96
|
+
private _updateCrossFadeFromPoseState;
|
|
97
|
+
private _evaluateCrossFadeFromPoseState;
|
|
74
98
|
private _updateFinishedState;
|
|
99
|
+
private _evaluateFinishedState;
|
|
75
100
|
private _updateCrossFadeData;
|
|
76
|
-
private
|
|
77
|
-
private
|
|
101
|
+
private _preparePlayOwner;
|
|
102
|
+
private _applyStateTransitions;
|
|
78
103
|
private _checkSubTransition;
|
|
79
104
|
private _checkBackwardsSubTransition;
|
|
80
|
-
private
|
|
105
|
+
private _applyTransitionsByCondition;
|
|
106
|
+
private _preparePlay;
|
|
107
|
+
private _applyTransition;
|
|
108
|
+
private _checkConditions;
|
|
109
|
+
private _prepareCrossFadeByTransition;
|
|
81
110
|
private _fireAnimationEvents;
|
|
82
111
|
private _fireSubAnimationEvents;
|
|
83
112
|
private _fireBackwardSubAnimationEvents;
|
|
84
113
|
private _callAnimatorScriptOnEnter;
|
|
85
114
|
private _callAnimatorScriptOnUpdate;
|
|
86
115
|
private _callAnimatorScriptOnExit;
|
|
87
|
-
private
|
|
116
|
+
private _checkAnyAndEntryState;
|
|
88
117
|
private _checkRevertOwner;
|
|
89
118
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnimatorControllerParameterValueType } from "./AnimatorControllerParameter";
|
|
2
|
+
import { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
|
|
3
|
+
/**
|
|
4
|
+
* Condition that is used to determine if a transition must be taken.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AnimatorCondition {
|
|
7
|
+
/** The mode of the condition. */
|
|
8
|
+
mode: AnimatorConditionMode;
|
|
9
|
+
/** The name of the parameter used in the condition. */
|
|
10
|
+
parameterName: string;
|
|
11
|
+
/** The AnimatorParameter's threshold value for the condition to be true. */
|
|
12
|
+
threshold?: AnimatorControllerParameterValueType;
|
|
13
|
+
}
|
|
@@ -1,15 +1,45 @@
|
|
|
1
|
+
import { AnimatorControllerParameter, AnimatorControllerParameterValueType } from "./AnimatorControllerParameter";
|
|
1
2
|
import { AnimatorControllerLayer } from "./AnimatorControllerLayer";
|
|
2
3
|
/**
|
|
3
4
|
* Store the data for Animator playback.
|
|
4
5
|
*/
|
|
5
6
|
export declare class AnimatorController {
|
|
6
7
|
private _updateFlagManager;
|
|
7
|
-
private _layers;
|
|
8
|
-
private _layersMap;
|
|
9
8
|
/**
|
|
10
9
|
* The layers in the controller.
|
|
11
10
|
*/
|
|
12
11
|
get layers(): Readonly<AnimatorControllerLayer[]>;
|
|
12
|
+
/**
|
|
13
|
+
* The parameters in the controller.
|
|
14
|
+
*/
|
|
15
|
+
get parameters(): Readonly<AnimatorControllerParameter[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Add a parameter to the controller.
|
|
18
|
+
* @param name - The name of the parameter
|
|
19
|
+
* @param value - The value of the parameter
|
|
20
|
+
*/
|
|
21
|
+
addParameter(name: string, value?: AnimatorControllerParameterValueType): AnimatorControllerParameter;
|
|
22
|
+
/**
|
|
23
|
+
* Add a parameter to the controller.
|
|
24
|
+
* @param parameter - The parameter
|
|
25
|
+
*/
|
|
26
|
+
addParameter(parameter: AnimatorControllerParameter): AnimatorControllerParameter;
|
|
27
|
+
/**
|
|
28
|
+
* Remove a parameter from the controller.
|
|
29
|
+
* @param parameter - The parameter
|
|
30
|
+
*/
|
|
31
|
+
removeParameter(parameter: AnimatorControllerParameter): void;
|
|
32
|
+
/**
|
|
33
|
+
* Get the parameter by name.
|
|
34
|
+
* @param name - The name of the parameter
|
|
35
|
+
*/
|
|
36
|
+
getParameter(name: string): AnimatorControllerParameter;
|
|
37
|
+
/**
|
|
38
|
+
* Set the value of the given parameter.
|
|
39
|
+
* @param name - The name of the parameter
|
|
40
|
+
* @param value - The value of the parameter
|
|
41
|
+
*/
|
|
42
|
+
setParameterValue(name: string, value: AnimatorControllerParameterValueType): void;
|
|
13
43
|
/**
|
|
14
44
|
* Get the layer by name.
|
|
15
45
|
* @param name - The layer's name.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type AnimatorControllerParameterValueType = number | string | boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Used to communicate between scripting and the controller, parameters can be set in scripting and used by the controller.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AnimatorControllerParameter {
|
|
6
|
+
/** The name of the parameter. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** The value of the parameter. */
|
|
9
|
+
value: AnimatorControllerParameterValueType;
|
|
10
|
+
}
|