@galacean/engine-core 2.0.0-alpha.56 → 2.0.0-alpha.58
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 +13833 -11865
- package/dist/main.js.map +1 -1
- package/dist/module.js +13833 -11866
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/BasicResources.d.ts +8 -2
- package/types/Camera.d.ts +6 -0
- package/types/Engine.d.ts +10 -5
- package/types/SystemInfo.d.ts +3 -4
- package/types/graphic/Primitive.d.ts +2 -2
- package/types/lighting/ambientOcclusion/ScalableAmbientObscurancePass.d.ts +2 -2
- package/types/material/Material.d.ts +1 -0
- package/types/mesh/MeshTangentUtils.d.ts +9 -0
- package/types/mesh/ModelMesh.d.ts +5 -8
- package/types/mesh/PrimitiveMesh.d.ts +229 -101
- package/types/mesh/PrimitiveMeshOptions.d.ts +415 -0
- package/types/mesh/enums/PrimitiveMeshCapMode.d.ts +21 -0
- package/types/mesh/index.d.ts +2 -0
- package/types/mesh/primitive/MeshPathUtils.d.ts +13 -0
- package/types/mesh/primitive/PolygonUtils.d.ts +44 -0
- package/types/mesh/primitive/PrimitiveMeshBuilder.d.ts +25 -0
- package/types/mesh/primitive/PrimitiveMeshRestorer.d.ts +15 -0
- package/types/mesh/primitive/SubdivisionUtils.d.ts +9 -0
- package/types/particle/ParticleSubEmitterSpawnState.d.ts +2 -1
- package/types/particle/ParticleTransformFeedbackSimulator.d.ts +2 -6
- package/types/physics/CharacterController.d.ts +3 -3
- package/types/physics/Collider.d.ts +3 -2
- package/types/physics/PhysicsMaterial.d.ts +9 -3
- package/types/physics/shape/ColliderShape.d.ts +18 -7
- package/types/physics/shape/MeshColliderShape.d.ts +7 -12
- package/types/postProcess/FinalPass.d.ts +2 -1
- package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +78 -0
- package/types/renderingHardwareInterface/IPlatformPrimitive.d.ts +6 -0
- package/types/renderingHardwareInterface/IPlatformShaderProgram.d.ts +4 -0
- package/types/renderingHardwareInterface/IPlatformTransformFeedbackPrimitive.d.ts +1 -1
- package/types/renderingHardwareInterface/index.d.ts +3 -0
- package/types/shader/BuiltinShaders.d.ts +27 -0
- package/types/shader/Shader.d.ts +0 -2
- package/types/shader/ShaderProgram.d.ts +2 -1
- package/types/shader/index.d.ts +1 -0
- package/types/shader/state/BlendState.d.ts +1 -1
- package/types/shader/state/DepthState.d.ts +1 -1
- package/types/shader/state/RasterState.d.ts +1 -1
- package/types/shader/state/StencilState.d.ts +1 -1
- package/types/texture/Texture.d.ts +25 -12
- package/types/texture/TextureUtils.d.ts +1 -0
- package/types/mesh/PrimitiveMeshRestorer.d.ts +0 -108
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.58",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"types/**/*"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@galacean/engine-design": "2.0.0-alpha.
|
|
22
|
-
"@galacean/engine-math": "2.0.0-alpha.
|
|
21
|
+
"@galacean/engine-design": "2.0.0-alpha.58",
|
|
22
|
+
"@galacean/engine-math": "2.0.0-alpha.58"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"b:types": "tsc"
|
|
@@ -3,6 +3,8 @@ import { Engine } from "./Engine";
|
|
|
3
3
|
import { RenderQueueMaskType } from "./RenderPipeline/enums/RenderQueueMaskType";
|
|
4
4
|
import { BlinnPhongMaterial, Material } from "./material";
|
|
5
5
|
import { ModelMesh } from "./mesh";
|
|
6
|
+
import { PhysicsMaterial } from "./physics/PhysicsMaterial";
|
|
7
|
+
import type { BuiltinShaders } from "./shader/BuiltinShaders";
|
|
6
8
|
import { RenderStateElementKey } from "./shader/enums/RenderStateElementKey";
|
|
7
9
|
import { Texture2D, TextureCube } from "./texture";
|
|
8
10
|
import { Texture2DArray } from "./texture/Texture2DArray";
|
|
@@ -11,10 +13,15 @@ import { Texture2DArray } from "./texture/Texture2DArray";
|
|
|
11
13
|
*/
|
|
12
14
|
export declare class BasicResources {
|
|
13
15
|
engine: Engine;
|
|
16
|
+
static physicsDefaultMaterial: PhysicsMaterial;
|
|
14
17
|
private static _maskReadInsideRenderStates;
|
|
15
18
|
private static _maskReadOutsideRenderStates;
|
|
16
19
|
private static _maskWriteIncrementRenderStates;
|
|
17
20
|
private static _maskWriteDecrementRenderStates;
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
static _initializePhysics(): void;
|
|
18
25
|
static getMaskInteractionRenderStates(maskInteraction: SpriteMaskInteraction): RenderStateElementMap;
|
|
19
26
|
static getMaskTypeRenderStates(maskType: RenderQueueMaskType): RenderStateElementMap;
|
|
20
27
|
/**
|
|
@@ -36,7 +43,7 @@ export declare class BasicResources {
|
|
|
36
43
|
private _blinnPhongMaterial;
|
|
37
44
|
private _prefilteredDFGTexture;
|
|
38
45
|
get prefilteredDFGTexture(): Texture2D;
|
|
39
|
-
constructor(engine: Engine);
|
|
46
|
+
constructor(engine: Engine, shaders: BuiltinShaders);
|
|
40
47
|
/**
|
|
41
48
|
* @internal
|
|
42
49
|
*/
|
|
@@ -49,6 +56,5 @@ export declare class BasicResources {
|
|
|
49
56
|
private _create1x1Texture;
|
|
50
57
|
private _create2DMaterial;
|
|
51
58
|
private _createMagentaMaterial;
|
|
52
|
-
private _createSpriteMaskMaterial;
|
|
53
59
|
}
|
|
54
60
|
export type RenderStateElementMap = Record<RenderStateElementKey, number | boolean>;
|
package/types/Camera.d.ts
CHANGED
|
@@ -199,6 +199,7 @@ export declare class Camera extends Component {
|
|
|
199
199
|
/**
|
|
200
200
|
* Whether to enable HDR.
|
|
201
201
|
* @defaultValue `false`
|
|
202
|
+
* @remarks Kept on this property across backends; rendering falls back to LDR when the device lacks HDR color targets.
|
|
202
203
|
*/
|
|
203
204
|
get enableHDR(): boolean;
|
|
204
205
|
set enableHDR(value: boolean);
|
|
@@ -218,6 +219,7 @@ export declare class Camera extends Component {
|
|
|
218
219
|
* Higher sample counts (e.g., 2x, 4x, 8x) produce smoother edges.
|
|
219
220
|
*
|
|
220
221
|
* @defaultValue `MSAASamples.FourX`
|
|
222
|
+
* @remarks The requested count is kept; rendering uses at most the count supported by the device.
|
|
221
223
|
*/
|
|
222
224
|
get msaaSamples(): MSAASamples;
|
|
223
225
|
set msaaSamples(value: MSAASamples);
|
|
@@ -349,6 +351,10 @@ export declare class Camera extends Component {
|
|
|
349
351
|
* @internal
|
|
350
352
|
*/
|
|
351
353
|
_getInternalColorTextureFormat(): TextureFormat;
|
|
354
|
+
/**
|
|
355
|
+
* @internal
|
|
356
|
+
*/
|
|
357
|
+
_isInternalFormatHDR(): boolean;
|
|
352
358
|
/**
|
|
353
359
|
* @internal
|
|
354
360
|
*/
|
package/types/Engine.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IInputOptions, IPhysics, IPhysicsManager, IShaderCompiler, IXRDevice } from "@galacean/engine-design";
|
|
2
2
|
import { CharRenderInfo } from "./2d/text/CharRenderInfo";
|
|
3
3
|
import { Font } from "./2d/text/Font";
|
|
4
4
|
import { BasicResources } from "./BasicResources";
|
|
@@ -18,11 +18,13 @@ import { InputManager } from "./input";
|
|
|
18
18
|
import { ParticleBufferUtils } from "./particle/ParticleBufferUtils";
|
|
19
19
|
import { ColliderShape } from "./physics/shape/ColliderShape";
|
|
20
20
|
import { PostProcessPass } from "./postProcess/PostProcessPass";
|
|
21
|
+
import type { BuiltinShaders } from "./shader/BuiltinShaders";
|
|
21
22
|
import { ShaderMacro } from "./shader/ShaderMacro";
|
|
22
23
|
import { ShaderMacroCollection } from "./shader/ShaderMacroCollection";
|
|
23
24
|
import { ShaderProgramMap } from "./shader/ShaderProgramMap";
|
|
24
25
|
import { RenderState } from "./shader/state/RenderState";
|
|
25
26
|
import { Texture2D } from "./texture";
|
|
27
|
+
import type { IHardwareRenderer } from "./renderingHardwareInterface";
|
|
26
28
|
import { ClearableObjectPool } from "./utils/ClearableObjectPool";
|
|
27
29
|
import { ReturnableObjectPool } from "./utils/ReturnableObjectPool";
|
|
28
30
|
import { XRManager } from "./xr/XRManager";
|
|
@@ -30,6 +32,8 @@ import { XRManager } from "./xr/XRManager";
|
|
|
30
32
|
* Engine.
|
|
31
33
|
*/
|
|
32
34
|
export declare class Engine extends EventDispatcher {
|
|
35
|
+
/** @internal */
|
|
36
|
+
static _builtinShaders: BuiltinShaders;
|
|
33
37
|
/** @internal */
|
|
34
38
|
static _noDepthTextureMacro: ShaderMacro;
|
|
35
39
|
/** @internal */
|
|
@@ -144,15 +148,15 @@ export declare class Engine extends EventDispatcher {
|
|
|
144
148
|
get isPaused(): boolean;
|
|
145
149
|
/**
|
|
146
150
|
* The number of vertical synchronization means the number of vertical blanking for one frame.
|
|
147
|
-
* @remarks 0 means that the vertical synchronization is turned off.
|
|
151
|
+
* @remarks 0 means that the vertical synchronization is turned off. Hosts without animation-frame scheduling use `targetFrameRate`.
|
|
148
152
|
*/
|
|
149
153
|
get vSyncCount(): number;
|
|
150
154
|
set vSyncCount(value: number);
|
|
151
155
|
/**
|
|
152
156
|
* Set the target frame rate you want to achieve.
|
|
153
157
|
* @remarks
|
|
154
|
-
* It
|
|
155
|
-
* The larger the value, the higher the target frame rate, Number.POSITIVE_INFINITY represents the infinite target frame rate.
|
|
158
|
+
* It takes effect when `vSyncCount = 0` or the host does not provide animation-frame scheduling.
|
|
159
|
+
* The larger the value, the higher the target frame rate, `Number.POSITIVE_INFINITY` represents the infinite target frame rate.
|
|
156
160
|
*/
|
|
157
161
|
get targetFrameRate(): number;
|
|
158
162
|
set targetFrameRate(value: number);
|
|
@@ -236,7 +240,8 @@ export declare class Engine extends EventDispatcher {
|
|
|
236
240
|
/**
|
|
237
241
|
* @internal
|
|
238
242
|
*/
|
|
239
|
-
protected _initialize(configuration: EngineConfiguration): Promise<
|
|
243
|
+
protected _initialize(configuration: EngineConfiguration): Promise<this>;
|
|
244
|
+
private _getRequestAnimationFrame;
|
|
240
245
|
private _onDeviceLost;
|
|
241
246
|
private _onDeviceRestored;
|
|
242
247
|
private _gc;
|
package/types/SystemInfo.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AssetPromise } from "./asset/AssetPromise";
|
|
2
|
-
import { Engine } from "./Engine";
|
|
2
|
+
import type { Engine } from "./Engine";
|
|
3
3
|
import { Platform } from "./Platform";
|
|
4
|
-
import { TextureFormat } from "./texture";
|
|
4
|
+
import type { TextureFormat } from "./texture";
|
|
5
5
|
/**
|
|
6
6
|
* Access operating system, platform and hardware information.
|
|
7
7
|
*/
|
|
@@ -10,8 +10,6 @@ export declare class SystemInfo {
|
|
|
10
10
|
static platform: Platform;
|
|
11
11
|
/** The operating system is running on. */
|
|
12
12
|
static operatingSystem: string;
|
|
13
|
-
/** @internal */
|
|
14
|
-
static _isBrowser: boolean;
|
|
15
13
|
/** Whether the system support SIMD. */
|
|
16
14
|
private static _simdSupported;
|
|
17
15
|
private static _webpSupported;
|
|
@@ -34,6 +32,7 @@ export declare class SystemInfo {
|
|
|
34
32
|
static _checkWebpSupported(): AssetPromise<boolean>;
|
|
35
33
|
/**
|
|
36
34
|
* Checks whether the system supports the given texture format.
|
|
35
|
+
* @param engine - Engine instance
|
|
37
36
|
* @param format - The texture format
|
|
38
37
|
* @returns Whether support the texture format
|
|
39
38
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Engine } from "../Engine";
|
|
2
2
|
import { GraphicsResource } from "../asset/GraphicsResource";
|
|
3
|
-
import {
|
|
3
|
+
import type { IPlatformShaderProgram } from "../renderingHardwareInterface";
|
|
4
4
|
import { IndexBufferBinding } from "./IndexBufferBinding";
|
|
5
5
|
import { SubPrimitive } from "./SubPrimitive";
|
|
6
6
|
import { VertexBufferBinding } from "./VertexBufferBinding";
|
|
@@ -43,7 +43,7 @@ export declare class Primitive extends GraphicsResource {
|
|
|
43
43
|
*/
|
|
44
44
|
setVertexBufferBindings(vertexBufferBindings: (VertexBufferBinding | null)[], firstIndex?: number): void;
|
|
45
45
|
setIndexBufferBinding(binding: IndexBufferBinding | null): void;
|
|
46
|
-
draw(shaderProgram:
|
|
46
|
+
draw(shaderProgram: IPlatformShaderProgram, subMesh: SubPrimitive): void;
|
|
47
47
|
_addReferCount(value: number): void;
|
|
48
48
|
_rebuild(): void;
|
|
49
49
|
protected _onDestroy(): void;
|
|
@@ -2,13 +2,13 @@ import { Camera } from "../../Camera";
|
|
|
2
2
|
import { Engine } from "../../Engine";
|
|
3
3
|
import { PipelinePass } from "../../RenderPipeline/PipelinePass";
|
|
4
4
|
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
5
|
+
import { Shader } from "../../shader";
|
|
5
6
|
import { RenderTarget } from "../../texture";
|
|
6
7
|
/**
|
|
7
8
|
* @internal
|
|
8
9
|
* Scalable Ambient Obscurance render pass.
|
|
9
10
|
*/
|
|
10
11
|
export declare class ScalableAmbientObscurancePass extends PipelinePass {
|
|
11
|
-
static readonly SHADER_NAME = "Lighting/ScalableAmbientOcclusion";
|
|
12
12
|
private static _invRadiusSquaredProp;
|
|
13
13
|
private static _intensityProp;
|
|
14
14
|
private static _projectionScaleRadiusProp;
|
|
@@ -30,7 +30,7 @@ export declare class ScalableAmbientObscurancePass extends PipelinePass {
|
|
|
30
30
|
private _offsetX;
|
|
31
31
|
private _offsetY;
|
|
32
32
|
private _quality;
|
|
33
|
-
constructor(engine: Engine);
|
|
33
|
+
constructor(engine: Engine, shader: Shader);
|
|
34
34
|
onConfig(camera: Camera, depthRenderTarget: RenderTarget): void;
|
|
35
35
|
onRender(context: RenderContext): void;
|
|
36
36
|
release(): void;
|
|
@@ -25,6 +25,7 @@ export declare class Material extends ReferResource implements IClone {
|
|
|
25
25
|
* Create a material instance.
|
|
26
26
|
* @param engine - Engine to which the material belongs
|
|
27
27
|
* @param shader - Shader used by the material
|
|
28
|
+
* @throws When the shader has been destroyed.
|
|
28
29
|
*/
|
|
29
30
|
constructor(engine: Engine, shader: Shader);
|
|
30
31
|
/**
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare class MeshTangentUtils {
|
|
6
|
+
static calculateTangents(positions: readonly Vector3[], normals: readonly Vector3[], uvs: readonly Vector2[], indices: ArrayLike<number> | null): Vector4[];
|
|
7
|
+
static calculateTangentsFromBuffer(vertices: Float32Array, indices: ArrayLike<number> | null): Float32Array;
|
|
8
|
+
private static _calculateTangents;
|
|
9
|
+
}
|
|
@@ -13,11 +13,6 @@ import { VertexAttribute } from "./enums/VertexAttribute";
|
|
|
13
13
|
* Define draw ranges with `addSubMesh()` and assign a material to each corresponding MeshRenderer slot.
|
|
14
14
|
*/
|
|
15
15
|
export declare class ModelMesh extends Mesh {
|
|
16
|
-
private static _tempVec0;
|
|
17
|
-
private static _tempVec1;
|
|
18
|
-
private static _tempVec2;
|
|
19
|
-
private static _tempVec3;
|
|
20
|
-
private static _tempVec4;
|
|
21
16
|
/** @internal */
|
|
22
17
|
_blendShapeManager: BlendShapeManager;
|
|
23
18
|
/** @internal */
|
|
@@ -224,9 +219,11 @@ export declare class ModelMesh extends Mesh {
|
|
|
224
219
|
*/
|
|
225
220
|
uploadData(releaseData: boolean): void;
|
|
226
221
|
/**
|
|
227
|
-
* Calculate
|
|
228
|
-
* @
|
|
229
|
-
*
|
|
222
|
+
* Calculate tangents from readable positions, normals and UVs.
|
|
223
|
+
* @remarks
|
|
224
|
+
* Without indices, every three consecutive vertices form a triangle.
|
|
225
|
+
* Incomplete trailing triangles and triangles with zero UV area are ignored.
|
|
226
|
+
* @see http://foundationsofgameenginedev.com/FGED2-sample.pdf
|
|
230
227
|
*/
|
|
231
228
|
calculateTangents(): void;
|
|
232
229
|
/**
|