@galacean/engine-core 1.1.0-alpha.0 → 1.1.0-alpha.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.
Files changed (194) hide show
  1. package/dist/main.js +4539 -3189
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +4539 -3189
  4. package/dist/module.js +4917 -3567
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/2d/sprite/Sprite.d.ts +3 -0
  8. package/types/Camera.d.ts +25 -4
  9. package/types/DisorderedArray.d.ts +4 -3
  10. package/types/Engine.d.ts +5 -1
  11. package/types/Entity.d.ts +3 -1
  12. package/types/RenderPipeline/BasicRenderPipeline.d.ts +1 -2
  13. package/types/RenderPipeline/ClassPool.d.ts +3 -1
  14. package/types/RenderPipeline/CullingResults.d.ts +1 -0
  15. package/types/RenderPipeline/DepthOnlyPass.d.ts +1 -0
  16. package/types/RenderPipeline/IPoolElement.d.ts +3 -0
  17. package/types/RenderPipeline/MeshRenderData.d.ts +3 -1
  18. package/types/RenderPipeline/PipelinePass.d.ts +16 -0
  19. package/types/RenderPipeline/PipelineUtils.d.ts +1 -0
  20. package/types/RenderPipeline/RenderElement.d.ts +5 -5
  21. package/types/RenderPipeline/RenderElementX.d.ts +12 -0
  22. package/types/RenderPipeline/RenderQueue.d.ts +1 -1
  23. package/types/RenderPipeline/SpriteMaskRenderData.d.ts +3 -1
  24. package/types/RenderPipeline/SpriteRenderData.d.ts +3 -1
  25. package/types/RenderPipeline/TextRenderData.d.ts +3 -1
  26. package/types/RenderPipeline/enums/PipelineStage.d.ts +2 -0
  27. package/types/Renderer.d.ts +5 -2
  28. package/types/Scene.d.ts +10 -4
  29. package/types/Ticker.d.ts +30 -0
  30. package/types/Transform.d.ts +1 -0
  31. package/types/animation/Animator.d.ts +3 -1
  32. package/types/animation/enums/LayerState.d.ts +3 -1
  33. package/types/asset/AssetType.d.ts +2 -0
  34. package/types/asset/LoadItem.d.ts +16 -9
  35. package/types/asset/Loader.d.ts +3 -1
  36. package/types/asset/ResourceManager.d.ts +8 -2
  37. package/types/asset/request.d.ts +7 -3
  38. package/types/base/Constant.d.ts +1 -0
  39. package/types/base/EventDispatcher.d.ts +1 -1
  40. package/types/clone/ComponentCloner.d.ts +2 -1
  41. package/types/enums/DepthTextureMode.d.ts +7 -0
  42. package/types/graphic/Buffer.d.ts +22 -6
  43. package/types/graphic/BufferUtil.d.ts +1 -0
  44. package/types/graphic/Primitive.d.ts +1 -0
  45. package/types/graphic/PrimitiveVertexBinding.d.ts +1 -0
  46. package/types/graphic/SubMesh.d.ts +3 -1
  47. package/types/graphic/SubPrimitive.d.ts +9 -0
  48. package/types/graphic/VertexElement.d.ts +10 -6
  49. package/types/index.d.ts +2 -1
  50. package/types/lighting/AmbientLight.d.ts +4 -1
  51. package/types/lighting/LightManager.d.ts +1 -0
  52. package/types/material/Material.d.ts +9 -2
  53. package/types/mesh/BufferMesh.d.ts +2 -2
  54. package/types/mesh/ModelMesh.d.ts +62 -41
  55. package/types/mesh/PrimitiveMesh.d.ts +4 -2
  56. package/types/mesh/Skin.d.ts +3 -0
  57. package/types/mesh/SkinnedMeshRenderer.d.ts +20 -11
  58. package/types/mesh/index.d.ts +6 -5
  59. package/types/particle/ParticleBufferUtils.d.ts +1 -0
  60. package/types/particle/ParticleData.d.ts +1 -0
  61. package/types/particle/ParticleGenerator.d.ts +72 -0
  62. package/types/particle/ParticleMaterial.d.ts +28 -0
  63. package/types/particle/ParticleMesh.d.ts +289 -0
  64. package/types/particle/ParticleShaderDeclaration.d.ts +1 -0
  65. package/types/particle/ParticleShaderMacro.d.ts +1 -0
  66. package/types/particle/ParticleShaderProperty.d.ts +1 -0
  67. package/types/particle/ParticleSystem.d.ts +41 -0
  68. package/types/particle/ParticleVertexElements.d.ts +1 -0
  69. package/types/particle/ParticleVertexUtils.d.ts +1 -0
  70. package/types/particle/enum/ParticleAnimationRowMode.d.ts +9 -0
  71. package/types/particle/enum/ParticleAnimationType.d.ts +9 -0
  72. package/types/particle/enum/ParticleCurveMode.d.ts +13 -0
  73. package/types/particle/enum/ParticleGradientMode.d.ts +13 -0
  74. package/types/particle/enum/ParticleRenderMode.d.ts +17 -0
  75. package/types/particle/enum/ParticleScaleMode.d.ts +11 -0
  76. package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +9 -0
  77. package/types/particle/enum/ParticleShapeType.d.ts +15 -0
  78. package/types/particle/enum/ParticleSimulationSpace.d.ts +9 -0
  79. package/types/particle/enum/index.d.ts +9 -0
  80. package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
  81. package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
  82. package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
  83. package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
  84. package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
  85. package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
  86. package/types/particle/enums/ParticleStopMode.d.ts +6 -0
  87. package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
  88. package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
  89. package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
  90. package/types/particle/module/Burst.d.ts +38 -0
  91. package/types/particle/module/ColorGradient.d.ts +75 -0
  92. package/types/particle/module/ColorOverLifetimeModule.d.ts +20 -0
  93. package/types/particle/module/EmissionModule.d.ts +63 -0
  94. package/types/particle/module/FrameOverTime.d.ts +73 -0
  95. package/types/particle/module/ParticleCurve.d.ts +37 -0
  96. package/types/particle/module/RotationOverLifetimeModule.d.ts +21 -0
  97. package/types/particle/module/RotationVelocityGradient.d.ts +184 -0
  98. package/types/particle/module/SizeGradient.d.ts +151 -0
  99. package/types/particle/module/SizeOverLifetimeModule.d.ts +21 -0
  100. package/types/particle/module/StartFrame.d.ts +46 -0
  101. package/types/particle/module/TextureSheetAnimationModule.d.ts +37 -0
  102. package/types/particle/module/VelocityGradient.d.ts +110 -0
  103. package/types/particle/module/VelocityOverLifetimeModule.d.ts +22 -0
  104. package/types/particle/module/index.d.ts +15 -0
  105. package/types/particle/module/shape/BaseShape.d.ts +26 -0
  106. package/types/particle/module/shape/BoxShape.d.ts +20 -0
  107. package/types/particle/module/shape/CircleShape.d.ts +27 -0
  108. package/types/particle/module/shape/ConeShape.d.ts +35 -0
  109. package/types/particle/module/shape/HemisphereShape.d.ts +23 -0
  110. package/types/particle/module/shape/ShapeUtils.d.ts +1 -0
  111. package/types/particle/module/shape/SphereShape.d.ts +23 -0
  112. package/types/particle/module/shape/index.d.ts +5 -0
  113. package/types/particle/modules/Burst.d.ts +14 -0
  114. package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
  115. package/types/particle/modules/EmissionModule.d.ts +45 -0
  116. package/types/particle/modules/MainModule.d.ts +68 -0
  117. package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
  118. package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
  119. package/types/particle/modules/ParticleCurve.d.ts +56 -0
  120. package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
  121. package/types/particle/modules/ParticleGradient.d.ts +94 -0
  122. package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
  123. package/types/particle/modules/ShapeModule.d.ts +9 -0
  124. package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
  125. package/types/particle/modules/TextureSheetAnimationModule.d.ts +42 -0
  126. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
  127. package/types/particle/modules/shape/BaseShape.d.ts +12 -0
  128. package/types/particle/modules/shape/BoxShape.d.ts +11 -0
  129. package/types/particle/modules/shape/CircleShape.d.ts +17 -0
  130. package/types/particle/modules/shape/ConeShape.d.ts +28 -0
  131. package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
  132. package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
  133. package/types/particle/modules/shape/SphereShape.d.ts +9 -0
  134. package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
  135. package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  136. package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
  137. package/types/particle/modules/shape/index.d.ts +6 -0
  138. package/types/particle/moudules/Burst.d.ts +25 -0
  139. package/types/particle/moudules/Emission.d.ts +47 -0
  140. package/types/particle/moudules/EmissionModule.d.ts +49 -0
  141. package/types/particle/moudules/MainModule.d.ts +59 -0
  142. package/types/particle/moudules/ParticleCurve.d.ts +27 -0
  143. package/types/particle/moudules/ParticleGradient.d.ts +28 -0
  144. package/types/particle/moudules/ShapeModule.d.ts +7 -0
  145. package/types/particle/moudules/shape/BaseShape.d.ts +28 -0
  146. package/types/particle/moudules/shape/BoxShape.d.ts +20 -0
  147. package/types/particle/moudules/shape/CircleShape.d.ts +27 -0
  148. package/types/particle/moudules/shape/ConeShape.d.ts +35 -0
  149. package/types/particle/moudules/shape/HemisphereShape.d.ts +23 -0
  150. package/types/particle/moudules/shape/ShapeUtils.d.ts +1 -0
  151. package/types/particle/moudules/shape/SphereShape.d.ts +23 -0
  152. package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  153. package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +15 -0
  154. package/types/particle/moudules/shape/index.d.ts +5 -0
  155. package/types/physics/PhysicsScene.d.ts +6 -2
  156. package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +0 -1
  157. package/types/renderingHardwareInterface/IPlatformTexture2D.d.ts +1 -1
  158. package/types/renderingHardwareInterface/IPlatformTexture2DArray.d.ts +1 -1
  159. package/types/renderingHardwareInterface/IPlatformTextureCube.d.ts +1 -1
  160. package/types/shader/Shader.d.ts +22 -0
  161. package/types/shader/enums/RenderStateElementKey.d.ts +58 -0
  162. package/types/shader/index.d.ts +1 -0
  163. package/types/shaderlib/particle/index.d.ts +14 -0
  164. package/types/shadow/CascadedShadowCasterPass.d.ts +5 -6
  165. package/types/shadow/PipelinePass.d.ts +16 -0
  166. package/types/sky/Sky.d.ts +12 -4
  167. package/types/texture/RenderTarget.d.ts +1 -2
  168. package/types/texture/Texture.d.ts +6 -0
  169. package/types/texture/Texture2D.d.ts +4 -2
  170. package/types/texture/Texture2DArray.d.ts +1 -1
  171. package/types/texture/TextureCube.d.ts +1 -1
  172. package/types/texture/enums/TextureFormat.d.ts +55 -49
  173. package/types/texture/enums/TextureUsage.d.ts +9 -0
  174. package/types/texture/index.d.ts +1 -0
  175. package/types/xr/XRManager.d.ts +31 -0
  176. package/types/xr/component/XRPoseDriver.d.ts +10 -0
  177. package/types/xr/data/XRCamera.d.ts +6 -0
  178. package/types/xr/data/XRDevice.d.ts +9 -0
  179. package/types/xr/data/XRHandle.d.ts +10 -0
  180. package/types/xr/enum/EnumXRButton.d.ts +5 -0
  181. package/types/xr/enum/EnumXRDevicePhase.d.ts +4 -0
  182. package/types/xr/enum/EnumXRFeature.d.ts +9 -0
  183. package/types/xr/enum/EnumXRInputSource.d.ts +8 -0
  184. package/types/xr/enum/EnumXRMode.d.ts +7 -0
  185. package/types/xr/enum/EnumXRSubsystem.d.ts +4 -0
  186. package/types/xr/enum/EnumXRTrackingMode.d.ts +7 -0
  187. package/types/xr/feature/XRCameraManager.d.ts +21 -0
  188. package/types/xr/feature/XRFeature.d.ts +29 -0
  189. package/types/xr/feature/XRImageTrackManager.d.ts +10 -0
  190. package/types/xr/feature/XRInputManager.d.ts +16 -0
  191. package/types/xr/index.d.ts +18 -0
  192. package/types/xr/provider/XRProvider.d.ts +19 -0
  193. package/types/xr/subsystem/XRInputSubsystem.d.ts +5 -0
  194. package/types/xr/subsystem/XRSubsystem.d.ts +30 -0
