@galacean/engine-core 0.0.0-experimental-renderSort.3 → 0.0.0-experimental-shaderlab.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/LICENSE +2 -2
- package/dist/main.js +19593 -18926
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +19593 -18926
- package/dist/module.js +20118 -19454
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/BasicResources.d.ts +1 -0
- package/types/Camera.d.ts +48 -8
- package/types/Canvas.d.ts +15 -5
- package/types/Component.d.ts +2 -0
- package/types/ComponentsManager.d.ts +3 -0
- package/types/DisorderedArray.d.ts +1 -0
- package/types/Engine.d.ts +9 -3
- package/types/Entity.d.ts +1 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +9 -32
- package/types/RenderPipeline/Index.d.ts +0 -1
- package/types/RenderPipeline/OpaqueTexturePass.d.ts +1 -0
- package/types/RenderPipeline/RenderQueue.d.ts +1 -9
- package/types/Renderer.d.ts +4 -1
- package/types/Scene.d.ts +14 -2
- package/types/SystemInfo.d.ts +2 -0
- package/types/Utils.d.ts +7 -1
- package/types/animation/AnimationClip.d.ts +32 -4
- package/types/animation/AnimationClipCurveBinding.d.ts +12 -2
- package/types/animation/AnimatorControllerLayer.d.ts +3 -0
- package/types/animation/AnimatorLayerMask.d.ts +45 -0
- package/types/animation/Keyframe.d.ts +1 -1
- package/types/animation/LayerPathMask.d.ts +16 -0
- package/types/animation/animationCurve/AnimationStringCurve.d.ts +7 -0
- package/types/animation/animationCurve/index.d.ts +1 -0
- package/types/animation/index.d.ts +1 -0
- package/types/asset/AssetPromise.d.ts +10 -5
- package/types/asset/AssetType.d.ts +6 -0
- package/types/asset/Loader.d.ts +7 -0
- package/types/asset/ReferResource.d.ts +3 -2
- package/types/asset/ResourceManager.d.ts +2 -0
- package/types/base/Constant.d.ts +1 -0
- package/types/enums/CameraType.d.ts +1 -0
- package/types/enums/Downsampling.d.ts +11 -0
- package/types/enums/MSAASamples.d.ts +13 -0
- package/types/index.d.ts +5 -1
- package/types/input/InputManager.d.ts +0 -2
- package/types/input/interface/IInput.d.ts +0 -8
- package/types/lighting/Light.d.ts +0 -1
- package/types/lighting/LightManager.d.ts +0 -1
- package/types/material/PBRMaterial.d.ts +23 -0
- package/types/mesh/SkinnedMeshRenderer.d.ts +2 -0
- package/types/particle/modules/MainModule.d.ts +2 -0
- package/types/particle/modules/shape/BaseShape.d.ts +2 -2
- package/types/particle/modules/shape/BoxShape.d.ts +2 -1
- package/types/particle/modules/shape/CircleShape.d.ts +2 -1
- package/types/particle/modules/shape/ConeShape.d.ts +2 -1
- package/types/particle/modules/shape/HemisphereShape.d.ts +2 -1
- package/types/particle/modules/shape/SphereShape.d.ts +2 -1
- package/types/particle/modules/shape/index.d.ts +1 -0
- package/types/physics/HitResult.d.ts +3 -0
- package/types/renderingHardwareInterface/IPlatformRenderTarget.d.ts +2 -2
- package/types/renderingHardwareInterface/index.d.ts +0 -1
- package/types/shader/Shader.d.ts +15 -2
- package/types/shader/state/DepthState.d.ts +2 -2
- package/types/shaderlib/ShaderFactory.d.ts +8 -1
- package/types/shadow/CascadedShadowCasterPass.d.ts +0 -1
- package/types/texture/RenderTarget.d.ts +5 -4
- package/types/texture/Texture.d.ts +1 -0
- package/types/texture/enums/RenderBufferDepthFormat.d.ts +11 -9
- package/types/texture/enums/TextureFormat.d.ts +30 -26
- package/types/xr/XRManager.d.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-shaderlab.2",
|
|
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": "0.0.0-experimental-
|
|
18
|
+
"@galacean/engine-math": "0.0.0-experimental-shaderlab.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "0.0.0-experimental-
|
|
21
|
+
"@galacean/engine-design": "0.0.0-experimental-shaderlab.2"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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,31 +35,59 @@ 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
|
-
private
|
|
41
|
-
private
|
|
42
|
-
private _farClipPlane;
|
|
57
|
+
private _isCustomViewMatrix;
|
|
58
|
+
private _isCustomProjectionMatrix;
|
|
43
59
|
private _fieldOfView;
|
|
44
60
|
private _orthographicSize;
|
|
45
61
|
private _isProjectionDirty;
|
|
46
62
|
private _isInvProjMatDirty;
|
|
47
|
-
private _isFrustumProjectDirty;
|
|
48
63
|
private _customAspectRatio;
|
|
49
64
|
private _renderTarget;
|
|
50
65
|
private _depthBufferParams;
|
|
51
|
-
private
|
|
66
|
+
private _opaqueTextureEnabled;
|
|
67
|
+
private _frustumChangeFlag;
|
|
52
68
|
private _transform;
|
|
53
69
|
private _isViewMatrixDirty;
|
|
54
70
|
private _isInvViewProjDirty;
|
|
55
71
|
private _viewport;
|
|
56
72
|
private _pixelViewport;
|
|
57
73
|
private _inverseProjectionMatrix;
|
|
58
|
-
private _lastAspectSize;
|
|
59
74
|
private _invViewProjMat;
|
|
75
|
+
/**
|
|
76
|
+
* Whether to enable opaque texture.
|
|
77
|
+
* If enabled, the opaque texture can be accessed in the shader using `camera_OpaqueTexture`.
|
|
78
|
+
*
|
|
79
|
+
* @defaultValue `false`
|
|
80
|
+
*
|
|
81
|
+
* @remarks If enabled, the `independentCanvasEnabled` property will be forced to be true.
|
|
82
|
+
*/
|
|
83
|
+
get opaqueTextureEnabled(): boolean;
|
|
84
|
+
set opaqueTextureEnabled(value: boolean);
|
|
85
|
+
/**
|
|
86
|
+
* Whether independent canvas is enabled.
|
|
87
|
+
*
|
|
88
|
+
* @remarks If true, the msaa in viewport can turn or off independently by `msaaSamples` property.
|
|
89
|
+
*/
|
|
90
|
+
get independentCanvasEnabled(): boolean;
|
|
60
91
|
/**
|
|
61
92
|
* Shader data.
|
|
62
93
|
*/
|
|
@@ -113,12 +144,13 @@ export declare class Camera extends Component {
|
|
|
113
144
|
* View matrix.
|
|
114
145
|
*/
|
|
115
146
|
get viewMatrix(): Readonly<Matrix>;
|
|
147
|
+
set viewMatrix(value: Matrix);
|
|
116
148
|
/**
|
|
117
149
|
* The projection matrix is calculated by the relevant parameters of the camera by default.
|
|
118
150
|
* If it is manually set, the manual value will be maintained. Call resetProjectionMatrix() to restore it.
|
|
119
151
|
*/
|
|
152
|
+
get projectionMatrix(): Readonly<Matrix>;
|
|
120
153
|
set projectionMatrix(value: Matrix);
|
|
121
|
-
get projectionMatrix(): Matrix;
|
|
122
154
|
/**
|
|
123
155
|
* Whether to enable HDR.
|
|
124
156
|
* @todo When render pipeline modification
|
|
@@ -130,6 +162,10 @@ export declare class Camera extends Component {
|
|
|
130
162
|
*/
|
|
131
163
|
get renderTarget(): RenderTarget | null;
|
|
132
164
|
set renderTarget(value: RenderTarget | null);
|
|
165
|
+
/**
|
|
166
|
+
* Restore the view matrix to the world matrix of the entity.
|
|
167
|
+
*/
|
|
168
|
+
resetViewMatrix(): void;
|
|
133
169
|
/**
|
|
134
170
|
* Restore the automatic calculation of projection matrix through fieldOfView, nearClipPlane and farClipPlane.
|
|
135
171
|
*/
|
|
@@ -238,7 +274,8 @@ export declare class Camera extends Component {
|
|
|
238
274
|
*/
|
|
239
275
|
_onDisableInScene(): void;
|
|
240
276
|
private _updatePixelViewport;
|
|
241
|
-
private
|
|
277
|
+
private _viewMatrixChange;
|
|
278
|
+
private _projectionMatrixChange;
|
|
242
279
|
private _innerViewportToWorldPoint;
|
|
243
280
|
private _updateShaderData;
|
|
244
281
|
/**
|
|
@@ -249,4 +286,7 @@ export declare class Camera extends Component {
|
|
|
249
286
|
* The inverse of the projection matrix.
|
|
250
287
|
*/
|
|
251
288
|
private _getInverseProjectionMatrix;
|
|
289
|
+
private _forceUseInternalCanvas;
|
|
290
|
+
private _onPixelViewportChanged;
|
|
291
|
+
private _checkMainCanvasAntialiasWaste;
|
|
252
292
|
}
|
package/types/Canvas.d.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Canvas.
|
|
3
3
|
*/
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
4
|
+
export declare abstract class Canvas {
|
|
5
|
+
private _width;
|
|
6
|
+
private _height;
|
|
7
|
+
/**
|
|
8
|
+
* The width of the canvas.
|
|
9
|
+
*/
|
|
10
|
+
get width(): number;
|
|
11
|
+
set width(value: number);
|
|
12
|
+
/**
|
|
13
|
+
*The height of the canvas.
|
|
14
|
+
*/
|
|
15
|
+
get height(): number;
|
|
16
|
+
set height(value: number);
|
|
17
|
+
protected abstract _onWidthChanged(value: number): void;
|
|
18
|
+
protected abstract _onHeightChange(value: number): void;
|
|
9
19
|
}
|
package/types/Component.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IReferable } from "./asset/IReferable";
|
|
1
2
|
import { EngineObject } from "./base";
|
|
2
3
|
import { Entity } from "./Entity";
|
|
3
4
|
import { Scene } from "./Scene";
|
|
@@ -22,4 +23,5 @@ export declare class Component extends EngineObject {
|
|
|
22
23
|
*/
|
|
23
24
|
get scene(): Scene;
|
|
24
25
|
constructor(entity: Entity);
|
|
26
|
+
protected _addResourceReferCount(resource: IReferable, count: number): void;
|
|
25
27
|
}
|
|
@@ -16,6 +16,9 @@ export declare class ComponentsManager {
|
|
|
16
16
|
private _onUpdateAnimations;
|
|
17
17
|
private _onUpdateRenderers;
|
|
18
18
|
private _componentsContainerPool;
|
|
19
|
+
addCamera(camera: Camera): void;
|
|
20
|
+
removeCamera(camera: Camera): void;
|
|
21
|
+
sortCameras(): void;
|
|
19
22
|
addRenderer(renderer: Renderer): void;
|
|
20
23
|
removeRenderer(renderer: Renderer): void;
|
|
21
24
|
addOnStartScript(script: Script): void;
|
|
@@ -19,6 +19,7 @@ export declare class DisorderedArray<T> {
|
|
|
19
19
|
deleteByIndex(index: number): T;
|
|
20
20
|
forEach(callbackFn: (element: T) => void, swapFn: (element: T, index: number) => void): void;
|
|
21
21
|
forEachAndClean(callbackFn: (e: T) => void): void;
|
|
22
|
+
sort(compareFn: (a: T, b: T) => number): void;
|
|
22
23
|
garbageCollection(): void;
|
|
23
24
|
private _startLoop;
|
|
24
25
|
private _endLoop;
|
package/types/Engine.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IPhysics, IShaderLab } from "@galacean/engine-design";
|
|
1
|
+
import { IHardwareRenderer, IInputOptions, IPhysics, IShaderLab, IXRDevice } from "@galacean/engine-design";
|
|
2
2
|
import { Canvas } from "./Canvas";
|
|
3
3
|
import { EngineSettings } from "./EngineSettings";
|
|
4
4
|
import { Entity } from "./Entity";
|
|
@@ -8,13 +8,15 @@ import { EventDispatcher, Time } from "./base";
|
|
|
8
8
|
import { ColorSpace } from "./enums/ColorSpace";
|
|
9
9
|
import { InputManager } from "./input";
|
|
10
10
|
import { PhysicsScene } from "./physics/PhysicsScene";
|
|
11
|
-
import {
|
|
11
|
+
import { XRManager } from "./xr/XRManager";
|
|
12
12
|
/**
|
|
13
13
|
* Engine.
|
|
14
14
|
*/
|
|
15
15
|
export declare class Engine extends EventDispatcher {
|
|
16
16
|
/** Input manager of Engine. */
|
|
17
17
|
readonly inputManager: InputManager;
|
|
18
|
+
/** XR manager of Engine. */
|
|
19
|
+
readonly xrManager: XRManager;
|
|
18
20
|
private _settings;
|
|
19
21
|
private _resourceManager;
|
|
20
22
|
private _sceneManager;
|
|
@@ -130,8 +132,12 @@ export declare class Engine extends EventDispatcher {
|
|
|
130
132
|
export interface EngineConfiguration {
|
|
131
133
|
/** Physics. */
|
|
132
134
|
physics?: IPhysics;
|
|
135
|
+
/** XR Device. */
|
|
136
|
+
xrDevice?: IXRDevice;
|
|
133
137
|
/** Color space. */
|
|
134
138
|
colorSpace?: ColorSpace;
|
|
135
|
-
/** Shader lab */
|
|
139
|
+
/** Shader lab. */
|
|
136
140
|
shaderLab?: IShaderLab;
|
|
141
|
+
/** Input options. */
|
|
142
|
+
input?: IInputOptions;
|
|
137
143
|
}
|
package/types/Entity.d.ts
CHANGED
|
@@ -1,48 +1,23 @@
|
|
|
1
1
|
import { Camera } from "../Camera";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { RenderTarget, TextureCubeFace } from "../texture";
|
|
2
|
+
import { CameraClearFlags } from "../enums/CameraClearFlags";
|
|
3
|
+
import { TextureCubeFace } from "../texture";
|
|
5
4
|
import { RenderContext } from "./RenderContext";
|
|
6
5
|
import { RenderData } from "./RenderData";
|
|
7
|
-
import { RenderPass } from "./RenderPass";
|
|
8
6
|
/**
|
|
9
7
|
* Basic render pipeline.
|
|
10
8
|
*/
|
|
11
9
|
export declare class BasicRenderPipeline {
|
|
12
10
|
private _camera;
|
|
13
|
-
private _defaultPass;
|
|
14
|
-
private _renderPassArray;
|
|
15
11
|
private _lastCanvasSize;
|
|
16
|
-
private
|
|
12
|
+
private _internalColorTarget;
|
|
13
|
+
private _cascadedShadowCasterPass;
|
|
17
14
|
private _depthOnlyPass;
|
|
15
|
+
private _opaqueTexturePass;
|
|
18
16
|
/**
|
|
19
17
|
* Create a basic render pipeline.
|
|
20
18
|
* @param camera - Camera
|
|
21
19
|
*/
|
|
22
20
|
constructor(camera: Camera);
|
|
23
|
-
/**
|
|
24
|
-
* Default render pass.
|
|
25
|
-
*/
|
|
26
|
-
get defaultRenderPass(): RenderPass;
|
|
27
|
-
/**
|
|
28
|
-
* Add render pass.
|
|
29
|
-
* @param nameOrPass - The name of this Pass or RenderPass object. When it is a name, the following parameters need to be provided
|
|
30
|
-
* @param priority - Priority, less than 0 before the default pass, greater than 0 after the default pass
|
|
31
|
-
* @param renderTarget - The specified Render Target
|
|
32
|
-
* @param replaceMaterial - Replaced material
|
|
33
|
-
* @param mask - Perform bit and operations with Entity.Layer to filter the objects that this Pass needs to render
|
|
34
|
-
*/
|
|
35
|
-
addRenderPass(nameOrPass: string | RenderPass, priority?: number, renderTarget?: RenderTarget, replaceMaterial?: Material, mask?: Layer): void;
|
|
36
|
-
/**
|
|
37
|
-
* Remove render pass by name or render pass object.
|
|
38
|
-
* @param nameOrPass - Render pass name or render pass object
|
|
39
|
-
*/
|
|
40
|
-
removeRenderPass(nameOrPass: string | RenderPass): void;
|
|
41
|
-
/**
|
|
42
|
-
* Get render pass by name.
|
|
43
|
-
* @param name - Render pass name
|
|
44
|
-
*/
|
|
45
|
-
getRenderPass(name: string): RenderPass;
|
|
46
21
|
/**
|
|
47
22
|
* Destroy internal resources.
|
|
48
23
|
*/
|
|
@@ -52,8 +27,9 @@ export declare class BasicRenderPipeline {
|
|
|
52
27
|
* @param context - Render context
|
|
53
28
|
* @param cubeFace - Render surface of cube texture
|
|
54
29
|
* @param mipLevel - Set mip level the data want to write
|
|
30
|
+
* @param ignoreClear - Ignore clear flag
|
|
55
31
|
*/
|
|
56
|
-
render(context: RenderContext, cubeFace?: TextureCubeFace, mipLevel?: number): void;
|
|
32
|
+
render(context: RenderContext, cubeFace?: TextureCubeFace, mipLevel?: number, ignoreClear?: CameraClearFlags): void;
|
|
57
33
|
private _drawRenderPass;
|
|
58
34
|
/**
|
|
59
35
|
* Push render data to render queue.
|
|
@@ -63,5 +39,6 @@ export declare class BasicRenderPipeline {
|
|
|
63
39
|
pushRenderData(context: RenderContext, data: RenderData): void;
|
|
64
40
|
private pushRenderDataWithShader;
|
|
65
41
|
private _drawBackgroundTexture;
|
|
66
|
-
private
|
|
42
|
+
private _prepareRender;
|
|
43
|
+
private _updateMVPShaderData;
|
|
67
44
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
*/
|
|
@@ -28,11 +27,4 @@ export declare class RenderQueue {
|
|
|
28
27
|
* Sort the elements.
|
|
29
28
|
*/
|
|
30
29
|
sort(compareFunc: Function): void;
|
|
31
|
-
/**
|
|
32
|
-
* @remarks
|
|
33
|
-
* Modified based on v8.
|
|
34
|
-
* https://github.com/v8/v8/blob/7.2-lkgr/src/js/array.js
|
|
35
|
-
*/
|
|
36
|
-
private _quickSort;
|
|
37
|
-
private _insertionSort;
|
|
38
30
|
}
|
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
|
}
|
package/types/Scene.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Engine } from "./Engine";
|
|
|
4
4
|
import { Entity } from "./Entity";
|
|
5
5
|
import { EngineObject } from "./base";
|
|
6
6
|
import { FogMode } from "./enums/FogMode";
|
|
7
|
+
import { DirectLight } from "./lighting";
|
|
7
8
|
import { AmbientLight } from "./lighting/AmbientLight";
|
|
8
9
|
import { PhysicsScene } from "./physics/PhysicsScene";
|
|
9
10
|
import { ShaderData } from "./shader/ShaderData";
|
|
@@ -15,8 +16,6 @@ import { ShadowResolution } from "./shadow/enum/ShadowResolution";
|
|
|
15
16
|
export declare class Scene extends EngineObject {
|
|
16
17
|
private static _fogColorProperty;
|
|
17
18
|
private static _fogParamsProperty;
|
|
18
|
-
private static _sunlightColorProperty;
|
|
19
|
-
private static _sunlightDirectionProperty;
|
|
20
19
|
/** Scene name. */
|
|
21
20
|
name: string;
|
|
22
21
|
/** Physics. */
|
|
@@ -31,6 +30,11 @@ export declare class Scene extends EngineObject {
|
|
|
31
30
|
shadowFourCascadeSplits: Vector3;
|
|
32
31
|
/** Max Shadow distance. */
|
|
33
32
|
shadowDistance: number;
|
|
33
|
+
/**
|
|
34
|
+
* Last shadow fade distance in percentage, range [0,1].
|
|
35
|
+
* @remarks Value 0 is used for no shadow fade.
|
|
36
|
+
*/
|
|
37
|
+
shadowFadeBorder: number;
|
|
34
38
|
private _background;
|
|
35
39
|
private _shaderData;
|
|
36
40
|
private _shadowCascades;
|
|
@@ -42,6 +46,7 @@ export declare class Scene extends EngineObject {
|
|
|
42
46
|
private _fogDensity;
|
|
43
47
|
private _fogParams;
|
|
44
48
|
private _isActive;
|
|
49
|
+
private _sun;
|
|
45
50
|
/**
|
|
46
51
|
* Whether the scene is active.
|
|
47
52
|
*/
|
|
@@ -103,6 +108,12 @@ export declare class Scene extends EngineObject {
|
|
|
103
108
|
* Root entity collection.
|
|
104
109
|
*/
|
|
105
110
|
get rootEntities(): Readonly<Entity[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Sun light source.
|
|
113
|
+
* @remarks If set this to null, scene will use the brightest directional light.
|
|
114
|
+
*/
|
|
115
|
+
get sun(): DirectLight | null;
|
|
116
|
+
set sun(light: DirectLight | null);
|
|
106
117
|
/**
|
|
107
118
|
* Create scene.
|
|
108
119
|
* @param engine - Engine
|
|
@@ -152,4 +163,5 @@ export declare class Scene extends EngineObject {
|
|
|
152
163
|
private _addToRootEntityList;
|
|
153
164
|
private _computeLinearFogParams;
|
|
154
165
|
private _computeExponentialFogParams;
|
|
166
|
+
private _getSunlight;
|
|
155
167
|
}
|
package/types/SystemInfo.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export declare class SystemInfo {
|
|
|
7
7
|
static platform: Platform;
|
|
8
8
|
/** The operating system is running on. */
|
|
9
9
|
static operatingSystem: string;
|
|
10
|
+
/** Whether the system support SIMD. */
|
|
11
|
+
private static _simdSupported;
|
|
10
12
|
/**
|
|
11
13
|
* The pixel ratio of the device.
|
|
12
14
|
*/
|
package/types/Utils.d.ts
CHANGED
|
@@ -15,6 +15,12 @@ export declare class Utils {
|
|
|
15
15
|
* @returns Whether the url is absolute url.
|
|
16
16
|
*/
|
|
17
17
|
static isAbsoluteUrl(url: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Judge whether the url is base64 url.
|
|
20
|
+
* @param url - The url to be judged.
|
|
21
|
+
* @returns Whether the url is base64 url.
|
|
22
|
+
*/
|
|
23
|
+
static isBase64Url(url: string): boolean;
|
|
18
24
|
/**
|
|
19
25
|
* Get the values of an object.
|
|
20
26
|
*/
|
|
@@ -27,5 +33,5 @@ export declare class Utils {
|
|
|
27
33
|
*/
|
|
28
34
|
static resolveAbsoluteUrl(baseUrl: string, relativeUrl: string): string;
|
|
29
35
|
private static _stringToPath;
|
|
30
|
-
private static
|
|
36
|
+
private static _insertionSort;
|
|
31
37
|
}
|
|
@@ -46,12 +46,40 @@ export declare class AnimationClip extends EngineObject {
|
|
|
46
46
|
clearEvents(): void;
|
|
47
47
|
/**
|
|
48
48
|
* Add curve binding for the clip.
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
49
|
+
* @param entityPath - Path to the game object this curve applies to. The entityPath is formatted similar to a pathname, e.g. "/root/spine/leftArm"
|
|
50
|
+
* @param componentType - The class type of the component that is animated
|
|
51
|
+
* @param propertyPath - The path to the property being animated, support "a.b" and "a.b[x]" description mode
|
|
52
52
|
* @param curve - The animation curve
|
|
53
53
|
*/
|
|
54
|
-
addCurveBinding<T extends Component>(
|
|
54
|
+
addCurveBinding<T extends Component>(entityPath: string, componentType: new (entity: Entity) => T, propertyPath: string, curve: AnimationCurve<KeyframeValueType>): void;
|
|
55
|
+
/**
|
|
56
|
+
* Add curve binding for the clip.
|
|
57
|
+
* @param entityPath - Path to the game object this curve applies to. The entityPath is formatted similar to a pathname, e.g. "/root/spine/leftArm"
|
|
58
|
+
* @param componentType - The class type of the component that is animated
|
|
59
|
+
* @param setPropertyPath - The path to set the property being animated, support "a.b", "a.b[x]" and "a.b('c', 0, $value)" description mode
|
|
60
|
+
* @param getPropertyPath - The path to get the value when being animated, support "a.b", "a.b[x]" and "a.b('c', 0, $value)" description mode
|
|
61
|
+
* @param curve - The animation curve
|
|
62
|
+
*/
|
|
63
|
+
addCurveBinding<T extends Component>(entityPath: string, componentType: new (entity: Entity) => T, setPropertyPath: string, getPropertyPath: string, curve: AnimationCurve<KeyframeValueType>): void;
|
|
64
|
+
/**
|
|
65
|
+
* Add curve binding for the clip.
|
|
66
|
+
* @param entityPath - Path to the game object this curve applies to. The entityPath is formatted similar to a pathname, e.g. "/root/spine/leftArm"
|
|
67
|
+
* @param componentType - The type index of the component that is animated
|
|
68
|
+
* @param componentIndex - The class type of the component that is animated
|
|
69
|
+
* @param propertyPath - The path to the property being animated, support "a.b" and "a.b[x]" description mode
|
|
70
|
+
* @param curve - The animation curve
|
|
71
|
+
*/
|
|
72
|
+
addCurveBinding<T extends Component>(entityPath: string, componentType: new (entity: Entity) => T, componentIndex: number, propertyPath: string, curve: AnimationCurve<KeyframeValueType>): void;
|
|
73
|
+
/**
|
|
74
|
+
* Add curve binding for the clip.
|
|
75
|
+
* @param entityPath - Path to the game object this curve applies to. The entityPath is formatted similar to a pathname, e.g. "/root/spine/leftArm"
|
|
76
|
+
* @param componentType - The class type of the component that is animated
|
|
77
|
+
* @param componentIndex - The class type of the component that is animated
|
|
78
|
+
* @param setPropertyPath - The path to set the property being animated, support "a.b", "a.b[x]" and "a.b('c', 0, $value)" description mode
|
|
79
|
+
* @param getPropertyPath - The path to get the value when being animated, support "a.b", "a.b[x]" and "a.b('c', 0, $value)" description mode
|
|
80
|
+
* @param curve - The animation curve
|
|
81
|
+
*/
|
|
82
|
+
addCurveBinding<T extends Component>(entityPath: string, componentType: new (entity: Entity) => T, componentIndex: number, setPropertyPath: string, getPropertyPath: string, curve: AnimationCurve<KeyframeValueType>): void;
|
|
55
83
|
/**
|
|
56
84
|
* Clears all curve bindings from the clip.
|
|
57
85
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Component } from "../Component";
|
|
2
2
|
import { Entity } from "../Entity";
|
|
3
|
-
import { AnimationCurve } from "./animationCurve";
|
|
4
3
|
import { KeyframeValueType } from "./Keyframe";
|
|
4
|
+
import { AnimationCurve } from "./animationCurve";
|
|
5
5
|
/**
|
|
6
6
|
* Associate AnimationCurve and the Entity
|
|
7
7
|
*/
|
|
@@ -13,8 +13,18 @@ export declare class AnimationClipCurveBinding {
|
|
|
13
13
|
relativePath: string;
|
|
14
14
|
/** The class type of the component that is animated. */
|
|
15
15
|
type: new (entity: Entity) => Component;
|
|
16
|
-
/** The
|
|
16
|
+
/** The index of the component that is animated. */
|
|
17
|
+
typeIndex: number;
|
|
18
|
+
/**
|
|
19
|
+
* The name or path to the property being animated.
|
|
20
|
+
* @remarks support property:"a.b", array: "a.b[0]", method: "a.b('c', 0, $value)"
|
|
21
|
+
*/
|
|
17
22
|
property: string;
|
|
23
|
+
/**
|
|
24
|
+
* The name or path to get the value when being animated.
|
|
25
|
+
* @remarks support property:"a.b", array: "a.b[0]", method: "a.b('c', 0)"
|
|
26
|
+
*/
|
|
27
|
+
getProperty?: string;
|
|
18
28
|
/** The animation curve. */
|
|
19
29
|
curve: AnimationCurve<KeyframeValueType>;
|
|
20
30
|
private _tempCurveOwner;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AnimatorStateMachine } from "./AnimatorStateMachine";
|
|
2
2
|
import { AnimatorLayerBlendingMode } from "./enums/AnimatorLayerBlendingMode";
|
|
3
|
+
import { AnimatorLayerMask } from "./AnimatorLayerMask";
|
|
3
4
|
/**
|
|
4
5
|
* The Animation Layer contains a state machine that controls animations of a model or part of it.
|
|
5
6
|
*/
|
|
@@ -11,6 +12,8 @@ export declare class AnimatorControllerLayer {
|
|
|
11
12
|
blendingMode: AnimatorLayerBlendingMode;
|
|
12
13
|
/** The state machine for the layer. */
|
|
13
14
|
stateMachine: AnimatorStateMachine;
|
|
15
|
+
/** The AnimatorLayerMask is used to mask out certain entities from being animated by an AnimatorLayer. */
|
|
16
|
+
mask: AnimatorLayerMask;
|
|
14
17
|
/**
|
|
15
18
|
* @param name - The layer's name
|
|
16
19
|
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Entity } from "../Entity";
|
|
2
|
+
import { LayerPathMask } from "./LayerPathMask";
|
|
3
|
+
/**
|
|
4
|
+
* AnimatorLayerMask is used to mask out certain entities from being animated by an AnimatorLayer.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AnimatorLayerMask {
|
|
7
|
+
/**
|
|
8
|
+
* Creates an AnimatorLayerMask instance by specifying an entity.
|
|
9
|
+
* This will automatically add path masks for the entity and all its children.
|
|
10
|
+
* @param entity - The root entity to create path masks for
|
|
11
|
+
*/
|
|
12
|
+
static createByEntity(entity: Entity): AnimatorLayerMask;
|
|
13
|
+
private static _addPathMaskWithChildren;
|
|
14
|
+
private _pathMasks;
|
|
15
|
+
private _pathMaskMap;
|
|
16
|
+
/**
|
|
17
|
+
* The list of path masks.
|
|
18
|
+
*/
|
|
19
|
+
get pathMasks(): Readonly<LayerPathMask[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Adds a path mask to the AnimatorLayerMask, the root path is "".
|
|
22
|
+
* @param path - The path to add a mask for
|
|
23
|
+
* @returns The created or existing LayerPathMask
|
|
24
|
+
*/
|
|
25
|
+
addPathMask(path: string): LayerPathMask;
|
|
26
|
+
/**
|
|
27
|
+
* Removes a path mask from the AnimatorLayerMask.
|
|
28
|
+
* @param path - The path of the mask to remove
|
|
29
|
+
*/
|
|
30
|
+
removePathMask(path: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Get a path mask based on the given path.
|
|
33
|
+
* @param path - The path of the mask to get
|
|
34
|
+
* @returns The LayerPathMask for the given path
|
|
35
|
+
*/
|
|
36
|
+
getPathMask(path: string): LayerPathMask;
|
|
37
|
+
/**
|
|
38
|
+
* Sets the active state of a path mask.
|
|
39
|
+
* If recursive is true, it also sets the active state of all child path masks.
|
|
40
|
+
* @param path - The path of the mask to modify
|
|
41
|
+
* @param active - The active state to set
|
|
42
|
+
* @param withChildren - Whether to apply the active state recursively to child paths
|
|
43
|
+
*/
|
|
44
|
+
setPathMaskActive(path: string, active: boolean, withChildren?: boolean): void;
|
|
45
|
+
}
|
|
@@ -17,4 +17,4 @@ export declare class Keyframe<V extends KeyframeValueType, T = V extends number
|
|
|
17
17
|
/**
|
|
18
18
|
* Type of Keyframe value.
|
|
19
19
|
*/
|
|
20
|
-
export type KeyframeValueType = number | Vector2 | Vector3 | Vector4 | number[] | Float32Array | Quaternion | Color | Rect | boolean | ReferResource;
|
|
20
|
+
export type KeyframeValueType = number | Vector2 | Vector3 | Vector4 | number[] | Float32Array | Quaternion | Color | Rect | string | boolean | ReferResource;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LayerPathMask represents a mask for a specific entity in an animation layer.
|
|
3
|
+
* It is used to control the animation whether to be applied to the entity or not.
|
|
4
|
+
*/
|
|
5
|
+
export declare class LayerPathMask {
|
|
6
|
+
/**
|
|
7
|
+
* It identifies a particular entity in the hierarchy.
|
|
8
|
+
* Example: "arm/left/hand" could be a path to the left hand of a character.
|
|
9
|
+
*/
|
|
10
|
+
path: string;
|
|
11
|
+
/**
|
|
12
|
+
* The active property is indicating whether the animation at this path is active or not.
|
|
13
|
+
* When true, the animation for this path is applied; when false, the animation for this path is ignored.
|
|
14
|
+
*/
|
|
15
|
+
active: boolean;
|
|
16
|
+
}
|
|
@@ -10,3 +10,4 @@ export { AnimationVector3Curve } from "./AnimationVector3Curve";
|
|
|
10
10
|
export { AnimationVector4Curve } from "./AnimationVector4Curve";
|
|
11
11
|
export { AnimationRefCurve } from "./AnimationRefCurve";
|
|
12
12
|
export { AnimationRectCurve } from "./AnimationRectCurve";
|
|
13
|
+
export { AnimationStringCurve } from "./AnimationStringCurve";
|
|
@@ -18,4 +18,5 @@ export { AnimatorCullingMode } from "./enums/AnimatorCullingMode";
|
|
|
18
18
|
export { InterpolationType } from "./enums/InterpolationType";
|
|
19
19
|
export { WrapMode } from "./enums/WrapMode";
|
|
20
20
|
export * from "./Keyframe";
|
|
21
|
+
export * from "./AnimatorLayerMask";
|
|
21
22
|
export { StateMachineScript } from "./StateMachineScript";
|