@galacean/engine-core 1.2.0-alpha.11 → 1.2.0-alpha.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "1.2.0-alpha.11",
3
+ "version": "1.2.0-alpha.12",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -15,10 +15,10 @@
15
15
  "types/**/*"
16
16
  ],
17
17
  "dependencies": {
18
- "@galacean/engine-math": "1.2.0-alpha.11"
18
+ "@galacean/engine-math": "1.2.0-alpha.12"
19
19
  },
20
20
  "devDependencies": {
21
- "@galacean/engine-design": "1.2.0-alpha.11"
21
+ "@galacean/engine-design": "1.2.0-alpha.12"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
package/types/Camera.d.ts CHANGED
@@ -39,8 +39,6 @@ export declare class Camera extends Component {
39
39
  private _shaderData;
40
40
  private _isCustomViewMatrix;
41
41
  private _isCustomProjectionMatrix;
42
- private _nearClipPlane;
43
- private _farClipPlane;
44
42
  private _fieldOfView;
45
43
  private _orthographicSize;
46
44
  private _isProjectionDirty;
@@ -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
+ }
@@ -65,5 +65,6 @@ export declare class BasicRenderPipeline {
65
65
  pushRenderData(context: RenderContext, data: RenderData): void;
66
66
  private pushRenderDataWithShader;
67
67
  private _drawBackgroundTexture;
68
- private _callRender;
68
+ private _prepareRender;
69
+ private _updateMVPShaderData;
69
70
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Down sampling.
3
+ */
4
+ export declare enum Downsampling {
5
+ /** No down sampling. */
6
+ None = 1,
7
+ /** Half resolution down sampling. */
8
+ TwoX = 2,
9
+ /** Quarter resolution down sampling. */
10
+ FourX = 4
11
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Multi-sample anti-aliasing samples.
3
+ */
4
+ export declare enum MSAASamples {
5
+ /** No multi-sample anti-aliasing. */
6
+ None = 1,
7
+ /** Multi-sample anti-aliasing with 2 samples. */
8
+ TwoX = 2,
9
+ /** Multi-sample anti-aliasing with 4 samples. */
10
+ FourX = 4,
11
+ /** Multi-sample anti-aliasing with 8 samples. */
12
+ EightX = 8
13
+ }
@@ -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
+ }
@@ -1,17 +0,0 @@
1
- import { Mesh } from "../graphic/Mesh";
2
- import { SubMesh } from "../graphic/SubMesh";
3
- import { Material } from "../material/Material";
4
- import { Renderer } from "../Renderer";
5
- import { IPoolElement } from "./IPoolElement";
6
- import { RenderData } from "./RenderData";
7
- /**
8
- * Render element.
9
- */
10
- export declare class MeshRenderData extends RenderData implements IPoolElement {
11
- /** Mesh. */
12
- mesh: Mesh;
13
- /** Sub mesh. */
14
- subMesh: SubMesh;
15
- set(component: Renderer, material: Material, mesh: Mesh, subMesh: SubMesh): void;
16
- dispose(): void;
17
- }
@@ -1,19 +0,0 @@
1
- import { Mesh } from "../graphic/Mesh";
2
- import { SubMesh } from "../graphic/SubMesh";
3
- import { Material } from "../material/Material";
4
- import { Renderer } from "../Renderer";
5
- import { ShaderPass } from "../shader/ShaderPass";
6
- import { RenderState } from "../shader/state/RenderState";
7
- import { IPoolElement } from "./IPoolElement";
8
- import { RenderElement } from "./RenderElement";
9
- /**
10
- * Render element.
11
- */
12
- export declare class MeshRenderElement extends RenderElement implements IPoolElement {
13
- /** Mesh. */
14
- mesh: Mesh;
15
- /** Sub mesh. */
16
- subMesh: SubMesh;
17
- setValue(component: Renderer, mesh: Mesh, subMesh: SubMesh, material: Material, renderState: RenderState, shaderPass: ShaderPass): void;
18
- dispose(): void;
19
- }
@@ -1,15 +0,0 @@
1
- import { RenderData2D } from "../2d/data/RenderData2D";
2
- import { Material } from "../material/Material";
3
- import { Renderer } from "../Renderer";
4
- import { ShaderPass } from "../shader";
5
- import { RenderState } from "../shader/state/RenderState";
6
- import { Texture2D } from "../texture";
7
- import { IPoolElement } from "./IPoolElement";
8
- import { RenderElement } from "./RenderElement";
9
- export declare class SpriteElement extends RenderElement implements IPoolElement {
10
- renderData: RenderData2D;
11
- texture: Texture2D;
12
- constructor();
13
- setValue(component: Renderer, renderDate: RenderData2D, material: Material, texture: Texture2D, renderState: RenderState, shaderPass: ShaderPass): void;
14
- dispose(): void;
15
- }
@@ -1,12 +0,0 @@
1
- import { RenderData2D } from "../2d/data/RenderData2D";
2
- import { Material } from "../material/Material";
3
- import { Renderer } from "../Renderer";
4
- import { IPoolElement } from "./IPoolElement";
5
- import { RenderElement } from "./RenderElement";
6
- export declare class SpriteMaskElement extends RenderElement implements IPoolElement {
7
- renderData: RenderData2D;
8
- isAdd: boolean;
9
- constructor();
10
- setValue(component: Renderer, renderData: RenderData2D, material: Material): void;
11
- dispose(): void;
12
- }
@@ -1,8 +0,0 @@
1
- import { IPoolElement } from "./IPoolElement";
2
- import { RenderElement } from "./RenderElement";
3
- import { SpriteElement } from "./SpriteElement";
4
- export declare class TextRenderElement extends RenderElement implements IPoolElement {
5
- charElements: SpriteElement[];
6
- constructor();
7
- dispose(): void;
8
- }
@@ -1,2 +0,0 @@
1
- export interface IRefObject {
2
- }
@@ -1,27 +0,0 @@
1
- import { EngineObject } from "../base/EngineObject";
2
- import { Engine } from "../Engine";
3
- import { IRefObject } from "./IRefObject";
4
- /**
5
- * The base class of assets, with reference counting capability.
6
- */
7
- export declare abstract class RefObject extends EngineObject implements IRefObject {
8
- /** Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc(). */
9
- isGCIgnored: boolean;
10
- private _refCount;
11
- /**
12
- * Counted by valid references.
13
- */
14
- get refCount(): number;
15
- protected constructor(engine: Engine);
16
- /**
17
- * Destroy self.
18
- * @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully.
19
- * @returns Whether the release was successful.
20
- */
21
- destroy(force?: boolean): boolean;
22
- /**
23
- * Called when the resource is destroyed.
24
- * Subclasses can override this function.
25
- */
26
- protected abstract _onDestroy(): void;
27
- }
@@ -1,24 +0,0 @@
1
- import { EventDispatcher } from "./EventDispatcher";
2
- export type Listener = ((e: Event) => any) & {
3
- once?: boolean;
4
- };
5
- /** Event Object. * @class */
6
- export declare class Event {
7
- get propagationStopped(): boolean;
8
- get target(): EventDispatcher;
9
- set target(t: EventDispatcher);
10
- get timeStamp(): number;
11
- get currentTarget(): EventDispatcher;
12
- set currentTarget(t: EventDispatcher);
13
- get bubbles(): boolean;
14
- get type(): string | number;
15
- data: any;
16
- private _timeStamp;
17
- private _target;
18
- private _currentTarget;
19
- private _bubbles;
20
- private _propagationStopped;
21
- private _type;
22
- constructor(type: string | number, target?: EventDispatcher, data?: any, bubbles?: boolean);
23
- stopPropagation(): void;
24
- }
@@ -1,14 +0,0 @@
1
- export declare const Util: {
2
- isArray: (value: any) => boolean;
3
- isArrayLike(x: any): boolean;
4
- clone<T>(obj: T): T;
5
- downloadBlob(blob: Blob, fileName?: string): void;
6
- };
7
- export declare const isArrayLike: <T>(x: any) => x is ArrayLike<T>;
8
- /**
9
- * Fastly remove an element from array.
10
- * @param array - Array
11
- * @param item - Element
12
- */
13
- export declare function removeFromArray(array: any[], item: any): boolean;
14
- export declare function ObjectValues(obj: any): any[];
@@ -1,78 +0,0 @@
1
- import { Ray, Vector3 } from "@galacean/engine-math";
2
- import { Engine } from "../Engine";
3
- import { Layer } from "../Layer";
4
- import { HitResult } from "./HitResult";
5
- /**
6
- * A physics manager is a collection of colliders and constraints which can interact.
7
- */
8
- export declare class PhysicsManager {
9
- private static _collision;
10
- private _engine;
11
- private _restTime;
12
- private _fixedTimeStep;
13
- private _colliders;
14
- private _gravity;
15
- private _nativePhysicsManager;
16
- private _physicalObjectsMap;
17
- private _onContactEnter;
18
- private _onContactExit;
19
- private _onContactStay;
20
- private _onTriggerEnter;
21
- private _onTriggerExit;
22
- private _onTriggerStay;
23
- /**
24
- * The gravity of physics scene.
25
- */
26
- get gravity(): Vector3;
27
- set gravity(value: Vector3);
28
- /** The fixed time step in seconds at which physics are performed. */
29
- get fixedTimeStep(): number;
30
- set fixedTimeStep(value: number);
31
- constructor(engine: Engine);
32
- /**
33
- * Casts a ray through the Scene and returns the first hit.
34
- * @param ray - The ray
35
- * @returns Returns True if the ray intersects with a collider, otherwise false
36
- */
37
- raycast(ray: Ray): boolean;
38
- /**
39
- * Casts a ray through the Scene and returns the first hit.
40
- * @param ray - The ray
41
- * @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
42
- * @returns Returns True if the ray intersects with a collider, otherwise false
43
- */
44
- raycast(ray: Ray, outHitResult: HitResult): boolean;
45
- /**
46
- * Casts a ray through the Scene and returns the first hit.
47
- * @param ray - The ray
48
- * @param distance - The max distance the ray should check
49
- * @returns Returns True if the ray intersects with a collider, otherwise false
50
- */
51
- raycast(ray: Ray, distance: number): boolean;
52
- /**
53
- * Casts a ray through the Scene and returns the first hit.
54
- * @param ray - The ray
55
- * @param distance - The max distance the ray should check
56
- * @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
57
- * @returns Returns True if the ray intersects with a collider, otherwise false
58
- */
59
- raycast(ray: Ray, distance: number, outHitResult: HitResult): boolean;
60
- /**
61
- * Casts a ray through the Scene and returns the first hit.
62
- * @param ray - The ray
63
- * @param distance - The max distance the ray should check
64
- * @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
65
- * @returns Returns True if the ray intersects with a collider, otherwise false
66
- */
67
- raycast(ray: Ray, distance: number, layerMask: Layer): boolean;
68
- /**
69
- * Casts a ray through the Scene and returns the first hit.
70
- * @param ray - The ray
71
- * @param distance - The max distance the ray should check
72
- * @param layerMask - Layer mask that is used to selectively ignore Colliders when casting
73
- * @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
74
- * @returns Returns True if the ray intersects with a collider, otherwise false.
75
- */
76
- raycast(ray: Ray, distance: number, layerMask: Layer, outHitResult: HitResult): boolean;
77
- private _setGravity;
78
- }