@@ -0,0 +1,27 @@
1
+ import { IClone } from "@galacean/engine-design";
2
+ import { ParticleCurveMode } from "../enums/ParticleCurveMode";
3
+ /**
4
+ * Particle curve.
5
+ */
6
+ export declare class ParticleCurve implements IClone {
7
+ /** The curve mode. */
8
+ mode: ParticleCurveMode;
9
+ constant: number;
10
+ constantMin: number;
11
+ constantMax: number;
12
+ /**
13
+ * Query the curve value at the specified time.
14
+ * @param time - Normalized time at which to evaluate the curve, Valid when `mode` is set to `Curve` or `TwoCurves`
15
+ * @param lerpFactor - Lerp factor between two constants or curves, Valid when `mode` is set to `TwoConstants` or `TwoCurves`
16
+ * @returns - The result curve value
17
+ */
18
+ evaluate(time: number, lerpFactor: number): number;
19
+ /**
20
+ * @inheritDoc
21
+ */
22
+ cloneTo(destEmission: ParticleCurve): void;
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ clone(): ParticleCurve;
27
+ }
@@ -0,0 +1,28 @@
1
+ import { IClone } from "@galacean/engine-design";
2
+ import { Color } from "@galacean/engine-math";
3
+ import { ParticleGradientMode } from "../enums/ParticleGradientMode";
4
+ /**
5
+ * Particle curve.
6
+ */
7
+ export declare class ParticleGradient implements IClone {
8
+ /** The curve mode. */
9
+ mode: ParticleGradientMode;
10
+ color: Color;
11
+ colorMin: Color;
12
+ colorMax: Color;
13
+ /**
14
+ * Query the color at the specified time.
15
+ * @param time - Normalized time at which to evaluate the gradient, Valid when `mode` is set to `Gradient` or `TwoGradients`
16
+ * @param lerpFactor - Lerp factor between two colors or gradients, Valid when `mode` is set to `TwoColors` or `TwoGradients`
17
+ * @param out - The result color
18
+ */
19
+ evaluate(time: number, lerpFactor: number, out: Color): void;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ cloneTo(destEmission: ParticleGradient): void;
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ clone(): ParticleGradient;
28
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shape module of `ParticleSystem`.
3
+ */
4
+ export declare class ShapeModule {
5
+ /** Specifies whether the Shape Module is enabled or disabled. */
6
+ enabled: boolean;
7
+ }
@@ -0,0 +1,28 @@
1
+ import { IClone } from "@galacean/engine-design";
2
+ import { BoundingBox, Rand } from "@galacean/engine-math";
3
+ import { ParticleShapeType } from "./enums/ParticleShapeType";
4
+ /**
5
+ * Configures the initial positions and directions of particles.
6
+ */
7
+ export declare class BaseShape implements IClone {
8
+ /** The type of shape to emit particles from. */
9
+ shapeType: ParticleShapeType;
10
+ /** Specifies whether the ShapeModule is enabled or disabled. */
11
+ enable: boolean;
12
+ /** Randomizes the starting direction of particles. */
13
+ randomDirectionAmount: number;
14
+ protected _rand: Rand;
15
+ constructor(randSeed?: number);
16
+ /**
17
+ * @override
18
+ * @inheritDoc
19
+ */
20
+ cloneTo(destShape: BaseShape): void;
21
+ /**
22
+ * @override
23
+ * @inheritDoc
24
+ */
25
+ clone(): BaseShape;
26
+ protected _getShapeBoundBox(boundBox: BoundingBox): void;
27
+ protected _getSpeedBoundBox(boundBox: BoundingBox): void;
28
+ }
@@ -0,0 +1,20 @@
1
+ import { BoundingBox, Vector3 } from "@galacean/engine-math";
2
+ import { BaseShape } from "./BaseShape";
3
+ /**
4
+ * Box emitter shape
5
+ */
6
+ export declare class BoxShape extends BaseShape {
7
+ /** Thickness of the box to emit particles from. */
8
+ boxThickness: Vector3;
9
+ constructor();
10
+ /**
11
+ * @inheritDoc
12
+ */
13
+ protected _getShapeBoundBox(boundBox: BoundingBox): void;
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ protected _getSpeedBoundBox(boundBox: BoundingBox): void;
18
+ cloneTo(destShape: BoxShape): void;
19
+ clone(): BoxShape;
20
+ }
@@ -0,0 +1,27 @@
1
+ import { BoundingBox, Vector2, Vector3 } from "@galacean/engine-math";
2
+ import { BaseShape } from "./BaseShape";
3
+ import { ParticleShapeMultiModeValue } from "./enums/ParticleShapeMultiModeValue";
4
+ /**
5
+ * Circle Particle Emitter
6
+ */
7
+ export declare class CircleShape extends BaseShape {
8
+ protected static _tempPositionPoint: Vector2;
9
+ /** Radius of the shape to emit particles from. */
10
+ radius: number;
11
+ /** Angle of the circle arc to emit particles from. */
12
+ arc: number;
13
+ /** The mode to generate particles around the arc. */
14
+ arcMode: ParticleShapeMultiModeValue;
15
+ constructor();
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ protected _getShapeBoundBox(boundBox: BoundingBox): void;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ protected _getSpeedBoundBox(boundBox: BoundingBox): void;
24
+ _generatePositionAndDirection(position: Vector3, direction: Vector3): void;
25
+ cloneTo(destShape: CircleShape): void;
26
+ clone(): CircleShape;
27
+ }
@@ -0,0 +1,35 @@
1
+ import { BoundingBox, Vector2, Vector3 } from "@galacean/engine-math";
2
+ import { BaseShape } from "./BaseShape";
3
+ export declare enum ConeEmitType {
4
+ Base = 0,
5
+ BaseShell = 1,
6
+ Volume = 2,
7
+ VolumeShell = 3
8
+ }
9
+ /**
10
+ * Cone particle emitter
11
+ */
12
+ export declare class ConeShape extends BaseShape {
13
+ protected static _tempPositionPoint: Vector2;
14
+ protected static _tempDirectionPoint: Vector2;
15
+ /** Angle of the cone to emit particles from. */
16
+ angle: number;
17
+ /** Radius of the shape to emit particles from. */
18
+ radius: number;
19
+ /** Length of the cone to emit particles from. */
20
+ length: number;
21
+ /** Cone emitter subtype */
22
+ emitType: ConeEmitType;
23
+ constructor();
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ protected _getShapeBoundBox(boundBox: BoundingBox): void;
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ protected _getSpeedBoundBox(boundBox: BoundingBox): void;
32
+ _generatePositionAndDirection(position: Vector3, direction: Vector3): void;
33
+ cloneTo(destShape: ConeShape): void;
34
+ clone(): ConeShape;
35
+ }
@@ -0,0 +1,23 @@
1
+ import { BoundingBox, Vector3 } from "@galacean/engine-math";
2
+ import { BaseShape } from "./BaseShape";
3
+ /**
4
+ * Hemisphere emitter
5
+ */
6
+ export declare class HemisphereShape extends BaseShape {
7
+ /** Radius of the shape to emit particles from. */
8
+ radius: number;
9
+ /** Whether emit from shell */
10
+ emitFromShell: boolean;
11
+ constructor();
12
+ /**
13
+ * @inheritDoc
14
+ */
15
+ protected _getShapeBoundBox(boundBox: BoundingBox): void;
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ protected _getSpeedBoundBox(boundBox: BoundingBox): void;
20
+ _generatePositionAndDirection(position: Vector3, direction: Vector3): void;
21
+ cloneTo(destShape: HemisphereShape): void;
22
+ clone(): HemisphereShape;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { BoundingBox, Rand, Vector3 } from "@galacean/engine-math";
2
+ import { BaseShape } from "./BaseShape";
3
+ /**
4
+ * Sphere emitter
5
+ */
6
+ export declare class SphereShape extends BaseShape {
7
+ /** Radius of the shape to emit particles from. */
8
+ radius: number;
9
+ /** Whether emit from shell */
10
+ emitFromShell: boolean;
11
+ constructor();
12
+ /**
13
+ * @inheritDoc
14
+ */
15
+ protected _getShapeBoundBox(boundBox: BoundingBox): void;
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ protected _getSpeedBoundBox(boundBox: BoundingBox): void;
20
+ _generatePositionAndDirection(position: Vector3, direction: Vector3, rand?: Rand, randomSeeds?: Uint32Array): void;
21
+ cloneTo(destShape: SphereShape): void;
22
+ clone(): SphereShape;
23
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The mode used to generate new points in a shape.
3
+ */
4
+ export declare enum ParticleShapeMultiModeValue {
5
+ /** Generate points randomly. (Default) */
6
+ Random = 0,
7
+ /** Animate the emission point around the shape. */
8
+ Loop = 1
9
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The emission shape.
3
+ */
4
+ export declare enum ParticleShapeType {
5
+ /** Emit from the volume of a box. */
6
+ Box = 0,
7
+ /** Emit from a circle. */
8
+ Circle = 1,
9
+ /** Emit from the base of a cone. */
10
+ Cone = 2,
11
+ /** Emit from a half-sphere. */
12
+ Hemisphere = 3,
13
+ /** Emit from a sphere. */
14
+ Sphere = 4
15
+ }
@@ -0,0 +1,5 @@
1
+ export { BoxShape } from "./BoxShape";
2
+ export { CircleShape } from "./CircleShape";
3
+ export { ConeShape, ConeEmitType } from "./ConeShape";
4
+ export { HemisphereShape } from "./HemisphereShape";
5
+ export { SphereShape } from "./SphereShape";
@@ -9,6 +9,7 @@ export declare class PhysicsScene {
9
9
  private static _collision;
10
10
  private _scene;
11
11
  private _restTime;
12
+ private _fixedTimeStep;
12
13
  private _colliders;
13
14
  private _gravity;
14
15
  private _nativePhysicsScene;
@@ -18,13 +19,16 @@ export declare class PhysicsScene {
18
19
  private _onTriggerEnter;
19
20
  private _onTriggerExit;
20
21
  private _onTriggerStay;
21
- /** The fixed time step in seconds at which physics are performed. */
22
- fixedTimeStep: number;
23
22
  /**
24
23
  * The gravity of physics scene.
25
24
  */
26
25
  get gravity(): Vector3;
27
26
  set gravity(value: Vector3);
27
+ /**
28
+ * The fixed time step in seconds at which physics are performed.
29
+ */
30
+ get fixedTimeStep(): number;
31
+ set fixedTimeStep(value: number);
28
32
  constructor(scene: Scene);
29
33
  /**
30
34
  * Casts a ray through the Scene and returns the first hit.
@@ -3,6 +3,5 @@ export interface IPlatformBuffer {
3
3
  bind(): void;
4
4
  setData(byteLength: number, data: ArrayBuffer | ArrayBufferView, bufferByteOffset?: number, dataOffset?: number, dataLength?: number, options?: SetDataOptions): void;
5
5
  getData(data: ArrayBufferView, bufferByteOffset?: number, dataOffset?: number, dataLength?: number): void;
6
- resize(byteLength: number): void;
7
6
  destroy(): void;
8
7
  }
@@ -23,7 +23,7 @@ export interface IPlatformTexture2D extends IPlatformTexture {
23
23
  * @param x - X coordinate of area start
24
24
  * @param y - Y coordinate of area start
25
25
  */
26
- setImageSource(imageSource: TexImageSource | OffscreenCanvas, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
26
+ setImageSource(imageSource: TexImageSource, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
27
27
  /**
28
28
  * Get the pixel color buffer according to the specified area.
29
29
  * @param x - X coordinate of area start
@@ -25,7 +25,7 @@ export interface IPlatformTexture2DArray extends IPlatformTexture {
25
25
  * @param x - X coordinate of area start
26
26
  * @param y - Y coordinate of area start
27
27
  */
28
- setImageSource(index: number, imageSource: TexImageSource | OffscreenCanvas, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
28
+ setImageSource(index: number, imageSource: TexImageSource, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
29
29
  /**
30
30
  * Get the pixel color buffer according to the specified area.
31
31
  * @param elementIndex - The texture array element index
@@ -26,7 +26,7 @@ export interface IPlatformTextureCube extends IPlatformTexture {
26
26
  * @param x - X coordinate of area start
27
27
  * @param y - Y coordinate of area start
28
28
  */
29
- setImageSource(face: TextureCubeFace, imageSource: TexImageSource | OffscreenCanvas, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
29
+ setImageSource(face: TextureCubeFace, imageSource: TexImageSource, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void;
30
30
  /**
31
31
  * Get the pixel color buffer according to the specified cube face and area.
32
32
  * @param face - You can choose which cube face to read
@@ -9,6 +9,27 @@ import { SubShader } from "./SubShader";
9
9
  export declare class Shader {
10
10
  readonly name: string;
11
11
  private static _shaderMap;
12
+ /**
13
+ * Create a shader by source code.
14
+ *
15
+ * @remarks
16
+ *
17
+ * ShaderLab must be enabled first as follows:
18
+ * ```ts
19
+ * // Import shaderLab
20
+ * import { ShaderLab } from "@galacean/engine-shader-lab";
21
+ * // Create engine with shaderLab
22
+ * const engine = await WebGLEngine.create({ canvas: "canvas", new ShaderLab() });
23
+ * ...
24
+ * ```
25
+ *
26
+ * @param shaderSource - shader code
27
+ * @returns Shader
28
+ *
29
+ * @throws
30
+ * Throw string exception if shaderLab has not been enabled properly.
31
+ */
32
+ static create(shaderSource: string): Shader;
12
33
  /**
13
34
  * Create a shader.
14
35
  * @param name - Name of the shader
@@ -53,6 +74,7 @@ export declare class Shader {
53
74
  * @returns Is the compiled shader variant valid
54
75
  */
55
76
  compileVariant(engine: Engine, macros: string[]): boolean;
77
+ private static _applyConstRenderStates;
56
78
  /**
57
79
  * @deprecated Please use `ShaderMacro.getByName` instead
58
80
  *
@@ -0,0 +1,58 @@
1
+ export declare enum RenderStateElementKey {
2
+ /** Blend state enabled for target 0 key. */
3
+ BlendStateEnabled0 = 0,
4
+ /** Blend state color blend operation for target 0 key. */
5
+ BlendStateColorBlendOperation0 = 1,
6
+ /** Blend state alpha blend operation for target 0 key. */
7
+ BlendStateAlphaBlendOperation0 = 2,
8
+ /** Blend state source color blend factor for target 0 key. */
9
+ BlendStateSourceColorBlendFactor0 = 3,
10
+ /** Blend state source alpha blend factor for target 0 key. */
11
+ BlendStateSourceAlphaBlendFactor0 = 4,
12
+ /** Blend state destination color blend factor for target 0 key. */
13
+ BlendStateDestinationColorBlendFactor0 = 5,
14
+ /** Blend state destination alpha blend factor for target 0 key. */
15
+ BlendStateDestinationAlphaBlendFactor0 = 6,
16
+ /** Blend state color write mask for target 0 key. */
17
+ BlendStateColorWriteMask0 = 7,
18
+ /** Blend state blend color key. */
19
+ BlendStateBlendColor = 8,
20
+ /** Blend state alpha to coverage key. */
21
+ BlendStateAlphaToCoverage = 9,
22
+ /** Depth state enabled key. */
23
+ DepthStateEnabled = 10,
24
+ /** Depth state write enabled key. */
25
+ DepthStateWriteEnabled = 11,
26
+ /** Depth state compare function key. */
27
+ DepthStateCompareFunction = 12,
28
+ /** Stencil state enabled key. */
29
+ StencilStateEnabled = 13,
30
+ /** Stencil state reference value key. */
31
+ StencilStateReferenceValue = 14,
32
+ /** Stencil state read mask key. */
33
+ StencilStateMask = 15,
34
+ /** Stencil state write mask key. */
35
+ StencilStateWriteMask = 16,
36
+ /** Stencil state compare function front key. */
37
+ StencilStateCompareFunctionFront = 17,
38
+ /** Stencil state compare function back key. */
39
+ StencilStateCompareFunctionBack = 18,
40
+ /** Stencil state pass operation front key. */
41
+ StencilStatePassOperationFront = 19,
42
+ /** Stencil state pass operation back key. */
43
+ StencilStatePassOperationBack = 20,
44
+ /** Stencil state fail operation front key. */
45
+ StencilStateFailOperationFront = 21,
46
+ /** Stencil state fail operation back key. */
47
+ StencilStateFailOperationBack = 22,
48
+ /** Stencil state z fail operation front key. */
49
+ StencilStateZFailOperationFront = 23,
50
+ /** Stencil state z fail operation back key. */
51
+ StencilStateZFailOperationBack = 24,
52
+ /** Raster state fill mode key. */
53
+ RasterStateCullMode = 25,
54
+ /** Raster state cull mode key. */
55
+ RasterStateDepthBias = 26,
56
+ /** Raster state depth bias key. */
57
+ RasterStateSlopeScaledDepthBias = 27
58
+ }
@@ -3,6 +3,7 @@ export { BlendOperation } from "./enums/BlendOperation";
3
3
  export { ColorWriteMask } from "./enums/ColorWriteMask";
4
4
  export { CompareFunction } from "./enums/CompareFunction";
5
5
  export { CullMode } from "./enums/CullMode";
6
+ export { RenderStateElementKey as RenderStateDataKey } from "./enums/RenderStateElementKey";
6
7
  export { RenderQueueType } from "./enums/RenderQueueType";
7
8
  export { ShaderPropertyType } from "./enums/ShaderPropertyType";
8
9
  export { StencilOperation } from "./enums/StencilOperation";
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ particle_common: string;
3
+ velocity_over_lifetime_module: string;
4
+ rotation_over_lifetime_module: string;
5
+ size_over_lifetime_module: string;
6
+ color_over_lifetime_module: string;
7
+ texture_sheet_animation_module: string;
8
+ sphere_billboard: string;
9
+ stretched_billboard: string;
10
+ vertical_billboard: string;
11
+ horizontal_billboard: string;
12
+ particle_mesh: string;
13
+ };
14
+ export default _default;
@@ -1,8 +1,9 @@
1
1
  import { Camera } from "../Camera";
2
+ import { PipelinePass } from "../RenderPipeline/PipelinePass";
2
3
  /**
3
- * Cascade shadow caster.
4
+ * Cascade shadow caster pass.
4
5
  */
5
- export declare class CascadedShadowCasterPass {
6
+ export declare class CascadedShadowCasterPass extends PipelinePass {
6
7
  private static _lightShadowBiasProperty;
7
8
  private static _lightDirectionProperty;
8
9
  private static _shadowMatricesProperty;
@@ -17,7 +18,6 @@ export declare class CascadedShadowCasterPass {
17
18
  private static _tempVector;
18
19
  private static _tempMatrix0;
19
20
  private readonly _camera;
20
- private readonly _engine;
21
21
  private readonly _supportDepthTexture;
22
22
  private _shadowMapResolution;
23
23
  private _shadowMapSize;
@@ -30,18 +30,17 @@ export declare class CascadedShadowCasterPass {
30
30
  private _lightSide;
31
31
  private _existShadowMap;
32
32
  private _splitBoundSpheres;
33
- /** The end is project prcision problem in shader. */
33
+ /** The end is project precision problem in shader. */
34
34
  private _shadowMatrices;
35
35
  private _shadowInfos;
36
36
  private _depthTexture;
37
- private _renderTargets;
37
+ private _renderTarget;
38
38
  private _viewportOffsets;
39
39
  constructor(camera: Camera);
40
40
  private _renderDirectShadowMap;
41
41
  private _updateReceiversShaderData;
42
42
  private _getCascadesSplitDistance;
43
43
  private _getFarWithRadius;
44
- private _getAvailableRenderTarget;
45
44
  private _updateShadowSettings;
46
45
  private _updateSingleShadowCasterShaderData;
47
46
  }
@@ -0,0 +1,16 @@
1
+ import { Engine } from "../Engine";
2
+ import { CullingResults } from "../RenderPipeline/CullingResults";
3
+ import { RenderContext } from "../RenderPipeline/RenderContext";
4
+ /**
5
+ * PipelinePass is a base class for all pipeline passes.
6
+ */
7
+ export declare abstract class PipelinePass {
8
+ protected _engine: Engine;
9
+ constructor(engine: Engine);
10
+ /**
11
+ * Called before rendering a camera, override this method to configure the camera If you need to configure the camera clear flag or render target.
12
+ * @param context - Rendering context
13
+ * @param cullingResults - Culling results
14
+ */
15
+ abstract onRender(context: RenderContext, cullingResults: CullingResults): void;
16
+ }
@@ -7,8 +7,16 @@ export declare class Sky {
7
7
  private static _epsilon;
8
8
  private static _viewProjMatrix;
9
9
  private static _projectionMatrix;
10
- /** Material of the sky. */
11
- material: Material;
12
- /** Mesh of the sky. */
13
- mesh: Mesh;
10
+ private _material;
11
+ private _mesh;
12
+ /**
13
+ * Material of the sky.
14
+ */
15
+ get material(): Material;
16
+ set material(value: Material);
17
+ /**
18
+ * Mesh of the sky.
19
+ */
20
+ get mesh(): Mesh;
21
+ set mesh(value: Mesh);
14
22
  }
@@ -79,9 +79,8 @@ export declare class RenderTarget extends GraphicsResource {
79
79
  */
80
80
  constructor(engine: Engine, width: number, height: number, colorTextures: Texture[], depthTexture: Texture, antiAliasing?: number);
81
81
  /**
82
- *
83
82
  * Get the render color texture by index.
84
- * @param index
83
+ * @param index - Render color texture index
85
84
  */
86
85
  getColorTexture(index?: number): Texture | null;
87
86
  /**
@@ -2,6 +2,7 @@ import { GraphicsResource } from "../asset/GraphicsResource";
2
2
  import { TextureDepthCompareFunction } from "./enums/TextureDepthCompareFunction";
3
3
  import { TextureFilterMode } from "./enums/TextureFilterMode";
4
4
  import { TextureFormat } from "./enums/TextureFormat";
5
+ import { TextureUsage } from "./enums/TextureUsage";
5
6
  import { TextureWrapMode } from "./enums/TextureWrapMode";
6
7
  /**
7
8
  * The base class of texture, contains some common functions of texture-related classes.
@@ -11,6 +12,7 @@ export declare abstract class Texture extends GraphicsResource {
11
12
  protected _format: TextureFormat;
12
13
  protected _width: number;
13
14
  protected _height: number;
15
+ protected _usage: TextureUsage;
14
16
  protected _mipmapCount: number;
15
17
  private _wrapModeU;
16
18
  private _wrapModeV;
@@ -30,6 +32,10 @@ export declare abstract class Texture extends GraphicsResource {
30
32
  * The height of the texture.
31
33
  */
32
34
  get height(): number;
35
+ /**
36
+ * The usage of the texture.
37
+ */
38
+ get usage(): TextureUsage;
33
39
  /**
34
40
  * Wrapping mode for texture coordinate S.
35
41
  */
@@ -1,5 +1,6 @@
1
1
  import { Engine } from "../Engine";
2
2
  import { TextureFormat } from "./enums/TextureFormat";
3
+ import { TextureUsage } from "./enums/TextureUsage";
3
4
  import { Texture } from "./Texture";
4
5
  /**
5
6
  * Two-dimensional texture.
@@ -12,8 +13,9 @@ export declare class Texture2D extends Texture {
12
13
  * @param height - Texture height
13
14
  * @param format - Texture format. default `TextureFormat.R8G8B8A8`
14
15
  * @param mipmap - Whether to use multi-level texture
16
+ * @param usage - Texture usage
15
17
  */
16
- constructor(engine: Engine, width: number, height: number, format?: TextureFormat, mipmap?: boolean);
18
+ constructor(engine: Engine, width: number, height: number, format?: TextureFormat, mipmap?: boolean, usage?: TextureUsage);
17
19
  /**
18
20
  * Setting pixels data through color buffer data, designated area and texture mipmapping level,it's also applicable to compressed formats.
19
21
  * @remarks If it is the WebGL1.0 platform and the texture format is compressed, the first upload must be filled with textures.
@@ -34,7 +36,7 @@ export declare class Texture2D extends Texture {
34
36
  * @param x - X coordinate of area start
35
37
  * @param y - Y coordinate of area start
36
38
  */
37
- setImageSource(imageSource: TexImageSource | OffscreenCanvas, mipLevel?: number, flipY?: boolean, premultiplyAlpha?: boolean, x?: number, y?: number): void;
39
+ setImageSource(imageSource: TexImageSource, mipLevel?: number, flipY?: boolean, premultiplyAlpha?: boolean, x?: number, y?: number): void;
38
40
  /**
39
41
  * Get pixel color buffer.
40
42
  * @param out - Color buffer
@@ -43,7 +43,7 @@ export declare class Texture2DArray extends Texture {
43
43
  * @param x - X coordinate of area start
44
44
  * @param y - Y coordinate of area start
45
45
  */
46
- setImageSource(elementIndex: number, imageSource: TexImageSource | OffscreenCanvas, mipLevel?: number, flipY?: boolean, premultiplyAlpha?: boolean, x?: number, y?: number): void;
46
+ setImageSource(elementIndex: number, imageSource: TexImageSource, mipLevel?: number, flipY?: boolean, premultiplyAlpha?: boolean, x?: number, y?: number): void;
47
47
  /**
48
48
  * Get pixel color buffer.
49
49
  * @param elementIndex - The texture array element index
@@ -36,7 +36,7 @@ export declare class TextureCube extends Texture {
36
36
  * @param x - X coordinate of area start
37
37
  * @param y - Y coordinate of area start
38
38
  */
39
- setImageSource(face: TextureCubeFace, imageSource: TexImageSource | OffscreenCanvas, mipLevel?: number, flipY?: boolean, premultiplyAlpha?: boolean, x?: number, y?: number): void;
39
+ setImageSource(face: TextureCubeFace, imageSource: TexImageSource, mipLevel?: number, flipY?: boolean, premultiplyAlpha?: boolean, x?: number, y?: number): void;
40
40
  /**
41
41
  * Get pixel color buffer.
42
42
  * @param out - Color buffer