@galacean/engine-core 2.0.0-alpha.16 → 2.0.0-alpha.18
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 +1028 -53
- package/dist/main.js.map +1 -1
- package/dist/module.js +1028 -54
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/graphic/Buffer.d.ts +8 -1
- package/types/graphic/TransformFeedback.d.ts +1 -0
- package/types/graphic/TransformFeedbackPrimitive.d.ts +1 -0
- package/types/graphic/TransformFeedbackShader.d.ts +1 -0
- package/types/graphic/TransformFeedbackSimulator.d.ts +1 -0
- package/types/graphic/enums/BufferBindFlag.d.ts +2 -2
- package/types/particle/ParticleGenerator.d.ts +7 -0
- package/types/particle/ParticleTransformFeedbackSimulator.d.ts +1 -0
- package/types/particle/enums/attributes/ParticleFeedbackVertexAttribute.d.ts +1 -0
- package/types/particle/index.d.ts +1 -0
- package/types/particle/modules/LimitVelocityOverLifetimeModule.d.ts +119 -0
- package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +1 -0
- package/types/renderingHardwareInterface/IPlatformTransformFeedback.d.ts +1 -0
- package/types/renderingHardwareInterface/IPlatformTransformFeedbackPrimitive.d.ts +1 -0
- package/types/renderingHardwareInterface/index.d.ts +2 -0
- package/types/shader/ShaderPass.d.ts +1 -1
- package/types/shaderlib/ShaderLib.d.ts +2 -0
- package/types/shaderlib/particle/index.d.ts +2 -0
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.18",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"types/**/*"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@galacean/engine-math": "2.0.0-alpha.
|
|
21
|
+
"@galacean/engine-math": "2.0.0-alpha.18"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@galacean/engine-design": "2.0.0-alpha.
|
|
24
|
+
"@galacean/engine-design": "2.0.0-alpha.18"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"b:types": "tsc"
|
|
@@ -10,7 +10,6 @@ export declare class Buffer extends GraphicsResource {
|
|
|
10
10
|
private _type;
|
|
11
11
|
private _byteLength;
|
|
12
12
|
private _bufferUsage;
|
|
13
|
-
private _platformBuffer;
|
|
14
13
|
private _readable;
|
|
15
14
|
private _data;
|
|
16
15
|
/**
|
|
@@ -106,6 +105,14 @@ export declare class Buffer extends GraphicsResource {
|
|
|
106
105
|
* @param dataLength - Output data length
|
|
107
106
|
*/
|
|
108
107
|
getData(data: ArrayBufferView, bufferByteOffset: number, dataOffset: number, dataLength: number): void;
|
|
108
|
+
/**
|
|
109
|
+
* Copy data from another buffer on the GPU.
|
|
110
|
+
* @param srcBuffer - Source buffer
|
|
111
|
+
* @param srcByteOffset - Byte offset in the source buffer
|
|
112
|
+
* @param dstByteOffset - Byte offset in this buffer
|
|
113
|
+
* @param byteLength - Number of bytes to copy
|
|
114
|
+
*/
|
|
115
|
+
copyFromBuffer(srcBuffer: Buffer, srcByteOffset: number, dstByteOffset: number, byteLength: number): void;
|
|
109
116
|
/**
|
|
110
117
|
* Mark buffer as readable, the `data` property will be not accessible anymore.
|
|
111
118
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { ParticleStopMode } from "./enums/ParticleStopMode";
|
|
|
2
2
|
import { ColorOverLifetimeModule } from "./modules/ColorOverLifetimeModule";
|
|
3
3
|
import { EmissionModule } from "./modules/EmissionModule";
|
|
4
4
|
import { ForceOverLifetimeModule } from "./modules/ForceOverLifetimeModule";
|
|
5
|
+
import { LimitVelocityOverLifetimeModule } from "./modules/LimitVelocityOverLifetimeModule";
|
|
5
6
|
import { MainModule } from "./modules/MainModule";
|
|
6
7
|
import { RotationOverLifetimeModule } from "./modules/RotationOverLifetimeModule";
|
|
7
8
|
import { SizeOverLifetimeModule } from "./modules/SizeOverLifetimeModule";
|
|
@@ -16,11 +17,13 @@ export declare class ParticleGenerator {
|
|
|
16
17
|
private static _tempVector22;
|
|
17
18
|
private static _tempVector30;
|
|
18
19
|
private static _tempVector31;
|
|
20
|
+
private static _tempVector32;
|
|
19
21
|
private static _tempMat;
|
|
20
22
|
private static _tempColor0;
|
|
21
23
|
private static _tempParticleRenderers;
|
|
22
24
|
private static readonly _particleIncreaseCount;
|
|
23
25
|
private static readonly _transformedBoundsIncreaseCount;
|
|
26
|
+
private static readonly _transformFeedbackMacro;
|
|
24
27
|
/** Use auto random seed. */
|
|
25
28
|
useAutoRandomSeed: boolean;
|
|
26
29
|
/** Main module. */
|
|
@@ -31,6 +34,8 @@ export declare class ParticleGenerator {
|
|
|
31
34
|
readonly velocityOverLifetime: VelocityOverLifetimeModule;
|
|
32
35
|
/** Force over lifetime module. */
|
|
33
36
|
readonly forceOverLifetime: ForceOverLifetimeModule;
|
|
37
|
+
/** Limit velocity over lifetime module. */
|
|
38
|
+
readonly limitVelocityOverLifetime: LimitVelocityOverLifetimeModule;
|
|
34
39
|
/** Size over lifetime module. */
|
|
35
40
|
readonly sizeOverLifetime: SizeOverLifetimeModule;
|
|
36
41
|
/** Rotation over lifetime module. */
|
|
@@ -80,6 +85,8 @@ export declare class ParticleGenerator {
|
|
|
80
85
|
*/
|
|
81
86
|
emit(count: number): void;
|
|
82
87
|
private _addNewParticle;
|
|
88
|
+
private _addFeedbackParticle;
|
|
89
|
+
private _clearActiveParticles;
|
|
83
90
|
private _retireActiveParticles;
|
|
84
91
|
private _freeRetiredParticles;
|
|
85
92
|
private _addActiveParticlesToVertexBuffer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -19,4 +19,5 @@ export { RotationOverLifetimeModule } from "./modules/RotationOverLifetimeModule
|
|
|
19
19
|
export { SizeOverLifetimeModule } from "./modules/SizeOverLifetimeModule";
|
|
20
20
|
export { TextureSheetAnimationModule } from "./modules/TextureSheetAnimationModule";
|
|
21
21
|
export { VelocityOverLifetimeModule } from "./modules/VelocityOverLifetimeModule";
|
|
22
|
+
export { LimitVelocityOverLifetimeModule } from "./modules/LimitVelocityOverLifetimeModule";
|
|
22
23
|
export * from "./modules/shape/index";
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { ShaderMacro } from "../../shader";
|
|
2
|
+
import { ShaderProperty } from "../../shader/ShaderProperty";
|
|
3
|
+
import { ParticleSimulationSpace } from "../enums/ParticleSimulationSpace";
|
|
4
|
+
import { ParticleGenerator } from "../ParticleGenerator";
|
|
5
|
+
import { ParticleCompositeCurve } from "./ParticleCompositeCurve";
|
|
6
|
+
import { ParticleGeneratorModule } from "./ParticleGeneratorModule";
|
|
7
|
+
/**
|
|
8
|
+
* Limit velocity over lifetime module.
|
|
9
|
+
*/
|
|
10
|
+
export declare class LimitVelocityOverLifetimeModule extends ParticleGeneratorModule {
|
|
11
|
+
static readonly _enabledMacro: ShaderMacro;
|
|
12
|
+
static readonly _separateAxesMacro: ShaderMacro;
|
|
13
|
+
static readonly _speedConstantModeMacro: ShaderMacro;
|
|
14
|
+
static readonly _speedCurveModeMacro: ShaderMacro;
|
|
15
|
+
static readonly _speedIsRandomMacro: ShaderMacro;
|
|
16
|
+
static readonly _dragCurveModeMacro: ShaderMacro;
|
|
17
|
+
static readonly _dragIsRandomMacro: ShaderMacro;
|
|
18
|
+
static readonly _multiplyDragBySizeMacro: ShaderMacro;
|
|
19
|
+
static readonly _multiplyDragByVelocityMacro: ShaderMacro;
|
|
20
|
+
static readonly _speedMaxConstProperty: ShaderProperty;
|
|
21
|
+
static readonly _speedMinConstProperty: ShaderProperty;
|
|
22
|
+
static readonly _speedMaxCurveProperty: ShaderProperty;
|
|
23
|
+
static readonly _speedMinCurveProperty: ShaderProperty;
|
|
24
|
+
static readonly _speedMaxConstVecProperty: ShaderProperty;
|
|
25
|
+
static readonly _speedMinConstVecProperty: ShaderProperty;
|
|
26
|
+
static readonly _speedXMaxCurveProperty: ShaderProperty;
|
|
27
|
+
static readonly _speedXMinCurveProperty: ShaderProperty;
|
|
28
|
+
static readonly _speedYMaxCurveProperty: ShaderProperty;
|
|
29
|
+
static readonly _speedYMinCurveProperty: ShaderProperty;
|
|
30
|
+
static readonly _speedZMaxCurveProperty: ShaderProperty;
|
|
31
|
+
static readonly _speedZMinCurveProperty: ShaderProperty;
|
|
32
|
+
static readonly _dampenProperty: ShaderProperty;
|
|
33
|
+
static readonly _dragConstantProperty: ShaderProperty;
|
|
34
|
+
static readonly _dragMaxCurveProperty: ShaderProperty;
|
|
35
|
+
static readonly _dragMinCurveProperty: ShaderProperty;
|
|
36
|
+
static readonly _spaceProperty: ShaderProperty;
|
|
37
|
+
private _speedMinConstantVec;
|
|
38
|
+
private _speedMaxConstantVec;
|
|
39
|
+
private _dragConstantVec;
|
|
40
|
+
private _enabledModuleMacro;
|
|
41
|
+
private _separateAxesCachedMacro;
|
|
42
|
+
private _speedModeMacro;
|
|
43
|
+
private _speedRandomMacro;
|
|
44
|
+
private _dragCurveCachedMacro;
|
|
45
|
+
private _dragRandomCachedMacro;
|
|
46
|
+
private _dragSizeMacro;
|
|
47
|
+
private _dragVelocityMacro;
|
|
48
|
+
private _separateAxes;
|
|
49
|
+
private _speedX;
|
|
50
|
+
private _speedY;
|
|
51
|
+
private _speedZ;
|
|
52
|
+
private _dampen;
|
|
53
|
+
private _drag;
|
|
54
|
+
private _multiplyDragByParticleSize;
|
|
55
|
+
private _multiplyDragByParticleVelocity;
|
|
56
|
+
private _space;
|
|
57
|
+
/**
|
|
58
|
+
* Whether to limit velocity on each axis separately.
|
|
59
|
+
*/
|
|
60
|
+
get separateAxes(): boolean;
|
|
61
|
+
set separateAxes(value: boolean);
|
|
62
|
+
/**
|
|
63
|
+
* Speed limit when separateAxes is false.
|
|
64
|
+
*/
|
|
65
|
+
get speed(): ParticleCompositeCurve;
|
|
66
|
+
set speed(value: ParticleCompositeCurve);
|
|
67
|
+
/**
|
|
68
|
+
* Speed limit for the x-axis (or overall limit when separateAxes is false).
|
|
69
|
+
*/
|
|
70
|
+
get speedX(): ParticleCompositeCurve;
|
|
71
|
+
set speedX(value: ParticleCompositeCurve);
|
|
72
|
+
/**
|
|
73
|
+
* Speed limit for the y-axis.
|
|
74
|
+
*/
|
|
75
|
+
get speedY(): ParticleCompositeCurve;
|
|
76
|
+
set speedY(value: ParticleCompositeCurve);
|
|
77
|
+
/**
|
|
78
|
+
* Speed limit for the z-axis.
|
|
79
|
+
*/
|
|
80
|
+
get speedZ(): ParticleCompositeCurve;
|
|
81
|
+
set speedZ(value: ParticleCompositeCurve);
|
|
82
|
+
/**
|
|
83
|
+
* Controls how much the velocity is dampened when it exceeds the limit.
|
|
84
|
+
* @remarks Value is clamped to [0, 1]. 0 means no damping, 1 means full damping.
|
|
85
|
+
*/
|
|
86
|
+
get dampen(): number;
|
|
87
|
+
set dampen(value: number);
|
|
88
|
+
/**
|
|
89
|
+
* Controls the amount of drag applied to particle velocities.
|
|
90
|
+
*/
|
|
91
|
+
get drag(): ParticleCompositeCurve;
|
|
92
|
+
set drag(value: ParticleCompositeCurve);
|
|
93
|
+
/**
|
|
94
|
+
* Adjust the amount of drag based on particle sizes.
|
|
95
|
+
*/
|
|
96
|
+
get multiplyDragByParticleSize(): boolean;
|
|
97
|
+
set multiplyDragByParticleSize(value: boolean);
|
|
98
|
+
/**
|
|
99
|
+
* Adjust the amount of drag based on particle speeds.
|
|
100
|
+
*/
|
|
101
|
+
get multiplyDragByParticleVelocity(): boolean;
|
|
102
|
+
set multiplyDragByParticleVelocity(value: boolean);
|
|
103
|
+
/**
|
|
104
|
+
* Specifies if the velocity limits are in local space or world space.
|
|
105
|
+
* @remarks Only takes effect when 'separateAxes' is enabled.
|
|
106
|
+
*/
|
|
107
|
+
get space(): ParticleSimulationSpace;
|
|
108
|
+
set space(value: ParticleSimulationSpace);
|
|
109
|
+
/**
|
|
110
|
+
* Specifies whether the module is enabled.
|
|
111
|
+
* @remarks This module requires WebGL2, On WebGL1, enabling will be silently ignored.
|
|
112
|
+
*/
|
|
113
|
+
get enabled(): boolean;
|
|
114
|
+
set enabled(value: boolean);
|
|
115
|
+
constructor(generator: ParticleGenerator);
|
|
116
|
+
private _uploadScalarSpeed;
|
|
117
|
+
private _uploadSeparateAxisSpeeds;
|
|
118
|
+
private _uploadDrag;
|
|
119
|
+
}
|
|
@@ -3,5 +3,6 @@ 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
|
+
copyFromBuffer(srcBuffer: IPlatformBuffer, srcByteOffset: number, dstByteOffset: number, byteLength: number): void;
|
|
6
7
|
destroy(): void;
|
|
7
8
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,3 +4,5 @@ export type { IPlatformTexture } from "./IPlatformTexture";
|
|
|
4
4
|
export type { IPlatformTexture2D } from "./IPlatformTexture2D";
|
|
5
5
|
export type { IPlatformTexture2DArray } from "./IPlatformTexture2DArray";
|
|
6
6
|
export type { IPlatformTextureCube } from "./IPlatformTextureCube";
|
|
7
|
+
export type { IPlatformTransformFeedback } from "./IPlatformTransformFeedback";
|
|
8
|
+
export type { IPlatformTransformFeedbackPrimitive } from "./IPlatformTransformFeedbackPrimitive";
|
|
@@ -3,7 +3,6 @@ import { ShaderPart } from "./ShaderPart";
|
|
|
3
3
|
* Shader pass containing vertex and fragment source.
|
|
4
4
|
*/
|
|
5
5
|
export declare class ShaderPass extends ShaderPart {
|
|
6
|
-
private static _shaderPassCounter;
|
|
7
6
|
private _vertexSource;
|
|
8
7
|
private _fragmentSource;
|
|
9
8
|
/**
|
|
@@ -22,4 +21,5 @@ export declare class ShaderPass extends ShaderPart {
|
|
|
22
21
|
*/
|
|
23
22
|
constructor(vertexSource: string, fragmentSource: string, tags?: Record<string, number | string | boolean>);
|
|
24
23
|
private _getCanonicalShaderProgram;
|
|
24
|
+
private _getShaderLabProgram;
|
|
25
25
|
}
|
|
@@ -6,6 +6,8 @@ export declare const ShaderLib: {
|
|
|
6
6
|
color_over_lifetime_module: string;
|
|
7
7
|
texture_sheet_animation_module: string;
|
|
8
8
|
force_over_lifetime_module: string;
|
|
9
|
+
limit_velocity_over_lifetime_module: string;
|
|
10
|
+
particle_feedback_simulation: string;
|
|
9
11
|
sphere_billboard: string;
|
|
10
12
|
stretched_billboard: string;
|
|
11
13
|
vertical_billboard: string;
|
|
@@ -6,6 +6,8 @@ declare const _default: {
|
|
|
6
6
|
color_over_lifetime_module: string;
|
|
7
7
|
texture_sheet_animation_module: string;
|
|
8
8
|
force_over_lifetime_module: string;
|
|
9
|
+
limit_velocity_over_lifetime_module: string;
|
|
10
|
+
particle_feedback_simulation: string;
|
|
9
11
|
sphere_billboard: string;
|
|
10
12
|
stretched_billboard: string;
|
|
11
13
|
vertical_billboard: string;
|