@galacean/engine-core 1.2.0-alpha.8 → 1.2.0-beta.0

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.
Files changed (77) hide show
  1. package/dist/main.js +10245 -9942
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +10245 -9942
  4. package/dist/module.js +10245 -9942
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/Camera.d.ts +36 -2
  8. package/types/Deprecated.d.ts +101 -0
  9. package/types/RenderPipeline/BasicRenderPipeline.d.ts +6 -31
  10. package/types/RenderPipeline/RenderQueue.d.ts +1 -2
  11. package/types/RenderPipeline/index.d.ts +0 -1
  12. package/types/Renderer.d.ts +4 -1
  13. package/types/animation/AnimatorLayerMask.d.ts +1 -1
  14. package/types/enums/Downsampling.d.ts +11 -0
  15. package/types/enums/MSAASamples.d.ts +13 -0
  16. package/types/index.d.ts +2 -0
  17. package/types/mesh/SkinnedMeshRenderer.d.ts +2 -0
  18. package/types/physics/HitResult.d.ts +3 -0
  19. package/types/renderingHardwareInterface/IPlatformRenderTarget.d.ts +2 -2
  20. package/types/shader/state/DepthState.d.ts +2 -2
  21. package/types/shaderlib/ShaderFactory.d.ts +1 -0
  22. package/types/texture/RenderTarget.d.ts +5 -4
  23. package/types/texture/Texture.d.ts +1 -0
  24. package/types/texture/enums/PixelFormat.d.ts +73 -0
  25. package/types/texture/enums/RenderBufferDepthFormat.d.ts +11 -9
  26. package/types/texture/enums/TextureFormat.d.ts +30 -26
  27. package/types/RenderPipeline/MeshRenderData.d.ts +0 -17
  28. package/types/physics/PhysicsManager.d.ts +0 -78
  29. package/types/xr/XRPose.d.ts +0 -15
  30. package/types/xr/feature/XRFeature.d.ts +0 -16
  31. package/types/xr/feature/XRFeatureManager.d.ts +0 -65
  32. package/types/xr/feature/XRFeatureType.d.ts +0 -13
  33. package/types/xr/feature/camera/XRCameraManager.d.ts +0 -26
  34. package/types/xr/feature/hitTest/TrackableType.d.ts +0 -10
  35. package/types/xr/feature/hitTest/XRHitResult.d.ts +0 -19
  36. package/types/xr/feature/hitTest/XRHitTest.d.ts +0 -39
  37. package/types/xr/feature/hitTest/XRHitTestManager.d.ts +0 -38
  38. package/types/xr/feature/hitTest/XRHitTestType.d.ts +0 -16
  39. package/types/xr/feature/movementTracking/XRMovementTracking.d.ts +0 -18
  40. package/types/xr/feature/movementTracking/XRMovementTrackingManager.d.ts +0 -10
  41. package/types/xr/feature/movementTracking/XRMovementTrackingMode.d.ts +0 -5
  42. package/types/xr/feature/trackable/XRRequestTrackingState.d.ts +0 -11
  43. package/types/xr/feature/trackable/XRTrackableFeature.d.ts +0 -38
  44. package/types/xr/feature/trackable/XRTrackableManager.d.ts +0 -41
  45. package/types/xr/feature/trackable/anchor/XRAnchor.d.ts +0 -6
  46. package/types/xr/feature/trackable/anchor/XRAnchorTracking.d.ts +0 -37
  47. package/types/xr/feature/trackable/anchor/XRAnchorTrackingManager.d.ts +0 -20
  48. package/types/xr/feature/trackable/anchor/XRRequestAnchor.d.ts +0 -15
  49. package/types/xr/feature/trackable/image/XRImageTracking.d.ts +0 -24
  50. package/types/xr/feature/trackable/image/XRImageTrackingManager.d.ts +0 -31
  51. package/types/xr/feature/trackable/image/XRReferenceImage.d.ts +0 -11
  52. package/types/xr/feature/trackable/image/XRRequestImage.d.ts +0 -13
  53. package/types/xr/feature/trackable/image/XRTrackedImage.d.ts +0 -8
  54. package/types/xr/feature/trackable/plane/XRPlaneMode.d.ts +0 -13
  55. package/types/xr/feature/trackable/plane/XRPlaneTracking.d.ts +0 -23
  56. package/types/xr/feature/trackable/plane/XRPlaneTrackingManager.d.ts +0 -11
  57. package/types/xr/feature/trackable/plane/XRRequestPlane.d.ts +0 -12
  58. package/types/xr/feature/trackable/plane/XRTrackedPlane.d.ts +0 -20
  59. package/types/xr/index.d.ts +0 -25
  60. package/types/xr/input/XRCamera.d.ts +0 -15
  61. package/types/xr/input/XRController.d.ts +0 -38
  62. package/types/xr/input/XRControllerPoseMode.d.ts +0 -9
  63. package/types/xr/input/XRInput.d.ts +0 -8
  64. package/types/xr/input/XRInputButton.d.ts +0 -19
  65. package/types/xr/input/XRInputEvent.d.ts +0 -24
  66. package/types/xr/input/XRInputEventType.d.ts +0 -11
  67. package/types/xr/input/XRInputManager.d.ts +0 -31
  68. package/types/xr/input/XRInputType.d.ts +0 -23
  69. package/types/xr/input/XRTargetRayMode.d.ts +0 -12
  70. package/types/xr/input/XRTrackedInputDevice.d.ts +0 -21
  71. package/types/xr/input/XRTrackedUpdateFlag.d.ts +0 -11
  72. package/types/xr/input/XRTrackingState.d.ts +0 -11
  73. package/types/xr/session/XRSessionManager.d.ts +0 -45
  74. package/types/xr/session/XRSessionMode.d.ts +0 -8
  75. package/types/xr/session/XRSessionState.d.ts +0 -13
  76. /package/types/{xr/feature/trackable/XRRequestTracking.d.ts → BasicResources.d.ts} +0 -0
  77. /package/types/{xr/feature/trackable/XRTracked.d.ts → RenderPipeline/OpaqueTexturePass.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-core",
3
- "version": "1.2.0-alpha.8",
3
+ "version": "1.2.0-beta.0",
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.8"
18
+ "@galacean/engine-math": "1.2.0-beta.0"
19
19
  },
