@galacean/engine-core 2.0.0-alpha.51 → 2.0.0-alpha.53
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 +9901 -8312
- package/dist/main.js.map +1 -1
- package/dist/module.js +9900 -8314
- package/dist/module.js.map +1 -1
- package/package.json +3 -5
- package/types/ComponentsManager.d.ts +3 -0
- package/types/RenderPipeline/RenderElement.d.ts +1 -1
- package/types/Renderer.d.ts +1 -1
- package/types/Scene.d.ts +1 -1
- package/types/Signal.d.ts +2 -0
- package/types/graphic/ElementRangeMapping.d.ts +9 -0
- package/types/graphic/TransformFeedbackPrimitive.d.ts +18 -28
- package/types/graphic/TransformFeedbackSimulator.d.ts +18 -18
- package/types/particle/ParticleBounds.d.ts +87 -0
- package/types/particle/ParticleBufferUtils.d.ts +18 -11
- package/types/particle/ParticleGenerator.d.ts +58 -85
- package/types/particle/ParticleRenderer.d.ts +22 -21
- package/types/particle/ParticleSubEmitterSpawnState.d.ts +35 -0
- package/types/particle/ParticleSystemManager.d.ts +17 -0
- package/types/particle/ParticleTransformFeedbackSimulator.d.ts +29 -29
- package/types/particle/enums/ParticleInheritVelocityMode.d.ts +14 -0
- package/types/particle/enums/ParticleRandomSubSeeds.d.ts +2 -1
- package/types/particle/enums/ParticleSubEmitterType.d.ts +4 -1
- package/types/particle/enums/attributes/ParticleFeedbackVertexAttribute.d.ts +3 -1
- package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +10 -8
- package/types/particle/index.d.ts +2 -0
- package/types/particle/modules/BirthSubEmitterCommand.d.ts +29 -0
- package/types/particle/modules/BirthSubEmitterState.d.ts +9 -0
- package/types/particle/modules/DeathSubEmitterCommand.d.ts +19 -0
- package/types/particle/modules/EmissionModule.d.ts +23 -12
- package/types/particle/modules/EmissionState.d.ts +13 -0
- package/types/particle/modules/InheritVelocityModule.d.ts +86 -0
- package/types/particle/modules/MainModule.d.ts +13 -7
- package/types/particle/modules/ParticleCompositeCurve.d.ts +4 -0
- package/types/particle/modules/SubEmitter.d.ts +5 -4
- package/types/particle/modules/SubEmittersModule.d.ts +70 -16
- package/types/particle/modules/VelocityOverLifetimeModule.d.ts +8 -7
- package/types/physics/Collider.d.ts +1 -3
- package/types/physics/DynamicCollider.d.ts +7 -8
- package/types/physics/PhysicsScene.d.ts +43 -1
- package/types/physics/shape/ColliderShape.d.ts +5 -2
- package/types/renderingHardwareInterface/IPlatformTransformFeedbackPrimitive.d.ts +10 -11
- package/types/shader/Shader.d.ts +13 -4
- package/types/shader/ShaderFactory.d.ts +9 -0
- package/types/shader/ShaderMacroProcessor.d.ts +10 -28
- package/types/shader/ShaderPass.d.ts +4 -8
- package/types/shader/enums/ShaderPreprocessorDirective.d.ts +7 -1
- package/types/shader/index.d.ts +1 -0
- package/types/shader/state/BlendState.d.ts +1 -1
- package/types/shader/state/RenderState.d.ts +1 -1
- package/types/physics/enums/ColliderShapeChangeFlag.d.ts +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.53",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -18,10 +18,8 @@
|
|
|
18
18
|
"types/**/*"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@galacean/engine-math": "2.0.0-alpha.
|
|
22
|
-
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@galacean/engine-design": "2.0.0-alpha.51"
|
|
21
|
+
"@galacean/engine-math": "2.0.0-alpha.53",
|
|
22
|
+
"@galacean/engine-design": "2.0.0-alpha.53"
|
|
25
23
|
},
|
|
26
24
|
"scripts": {
|
|
27
25
|
"b:types": "tsc"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Camera } from "./Camera";
|
|
2
2
|
import { Component } from "./Component";
|
|
3
3
|
import { Renderer } from "./Renderer";
|
|
4
|
+
import { ParticleSystemManager } from "./particle/ParticleSystemManager";
|
|
4
5
|
import { Script } from "./Script";
|
|
5
6
|
import { Animator } from "./animation";
|
|
6
7
|
import { IUICanvas } from "./ui/IUICanvas";
|
|
@@ -9,6 +10,8 @@ import { DisorderedArray } from "./utils/DisorderedArray";
|
|
|
9
10
|
* The manager of the components.
|
|
10
11
|
*/
|
|
11
12
|
export declare class ComponentsManager {
|
|
13
|
+
/** @internal */
|
|
14
|
+
readonly _particleSystemManager: ParticleSystemManager;
|
|
12
15
|
/** @internal */
|
|
13
16
|
_cameraNeedSorting: boolean;
|
|
14
17
|
/** @internal */
|
|
@@ -20,7 +20,7 @@ export declare class RenderElement implements IPoolElement {
|
|
|
20
20
|
_isBatched: boolean;
|
|
21
21
|
texture?: Texture2D;
|
|
22
22
|
subChunk?: SubPrimitiveChunk;
|
|
23
|
-
set(component: Renderer, material: Material, primitive: Primitive, subPrimitive: SubMesh, texture?: Texture2D, subChunk?: SubPrimitiveChunk): void;
|
|
23
|
+
set(component: Renderer, material: Material, primitive: Primitive, subPrimitive: SubMesh, texture?: Texture2D, subChunk?: SubPrimitiveChunk, shaderData?: ShaderData): void;
|
|
24
24
|
/**
|
|
25
25
|
* @internal
|
|
26
26
|
* Copy identity fields from `source` and reset per-queue batch state, so the same
|
package/types/Renderer.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ export declare class Renderer extends Component implements ICloneHook<Renderer>
|
|
|
57
57
|
*/
|
|
58
58
|
get shaderData(): ShaderData;
|
|
59
59
|
/**
|
|
60
|
-
* Whether
|
|
60
|
+
* Whether this renderer was culled by all cameras in the previous frame.
|
|
61
61
|
*/
|
|
62
62
|
get isCulled(): boolean;
|
|
63
63
|
/**
|
package/types/Scene.d.ts
CHANGED
package/types/Signal.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import { Component } from "./Component";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class Signal<T extends any[] = []> extends DataObject implements ICloneHook<Signal<T>> {
|
|
9
9
|
private _listeners;
|
|
10
|
+
/** Number of registered listeners. */
|
|
11
|
+
get listenerCount(): number;
|
|
10
12
|
/**
|
|
11
13
|
* Add a listener for this signal.
|
|
12
14
|
* @param fn - The callback function
|
|
@@ -1,52 +1,45 @@
|
|
|
1
|
-
import { Engine } from "../Engine";
|
|
1
|
+
import type { Engine } from "../Engine";
|
|
2
2
|
import { GraphicsResource } from "../asset/GraphicsResource";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { MeshTopology } from "./enums/MeshTopology";
|
|
3
|
+
import type { ShaderProgram } from "../shader/ShaderProgram";
|
|
4
|
+
import type { ElementRangeMapping } from "./ElementRangeMapping";
|
|
5
|
+
import type { MeshTopology } from "./enums/MeshTopology";
|
|
6
6
|
import { VertexBufferBinding } from "./VertexBufferBinding";
|
|
7
|
-
import { VertexElement } from "./VertexElement";
|
|
7
|
+
import type { VertexElement } from "./VertexElement";
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
|
10
10
|
* Primitive for Transform Feedback simulation with read/write buffer swapping.
|
|
11
11
|
*/
|
|
12
12
|
export declare class TransformFeedbackPrimitive extends GraphicsResource {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
private _transformFeedback;
|
|
13
|
+
private _platformPrimitive;
|
|
14
|
+
private readonly _transformFeedback;
|
|
16
15
|
private _bindingA;
|
|
17
16
|
private _bindingB;
|
|
18
|
-
private _byteStride;
|
|
17
|
+
private readonly _byteStride;
|
|
19
18
|
private _readIsA;
|
|
20
19
|
/**
|
|
21
20
|
* The current read buffer binding.
|
|
22
21
|
*/
|
|
23
22
|
get readBinding(): VertexBufferBinding;
|
|
24
|
-
/**
|
|
25
|
-
* The current write buffer binding.
|
|
26
|
-
*/
|
|
27
|
-
get writeBinding(): VertexBufferBinding;
|
|
28
23
|
/**
|
|
29
24
|
* @param engine - Engine instance
|
|
30
25
|
* @param byteStride - Bytes per vertex
|
|
26
|
+
* @param vertexCount - Number of vertices to allocate
|
|
31
27
|
*/
|
|
32
|
-
constructor(engine: Engine, byteStride: number);
|
|
28
|
+
constructor(engine: Engine, byteStride: number, vertexCount: number);
|
|
33
29
|
/**
|
|
34
30
|
* Resize read and write buffers.
|
|
35
31
|
* @param vertexCount - Number of vertices to allocate
|
|
32
|
+
* @param mappings - Element ranges to preserve from the previous read buffer
|
|
36
33
|
*/
|
|
37
|
-
resize(vertexCount: number): void;
|
|
34
|
+
resize(vertexCount: number, mappings: ReadonlyArray<ElementRangeMapping>): void;
|
|
38
35
|
/**
|
|
39
|
-
*
|
|
36
|
+
* Bind state before issuing draw calls, rebuilding the vertex layout when needed.
|
|
40
37
|
* @param program - Shader program for attribute locations
|
|
41
38
|
* @param feedbackElements - Vertex elements describing the read/write buffer
|
|
42
|
-
* @param
|
|
43
|
-
* @param inputElements - Vertex elements describing the input
|
|
39
|
+
* @param inputBindings - Additional input buffer bindings
|
|
40
|
+
* @param inputElements - Vertex elements describing the input buffers
|
|
44
41
|
*/
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Bind state before issuing draw calls.
|
|
48
|
-
*/
|
|
49
|
-
beginDraw(): void;
|
|
42
|
+
beginDraw(program: ShaderProgram, feedbackElements: VertexElement[], inputBindings: VertexBufferBinding[], inputElements: VertexElement[]): void;
|
|
50
43
|
/**
|
|
51
44
|
* Issue a draw call for a vertex range, capturing output to the write buffer.
|
|
52
45
|
* @param mode - Primitive topology
|
|
@@ -55,13 +48,10 @@ export declare class TransformFeedbackPrimitive extends GraphicsResource {
|
|
|
55
48
|
*/
|
|
56
49
|
draw(mode: MeshTopology, first: number, count: number): void;
|
|
57
50
|
/**
|
|
58
|
-
* Unbind state after draw calls.
|
|
51
|
+
* Unbind state after draw calls and make the written buffer current.
|
|
59
52
|
*/
|
|
60
53
|
endDraw(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Swap read and write buffers.
|
|
63
|
-
*/
|
|
64
|
-
swap(): void;
|
|
65
54
|
_rebuild(): void;
|
|
55
|
+
private _createBinding;
|
|
66
56
|
protected _onDestroy(): void;
|
|
67
57
|
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { Engine } from "../Engine";
|
|
1
|
+
import type { Engine } from "../Engine";
|
|
2
|
+
import type { ElementRangeMapping } from "./ElementRangeMapping";
|
|
2
3
|
import { MeshTopology } from "./enums/MeshTopology";
|
|
3
|
-
import { VertexBufferBinding } from "./VertexBufferBinding";
|
|
4
|
-
import { VertexElement } from "./VertexElement";
|
|
5
|
-
import { ShaderData } from "../shader/ShaderData";
|
|
6
|
-
import { ShaderPass } from "../shader/ShaderPass";
|
|
4
|
+
import type { VertexBufferBinding } from "./VertexBufferBinding";
|
|
5
|
+
import type { VertexElement } from "./VertexElement";
|
|
6
|
+
import type { ShaderData } from "../shader/ShaderData";
|
|
7
|
+
import type { ShaderPass } from "../shader/ShaderPass";
|
|
7
8
|
/**
|
|
8
9
|
* @internal
|
|
9
10
|
* General-purpose Transform Feedback simulator.
|
|
10
11
|
* Manages per-frame simulation with shared shader program caching.
|
|
11
12
|
*/
|
|
12
13
|
export declare class TransformFeedbackSimulator {
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
14
|
+
private readonly _primitive;
|
|
15
|
+
private readonly _shaderPass;
|
|
16
|
+
private readonly _feedbackVaryings;
|
|
16
17
|
/**
|
|
17
18
|
* The current read buffer binding.
|
|
18
19
|
*/
|
|
19
20
|
get readBinding(): VertexBufferBinding;
|
|
20
|
-
/**
|
|
21
|
-
* The current write buffer binding.
|
|
22
|
-
*/
|
|
23
|
-
get writeBinding(): VertexBufferBinding;
|
|
24
21
|
/**
|
|
25
22
|
* @param engine - Engine instance
|
|
26
23
|
* @param byteStride - Bytes per vertex in the feedback buffer
|
|
27
|
-
* @param
|
|
24
|
+
* @param vertexCount - Number of vertices to allocate
|
|
25
|
+
* @param shaderPass - Shader pass used for simulation
|
|
26
|
+
* @param feedbackVaryings - Vertex shader outputs captured by Transform Feedback
|
|
28
27
|
*/
|
|
29
|
-
constructor(engine: Engine, byteStride: number, shaderPass: ShaderPass);
|
|
28
|
+
constructor(engine: Engine, byteStride: number, vertexCount: number, shaderPass: ShaderPass, feedbackVaryings: string[]);
|
|
30
29
|
/**
|
|
31
30
|
* Resize feedback buffers.
|
|
32
31
|
* @param vertexCount - Number of vertices to allocate
|
|
32
|
+
* @param mappings - Element ranges to preserve from the previous feedback state
|
|
33
33
|
*/
|
|
34
|
-
resize(vertexCount: number): void;
|
|
34
|
+
resize(vertexCount: number, mappings: ReadonlyArray<ElementRangeMapping>): void;
|
|
35
35
|
/**
|
|
36
36
|
* Begin a simulation step: get/compile program, bind, upload uniforms, update layout.
|
|
37
37
|
* @param shaderData - Shader data with current macros and uniforms
|
|
38
38
|
* @param feedbackElements - Vertex elements for the feedback buffer
|
|
39
|
-
* @param
|
|
40
|
-
* @param inputElements - Vertex elements for the input
|
|
39
|
+
* @param inputBindings - Input buffer bindings
|
|
40
|
+
* @param inputElements - Vertex elements for the input buffers
|
|
41
41
|
*/
|
|
42
|
-
beginUpdate(shaderData: ShaderData, feedbackElements: VertexElement[],
|
|
42
|
+
beginUpdate(shaderData: ShaderData, feedbackElements: VertexElement[], inputBindings: VertexBufferBinding[], inputElements: VertexElement[]): boolean;
|
|
43
43
|
/**
|
|
44
44
|
* Issue a draw call for a vertex range.
|
|
45
45
|
* @param mode - Primitive topology
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { BoundingBox, Vector3 } from "@galacean/engine-math";
|
|
2
|
+
import type { ParticleGenerator } from "./ParticleGenerator";
|
|
3
|
+
import type { ParticleSubEmitterCommand } from "./modules/SubEmittersModule";
|
|
4
|
+
/**
|
|
5
|
+
* Owns the conservative bounds state for one particle generator.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare class ParticleBounds {
|
|
9
|
+
private readonly _generator;
|
|
10
|
+
private static readonly _tempVector20;
|
|
11
|
+
private static readonly _tempVector21;
|
|
12
|
+
private static readonly _tempVector22;
|
|
13
|
+
private static readonly _tempVector30;
|
|
14
|
+
private static readonly _tempVector31;
|
|
15
|
+
private static readonly _tempVector32;
|
|
16
|
+
private static readonly _tempVector33;
|
|
17
|
+
private static readonly _tempVector34;
|
|
18
|
+
private static readonly _tempInitialDisplacement;
|
|
19
|
+
private static readonly _tempMatrix;
|
|
20
|
+
private static readonly _tempEmissionBounds;
|
|
21
|
+
private static readonly _tempScaledBounds;
|
|
22
|
+
private static readonly _recordStride;
|
|
23
|
+
private static readonly _recordTimeOffset;
|
|
24
|
+
private static readonly _recordMaxLifetimeOffset;
|
|
25
|
+
private static readonly _recordCurrentAxisReachOffset;
|
|
26
|
+
private static readonly _recordInitialDisplacementOffset;
|
|
27
|
+
private static readonly _recordInitialFactorOffset;
|
|
28
|
+
private static readonly _recordIncreaseCount;
|
|
29
|
+
private static readonly _bakedInitialVelocityFactor;
|
|
30
|
+
private static readonly _tempEmissionRecord;
|
|
31
|
+
private readonly _generatorBounds;
|
|
32
|
+
private readonly _transformedBounds;
|
|
33
|
+
private _sourceBounds;
|
|
34
|
+
private _sourceBoundsFrame;
|
|
35
|
+
private _previousTrajectoryBounds;
|
|
36
|
+
private _trajectoryFrameDisplacement;
|
|
37
|
+
private _emissionRecords;
|
|
38
|
+
private _emissionRecordCount;
|
|
39
|
+
private _nextEmissionExpiry;
|
|
40
|
+
private _lastEmissionFrame;
|
|
41
|
+
private _currentInheritedAxisReach;
|
|
42
|
+
private _lastInitialCurveFactor;
|
|
43
|
+
constructor(_generator: ParticleGenerator);
|
|
44
|
+
update(out: BoundingBox): void;
|
|
45
|
+
generateTransformed(): void;
|
|
46
|
+
recordSubEmitterEmission(playTime: number, command: ParticleSubEmitterCommand, eventSizeBounds: number): void;
|
|
47
|
+
recordWorldEmission(playTime: number, worldPosition: Vector3 | undefined, inheritedBounds: Vector3, usesInitialInheritCurve: boolean): void;
|
|
48
|
+
captureSource(): void;
|
|
49
|
+
captureTrajectory(resetBaseline: boolean): void;
|
|
50
|
+
resetTrajectoryBaseline(): void;
|
|
51
|
+
accumulateInheritedVelocity(deltaTime: number): void;
|
|
52
|
+
retireEmissionRecords(): void;
|
|
53
|
+
resetEmissionRecords(): void;
|
|
54
|
+
discardParticleState(): void;
|
|
55
|
+
releaseEmissionRecords(): void;
|
|
56
|
+
getConfiguredParticleSizeExtent(): number;
|
|
57
|
+
getParticleSizeExtent(sizeX: number, sizeY: number, sizeZ: number): number;
|
|
58
|
+
private _updateWorld;
|
|
59
|
+
private _updateLocal;
|
|
60
|
+
private _getSourceBounds;
|
|
61
|
+
private _recordEmission;
|
|
62
|
+
private _storeEmissionRecord;
|
|
63
|
+
private _preserveInitialCurveFactor;
|
|
64
|
+
private _mergeLocalEmissionBounds;
|
|
65
|
+
private _getSubEmitterGeneratorBounds;
|
|
66
|
+
private _calculateGeneratorBounds;
|
|
67
|
+
private _mergeWorldEmissionBounds;
|
|
68
|
+
private _getInheritedBoundsExtent;
|
|
69
|
+
private _calculateTransformedBounds;
|
|
70
|
+
private _useOrbitalBounds;
|
|
71
|
+
private _getNoiseBoundsExtents;
|
|
72
|
+
private _getGravityBoundsReach;
|
|
73
|
+
private _addGravityToBounds;
|
|
74
|
+
private static _scaleRange;
|
|
75
|
+
private _getRangeReach;
|
|
76
|
+
private _getVectorReach;
|
|
77
|
+
private _getExtremeValueFromZero;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
export declare enum ParticleBoundsUpdateFlags {
|
|
83
|
+
/** World transform changes invalidate transformed bounds. */
|
|
84
|
+
TransformVolume = 2,
|
|
85
|
+
/** Generator parameter changes invalidate local generator bounds. */
|
|
86
|
+
GeneratorVolume = 4
|
|
87
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Engine } from "../Engine";
|
|
1
|
+
import type { Engine } from "../Engine";
|
|
2
2
|
import { IndexBufferBinding } from "../graphic/IndexBufferBinding";
|
|
3
3
|
import { VertexBufferBinding } from "../graphic/VertexBufferBinding";
|
|
4
4
|
import { VertexElement } from "../graphic/VertexElement";
|
|
@@ -6,20 +6,27 @@ import { VertexElement } from "../graphic/VertexElement";
|
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
8
|
export declare class ParticleBufferUtils {
|
|
9
|
-
static readonly
|
|
10
|
-
static readonly
|
|
11
|
-
static readonly
|
|
12
|
-
static readonly
|
|
9
|
+
static readonly feedbackInstanceInputVertexElements: VertexElement[];
|
|
10
|
+
static readonly feedbackStateInputVertexElements: VertexElement[];
|
|
11
|
+
static readonly feedbackStateWithTrajectoryInputVertexElements: VertexElement[];
|
|
12
|
+
static readonly subEmitterTrajectoryGatherInputVertexElements: VertexElement[];
|
|
13
|
+
static readonly feedbackInstanceWithSpawnStateInputVertexElements: VertexElement[];
|
|
14
|
+
static readonly forwardFeedbackStateInstanceInputVertexElements: VertexElement[];
|
|
15
|
+
static readonly forwardSubEmitterSpawnStateInstanceInputVertexElements: VertexElement[];
|
|
16
|
+
static readonly forwardBillboardInputVertexElement: VertexElement;
|
|
17
|
+
static readonly forwardParticleInstanceInputVertexElements: VertexElement[];
|
|
18
|
+
static readonly feedbackStateVertexStride = 24;
|
|
19
|
+
static readonly feedbackStateWithTrajectoryVertexStride = 48;
|
|
20
|
+
static readonly subEmitterSpawnStateVertexStride = 24;
|
|
21
|
+
static readonly instanceVertexStride = 180;
|
|
13
22
|
static readonly instanceVertexFloatStride: number;
|
|
14
23
|
static readonly startLifeTimeOffset = 3;
|
|
15
24
|
static readonly timeOffset = 7;
|
|
16
|
-
static readonly simulationUVOffset =
|
|
25
|
+
static readonly simulationUVOffset = 36;
|
|
26
|
+
static readonly inheritVelocityOffset = 40;
|
|
27
|
+
static readonly inheritVelocityRandomOffset = 43;
|
|
28
|
+
static readonly limitVelocityRandomOffset = 44;
|
|
17
29
|
static readonly billboardIndexCount = 6;
|
|
18
|
-
static readonly boundsFloatStride = 8;
|
|
19
|
-
static readonly boundsTimeOffset = 6;
|
|
20
|
-
static readonly boundsMaxLifetimeOffset = 7;
|
|
21
|
-
readonly billboardVertexElement: VertexElement;
|
|
22
|
-
readonly instanceVertexElements: VertexElement[];
|
|
23
30
|
readonly billboardVertexBufferBinding: VertexBufferBinding;
|
|
24
31
|
readonly billboardIndexBufferBinding: IndexBufferBinding;
|
|
25
32
|
constructor(engine: Engine);
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { DataObject } from "../base/DataObject";
|
|
2
|
-
import {
|
|
2
|
+
import { Vector3 } from "@galacean/engine-math";
|
|
3
3
|
import type { ICloneHook } from "../clone/ICloneHook";
|
|
4
4
|
import { Primitive } from "../graphic/Primitive";
|
|
5
5
|
import { SubMesh } from "../graphic/SubMesh";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import type { ShaderData } from "../shader";
|
|
7
|
+
import { ParticleBounds } from "./ParticleBounds";
|
|
8
8
|
import { ParticleRenderer } from "./ParticleRenderer";
|
|
9
9
|
import { ParticleTransformFeedbackSimulator } from "./ParticleTransformFeedbackSimulator";
|
|
10
10
|
import { ParticleStopMode } from "./enums/ParticleStopMode";
|
|
11
11
|
import { ColorOverLifetimeModule } from "./modules/ColorOverLifetimeModule";
|
|
12
12
|
import { CustomDataModule } from "./modules/CustomDataModule";
|
|
13
13
|
import { EmissionModule } from "./modules/EmissionModule";
|
|
14
|
+
import { InheritVelocityModule } from "./modules/InheritVelocityModule";
|
|
14
15
|
import { ForceOverLifetimeModule } from "./modules/ForceOverLifetimeModule";
|
|
15
16
|
import { LimitVelocityOverLifetimeModule } from "./modules/LimitVelocityOverLifetimeModule";
|
|
16
17
|
import { MainModule } from "./modules/MainModule";
|
|
@@ -19,25 +20,29 @@ import { SizeOverLifetimeModule } from "./modules/SizeOverLifetimeModule";
|
|
|
19
20
|
import { TextureSheetAnimationModule } from "./modules/TextureSheetAnimationModule";
|
|
20
21
|
import { NoiseModule } from "./modules/NoiseModule";
|
|
21
22
|
import { VelocityOverLifetimeModule } from "./modules/VelocityOverLifetimeModule";
|
|
22
|
-
import { SubEmittersModule } from "./modules/SubEmittersModule";
|
|
23
|
+
import { SubEmittersModule, type ParticleSubEmitterCommand } from "./modules/SubEmittersModule";
|
|
23
24
|
/**
|
|
24
25
|
* Particle Generator.
|
|
25
26
|
*/
|
|
26
27
|
export declare class ParticleGenerator extends DataObject implements ICloneHook<ParticleGenerator> {
|
|
27
|
-
private static
|
|
28
|
-
private static
|
|
29
|
-
private static
|
|
30
|
-
private static
|
|
31
|
-
private static
|
|
32
|
-
private static
|
|
33
|
-
private static
|
|
34
|
-
private static
|
|
35
|
-
private static
|
|
36
|
-
private static
|
|
37
|
-
private static
|
|
28
|
+
private static readonly _tempVector30;
|
|
29
|
+
private static readonly _tempVector31;
|
|
30
|
+
private static readonly _tempVector32;
|
|
31
|
+
private static readonly _tempVector33;
|
|
32
|
+
private static readonly _tempVector34;
|
|
33
|
+
private static readonly _tempColor;
|
|
34
|
+
private static readonly _tempQuat0;
|
|
35
|
+
private static readonly _tempParticleRenderers;
|
|
36
|
+
private static readonly _vertexBufferBindingScratch;
|
|
37
|
+
private static readonly _eventColor;
|
|
38
|
+
private static readonly _eventSize;
|
|
39
|
+
private static readonly _eventRotation;
|
|
38
40
|
private static readonly _particleIncreaseCount;
|
|
39
|
-
private static readonly _transformedBoundsIncreaseCount;
|
|
40
41
|
private static readonly _transformFeedbackMacro;
|
|
42
|
+
private static readonly _trajectoryFeedbackMacro;
|
|
43
|
+
private static readonly _hasSubEmitterSpawnedParticlesMacro;
|
|
44
|
+
private static readonly _currentTimeProperty;
|
|
45
|
+
private static readonly _particleValueInheritanceMask;
|
|
41
46
|
/** Use auto random seed. */
|
|
42
47
|
useAutoRandomSeed: boolean;
|
|
43
48
|
/** Main module. */
|
|
@@ -60,6 +65,8 @@ export declare class ParticleGenerator extends DataObject implements ICloneHook<
|
|
|
60
65
|
readonly textureSheetAnimation: TextureSheetAnimationModule;
|
|
61
66
|
/** Noise module. */
|
|
62
67
|
readonly noise: NoiseModule;
|
|
68
|
+
/** Inherit velocity module. */
|
|
69
|
+
readonly inheritVelocity: InheritVelocityModule;
|
|
63
70
|
/** Sub emitters module. */
|
|
64
71
|
readonly subEmitters: SubEmittersModule;
|
|
65
72
|
/** Custom data module. */
|
|
@@ -77,38 +84,28 @@ export declare class ParticleGenerator extends DataObject implements ICloneHook<
|
|
|
77
84
|
/** @internal */
|
|
78
85
|
_firstRetiredElement: number;
|
|
79
86
|
/** @internal */
|
|
80
|
-
_primitive: Primitive;
|
|
87
|
+
readonly _primitive: Primitive;
|
|
81
88
|
/** @internal */
|
|
82
|
-
|
|
83
|
-
/** @internal */
|
|
84
|
-
_subPrimitive: SubMesh;
|
|
89
|
+
readonly _subPrimitive: SubMesh;
|
|
85
90
|
/** @internal */
|
|
86
91
|
readonly _renderer: ParticleRenderer;
|
|
87
92
|
/** @internal */
|
|
88
|
-
|
|
93
|
+
readonly _bounds: ParticleBounds;
|
|
94
|
+
/** @internal */
|
|
95
|
+
readonly _incomingSubEmitterCommands: ParticleSubEmitterCommand[];
|
|
89
96
|
/** @internal */
|
|
90
|
-
|
|
97
|
+
_feedbackSimulator: ParticleTransformFeedbackSimulator | null;
|
|
98
|
+
private _subEmitterSpawnState;
|
|
99
|
+
private _activeSubEmitterParticleCount;
|
|
100
|
+
private _resetTrajectoryOnNextFeedback;
|
|
91
101
|
/** @internal */
|
|
92
|
-
|
|
93
|
-
private _feedbackReadback;
|
|
94
|
-
private _isPlaying;
|
|
102
|
+
_isPlaying: boolean;
|
|
95
103
|
private _instanceBufferResized;
|
|
96
|
-
private
|
|
104
|
+
private _particleCapacityDirty;
|
|
97
105
|
private _instanceVertexBufferBinding;
|
|
98
106
|
private _instanceVertices;
|
|
99
107
|
private _randomSeed;
|
|
100
|
-
private _transformedBoundsArray;
|
|
101
|
-
private _transformedBoundsCount;
|
|
102
|
-
private _firstActiveTransformedBoundingBox;
|
|
103
|
-
private _firstFreeTransformedBoundingBox;
|
|
104
108
|
private _playStartDelay;
|
|
105
|
-
private _eventPos;
|
|
106
|
-
private _eventColor;
|
|
107
|
-
private _eventSize;
|
|
108
|
-
private _eventRotation;
|
|
109
|
-
private _eventDir;
|
|
110
|
-
private _emitLocalPos;
|
|
111
|
-
private _emitDirection;
|
|
112
109
|
/**
|
|
113
110
|
* Whether the particle generator is contain alive or is still creating particles.
|
|
114
111
|
*/
|
|
@@ -150,11 +147,6 @@ export declare class ParticleGenerator extends DataObject implements ICloneHook<
|
|
|
150
147
|
* @internal
|
|
151
148
|
*/
|
|
152
149
|
_update(elapsedTime: number): void;
|
|
153
|
-
/**
|
|
154
|
-
* @internal
|
|
155
|
-
* Run Transform Feedback simulation pass.
|
|
156
|
-
*/
|
|
157
|
-
_updateFeedback(shaderData: ShaderData, deltaTime: number): void;
|
|
158
150
|
/**
|
|
159
151
|
* @internal
|
|
160
152
|
*/
|
|
@@ -162,15 +154,15 @@ export declare class ParticleGenerator extends DataObject implements ICloneHook<
|
|
|
162
154
|
/**
|
|
163
155
|
* @internal
|
|
164
156
|
*/
|
|
165
|
-
|
|
157
|
+
_updateShaderData(shaderData: ShaderData): void;
|
|
166
158
|
/**
|
|
167
159
|
* @internal
|
|
168
160
|
*/
|
|
169
|
-
|
|
161
|
+
_resetGlobalRandSeed(seed: number): void;
|
|
170
162
|
/**
|
|
171
163
|
* @internal
|
|
172
164
|
*/
|
|
173
|
-
|
|
165
|
+
_markParticleCapacityDirty(): void;
|
|
174
166
|
/**
|
|
175
167
|
* @internal
|
|
176
168
|
*/
|
|
@@ -178,11 +170,11 @@ export declare class ParticleGenerator extends DataObject implements ICloneHook<
|
|
|
178
170
|
/**
|
|
179
171
|
* @internal
|
|
180
172
|
*/
|
|
181
|
-
|
|
173
|
+
_resyncAfterCulling(): void;
|
|
182
174
|
/**
|
|
183
175
|
* @internal
|
|
184
176
|
*/
|
|
185
|
-
|
|
177
|
+
_getAliveParticleCount(): number;
|
|
186
178
|
/**
|
|
187
179
|
* @internal
|
|
188
180
|
* @inheritdoc
|
|
@@ -192,48 +184,29 @@ export declare class ParticleGenerator extends DataObject implements ICloneHook<
|
|
|
192
184
|
* @internal
|
|
193
185
|
*/
|
|
194
186
|
_destroy(): void;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* @internal
|
|
201
|
-
*/
|
|
202
|
-
_updateBoundsSimulationWorld(bounds: BoundingBox): void;
|
|
203
|
-
/**
|
|
204
|
-
* @internal
|
|
205
|
-
*/
|
|
206
|
-
_freeBoundsArray(): void;
|
|
207
|
-
/**
|
|
208
|
-
* @internal
|
|
209
|
-
*/
|
|
210
|
-
_generateTransformedBounds(): void;
|
|
187
|
+
private _updateFeedback;
|
|
188
|
+
private _resizeInstanceBuffer;
|
|
189
|
+
private static _copyParticleRange;
|
|
190
|
+
private static _addVertexInputLayout;
|
|
211
191
|
private _addNewParticle;
|
|
212
|
-
private
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
_emitFromSubEmitter(count: number, worldPosition: Vector3, inheritColor: Color | null, inheritSize: Vector3 | null, inheritRotation: Vector3 | null, worldDirection?: Vector3 | null): void;
|
|
217
|
-
private _addFeedbackParticle;
|
|
192
|
+
private _consumeBirthSubEmitterCommand;
|
|
193
|
+
private _emitParticles;
|
|
194
|
+
private _ensureParticleCapacity;
|
|
195
|
+
private _prepareBirthRange;
|
|
218
196
|
private _clearActiveParticles;
|
|
219
|
-
private
|
|
220
|
-
private
|
|
221
|
-
private
|
|
197
|
+
private _discardLostGPUParticleState;
|
|
198
|
+
private _discardActiveParticles;
|
|
199
|
+
private _resetTrajectoryFeedbackBaseline;
|
|
200
|
+
private _retireExpiredParticles;
|
|
201
|
+
private _finalizeRetiredParticles;
|
|
202
|
+
private _releaseSubEmitterSpawnStateIfUnused;
|
|
203
|
+
private _ensureSubEmitterSpawnState;
|
|
204
|
+
private _getRingDistance;
|
|
205
|
+
private _getNotRetiredParticleCount;
|
|
206
|
+
private _getFramePlayTime;
|
|
207
|
+
private _nextRingIndex;
|
|
222
208
|
private _evaluateOverLifetime;
|
|
223
209
|
private _freeRetiredParticles;
|
|
224
210
|
private _addActiveParticlesToVertexBuffer;
|
|
225
211
|
private _addVertexBufferBindingsFilterDuplicate;
|
|
226
|
-
private _resizeTransformedBoundsArray;
|
|
227
|
-
private _retireTransformedBounds;
|
|
228
|
-
private _calculateGeneratorBounds;
|
|
229
|
-
private _mergeTransformedBounds;
|
|
230
|
-
private _calculateTransformedBounds;
|
|
231
|
-
private _useOrbitalBounds;
|
|
232
|
-
private _getNoiseBoundsExtents;
|
|
233
|
-
private _getGravityBoundsReach;
|
|
234
|
-
private _getRangeReach;
|
|
235
|
-
private _getVectorReach;
|
|
236
|
-
private _getCurveMagnitudeFromZero;
|
|
237
|
-
private _addGravityToBounds;
|
|
238
|
-
private _getExtremeValueFromZero;
|
|
239
212
|
}
|