@galacean/engine-core 2.0.0-alpha.5 → 2.0.0-alpha.50
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 +23868 -20447
- package/dist/main.js.map +1 -1
- package/dist/module.js +23856 -20439
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/assembler/ISpriteAssembler.d.ts +1 -0
- package/types/2d/assembler/ISpriteRenderer.d.ts +3 -2
- package/types/2d/assembler/SimpleSpriteAssembler.d.ts +1 -0
- package/types/2d/assembler/SlicedSpriteAssembler.d.ts +1 -0
- package/types/2d/assembler/TiledSpriteAssembler.d.ts +1 -0
- package/types/2d/atlas/FontAtlas.d.ts +23 -1
- package/types/2d/atlas/SpriteAtlas.d.ts +8 -0
- package/types/2d/sprite/Sprite.d.ts +30 -4
- package/types/2d/sprite/SpriteMask.d.ts +49 -1
- package/types/2d/sprite/SpriteRenderer.d.ts +35 -1
- package/types/2d/text/CharInfo.d.ts +20 -1
- package/types/2d/text/CharRenderInfo.d.ts +15 -1
- package/types/2d/text/Font.d.ts +11 -1
- package/types/2d/text/ITextRenderer.d.ts +3 -0
- package/types/2d/text/SubFont.d.ts +35 -1
- package/types/2d/text/TextRenderer.d.ts +54 -1
- package/types/2d/text/TextUtils.d.ts +89 -1
- package/types/Background.d.ts +19 -2
- package/types/BasicResources.d.ts +52 -0
- package/types/Camera.d.ts +73 -1
- package/types/Canvas.d.ts +36 -7
- package/types/Component.d.ts +35 -2
- package/types/ComponentsDependencies.d.ts +38 -1
- package/types/ComponentsManager.d.ts +17 -0
- package/types/Engine.d.ts +110 -4
- package/types/EngineEventType.d.ts +13 -0
- package/types/Entity.d.ts +112 -21
- package/types/Polyfill.d.ts +12 -1
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -1
- package/types/RenderPipeline/BatcherManager.d.ts +23 -1
- package/types/RenderPipeline/Blitter.d.ts +1 -1
- package/types/RenderPipeline/CullingResults.d.ts +17 -1
- package/types/RenderPipeline/DepthOnlyPass.d.ts +18 -1
- package/types/RenderPipeline/InstanceBuffer.d.ts +28 -0
- package/types/RenderPipeline/MaskManager.d.ts +36 -1
- package/types/RenderPipeline/OpaqueTexturePass.d.ts +16 -1
- package/types/RenderPipeline/PipelineUtils.d.ts +11 -1
- package/types/RenderPipeline/PrimitiveChunk.d.ts +27 -1
- package/types/RenderPipeline/PrimitiveChunkManager.d.ts +16 -1
- package/types/RenderPipeline/RenderContext.d.ts +46 -1
- package/types/RenderPipeline/RenderElement.d.ts +26 -6
- package/types/RenderPipeline/RenderQueue.d.ts +23 -1
- package/types/RenderPipeline/RenderTargetPool.d.ts +17 -1
- package/types/RenderPipeline/SubPrimitiveChunk.d.ts +14 -1
- package/types/RenderPipeline/VertexArea.d.ts +10 -1
- package/types/RenderPipeline/VertexMergeBatcher.d.ts +11 -0
- package/types/RenderPipeline/enums/RenderQueueMaskType.d.ts +9 -1
- package/types/RenderPipeline/index.d.ts +4 -1
- package/types/Renderer.d.ts +81 -18
- package/types/Scene.d.ts +34 -7
- package/types/SceneManager.d.ts +18 -6
- package/types/Script.d.ts +41 -0
- package/types/Signal.d.ts +69 -0
- package/types/SystemInfo.d.ts +13 -0
- package/types/Transform.d.ts +26 -1
- package/types/UpdateFlag.d.ts +4 -1
- package/types/UpdateFlagManager.d.ts +41 -1
- package/types/Utils.d.ts +20 -0
- package/types/VirtualCamera.d.ts +16 -1
- package/types/animation/AnimationClip.d.ts +13 -2
- package/types/animation/AnimationClipCurveBinding.d.ts +17 -2
- package/types/animation/AnimationEvent.d.ts +2 -2
- package/types/animation/Animator.d.ts +49 -10
- package/types/animation/AnimatorController.d.ts +20 -2
- package/types/animation/AnimatorControllerLayer.d.ts +17 -2
- package/types/animation/AnimatorControllerParameter.d.ts +4 -0
- package/types/animation/AnimatorState.d.ts +46 -2
- package/types/animation/AnimatorStateInstance.d.ts +46 -0
- package/types/animation/AnimatorStateMachine.d.ts +17 -2
- package/types/animation/AnimatorStateTransition.d.ts +9 -0
- package/types/animation/AnimatorStateTransitionCollection.d.ts +23 -1
- package/types/animation/Keyframe.d.ts +1 -1
- package/types/animation/StateMachineScript.d.ts +2 -0
- package/types/animation/animationCurve/AnimationArrayCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationBoolCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationColorCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationCurve.d.ts +9 -1
- package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +38 -0
- package/types/animation/animationCurve/AnimationFloatCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationQuaternionCurve.d.ts +41 -0
- package/types/animation/animationCurve/AnimationRectCurve.d.ts +18 -0
- package/types/animation/animationCurve/AnimationRefCurve.d.ts +20 -2
- package/types/animation/animationCurve/AnimationStringCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationVector2Curve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationVector3Curve.d.ts +43 -0
- package/types/animation/animationCurve/AnimationVector4Curve.d.ts +39 -0
- package/types/animation/animationCurve/interfaces/IAnimationCurveCalculator.d.ts +18 -1
- package/types/animation/enums/AnimatorStatePlayState.d.ts +8 -1
- package/types/animation/index.d.ts +1 -0
- package/types/animation/internal/AnimationCurveLayerOwner.d.ts +15 -1
- package/types/animation/internal/AnimationEventHandler.d.ts +8 -1
- package/types/animation/internal/AnimatorLayerData.d.ts +28 -1
- package/types/animation/internal/AnimatorStateData.d.ts +14 -1
- package/types/animation/internal/AnimatorStatePlayData.d.ts +27 -1
- package/types/animation/internal/AnimatorTempValue.d.ts +12 -1
- package/types/animation/internal/animationCurveOwner/AnimationCurveOwner.d.ts +39 -0
- package/types/animation/internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +12 -1
- package/types/animation/internal/animationCurveOwner/assembler/IAnimationCurveOwnerAssembler.d.ts +10 -1
- package/types/animation/internal/animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler.d.ts +13 -1
- package/types/animation/internal/animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler.d.ts +13 -1
- package/types/animation/internal/animationCurveOwner/assembler/ScaleAnimationCurveOwnerAssembler.d.ts +13 -1
- package/types/animation/internal/animationCurveOwner/assembler/UniversalAnimationCurveOwnerAssembler.d.ts +23 -1
- package/types/asset/AssetPromise.d.ts +4 -4
- package/types/asset/AssetType.d.ts +7 -9
- package/types/asset/GraphicsResource.d.ts +10 -0
- package/types/asset/IReferable.d.ts +8 -0
- package/types/asset/JSONAsset.d.ts +1 -1
- package/types/asset/LoadItem.d.ts +1 -1
- package/types/asset/Loader.d.ts +2 -2
- package/types/asset/ReferResource.d.ts +28 -0
- package/types/asset/RenderingStatistics.d.ts +8 -0
- package/types/asset/ResourceManager.d.ts +117 -9
- package/types/audio/AudioClip.d.ts +8 -0
- package/types/audio/AudioManager.d.ts +18 -0
- package/types/audio/AudioSource.d.ts +20 -2
- package/types/base/DataObject.d.ts +6 -0
- package/types/base/EngineObject.d.ts +4 -0
- package/types/base/Time.d.ts +13 -0
- package/types/base/index.d.ts +1 -0
- package/types/clone/CloneDecorators.d.ts +37 -0
- package/types/clone/CloneUtil.d.ts +30 -0
- package/types/clone/ComponentCloner.d.ts +4 -10
- package/types/clone/ICloneHook.d.ts +12 -0
- package/types/enums/CameraType.d.ts +9 -1
- package/types/env-probe/CubeProbe.d.ts +2 -0
- package/types/env-probe/Probe.d.ts +1 -1
- package/types/graphic/Buffer.d.ts +23 -3
- package/types/graphic/BufferUtil.d.ts +8 -0
- package/types/graphic/IndexBufferBinding.d.ts +4 -0
- package/types/graphic/Mesh.d.ts +58 -1
- package/types/graphic/Primitive.d.ts +50 -1
- package/types/graphic/TransformFeedback.d.ts +46 -0
- package/types/graphic/TransformFeedbackPrimitive.d.ts +67 -0
- package/types/graphic/TransformFeedbackSimulator.d.ts +55 -0
- package/types/graphic/VertexBufferBinding.d.ts +4 -0
- package/types/graphic/VertexElement.d.ts +1 -0
- package/types/graphic/enums/BufferBindFlag.d.ts +5 -3
- package/types/index.d.ts +7 -4
- package/types/input/InputManager.d.ts +25 -6
- package/types/input/enums/PointerButton.d.ts +8 -0
- package/types/input/keyboard/KeyboardManager.d.ts +41 -1
- package/types/input/pointer/Pointer.d.ts +37 -1
- package/types/input/pointer/PointerEventData.d.ts +4 -0
- package/types/input/pointer/PointerManager.d.ts +58 -0
- package/types/input/pointer/emitter/IHitResult.d.ts +11 -1
- package/types/input/pointer/emitter/PhysicsPointerEventEmitter.d.ts +20 -1
- package/types/input/wheel/WheelManager.d.ts +34 -1
- package/types/lighting/AmbientLight.d.ts +9 -8
- package/types/lighting/DirectLight.d.ts +17 -0
- package/types/lighting/KHR_lights.d.ts +13 -1
- package/types/lighting/Light.d.ts +2 -0
- package/types/lighting/LightManager.d.ts +57 -0
- package/types/lighting/PointLight.d.ts +17 -0
- package/types/lighting/SpotLight.d.ts +17 -0
- package/types/lighting/ambientOcclusion/AmbientOcclusion.d.ts +4 -0
- package/types/lighting/ambientOcclusion/ScalableAmbientObscurancePass.d.ts +38 -1
- package/types/material/BaseMaterial.d.ts +15 -11
- package/types/material/Material.d.ts +5 -9
- package/types/mesh/BlendShape.d.ts +14 -1
- package/types/mesh/BlendShapeFrame.d.ts +11 -4
- package/types/mesh/BlendShapeManager.d.ts +101 -1
- package/types/mesh/BufferMesh.d.ts +2 -2
- package/types/mesh/MeshRenderer.d.ts +42 -0
- package/types/mesh/ModelMesh.d.ts +23 -4
- package/types/mesh/PrimitiveMesh.d.ts +38 -4
- package/types/mesh/PrimitiveMeshRestorer.d.ts +107 -0
- package/types/mesh/Skin.d.ts +12 -3
- package/types/mesh/SkinnedMeshRenderer.d.ts +27 -1
- package/types/particle/ParticleBufferUtils.d.ts +26 -1
- package/types/particle/ParticleGenerator.d.ts +147 -2
- package/types/particle/ParticleMaterial.d.ts +3 -1
- package/types/particle/ParticleRenderer.d.ts +61 -1
- package/types/particle/ParticleTransformFeedbackSimulator.d.ts +52 -0
- package/types/particle/enums/ParticleRandomSubSeeds.d.ts +25 -1
- package/types/particle/enums/ParticleScaleMode.d.ts +5 -5
- package/types/particle/enums/ParticleSubEmitterInheritProperty.d.ts +17 -0
- package/types/particle/enums/ParticleSubEmitterType.d.ts +9 -0
- package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +6 -1
- package/types/particle/enums/attributes/ParticleFeedbackVertexAttribute.d.ts +8 -0
- package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +17 -1
- package/types/particle/index.d.ts +7 -0
- package/types/particle/modules/Burst.d.ts +23 -2
- package/types/particle/modules/ColorOverLifetimeModule.d.ts +19 -0
- package/types/particle/modules/CustomDataModule.d.ts +90 -0
- package/types/particle/modules/EmissionModule.d.ts +36 -0
- package/types/particle/modules/ForceOverLifetimeModule.d.ts +16 -1
- package/types/particle/modules/LimitVelocityOverLifetimeModule.d.ts +164 -0
- package/types/particle/modules/MainModule.d.ts +45 -6
- package/types/particle/modules/NoiseModule.d.ts +114 -0
- package/types/particle/modules/ParticleCompositeCurve.d.ts +42 -4
- package/types/particle/modules/ParticleCompositeGradient.d.ts +8 -2
- package/types/particle/modules/ParticleCurve.d.ts +31 -2
- package/types/particle/modules/ParticleGeneratorModule.d.ts +9 -3
- package/types/particle/modules/ParticleGradient.d.ts +22 -5
- package/types/particle/modules/RotationOverLifetimeModule.d.ts +27 -3
- package/types/particle/modules/SizeOverLifetimeModule.d.ts +25 -0
- package/types/particle/modules/SubEmitter.d.ts +31 -0
- package/types/particle/modules/SubEmittersModule.d.ts +57 -0
- package/types/particle/modules/TextureSheetAnimationModule.d.ts +14 -1
- package/types/particle/modules/VelocityOverLifetimeModule.d.ts +120 -0
- package/types/particle/modules/shape/BaseShape.d.ts +65 -2
- package/types/particle/modules/shape/BoxShape.d.ts +13 -2
- package/types/particle/modules/shape/CircleShape.d.ts +13 -1
- package/types/particle/modules/shape/ConeShape.d.ts +13 -4
- package/types/particle/modules/shape/HemisphereShape.d.ts +13 -0
- package/types/particle/modules/shape/MeshShape.d.ts +26 -3
- package/types/particle/modules/shape/ShapeUtils.d.ts +13 -1
- package/types/particle/modules/shape/SphereShape.d.ts +13 -0
- package/types/physics/CharacterController.d.ts +21 -0
- package/types/physics/Collider.d.ts +47 -2
- package/types/physics/Collision.d.ts +3 -0
- package/types/physics/DynamicCollider.d.ts +28 -1
- package/types/physics/HitResult.d.ts +2 -2
- package/types/physics/PhysicsMaterial.d.ts +3 -0
- package/types/physics/PhysicsScene.d.ts +56 -6
- package/types/physics/StaticCollider.d.ts +5 -0
- package/types/physics/enums/ColliderShapeChangeFlag.d.ts +8 -1
- package/types/physics/enums/HingeJointFlag.d.ts +14 -1
- package/types/physics/joint/HingeJoint.d.ts +4 -0
- package/types/physics/joint/Joint.d.ts +22 -2
- package/types/physics/joint/JointLimits.d.ts +2 -1
- package/types/physics/joint/JointMotor.d.ts +2 -1
- package/types/physics/shape/ColliderShape.d.ts +26 -3
- package/types/physics/shape/MeshColliderShape.d.ts +11 -5
- package/types/postProcess/FinalPass.d.ts +19 -1
- package/types/postProcess/PostProcess.d.ts +11 -6
- package/types/postProcess/PostProcessEffect.d.ts +6 -1
- package/types/postProcess/PostProcessEffectParameter.d.ts +23 -3
- package/types/postProcess/PostProcessManager.d.ts +43 -0
- package/types/postProcess/PostProcessPass.d.ts +3 -2
- package/types/postProcess/PostProcessUberPass.d.ts +2 -1
- package/types/postProcess/effects/BloomEffect.d.ts +26 -1
- package/types/postProcess/effects/TonemappingEffect.d.ts +3 -0
- package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +1 -0
- package/types/renderingHardwareInterface/IPlatformTransformFeedback.d.ts +36 -0
- package/types/renderingHardwareInterface/IPlatformTransformFeedbackPrimitive.d.ts +40 -0
- package/types/renderingHardwareInterface/index.d.ts +2 -0
- package/types/shader/Shader.d.ts +38 -22
- package/types/shader/ShaderBlockProperty.d.ts +19 -0
- package/types/shader/ShaderData.d.ts +43 -4
- package/types/shader/ShaderFactory.d.ts +78 -0
- package/types/shader/ShaderMacro.d.ts +17 -2
- package/types/shader/ShaderMacroCollection.d.ts +57 -1
- package/types/shader/ShaderMacroProcessor.d.ts +72 -0
- package/types/shader/ShaderPass.d.ts +46 -13
- package/types/shader/ShaderProgram.d.ts +91 -1
- package/types/shader/ShaderProgramMap.d.ts +20 -0
- package/types/shader/ShaderProperty.d.ts +17 -0
- package/types/shader/ShaderTagKey.d.ts +2 -0
- package/types/shader/ShaderUniform.d.ts +49 -1
- package/types/shader/ShaderUniformBlock.d.ts +9 -1
- package/types/shader/enums/ConstantBufferBindingPoint.d.ts +7 -0
- package/types/shader/enums/ShaderPreprocessorDirective.d.ts +16 -0
- package/types/shader/index.d.ts +1 -1
- package/types/shader/state/BlendState.d.ts +16 -1
- package/types/shader/state/DepthState.d.ts +16 -1
- package/types/shader/state/RasterState.d.ts +19 -1
- package/types/shader/state/RenderState.d.ts +13 -2
- package/types/shader/state/RenderTargetBlendState.d.ts +2 -1
- package/types/shader/state/StencilState.d.ts +15 -1
- package/types/shadow/CascadedShadowCasterPass.d.ts +5 -0
- package/types/shadow/ShadowSliceData.d.ts +13 -1
- package/types/shadow/ShadowUtils.d.ts +43 -1
- package/types/sky/Sky.d.ts +13 -4
- package/types/sky/SkyBoxMaterial.d.ts +0 -7
- package/types/texture/RenderTarget.d.ts +28 -3
- package/types/texture/Texture.d.ts +21 -0
- package/types/texture/Texture2D.d.ts +4 -0
- package/types/texture/Texture2DArray.d.ts +4 -0
- package/types/texture/TextureCube.d.ts +4 -0
- package/types/texture/TextureUtils.d.ts +16 -1
- package/types/trail/TrailRenderer.d.ts +13 -8
- package/types/ui/IUICanvas.d.ts +16 -1
- package/types/utils/DisorderedArray.d.ts +3 -1
- package/types/xr/XRManager.d.ts +28 -0
- package/types/RenderPipeline/BatchUtils.d.ts +0 -1
- package/types/RenderPipeline/SubRenderElement.d.ts +0 -22
- package/types/clone/CloneManager.d.ts +0 -31
- package/types/clone/enums/CloneMode.d.ts +0 -13
- package/types/shader/ShaderPool.d.ts +0 -1
- package/types/shader/ShaderProgramPool.d.ts +0 -1
- package/types/shader/state/index.d.ts +0 -6
- package/types/shaderlib/ShaderFactory.d.ts +0 -20
- package/types/shaderlib/ShaderLib.d.ts +0 -73
- package/types/shaderlib/index.d.ts +0 -1
- package/types/shaderlib/particle/index.d.ts +0 -15
- package/types/shaderlib/pbr/index.d.ts +0 -11
- package/types/shaderlib/shadow/index.d.ts +0 -8
|
@@ -1,26 +1,43 @@
|
|
|
1
|
+
import { DataObject } from "../base/DataObject";
|
|
2
|
+
import { BoundingBox, Color, Vector3 } from "@galacean/engine-math";
|
|
3
|
+
import type { ICloneHook } from "../clone/ICloneHook";
|
|
4
|
+
import { Primitive } from "../graphic/Primitive";
|
|
5
|
+
import { SubMesh } from "../graphic/SubMesh";
|
|
6
|
+
import { VertexBufferBinding } from "../graphic/VertexBufferBinding";
|
|
7
|
+
import { ShaderData } from "../shader";
|
|
8
|
+
import { ParticleRenderer } from "./ParticleRenderer";
|
|
9
|
+
import { ParticleTransformFeedbackSimulator } from "./ParticleTransformFeedbackSimulator";
|
|
1
10
|
import { ParticleStopMode } from "./enums/ParticleStopMode";
|
|
2
11
|
import { ColorOverLifetimeModule } from "./modules/ColorOverLifetimeModule";
|
|
12
|
+
import { CustomDataModule } from "./modules/CustomDataModule";
|
|
3
13
|
import { EmissionModule } from "./modules/EmissionModule";
|
|
4
14
|
import { ForceOverLifetimeModule } from "./modules/ForceOverLifetimeModule";
|
|
15
|
+
import { LimitVelocityOverLifetimeModule } from "./modules/LimitVelocityOverLifetimeModule";
|
|
5
16
|
import { MainModule } from "./modules/MainModule";
|
|
6
17
|
import { RotationOverLifetimeModule } from "./modules/RotationOverLifetimeModule";
|
|
7
18
|
import { SizeOverLifetimeModule } from "./modules/SizeOverLifetimeModule";
|
|
8
19
|
import { TextureSheetAnimationModule } from "./modules/TextureSheetAnimationModule";
|
|
20
|
+
import { NoiseModule } from "./modules/NoiseModule";
|
|
9
21
|
import { VelocityOverLifetimeModule } from "./modules/VelocityOverLifetimeModule";
|
|
22
|
+
import { SubEmittersModule } from "./modules/SubEmittersModule";
|
|
10
23
|
/**
|
|
11
24
|
* Particle Generator.
|
|
12
25
|
*/
|
|
13
|
-
export declare class ParticleGenerator {
|
|
26
|
+
export declare class ParticleGenerator extends DataObject implements ICloneHook<ParticleGenerator> {
|
|
14
27
|
private static _tempVector20;
|
|
15
28
|
private static _tempVector21;
|
|
16
29
|
private static _tempVector22;
|
|
17
30
|
private static _tempVector30;
|
|
18
31
|
private static _tempVector31;
|
|
32
|
+
private static _tempVector32;
|
|
33
|
+
private static _tempVector33;
|
|
19
34
|
private static _tempMat;
|
|
20
|
-
private static
|
|
35
|
+
private static _tempColor;
|
|
36
|
+
private static _tempQuat0;
|
|
21
37
|
private static _tempParticleRenderers;
|
|
22
38
|
private static readonly _particleIncreaseCount;
|
|
23
39
|
private static readonly _transformedBoundsIncreaseCount;
|
|
40
|
+
private static readonly _transformFeedbackMacro;
|
|
24
41
|
/** Use auto random seed. */
|
|
25
42
|
useAutoRandomSeed: boolean;
|
|
26
43
|
/** Main module. */
|
|
@@ -31,6 +48,8 @@ export declare class ParticleGenerator {
|
|
|
31
48
|
readonly velocityOverLifetime: VelocityOverLifetimeModule;
|
|
32
49
|
/** Force over lifetime module. */
|
|
33
50
|
readonly forceOverLifetime: ForceOverLifetimeModule;
|
|
51
|
+
/** Limit velocity over lifetime module. */
|
|
52
|
+
readonly limitVelocityOverLifetime: LimitVelocityOverLifetimeModule;
|
|
34
53
|
/** Size over lifetime module. */
|
|
35
54
|
readonly sizeOverLifetime: SizeOverLifetimeModule;
|
|
36
55
|
/** Rotation over lifetime module. */
|
|
@@ -39,6 +58,39 @@ export declare class ParticleGenerator {
|
|
|
39
58
|
readonly colorOverLifetime: ColorOverLifetimeModule;
|
|
40
59
|
/** Texture sheet animation module. */
|
|
41
60
|
readonly textureSheetAnimation: TextureSheetAnimationModule;
|
|
61
|
+
/** Noise module. */
|
|
62
|
+
readonly noise: NoiseModule;
|
|
63
|
+
/** Sub emitters module. */
|
|
64
|
+
readonly subEmitters: SubEmittersModule;
|
|
65
|
+
/** Custom data module. */
|
|
66
|
+
readonly customData: CustomDataModule;
|
|
67
|
+
/** @internal */
|
|
68
|
+
_currentParticleCount: number;
|
|
69
|
+
/** @internal */
|
|
70
|
+
_playTime: number;
|
|
71
|
+
/** @internal */
|
|
72
|
+
_firstNewElement: number;
|
|
73
|
+
/** @internal */
|
|
74
|
+
_firstActiveElement: number;
|
|
75
|
+
/** @internal */
|
|
76
|
+
_firstFreeElement: number;
|
|
77
|
+
/** @internal */
|
|
78
|
+
_firstRetiredElement: number;
|
|
79
|
+
/** @internal */
|
|
80
|
+
_primitive: Primitive;
|
|
81
|
+
/** @internal */
|
|
82
|
+
_vertexBufferBindings: VertexBufferBinding[];
|
|
83
|
+
/** @internal */
|
|
84
|
+
_subPrimitive: SubMesh;
|
|
85
|
+
/** @internal */
|
|
86
|
+
readonly _renderer: ParticleRenderer;
|
|
87
|
+
/** @internal */
|
|
88
|
+
_feedbackSimulator: ParticleTransformFeedbackSimulator;
|
|
89
|
+
/** @internal */
|
|
90
|
+
_useTransformFeedback: boolean;
|
|
91
|
+
/** @internal */
|
|
92
|
+
private _feedbackBindingIndex;
|
|
93
|
+
private _feedbackReadback;
|
|
42
94
|
private _isPlaying;
|
|
43
95
|
private _instanceBufferResized;
|
|
44
96
|
private _waitProcessRetiredElementCount;
|
|
@@ -50,6 +102,13 @@ export declare class ParticleGenerator {
|
|
|
50
102
|
private _firstActiveTransformedBoundingBox;
|
|
51
103
|
private _firstFreeTransformedBoundingBox;
|
|
52
104
|
private _playStartDelay;
|
|
105
|
+
private _eventPos;
|
|
106
|
+
private _eventColor;
|
|
107
|
+
private _eventSize;
|
|
108
|
+
private _eventRotation;
|
|
109
|
+
private _eventDir;
|
|
110
|
+
private _emitLocalPos;
|
|
111
|
+
private _emitDirection;
|
|
53
112
|
/**
|
|
54
113
|
* Whether the particle generator is contain alive or is still creating particles.
|
|
55
114
|
*/
|
|
@@ -63,6 +122,10 @@ export declare class ParticleGenerator {
|
|
|
63
122
|
*/
|
|
64
123
|
get randomSeed(): number;
|
|
65
124
|
set randomSeed(value: number);
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
constructor(renderer: ParticleRenderer);
|
|
66
129
|
/**
|
|
67
130
|
* Start emitting particles.
|
|
68
131
|
* @param withChildren - Whether to start the particle generator of the child entity
|
|
@@ -79,8 +142,84 @@ export declare class ParticleGenerator {
|
|
|
79
142
|
* @param count - Number of particles to emit
|
|
80
143
|
*/
|
|
81
144
|
emit(count: number): void;
|
|
145
|
+
/**
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
_emit(playTime: number, count: number, emitWorldPositionOverride?: Vector3): number;
|
|
149
|
+
/**
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
_update(elapsedTime: number): void;
|
|
153
|
+
/**
|
|
154
|
+
* @internal
|
|
155
|
+
* Run Transform Feedback simulation pass.
|
|
156
|
+
*/
|
|
157
|
+
_updateFeedback(shaderData: ShaderData, deltaTime: number): void;
|
|
158
|
+
/**
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
_reorganizeGeometryBuffers(): void;
|
|
162
|
+
/**
|
|
163
|
+
* @internal
|
|
164
|
+
*/
|
|
165
|
+
_resizeInstanceBuffer(isIncrease: boolean, increaseCount?: number): void;
|
|
166
|
+
/**
|
|
167
|
+
* @internal
|
|
168
|
+
*/
|
|
169
|
+
_updateShaderData(shaderData: ShaderData): void;
|
|
170
|
+
/**
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
|
+
_resetGlobalRandSeed(seed: number): void;
|
|
174
|
+
/**
|
|
175
|
+
* @internal
|
|
176
|
+
*/
|
|
177
|
+
_setTransformFeedback(): void;
|
|
178
|
+
/**
|
|
179
|
+
* @internal
|
|
180
|
+
*/
|
|
181
|
+
_getAliveParticleCount(): number;
|
|
182
|
+
/**
|
|
183
|
+
* @internal
|
|
184
|
+
*/
|
|
185
|
+
_getNotRetiredParticleCount(): number;
|
|
186
|
+
/**
|
|
187
|
+
* @internal
|
|
188
|
+
* @inheritdoc
|
|
189
|
+
*/
|
|
190
|
+
_onClone(target: ParticleGenerator): void;
|
|
191
|
+
/**
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
_destroy(): void;
|
|
195
|
+
/**
|
|
196
|
+
* @internal
|
|
197
|
+
*/
|
|
198
|
+
_updateBoundsSimulationLocal(bounds: BoundingBox): void;
|
|
199
|
+
/**
|
|
200
|
+
* @internal
|
|
201
|
+
*/
|
|
202
|
+
_updateBoundsSimulationWorld(bounds: BoundingBox): void;
|
|
203
|
+
/**
|
|
204
|
+
* @internal
|
|
205
|
+
*/
|
|
206
|
+
_freeBoundsArray(): void;
|
|
207
|
+
/**
|
|
208
|
+
* @internal
|
|
209
|
+
*/
|
|
210
|
+
_generateTransformedBounds(): void;
|
|
82
211
|
private _addNewParticle;
|
|
212
|
+
private _onParticleBirth;
|
|
213
|
+
/**
|
|
214
|
+
* @internal
|
|
215
|
+
*/
|
|
216
|
+
_emitFromSubEmitter(count: number, worldPosition: Vector3, inheritColor: Color | null, inheritSize: Vector3 | null, inheritRotation: Vector3 | null, worldDirection?: Vector3 | null): void;
|
|
217
|
+
private _addFeedbackParticle;
|
|
218
|
+
private _clearActiveParticles;
|
|
83
219
|
private _retireActiveParticles;
|
|
220
|
+
private _readbackFeedback;
|
|
221
|
+
private _onParticleDeath;
|
|
222
|
+
private _evaluateOverLifetime;
|
|
84
223
|
private _freeRetiredParticles;
|
|
85
224
|
private _addActiveParticlesToVertexBuffer;
|
|
86
225
|
private _addVertexBufferBindingsFilterDuplicate;
|
|
@@ -89,6 +228,12 @@ export declare class ParticleGenerator {
|
|
|
89
228
|
private _calculateGeneratorBounds;
|
|
90
229
|
private _mergeTransformedBounds;
|
|
91
230
|
private _calculateTransformedBounds;
|
|
231
|
+
private _useOrbitalBounds;
|
|
232
|
+
private _getNoiseBoundsExtents;
|
|
233
|
+
private _getGravityBoundsReach;
|
|
234
|
+
private _getRangeReach;
|
|
235
|
+
private _getVectorReach;
|
|
236
|
+
private _getCurveMagnitudeFromZero;
|
|
92
237
|
private _addGravityToBounds;
|
|
93
238
|
private _getExtremeValueFromZero;
|
|
94
239
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Engine } from "../Engine";
|
|
2
2
|
import { EffectMaterial } from "../material/EffectMaterial";
|
|
3
|
+
import { Shader } from "../shader/Shader";
|
|
3
4
|
/**
|
|
4
5
|
* Particle Material.
|
|
5
6
|
*/
|
|
@@ -7,8 +8,9 @@ export declare class ParticleMaterial extends EffectMaterial {
|
|
|
7
8
|
/**
|
|
8
9
|
* Create a particle material instance.
|
|
9
10
|
* @param engine - Engine to which the material belongs
|
|
11
|
+
* @param shader - Shader used by the material
|
|
10
12
|
*/
|
|
11
|
-
constructor(engine: Engine);
|
|
13
|
+
constructor(engine: Engine, shader?: Shader);
|
|
12
14
|
/**
|
|
13
15
|
* @inheritdoc
|
|
14
16
|
*/
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { BoundingBox, Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import { Entity } from "../Entity";
|
|
2
3
|
import { RenderContext } from "../RenderPipeline/RenderContext";
|
|
3
4
|
import { Renderer } from "../Renderer";
|
|
5
|
+
import { TransformModifyFlags } from "../Transform";
|
|
4
6
|
import { ModelMesh } from "../mesh/ModelMesh";
|
|
5
7
|
import { ParticleGenerator } from "./ParticleGenerator";
|
|
6
8
|
import { ParticleRenderMode } from "./enums/ParticleRenderMode";
|
|
@@ -25,9 +27,13 @@ export declare class ParticleRenderer extends Renderer {
|
|
|
25
27
|
lengthScale: number;
|
|
26
28
|
/** The pivot of particle. */
|
|
27
29
|
pivot: Vector3;
|
|
30
|
+
/** @internal */
|
|
31
|
+
_generatorBounds: BoundingBox;
|
|
32
|
+
/** @internal */
|
|
33
|
+
_transformedBounds: BoundingBox;
|
|
34
|
+
private _mesh;
|
|
28
35
|
private _renderMode;
|
|
29
36
|
private _currentRenderModeMacro;
|
|
30
|
-
private _mesh;
|
|
31
37
|
private _supportInstancedArrays;
|
|
32
38
|
/**
|
|
33
39
|
* Specifies how particles are rendered.
|
|
@@ -40,8 +46,62 @@ export declare class ParticleRenderer extends Renderer {
|
|
|
40
46
|
*/
|
|
41
47
|
get mesh(): ModelMesh;
|
|
42
48
|
set mesh(value: ModelMesh);
|
|
49
|
+
/**
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
constructor(entity: Entity);
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
_onEnable(): void;
|
|
57
|
+
/**
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
_onDisable(): void;
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
_prepareRender(context: RenderContext): void;
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
_updateTransformShaderData(context: RenderContext, onlyMVP: boolean): void;
|
|
43
69
|
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
44
70
|
protected _update(context: RenderContext): void;
|
|
45
71
|
protected _render(context: RenderContext): void;
|
|
46
72
|
protected _onDestroy(): void;
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
* @inheritdoc
|
|
76
|
+
*/
|
|
77
|
+
_onClone(target: ParticleRenderer): void;
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
_isContainDirtyFlag(type: number): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
_setDirtyFlagFalse(type: number): void;
|
|
86
|
+
/**
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
_onWorldVolumeChanged(): void;
|
|
90
|
+
/**
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
_onGeneratorParamsChanged(): void;
|
|
94
|
+
/**
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
_onTransformChanged(type: TransformModifyFlags): void;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @internal
|
|
101
|
+
*/
|
|
102
|
+
export declare enum ParticleUpdateFlags {
|
|
103
|
+
/** On World Transform Changed */
|
|
104
|
+
TransformVolume = 2,
|
|
105
|
+
/** On Generator Bounds Related Params Changed */
|
|
106
|
+
GeneratorVolume = 4
|
|
47
107
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import { Engine } from "../Engine";
|
|
3
|
+
import { VertexBufferBinding } from "../graphic/VertexBufferBinding";
|
|
4
|
+
import { ShaderData } from "../shader/ShaderData";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
* Particle-specific Transform Feedback simulation.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ParticleTransformFeedbackSimulator {
|
|
10
|
+
private static readonly _deltaTimeProperty;
|
|
11
|
+
/** @internal */
|
|
12
|
+
_instanceBinding: VertexBufferBinding;
|
|
13
|
+
private _simulator;
|
|
14
|
+
private _particleInitData;
|
|
15
|
+
private _oldReadBuffer;
|
|
16
|
+
private _oldWriteBuffer;
|
|
17
|
+
/**
|
|
18
|
+
* The current read buffer binding for the render pass.
|
|
19
|
+
*/
|
|
20
|
+
get readBinding(): VertexBufferBinding;
|
|
21
|
+
constructor(engine: Engine);
|
|
22
|
+
/**
|
|
23
|
+
* Resize feedback buffers.
|
|
24
|
+
* Saves pre-resize buffers internally for subsequent `copyOldBufferData` / `destroyOldBuffers` calls.
|
|
25
|
+
* @param particleCount - Number of particles to allocate
|
|
26
|
+
* @param instanceBinding - New instance vertex buffer binding
|
|
27
|
+
*/
|
|
28
|
+
resize(particleCount: number, instanceBinding: VertexBufferBinding): void;
|
|
29
|
+
/**
|
|
30
|
+
* Write initial position and velocity for a newly emitted particle.
|
|
31
|
+
*/
|
|
32
|
+
writeParticleData(index: number, position: Vector3, vx: number, vy: number, vz: number): void;
|
|
33
|
+
/**
|
|
34
|
+
* Copy data from pre-resize buffers to current buffers.
|
|
35
|
+
* Must be called after `resize` which saves the old buffers.
|
|
36
|
+
*/
|
|
37
|
+
copyOldBufferData(srcByteOffset: number, dstByteOffset: number, byteLength: number): void;
|
|
38
|
+
/**
|
|
39
|
+
* Destroy pre-resize buffers saved during `resize`.
|
|
40
|
+
*/
|
|
41
|
+
destroyOldBuffers(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Run one simulation step.
|
|
44
|
+
* @param shaderData - Shader data with current macros and uniforms
|
|
45
|
+
* @param particleCount - Total particle slot count
|
|
46
|
+
* @param firstActive - First active particle index in ring buffer
|
|
47
|
+
* @param firstFree - First free particle index in ring buffer
|
|
48
|
+
* @param deltaTime - Frame delta time
|
|
49
|
+
*/
|
|
50
|
+
update(shaderData: ShaderData, particleCount: number, firstActive: number, firstFree: number, deltaTime: number): void;
|
|
51
|
+
destroy(): void;
|
|
52
|
+
}
|
|
@@ -1 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ParticleRandomSubSeeds {
|
|
5
|
+
Burst = 592910910,
|
|
6
|
+
StartDelay = 322376503,
|
|
7
|
+
StartColor = 306581307,
|
|
8
|
+
StartSize = 1793934638,
|
|
9
|
+
StartRotation = 3737431713,
|
|
10
|
+
randomizeRotationDirection = 2527743459,
|
|
11
|
+
StartLifetime = 2368504881,
|
|
12
|
+
StartSpeed = 4085612399,
|
|
13
|
+
VelocityOverLifetime = 3774601268,
|
|
14
|
+
ColorOverLifetime = 326370691,
|
|
15
|
+
SizeOverLifetime = 1494990940,
|
|
16
|
+
RotationOverLifetime = 1089181156,
|
|
17
|
+
TextureSheetAnimation = 197469413,
|
|
18
|
+
Shape = 2941263940,
|
|
19
|
+
GravityModifier = 2759560269,
|
|
20
|
+
ForceOverLifetime = 3875246972,
|
|
21
|
+
LimitVelocityOverLifetime = 3047300990,
|
|
22
|
+
Noise = 4105357473,
|
|
23
|
+
SubEmitter = 2622110509,
|
|
24
|
+
EmissionRate = 2625893077
|
|
25
|
+
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Control how Particle Generator apply transform scale.
|
|
3
3
|
*/
|
|
4
4
|
export declare enum ParticleScaleMode {
|
|
5
|
-
/** Scale the Particle Generator using the
|
|
6
|
-
|
|
7
|
-
/** Scale the Particle Generator using only its own transform scale
|
|
5
|
+
/** Scale the Particle Generator using the world scale, including all parent transforms. */
|
|
6
|
+
World = 0,
|
|
7
|
+
/** Scale the Particle Generator using only its own transform scale, ignoring parent scale. */
|
|
8
8
|
Local = 1,
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/** Scale only the emitter shape positions; particle size and movement are unaffected. */
|
|
10
|
+
Shape = 2
|
|
11
11
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional parent properties a sub-emitter inherits
|
|
3
|
+
* Sub particles are always emitted at the parent particle's position; these flags only select
|
|
4
|
+
* which additional properties are inherited on top of that.
|
|
5
|
+
*/
|
|
6
|
+
export declare enum ParticleSubEmitterInheritProperty {
|
|
7
|
+
/** Inherit no additional properties; sub particles are still emitted at the parent's position. */
|
|
8
|
+
None = 0,
|
|
9
|
+
/** Multiply parent's current color into the sub particle's start color. */
|
|
10
|
+
Color = 1,
|
|
11
|
+
/** Multiply parent's current size into the sub particle's start size. */
|
|
12
|
+
Size = 2,
|
|
13
|
+
/** Add parent's current rotation onto the sub particle's start rotation. */
|
|
14
|
+
Rotation = 4,
|
|
15
|
+
/** Emit the sub particle along the parent's velocity direction. */
|
|
16
|
+
Velocity = 8
|
|
17
|
+
}
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ParticleInstanceVertexAttribute {
|
|
5
|
+
ShapePositionStartLifeTime = "a_ShapePositionStartLifeTime",
|
|
6
|
+
DirectionTime = "a_DirectionTime",
|
|
7
|
+
StartColor = "a_StartColor",
|
|
8
|
+
StartSize = "a_StartSize",
|
|
9
|
+
StartRotation0 = "a_StartRotation0",
|
|
10
|
+
StartSpeed = "a_StartSpeed",
|
|
11
|
+
Random0 = "a_Random0",
|
|
12
|
+
Random1 = "a_Random1",
|
|
13
|
+
SimulationWorldPosition = "a_SimulationWorldPosition",
|
|
14
|
+
SimulationWorldRotation = "a_SimulationWorldRotation",
|
|
15
|
+
SimulationUV = "a_SimulationUV",
|
|
16
|
+
Random2 = "a_Random2"
|
|
17
|
+
}
|
|
@@ -7,8 +7,11 @@ export { ParticleRenderMode } from "./enums/ParticleRenderMode";
|
|
|
7
7
|
export { ParticleScaleMode } from "./enums/ParticleScaleMode";
|
|
8
8
|
export { ParticleSimulationSpace } from "./enums/ParticleSimulationSpace";
|
|
9
9
|
export { ParticleStopMode } from "./enums/ParticleStopMode";
|
|
10
|
+
export { ParticleSubEmitterType } from "./enums/ParticleSubEmitterType";
|
|
11
|
+
export { ParticleSubEmitterInheritProperty } from "./enums/ParticleSubEmitterInheritProperty";
|
|
10
12
|
export { Burst } from "./modules/Burst";
|
|
11
13
|
export { ColorOverLifetimeModule } from "./modules/ColorOverLifetimeModule";
|
|
14
|
+
export { CustomDataModule } from "./modules/CustomDataModule";
|
|
12
15
|
export { EmissionModule } from "./modules/EmissionModule";
|
|
13
16
|
export { MainModule } from "./modules/MainModule";
|
|
14
17
|
export { ParticleCompositeCurve } from "./modules/ParticleCompositeCurve";
|
|
@@ -19,4 +22,8 @@ export { RotationOverLifetimeModule } from "./modules/RotationOverLifetimeModule
|
|
|
19
22
|
export { SizeOverLifetimeModule } from "./modules/SizeOverLifetimeModule";
|
|
20
23
|
export { TextureSheetAnimationModule } from "./modules/TextureSheetAnimationModule";
|
|
21
24
|
export { VelocityOverLifetimeModule } from "./modules/VelocityOverLifetimeModule";
|
|
25
|
+
export { LimitVelocityOverLifetimeModule } from "./modules/LimitVelocityOverLifetimeModule";
|
|
26
|
+
export { NoiseModule } from "./modules/NoiseModule";
|
|
27
|
+
export { SubEmitter } from "./modules/SubEmitter";
|
|
28
|
+
export { SubEmittersModule } from "./modules/SubEmittersModule";
|
|
22
29
|
export * from "./modules/shape/index";
|
|
@@ -1,14 +1,35 @@
|
|
|
1
|
+
import { DataObject } from "../../base/DataObject";
|
|
1
2
|
import { ParticleCompositeCurve } from "./ParticleCompositeCurve";
|
|
2
3
|
/**
|
|
3
4
|
* A burst is a particle emission event, where a number of particles are all emitted at the same time
|
|
4
5
|
*/
|
|
5
|
-
export declare class Burst {
|
|
6
|
+
export declare class Burst extends DataObject {
|
|
6
7
|
time: number;
|
|
7
8
|
count: ParticleCompositeCurve;
|
|
9
|
+
private _cycles;
|
|
10
|
+
private _repeatInterval;
|
|
8
11
|
/**
|
|
9
|
-
*
|
|
12
|
+
* Number of times to repeat the burst.
|
|
13
|
+
*/
|
|
14
|
+
get cycles(): number;
|
|
15
|
+
set cycles(value: number);
|
|
16
|
+
/**
|
|
17
|
+
* Time interval between each repeated burst.
|
|
18
|
+
*/
|
|
19
|
+
get repeatInterval(): number;
|
|
20
|
+
set repeatInterval(value: number);
|
|
21
|
+
/**
|
|
22
|
+
* Create a single-shot burst.
|
|
10
23
|
* @param time - Time to emit the burst
|
|
11
24
|
* @param count - Count of particles to emit
|
|
12
25
|
*/
|
|
13
26
|
constructor(time: number, count: ParticleCompositeCurve);
|
|
27
|
+
/**
|
|
28
|
+
* Create a repeated burst.
|
|
29
|
+
* @param time - Time to emit the burst
|
|
30
|
+
* @param count - Count of particles to emit
|
|
31
|
+
* @param cycles - Number of times to repeat the burst
|
|
32
|
+
* @param repeatInterval - Time interval between each repeated burst
|
|
33
|
+
*/
|
|
34
|
+
constructor(time: number, count: ParticleCompositeCurve, cycles: number, repeatInterval: number);
|
|
14
35
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Rand } from "@galacean/engine-math";
|
|
2
|
+
import { ShaderData } from "../../shader/ShaderData";
|
|
1
3
|
import { ShaderMacro } from "../../shader/ShaderMacro";
|
|
2
4
|
import { ShaderProperty } from "../../shader/ShaderProperty";
|
|
3
5
|
import { ParticleCompositeGradient } from "./ParticleCompositeGradient";
|
|
@@ -6,15 +8,32 @@ import { ParticleGeneratorModule } from "./ParticleGeneratorModule";
|
|
|
6
8
|
* Color over lifetime module.
|
|
7
9
|
*/
|
|
8
10
|
export declare class ColorOverLifetimeModule extends ParticleGeneratorModule {
|
|
11
|
+
/** @internal */
|
|
9
12
|
static readonly _gradientMacro: ShaderMacro;
|
|
13
|
+
/** @internal */
|
|
10
14
|
static readonly _randomGradientsMacro: ShaderMacro;
|
|
15
|
+
/** @internal */
|
|
11
16
|
static readonly _minGradientColor: ShaderProperty;
|
|
17
|
+
/** @internal */
|
|
12
18
|
static readonly _minGradientAlpha: ShaderProperty;
|
|
19
|
+
/** @internal */
|
|
13
20
|
static readonly _maxGradientColor: ShaderProperty;
|
|
21
|
+
/** @internal */
|
|
14
22
|
static readonly _maxGradientAlpha: ShaderProperty;
|
|
23
|
+
/** @internal */
|
|
15
24
|
static readonly _gradientKeysCount: ShaderProperty;
|
|
16
25
|
/** Color gradient over lifetime. */
|
|
17
26
|
color: ParticleCompositeGradient;
|
|
27
|
+
/** @internal */
|
|
28
|
+
_colorGradientRand: Rand;
|
|
18
29
|
private _gradientKeysCount;
|
|
19
30
|
private _colorMacro;
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
_updateShaderData(shaderData: ShaderData): void;
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
_resetRandomSeed(seed: number): void;
|
|
20
39
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ShaderData } from "../../shader/ShaderData";
|
|
2
|
+
import { ParticleCompositeCurve } from "./ParticleCompositeCurve";
|
|
3
|
+
import { ParticleCompositeGradient } from "./ParticleCompositeGradient";
|
|
4
|
+
import { ParticleGeneratorModule } from "./ParticleGeneratorModule";
|
|
5
|
+
/**
|
|
6
|
+
* Custom data module — exposes any number of named per-particle data channels
|
|
7
|
+
* (scalars or colors) readable from a custom particle shader by their generated
|
|
8
|
+
* `renderer_<name>...` uniforms.
|
|
9
|
+
*
|
|
10
|
+
* Each stream is one uniform shared across the drawcall, not a per-particle
|
|
11
|
+
* attribute (unlike Unity's `SetCustomParticleData`); shader-side
|
|
12
|
+
* differentiation must mix in `a_Random*` / `normalizedAge` / etc.
|
|
13
|
+
*
|
|
14
|
+
* Register streams BEFORE attaching the entity to the scene — `ParticleRenderer._onEnable`
|
|
15
|
+
* uploads on the first frame and won't see entries added afterward.
|
|
16
|
+
*/
|
|
17
|
+
export declare class CustomDataModule extends ParticleGeneratorModule {
|
|
18
|
+
private static readonly _streamNamePattern;
|
|
19
|
+
private static readonly _zeroCurveArray;
|
|
20
|
+
private static readonly _zeroGradientColorArray;
|
|
21
|
+
private static readonly _zeroGradientAlphaArray;
|
|
22
|
+
private static readonly _zeroColor;
|
|
23
|
+
private static readonly _zeroVector4;
|
|
24
|
+
private _curves;
|
|
25
|
+
private _gradients;
|
|
26
|
+
private _curveStreams;
|
|
27
|
+
private _gradientStreams;
|
|
28
|
+
/**
|
|
29
|
+
* Curves keyed by name.
|
|
30
|
+
*/
|
|
31
|
+
get curves(): ReadonlyMap<string, ParticleCompositeCurve>;
|
|
32
|
+
/**
|
|
33
|
+
* Gradients keyed by name.
|
|
34
|
+
*/
|
|
35
|
+
get gradients(): ReadonlyMap<string, ParticleCompositeGradient>;
|
|
36
|
+
/**
|
|
37
|
+
* Add a scalar curve. Shader-side uniforms by `curve.mode`:
|
|
38
|
+
*
|
|
39
|
+
* | Mode | Uniforms |
|
|
40
|
+
* |--------------|-----------------------------------------|
|
|
41
|
+
* | Constant | `float renderer_<name>MaxConst` |
|
|
42
|
+
* | TwoConstants | + `float renderer_<name>MinConst` |
|
|
43
|
+
* | Curve | `vec2 renderer_<name>MaxGradient[4]` |
|
|
44
|
+
* | TwoCurves | + `vec2 renderer_<name>MinGradient[4]` |
|
|
45
|
+
*
|
|
46
|
+
* @param name - Must contain only letters, digits, or underscores, and not already be in use.
|
|
47
|
+
* @param curve - Stored by reference.
|
|
48
|
+
*/
|
|
49
|
+
addCurve(name: string, curve: ParticleCompositeCurve): void;
|
|
50
|
+
/**
|
|
51
|
+
* Add a color gradient. Shader-side uniforms by `gradient.mode`:
|
|
52
|
+
*
|
|
53
|
+
* | Mode | Uniforms |
|
|
54
|
+
* |--------------|-----------------------------------------------------------------------------------------------------------------------|
|
|
55
|
+
* | Constant | `vec4 renderer_<name>MaxConst` |
|
|
56
|
+
* | TwoConstants | + `vec4 renderer_<name>MinConst` |
|
|
57
|
+
* | Gradient | `vec4 renderer_<name>MaxGradientColor[4]`, `vec2 renderer_<name>MaxGradientAlpha[4]`, `vec4 renderer_<name>KeysCount` |
|
|
58
|
+
* | TwoGradients | + `vec4 renderer_<name>MinGradientColor[4]`, `vec2 renderer_<name>MinGradientAlpha[4]` |
|
|
59
|
+
*
|
|
60
|
+
* `KeysCount` packs `(colorMin, alphaMin, colorMax, alphaMax)` last-keyframe times for shader-side normalization;
|
|
61
|
+
* in single-Gradient mode the min lanes mirror the max lanes.
|
|
62
|
+
*
|
|
63
|
+
* @param name - Same validation as {@link addCurve}.
|
|
64
|
+
* @param gradient - Stored by reference.
|
|
65
|
+
*/
|
|
66
|
+
addGradient(name: string, gradient: ParticleCompositeGradient): void;
|
|
67
|
+
/**
|
|
68
|
+
* Remove a curve. Shader uniforms read 0 after removal.
|
|
69
|
+
* @param name - The name passed to {@link addCurve}
|
|
70
|
+
*/
|
|
71
|
+
removeCurve(name: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* Remove a gradient. Shader uniforms read 0 after removal.
|
|
74
|
+
* @param name - The name passed to {@link addGradient}
|
|
75
|
+
*/
|
|
76
|
+
removeGradient(name: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* Remove all custom data streams.
|
|
79
|
+
*/
|
|
80
|
+
clear(): void;
|
|
81
|
+
/**
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
_updateShaderData(shaderData: ShaderData): void;
|
|
85
|
+
private _uploadCurveStream;
|
|
86
|
+
private _uploadGradientStream;
|
|
87
|
+
private _zeroCurveUniforms;
|
|
88
|
+
private _zeroGradientUniforms;
|
|
89
|
+
private _validateName;
|
|
90
|
+
}
|