20
20
  "devDependencies": {
21
- "@galacean/engine-design": "1.2.0-alpha.8"
21
+ "@galacean/engine-design": "1.2.0-beta.0"
22
22
  },
23
23
  "scripts": {
24
24
  "b:types": "tsc"
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,15 +35,27 @@ 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
57
  private _isCustomViewMatrix;
41
58
  private _isCustomProjectionMatrix;
42
- private _nearClipPlane;
43
- private _farClipPlane;
44
59
  private _fieldOfView;
45
60
  private _orthographicSize;
46
61
  private _isProjectionDirty;
@@ -48,6 +63,7 @@ export declare class Camera extends Component {
48
63
  private _customAspectRatio;
49
64
  private _renderTarget;
50
65
  private _depthBufferParams;
66
+ private _opaqueTextureEnabled;
51
67
  private _frustumChangeFlag;
52
68
  private _transform;
53
69
  private _isViewMatrixDirty;
@@ -56,6 +72,22 @@ export declare class Camera extends Component {
56
72
  private _pixelViewport;
57
73
  private _inverseProjectionMatrix;
58
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;
59
91
  /**
60
92
  * Shader data.
61
93
  */
@@ -254,5 +286,7 @@ export declare class Camera extends Component {
254
286
  * The inverse of the projection matrix.
255
287
  */
256
288
  private _getInverseProjectionMatrix;
289
+ private _forceUseInternalCanvas;
257
290
  private _onPixelViewportChanged;
291
+ private _checkMainCanvasAntialiasWaste;
258
292
  }
@@ -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
+ }
@@ -1,49 +1,23 @@
1
1
  import { Camera } from "../Camera";
2
- import { Layer } from "../Layer";
3
2
  import { CameraClearFlags } from "../enums/CameraClearFlags";
4
- import { Material } from "../material";
5
- import { RenderTarget, TextureCubeFace } from "../texture";
3
+ import { TextureCubeFace } from "../texture";
6
4
  import { RenderContext } from "./RenderContext";
7
5
  import { RenderData } from "./RenderData";
8
- import { RenderPass } from "./RenderPass";
9
6
  /**
10
7
  * Basic render pipeline.
11
8
  */
12
9
  export declare class BasicRenderPipeline {
13
10
  private _camera;
14
- private _defaultPass;
15
- private _renderPassArray;
16
11
  private _lastCanvasSize;
17
- private _cascadedShadowCaster;
12
+ private _internalColorTarget;
13
+ private _cascadedShadowCasterPass;
18
14
  private _depthOnlyPass;
15
+ private _opaqueTexturePass;
19
16
  /**
20
17
  * Create a basic render pipeline.
21
18
  * @param camera - Camera
22
19
  */
23
20
  constructor(camera: Camera);
24
- /**
25
- * Default render pass.
26
- */
27
- get defaultRenderPass(): RenderPass;
28
- /**
29
- * Add render pass.
30
- * @param nameOrPass - The name of this Pass or RenderPass object. When it is a name, the following parameters need to be provided
31
- * @param priority - Priority, less than 0 before the default pass, greater than 0 after the default pass
32
- * @param renderTarget - The specified Render Target
33
- * @param replaceMaterial - Replaced material
34
- * @param mask - Perform bit and operations with Entity.Layer to filter the objects that this Pass needs to render
35
- */
36
- addRenderPass(nameOrPass: string | RenderPass, priority?: number, renderTarget?: RenderTarget, replaceMaterial?: Material, mask?: Layer): void;
37
- /**
38
- * Remove render pass by name or render pass object.
39
- * @param nameOrPass - Render pass name or render pass object
40
- */
41
- removeRenderPass(nameOrPass: string | RenderPass): void;
42
- /**
43
- * Get render pass by name.
44
- * @param name - Render pass name
45
- */
46
- getRenderPass(name: string): RenderPass;
47
21
  /**
48
22
  * Destroy internal resources.
49
23
  */
@@ -65,5 +39,6 @@ export declare class BasicRenderPipeline {
65
39
  pushRenderData(context: RenderContext, data: RenderData): void;
66
40
  private pushRenderDataWithShader;
67
41
  private _drawBackgroundTexture;
68
- private _callRender;
42
+ private _prepareRender;
43
+ private _updateMVPShaderData;
69
44
  }
@@ -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, mask: Layer, pipelineStageTagValue: string): void;
17
+ render(camera: Camera, pipelineStageTagValue: string): void;
19
18
  /**
20
19
  * Clear collection.
21
20
  */
@@ -1,4 +1,3 @@
1
1
  export { BasicRenderPipeline } from "./BasicRenderPipeline";
2
2
  export { PipelineStage } from "./enums/PipelineStage";
3
- export { RenderPass } from "./RenderPass";
4
3
  export { RenderQueue } from "./RenderQueue";
@@ -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
  }
@@ -27,7 +27,7 @@ export declare class AnimatorLayerMask {
27
27
  * Removes a path mask from the AnimatorLayerMask.
28
28
  * @param path - The path of the mask to remove
29
29
  */
30
- removePathMask(path: any): void;
30
+ removePathMask(path: string): void;
31
31
  /**
32
32
  * Get a path mask based on the given path.
33
33
  * @param path - The path of the mask to get
@@ -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
+ }
package/types/index.d.ts CHANGED
@@ -30,6 +30,8 @@ export { DepthTextureMode } from "./enums/DepthTextureMode";
30
30
  export { FogMode } from "./enums/FogMode";
31
31
  export { CameraClearFlags } from "./enums/CameraClearFlags";
32
32
  export { CameraType } from "./enums/CameraType";
33
+ export { MSAASamples } from "./enums/MSAASamples";
34
+ export { Downsampling } from "./enums/Downsampling";
33
35
  export { ColorSpace } from "./enums/ColorSpace";
34
36
  export { BackgroundTextureFillMode } from "./enums/BackgroundTextureFillMode";
35
37
  export { XRManager } from "./xr/XRManager";
@@ -1,5 +1,6 @@
1
1
  import { BoundingBox } from "@galacean/engine-math";
2
2
  import { Entity } from "../Entity";
3
+ import { RenderContext } from "../RenderPipeline/RenderContext";
3
4
  import { MeshRenderer } from "./MeshRenderer";
4
5
  import { Skin } from "./Skin";
5
6
  /**
@@ -38,6 +39,7 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
38
39
  */
39
40
  get bones(): ReadonlyArray<Entity>;
40
41
  set bones(value: ReadonlyArray<Entity>);
42
+ _updateShaderData(context: RenderContext, onlyMVP: boolean): void;
41
43
  private _checkBlendShapeWeightLength;
42
44
  private _onLocalBoundsChanged;
43
45
  private _getEntityHierarchyPath;
@@ -1,5 +1,6 @@
1
1
  import { Entity } from "../Entity";
2
2
  import { Vector3 } from "@galacean/engine-math";
3
+ import { ColliderShape } from "./shape";
3
4
  /**
4
5
  * Structure used to get information back from a raycast or a sweep.
5
6
  */
@@ -12,4 +13,6 @@ export declare class HitResult {
12
13
  point: Vector3;
13
14
  /** The normal of the surface the ray hit. */
14
15
  normal: Vector3;
16
+ /** The shape of the collider that was hit. */
17
+ shape: ColliderShape;
15
18
  }
@@ -5,10 +5,10 @@ import { TextureCubeFace } from "../texture";
5
5
  export interface IPlatformRenderTarget {
6
6
  /**
7
7
  * Set which face and mipLevel of the cube texture to render to.
8
- * @param faceIndex - Cube texture face
9
8
  * @param mipLevel - Set mip level the data want to write
9
+ * @param faceIndex - Cube texture face
10
10
  */
11
- setRenderTargetInfo(faceIndex: TextureCubeFace, mipLevel: number): void;
11
+ activeRenderTarget(mipLevel: number, faceIndex?: TextureCubeFace): void;
12
12
  /**
13
13
  * Blit FBO.
14
14
  */
@@ -6,9 +6,9 @@ export declare class DepthState {
6
6
  private static _getGLCompareFunction;
7
7
  /** Whether to enable the depth test. */
8
8
  enabled: boolean;
9
- /** Whether the depth value can be written.*/
10
- writeEnabled: boolean;
11
9
  /** Depth comparison function. */
12
10
  compareFunction: CompareFunction;
11
+ /** Whether the depth value can be written.*/
12
+ writeEnabled: boolean;
13
13
  private _platformApply;
14
14
  }
@@ -1,6 +1,7 @@
1
1
  export declare class ShaderFactory {
2
2
  static parseCustomMacros(macros: string[]): string;
3
3
  static registerInclude(includeName: string, includeSource: string): void;
4
+ static unRegisterInclude(includeName: string): void;
4
5
  /**
5
6
  * @param regex The default regex is for engine's builtin glsl `#include` syntax,
6
7
  * since `ShaderLab` use the same parsing function but different syntax for `#include` --- `/^[ \t]*#include +"([\w\d.]+)"/gm`
@@ -1,6 +1,7 @@
1
1
  import { GraphicsResource } from "../asset/GraphicsResource";
2
2
  import { Engine } from "../Engine";
3
3
  import { RenderBufferDepthFormat } from "./enums/RenderBufferDepthFormat";
4
+ import { TextureFormat } from "./enums/TextureFormat";
4
5
  import { Texture } from "./Texture";
5
6
  /**
6
7
  * The render target used for off-screen rendering.
@@ -43,10 +44,10 @@ export declare class RenderTarget extends GraphicsResource {
43
44
  * @param width - Render target width
44
45
  * @param height - Render target height
45
46
  * @param colorTexture - Render color texture
46
- * @param depthFormat - Depth format. default RenderBufferDepthFormat.Depth, engine will automatically select the supported precision
47
+ * @param depthFormat - Depth format. default TextureFormat.Depth, engine will automatically select the supported precision
47
48
  * @param antiAliasing - Anti-aliasing level, default is 1
48
49
  */
49
- constructor(engine: Engine, width: number, height: number, colorTexture: Texture, depthFormat?: RenderBufferDepthFormat | null, antiAliasing?: number);
50
+ constructor(engine: Engine, width: number, height: number, colorTexture: Texture, depthFormat?: TextureFormat | null | RenderBufferDepthFormat, antiAliasing?: number);
50
51
  /**
51
52
  * Create a render target through color texture and depth format.
52
53
  * @remarks If the color texture is not transmitted, only the depth texture is generated.
@@ -64,10 +65,10 @@ export declare class RenderTarget extends GraphicsResource {
64
65
  * @param width - Render target width
65
66
  * @param height - Render target height
66
67
  * @param colorTextures - Render color texture array
67
- * @param depthFormat - Depth format. default RenderBufferDepthFormat.Depth,engine will automatically select the supported precision
68
+ * @param depthFormat - Depth format. default TextureFormat.Depth,engine will automatically select the supported precision
68
69
  * @param antiAliasing - Anti-aliasing level, default is 1
69
70
  */
70
- constructor(engine: Engine, width: number, height: number, colorTextures: Texture[], depthFormat?: RenderBufferDepthFormat | null, antiAliasing?: number);
71
+ constructor(engine: Engine, width: number, height: number, colorTextures: Texture[], depthFormat?: TextureFormat | null | RenderBufferDepthFormat, antiAliasing?: number);
71
72
  /**
72
73
  * Create a render target with color texture array and depth texture.
73
74
  * @param engine - Define the engine to use for this off-screen rendering
@@ -76,4 +76,5 @@ export declare abstract class Texture extends GraphicsResource {
76
76
  */
77
77
  protected _getMaxMiplevel(size: number): number;
78
78
  protected _getMipmapCount(): number;
79
+ protected _isIntFormat(): boolean;
79
80
  }
@@ -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,21 +1,23 @@
1
1
  /**
2
+ * @deprecated Please use `TextureFormat` instead.
3
+ *
2
4
  * Render buffer depth format enumeration.
3
5
  */
4
6
  export declare enum RenderBufferDepthFormat {
5
7
  /** Render to depth buffer,engine will automatically select the supported precision. */
6
- Depth = 0,
7
- /** Render to depth stencil buffer, engine will automatically select the supported precision. */
8
- DepthStencil = 1,
8
+ Depth = 27,
9
9
  /** Render to stencil buffer. */
10
- Stencil = 2,
10
+ Stencil = 28,
11
+ /** Render to depth stencil buffer, engine will automatically select the supported precision. */
12
+ DepthStencil = 29,
11
13
  /** Force 16-bit depth buffer. */
12
- Depth16 = 3,
14
+ Depth16 = 30,
13
15
  /** Force 24-bit depth buffer. */
14
- Depth24 = 4,
16
+ Depth24 = 31,
15
17
  /** Force 32-bit depth buffer. */
16
- Depth32 = 5,
18
+ Depth32 = 32,
17
19
  /** Force 16-bit depth + 8-bit stencil buffer. */
18
- Depth24Stencil8 = 6,
20
+ Depth24Stencil8 = 33,
19
21
  /** Force 32-bit depth + 8-bit stencil buffer. */
20
- Depth32Stencil8 = 7
22
+ Depth32Stencil8 = 34
21
23
  }
@@ -20,56 +20,60 @@ export declare enum TextureFormat {
20
20
  R16G16B16A16 = 7,
21
21
  /** RGBA format, 32 bits per channel. */
22
22
  R32G32B32A32 = 8,
23
+ /** RGBA unsigned integer format, 32 bits per channel. */
24
+ R32G32B32A32_UInt = 9,
23
25
  /** RGB compressed format, 4 bits per pixel. */
24
- BC1 = 9,
26
+ BC1 = 10,
25
27
  /** RGBA compressed format, 8 bits per pixel. */
26
- BC3 = 10,
28
+ BC3 = 11,
27
29
  /** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
28
- BC7 = 11,
30
+ BC7 = 12,
29
31
  /** RGB compressed format, 4 bits per pixel. */
30
- ETC1_RGB = 12,
32
+ ETC1_RGB = 13,
31
33
  /** RGB compressed format, 4 bits per pixel. */
32
- ETC2_RGB = 13,
34
+ ETC2_RGB = 14,
33
35
  /** RGBA compressed format, 5 bits per pixel, 4 bit in RGB, 1 bit in A. */
34
- ETC2_RGBA5 = 14,
36
+ ETC2_RGBA5 = 15,
35
37
  /** RGB compressed format, 8 bits per pixel. */
36
- ETC2_RGBA8 = 15,
38
+ ETC2_RGBA8 = 16,
37
39
  /** RGB compressed format, 2 bits per pixel. */
38
- PVRTC_RGB2 = 16,
40
+ PVRTC_RGB2 = 17,
39
41
  /** RGBA compressed format, 2 bits per pixel. */
40
- PVRTC_RGBA2 = 17,
42
+ PVRTC_RGBA2 = 18,
41
43
  /** RGB compressed format, 4 bits per pixel. */
42
- PVRTC_RGB4 = 18,
44
+ PVRTC_RGB4 = 19,
43
45
  /** RGBA compressed format, 4 bits per pixel. */
44
- PVRTC_RGBA4 = 19,
46
+ PVRTC_RGBA4 = 20,
45
47
  /** RGB(A) compressed format, 128 bits per 4x4 pixel block. */
46
- ASTC_4x4 = 20,
48
+ ASTC_4x4 = 21,
47
49
  /** RGB(A) compressed format, 128 bits per 5x5 pixel block. */
48
- ASTC_5x5 = 21,
50
+ ASTC_5x5 = 22,
49
51
  /** RGB(A) compressed format, 128 bits per 6x6 pixel block. */
50
- ASTC_6x6 = 22,
52
+ ASTC_6x6 = 23,
51
53
  /** RGB(A) compressed format, 128 bits per 8x8 pixel block. */
52
- ASTC_8x8 = 23,
54
+ ASTC_8x8 = 24,
53
55
  /** RGB(A) compressed format, 128 bits per 10x10 pixel block. */
54
- ASTC_10x10 = 24,
56
+ ASTC_10x10 = 25,
55
57
  /** RGB(A) compressed format, 128 bits per 12x12 pixel block. */
56
- ASTC_12x12 = 25,
58
+ ASTC_12x12 = 26,
57
59
  /** Automatic depth format, engine will automatically select the supported precision. */
58
- Depth = 26,
60
+ Depth = 27,
61
+ /** Render to stencil buffer. */
62
+ Stencil = 28,
59
63
  /** Automatic depth stencil format, engine will automatically select the supported precision. */
60
- DepthStencil = 27,
64
+ DepthStencil = 29,
61
65
  /** 16-bit depth format. */
62
- Depth16 = 28,
66
+ Depth16 = 30,
63
67
  /** 24-bit depth format. */
64
- Depth24 = 29,
68
+ Depth24 = 31,
65
69
  /** 32-bit depth format. */
66
- Depth32 = 30,
70
+ Depth32 = 32,
67
71
  /** 16-bit depth + 8-bit stencil format. */
68
- Depth24Stencil8 = 31,
72
+ Depth24Stencil8 = 33,
69
73
  /** 32-bit depth + 8-bit stencil format. */
70
- Depth32Stencil8 = 32,
74
+ Depth32Stencil8 = 34,
71
75
  /** @deprecated Use `TextureFormat.BC1` instead. */
72
- DXT1 = 33,
76
+ DXT1 = 10,
73
77
  /** @deprecated Use `TextureFormat.BC3` instead. */
74
- DXT5 = 34
78
+ DXT5 = 11
75
79
  }