|
@@ -519,9 +519,9 @@
|
|
|
attributes: ["position", "age", "life", "seed", "size", "color", "direction", "initialDirection", "angle", "cellIndex"],
|
|
|
uniformsNames: ["currentCount", "timeDelta", "emitterWM", "lifeTime", "color1", "color2", "sizeRange", "scaleRange","gravity", "emitPower",
|
|
|
"direction1", "direction2", "minEmitBox", "maxEmitBox", "radius", "directionRandomizer", "height", "coneAngle", "stopFactor",
|
|
|
- "angleRange", "radiusRange", "cellInfos", "noiseStrength"],
|
|
|
+ "angleRange", "radiusRange", "cellInfos", "noiseStrength", "limitVelocityDamping"],
|
|
|
uniformBuffersNames: [],
|
|
|
- samplers:["randomSampler", "randomSampler2", "sizeGradientSampler", "angularSpeedGradientSampler", "velocityGradientSampler", "noiseSampler"],
|
|
|
+ samplers:["randomSampler", "randomSampler2", "sizeGradientSampler", "angularSpeedGradientSampler", "velocityGradientSampler", "limitVelocityGradientSampler", "noiseSampler", "dragGradientSampler"],
|
|
|
defines: "",
|
|
|
fallbacks: null,
|
|
|
onCompiled: null,
|
|
@@ -773,7 +773,15 @@
|
|
|
|
|
|
if (this._velocityGradientsTexture) {
|
|
|
defines += "\n#define VELOCITYGRADIENTS";
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this._limitVelocityGradientsTexture) {
|
|
|
+ defines += "\n#define LIMITVELOCITYGRADIENTS";
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this._dragGradientsTexture) {
|
|
|
+ defines += "\n#define DRAGGRADIENTS";
|
|
|
+ }
|
|
|
|
|
|
if (this.isAnimationSheetEnabled) {
|
|
|
defines += "\n#define ANIMATESHEET";
|
|
@@ -919,6 +927,14 @@
|
|
|
private _createVelocityGradientTexture() {
|
|
|
this._createFactorGradientTexture(this._velocityGradients, "_velocityGradientsTexture");
|
|
|
}
|
|
|
+
|
|
|
+ private _createLimitVelocityGradientTexture() {
|
|
|
+ this._createFactorGradientTexture(this._limitVelocityGradients, "_limitVelocityGradientsTexture");
|
|
|
+ }
|
|
|
+
|
|
|
+ private _createDragGradientTexture() {
|
|
|
+ this._createFactorGradientTexture(this._dragGradients, "_dragGradientsTexture");
|
|
|
+ }
|
|
|
|
|
|
private _createColorGradientTexture() {
|
|
|
if (!this._colorGradients || !this._colorGradients.length || this._colorGradientsTexture) {
|
|
@@ -959,6 +975,8 @@
|
|
|
this._createSizeGradientTexture();
|
|
|
this._createAngularSpeedGradientTexture();
|
|
|
this._createVelocityGradientTexture();
|
|
|
+ this._createLimitVelocityGradientTexture();
|
|
|
+ this._createDragGradientTexture();
|
|
|
|
|
|
this._recreateUpdateEffect();
|
|
|
this._recreateRenderEffect();
|
|
@@ -1030,6 +1048,15 @@
|
|
|
this._updateEffect.setTexture("velocityGradientSampler", this._velocityGradientsTexture);
|
|
|
}
|
|
|
|
|
|
+ if (this._limitVelocityGradientsTexture) {
|
|
|
+ this._updateEffect.setTexture("limitVelocityGradientSampler", this._limitVelocityGradientsTexture);
|
|
|
+ this._updateEffect.setFloat("limitVelocityDamping", this.limitVelocityDamping);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this._dragGradientsTexture) {
|
|
|
+ this._updateEffect.setTexture("dragGradientSampler", this._dragGradientsTexture);
|
|
|
+ }
|
|
|
+
|
|
|
if (this.particleEmitterType) {
|
|
|
this.particleEmitterType.applyToShader(this._updateEffect);
|
|
|
}
|