baseParticleSystem.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. import { Vector2, Vector3 } from "../Maths/math.vector.js";
  2. import { ImageProcessingConfigurationDefines } from "../Materials/imageProcessingConfiguration.defines.js";
  3. import { Color4 } from "../Maths/math.color.js";
  4. import "../Engines/Extensions/engine.dynamicBuffer.js";
  5. /**
  6. * This represents the base class for particle system in Babylon.
  7. * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
  8. * Particles can take different shapes while emitted like box, sphere, cone or you can write your custom function.
  9. * @example https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro
  10. */
  11. export class BaseParticleSystem {
  12. /**
  13. * Gets or sets a texture used to add random noise to particle positions
  14. */
  15. get noiseTexture() {
  16. return this._noiseTexture;
  17. }
  18. set noiseTexture(value) {
  19. if (this._noiseTexture === value) {
  20. return;
  21. }
  22. this._noiseTexture = value;
  23. this._reset();
  24. }
  25. /**
  26. * Gets or sets whether an animation sprite sheet is enabled or not on the particle system
  27. */
  28. get isAnimationSheetEnabled() {
  29. return this._isAnimationSheetEnabled;
  30. }
  31. set isAnimationSheetEnabled(value) {
  32. if (this._isAnimationSheetEnabled == value) {
  33. return;
  34. }
  35. this._isAnimationSheetEnabled = value;
  36. this._reset();
  37. }
  38. /**
  39. * Gets or sets a boolean enabling the use of logarithmic depth buffers, which is good for wide depth buffers.
  40. */
  41. get useLogarithmicDepth() {
  42. return this._useLogarithmicDepth;
  43. }
  44. set useLogarithmicDepth(value) {
  45. this._useLogarithmicDepth = value && this.getScene().getEngine().getCaps().fragmentDepthSupported;
  46. }
  47. /**
  48. * Get hosting scene
  49. * @returns the scene
  50. */
  51. getScene() {
  52. return this._scene;
  53. }
  54. _hasTargetStopDurationDependantGradient() {
  55. return ((this._startSizeGradients && this._startSizeGradients.length > 0) ||
  56. (this._emitRateGradients && this._emitRateGradients.length > 0) ||
  57. (this._lifeTimeGradients && this._lifeTimeGradients.length > 0));
  58. }
  59. /**
  60. * Gets the current list of drag gradients.
  61. * You must use addDragGradient and removeDragGradient to update this list
  62. * @returns the list of drag gradients
  63. */
  64. getDragGradients() {
  65. return this._dragGradients;
  66. }
  67. /**
  68. * Gets the current list of limit velocity gradients.
  69. * You must use addLimitVelocityGradient and removeLimitVelocityGradient to update this list
  70. * @returns the list of limit velocity gradients
  71. */
  72. getLimitVelocityGradients() {
  73. return this._limitVelocityGradients;
  74. }
  75. /**
  76. * Gets the current list of color gradients.
  77. * You must use addColorGradient and removeColorGradient to update this list
  78. * @returns the list of color gradients
  79. */
  80. getColorGradients() {
  81. return this._colorGradients;
  82. }
  83. /**
  84. * Gets the current list of size gradients.
  85. * You must use addSizeGradient and removeSizeGradient to update this list
  86. * @returns the list of size gradients
  87. */
  88. getSizeGradients() {
  89. return this._sizeGradients;
  90. }
  91. /**
  92. * Gets the current list of color remap gradients.
  93. * You must use addColorRemapGradient and removeColorRemapGradient to update this list
  94. * @returns the list of color remap gradients
  95. */
  96. getColorRemapGradients() {
  97. return this._colorRemapGradients;
  98. }
  99. /**
  100. * Gets the current list of alpha remap gradients.
  101. * You must use addAlphaRemapGradient and removeAlphaRemapGradient to update this list
  102. * @returns the list of alpha remap gradients
  103. */
  104. getAlphaRemapGradients() {
  105. return this._alphaRemapGradients;
  106. }
  107. /**
  108. * Gets the current list of life time gradients.
  109. * You must use addLifeTimeGradient and removeLifeTimeGradient to update this list
  110. * @returns the list of life time gradients
  111. */
  112. getLifeTimeGradients() {
  113. return this._lifeTimeGradients;
  114. }
  115. /**
  116. * Gets the current list of angular speed gradients.
  117. * You must use addAngularSpeedGradient and removeAngularSpeedGradient to update this list
  118. * @returns the list of angular speed gradients
  119. */
  120. getAngularSpeedGradients() {
  121. return this._angularSpeedGradients;
  122. }
  123. /**
  124. * Gets the current list of velocity gradients.
  125. * You must use addVelocityGradient and removeVelocityGradient to update this list
  126. * @returns the list of velocity gradients
  127. */
  128. getVelocityGradients() {
  129. return this._velocityGradients;
  130. }
  131. /**
  132. * Gets the current list of start size gradients.
  133. * You must use addStartSizeGradient and removeStartSizeGradient to update this list
  134. * @returns the list of start size gradients
  135. */
  136. getStartSizeGradients() {
  137. return this._startSizeGradients;
  138. }
  139. /**
  140. * Gets the current list of emit rate gradients.
  141. * You must use addEmitRateGradient and removeEmitRateGradient to update this list
  142. * @returns the list of emit rate gradients
  143. */
  144. getEmitRateGradients() {
  145. return this._emitRateGradients;
  146. }
  147. /**
  148. * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
  149. * This only works when particleEmitterTyps is a BoxParticleEmitter
  150. */
  151. get direction1() {
  152. if (this.particleEmitterType.direction1) {
  153. return this.particleEmitterType.direction1;
  154. }
  155. return Vector3.Zero();
  156. }
  157. set direction1(value) {
  158. if (this.particleEmitterType.direction1) {
  159. this.particleEmitterType.direction1 = value;
  160. }
  161. }
  162. /**
  163. * Random direction of each particle after it has been emitted, between direction1 and direction2 vectors.
  164. * This only works when particleEmitterTyps is a BoxParticleEmitter
  165. */
  166. get direction2() {
  167. if (this.particleEmitterType.direction2) {
  168. return this.particleEmitterType.direction2;
  169. }
  170. return Vector3.Zero();
  171. }
  172. set direction2(value) {
  173. if (this.particleEmitterType.direction2) {
  174. this.particleEmitterType.direction2 = value;
  175. }
  176. }
  177. /**
  178. * Minimum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
  179. * This only works when particleEmitterTyps is a BoxParticleEmitter
  180. */
  181. get minEmitBox() {
  182. if (this.particleEmitterType.minEmitBox) {
  183. return this.particleEmitterType.minEmitBox;
  184. }
  185. return Vector3.Zero();
  186. }
  187. set minEmitBox(value) {
  188. if (this.particleEmitterType.minEmitBox) {
  189. this.particleEmitterType.minEmitBox = value;
  190. }
  191. }
  192. /**
  193. * Maximum box point around our emitter. Our emitter is the center of particles source, but if you want your particles to emit from more than one point, then you can tell it to do so.
  194. * This only works when particleEmitterTyps is a BoxParticleEmitter
  195. */
  196. get maxEmitBox() {
  197. if (this.particleEmitterType.maxEmitBox) {
  198. return this.particleEmitterType.maxEmitBox;
  199. }
  200. return Vector3.Zero();
  201. }
  202. set maxEmitBox(value) {
  203. if (this.particleEmitterType.maxEmitBox) {
  204. this.particleEmitterType.maxEmitBox = value;
  205. }
  206. }
  207. /**
  208. * Gets or sets the billboard mode to use when isBillboardBased = true.
  209. * Value can be: ParticleSystem.BILLBOARDMODE_ALL, ParticleSystem.BILLBOARDMODE_Y, ParticleSystem.BILLBOARDMODE_STRETCHED
  210. */
  211. get billboardMode() {
  212. return this._billboardMode;
  213. }
  214. set billboardMode(value) {
  215. if (this._billboardMode === value) {
  216. return;
  217. }
  218. this._billboardMode = value;
  219. this._reset();
  220. }
  221. /**
  222. * Gets or sets a boolean indicating if the particles must be rendered as billboard or aligned with the direction
  223. */
  224. get isBillboardBased() {
  225. return this._isBillboardBased;
  226. }
  227. set isBillboardBased(value) {
  228. if (this._isBillboardBased === value) {
  229. return;
  230. }
  231. this._isBillboardBased = value;
  232. this._reset();
  233. }
  234. /**
  235. * Gets the image processing configuration used either in this material.
  236. */
  237. get imageProcessingConfiguration() {
  238. return this._imageProcessingConfiguration;
  239. }
  240. /**
  241. * Sets the Default image processing configuration used either in the this material.
  242. *
  243. * If sets to null, the scene one is in use.
  244. */
  245. set imageProcessingConfiguration(value) {
  246. this._attachImageProcessingConfiguration(value);
  247. }
  248. /**
  249. * Attaches a new image processing configuration to the Standard Material.
  250. * @param configuration
  251. */
  252. _attachImageProcessingConfiguration(configuration) {
  253. if (configuration === this._imageProcessingConfiguration) {
  254. return;
  255. }
  256. // Pick the scene configuration if needed.
  257. if (!configuration && this._scene) {
  258. this._imageProcessingConfiguration = this._scene.imageProcessingConfiguration;
  259. }
  260. else {
  261. this._imageProcessingConfiguration = configuration;
  262. }
  263. }
  264. /** @internal */
  265. _reset() { }
  266. /**
  267. * @internal
  268. */
  269. _removeGradientAndTexture(gradient, gradients, texture) {
  270. if (!gradients) {
  271. return this;
  272. }
  273. let index = 0;
  274. for (const valueGradient of gradients) {
  275. if (valueGradient.gradient === gradient) {
  276. gradients.splice(index, 1);
  277. break;
  278. }
  279. index++;
  280. }
  281. if (texture) {
  282. texture.dispose();
  283. }
  284. return this;
  285. }
  286. /**
  287. * Instantiates a particle system.
  288. * Particles are often small sprites used to simulate hard-to-reproduce phenomena like fire, smoke, water, or abstract visual effects like magic glitter and faery dust.
  289. * @param name The name of the particle system
  290. */
  291. constructor(name) {
  292. /**
  293. * List of animations used by the particle system.
  294. */
  295. this.animations = [];
  296. /**
  297. * The rendering group used by the Particle system to chose when to render.
  298. */
  299. this.renderingGroupId = 0;
  300. /**
  301. * The emitter represents the Mesh or position we are attaching the particle system to.
  302. */
  303. this.emitter = Vector3.Zero();
  304. /**
  305. * The maximum number of particles to emit per frame
  306. */
  307. this.emitRate = 10;
  308. /**
  309. * If you want to launch only a few particles at once, that can be done, as well.
  310. */
  311. this.manualEmitCount = -1;
  312. /**
  313. * The overall motion speed (0.01 is default update speed, faster updates = faster animation)
  314. */
  315. this.updateSpeed = 0.01;
  316. /**
  317. * The amount of time the particle system is running (depends of the overall update speed).
  318. */
  319. this.targetStopDuration = 0;
  320. /**
  321. * Specifies whether the particle system will be disposed once it reaches the end of the animation.
  322. */
  323. this.disposeOnStop = false;
  324. /**
  325. * Minimum power of emitting particles.
  326. */
  327. this.minEmitPower = 1;
  328. /**
  329. * Maximum power of emitting particles.
  330. */
  331. this.maxEmitPower = 1;
  332. /**
  333. * Minimum life time of emitting particles.
  334. */
  335. this.minLifeTime = 1;
  336. /**
  337. * Maximum life time of emitting particles.
  338. */
  339. this.maxLifeTime = 1;
  340. /**
  341. * Minimum Size of emitting particles.
  342. */
  343. this.minSize = 1;
  344. /**
  345. * Maximum Size of emitting particles.
  346. */
  347. this.maxSize = 1;
  348. /**
  349. * Minimum scale of emitting particles on X axis.
  350. */
  351. this.minScaleX = 1;
  352. /**
  353. * Maximum scale of emitting particles on X axis.
  354. */
  355. this.maxScaleX = 1;
  356. /**
  357. * Minimum scale of emitting particles on Y axis.
  358. */
  359. this.minScaleY = 1;
  360. /**
  361. * Maximum scale of emitting particles on Y axis.
  362. */
  363. this.maxScaleY = 1;
  364. /**
  365. * Gets or sets the minimal initial rotation in radians.
  366. */
  367. this.minInitialRotation = 0;
  368. /**
  369. * Gets or sets the maximal initial rotation in radians.
  370. */
  371. this.maxInitialRotation = 0;
  372. /**
  373. * Minimum angular speed of emitting particles (Z-axis rotation for each particle).
  374. */
  375. this.minAngularSpeed = 0;
  376. /**
  377. * Maximum angular speed of emitting particles (Z-axis rotation for each particle).
  378. */
  379. this.maxAngularSpeed = 0;
  380. /**
  381. * The layer mask we are rendering the particles through.
  382. */
  383. this.layerMask = 0x0fffffff;
  384. /**
  385. * This can help using your own shader to render the particle system.
  386. * The according effect will be created
  387. */
  388. this.customShader = null;
  389. /**
  390. * By default particle system starts as soon as they are created. This prevents the
  391. * automatic start to happen and let you decide when to start emitting particles.
  392. */
  393. this.preventAutoStart = false;
  394. /**
  395. * Gets or sets a boolean indicating that this particle system will allow fog to be rendered on it (false by default)
  396. */
  397. this.applyFog = false;
  398. /** @internal */
  399. this._wasDispatched = false;
  400. this._rootUrl = "";
  401. /** Gets or sets the strength to apply to the noise value (default is (10, 10, 10)) */
  402. this.noiseStrength = new Vector3(10, 10, 10);
  403. /**
  404. * Callback triggered when the particle animation is ending.
  405. */
  406. this.onAnimationEnd = null;
  407. /**
  408. * Blend mode use to render the particle, it can be either ParticleSystem.BLENDMODE_ONEONE or ParticleSystem.BLENDMODE_STANDARD.
  409. */
  410. this.blendMode = BaseParticleSystem.BLENDMODE_ONEONE;
  411. /**
  412. * Forces the particle to write their depth information to the depth buffer. This can help preventing other draw calls
  413. * to override the particles.
  414. */
  415. this.forceDepthWrite = false;
  416. /** Gets or sets a value indicating how many cycles (or frames) must be executed before first rendering (this value has to be set before starting the system). Default is 0 */
  417. this.preWarmCycles = 0;
  418. /** Gets or sets a value indicating the time step multiplier to use in pre-warm mode (default is 1) */
  419. this.preWarmStepOffset = 1;
  420. /**
  421. * If using a spritesheet (isAnimationSheetEnabled) defines the speed of the sprite loop (default is 1 meaning the animation will play once during the entire particle lifetime)
  422. */
  423. this.spriteCellChangeSpeed = 1;
  424. /**
  425. * If using a spritesheet (isAnimationSheetEnabled) defines the first sprite cell to display
  426. */
  427. this.startSpriteCellID = 0;
  428. /**
  429. * If using a spritesheet (isAnimationSheetEnabled) defines the last sprite cell to display
  430. */
  431. this.endSpriteCellID = 0;
  432. /**
  433. * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell width to use
  434. */
  435. this.spriteCellWidth = 0;
  436. /**
  437. * If using a spritesheet (isAnimationSheetEnabled), defines the sprite cell height to use
  438. */
  439. this.spriteCellHeight = 0;
  440. /**
  441. * If using a spritesheet (isAnimationSheetEnabled), defines wether the sprite animation is looping
  442. */
  443. this.spriteCellLoop = true;
  444. /**
  445. * This allows the system to random pick the start cell ID between startSpriteCellID and endSpriteCellID
  446. */
  447. this.spriteRandomStartCell = false;
  448. /** Gets or sets a Vector2 used to move the pivot (by default (0,0)) */
  449. this.translationPivot = new Vector2(0, 0);
  450. /**
  451. * Gets or sets a boolean indicating that hosted animations (in the system.animations array) must be started when system.start() is called
  452. */
  453. this.beginAnimationOnStart = false;
  454. /**
  455. * Gets or sets the frame to start the animation from when beginAnimationOnStart is true
  456. */
  457. this.beginAnimationFrom = 0;
  458. /**
  459. * Gets or sets the frame to end the animation on when beginAnimationOnStart is true
  460. */
  461. this.beginAnimationTo = 60;
  462. /**
  463. * Gets or sets a boolean indicating if animations must loop when beginAnimationOnStart is true
  464. */
  465. this.beginAnimationLoop = false;
  466. /**
  467. * Gets or sets a world offset applied to all particles
  468. */
  469. this.worldOffset = new Vector3(0, 0, 0);
  470. this._useLogarithmicDepth = false;
  471. /**
  472. * You can use gravity if you want to give an orientation to your particles.
  473. */
  474. this.gravity = Vector3.Zero();
  475. this._colorGradients = null;
  476. this._sizeGradients = null;
  477. this._lifeTimeGradients = null;
  478. this._angularSpeedGradients = null;
  479. this._velocityGradients = null;
  480. this._limitVelocityGradients = null;
  481. this._dragGradients = null;
  482. this._emitRateGradients = null;
  483. this._startSizeGradients = null;
  484. this._rampGradients = null;
  485. this._colorRemapGradients = null;
  486. this._alphaRemapGradients = null;
  487. /**
  488. * Defines the delay in milliseconds before starting the system (0 by default)
  489. */
  490. this.startDelay = 0;
  491. /** Gets or sets a value indicating the damping to apply if the limit velocity factor is reached */
  492. this.limitVelocityDamping = 0.4;
  493. /**
  494. * Random color of each particle after it has been emitted, between color1 and color2 vectors
  495. */
  496. this.color1 = new Color4(1.0, 1.0, 1.0, 1.0);
  497. /**
  498. * Random color of each particle after it has been emitted, between color1 and color2 vectors
  499. */
  500. this.color2 = new Color4(1.0, 1.0, 1.0, 1.0);
  501. /**
  502. * Color the particle will have at the end of its lifetime
  503. */
  504. this.colorDead = new Color4(0, 0, 0, 1.0);
  505. /**
  506. * An optional mask to filter some colors out of the texture, or filter a part of the alpha channel
  507. */
  508. this.textureMask = new Color4(1.0, 1.0, 1.0, 1.0);
  509. /** @internal */
  510. this._isSubEmitter = false;
  511. /** @internal */
  512. this._billboardMode = 7;
  513. /** @internal */
  514. this._isBillboardBased = true;
  515. /**
  516. * Local cache of defines for image processing.
  517. */
  518. this._imageProcessingConfigurationDefines = new ImageProcessingConfigurationDefines();
  519. this.id = name;
  520. this.name = name;
  521. }
  522. /**
  523. * Creates a Point Emitter for the particle system (emits directly from the emitter position)
  524. * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
  525. * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
  526. */
  527. createPointEmitter(direction1, direction2) {
  528. throw new Error("Method not implemented.");
  529. }
  530. /**
  531. * Creates a Hemisphere Emitter for the particle system (emits along the hemisphere radius)
  532. * @param radius The radius of the hemisphere to emit from
  533. * @param radiusRange The range of the hemisphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
  534. */
  535. createHemisphericEmitter(radius = 1, radiusRange = 1) {
  536. throw new Error("Method not implemented.");
  537. }
  538. /**
  539. * Creates a Sphere Emitter for the particle system (emits along the sphere radius)
  540. * @param radius The radius of the sphere to emit from
  541. * @param radiusRange The range of the sphere to emit from [0-1] 0 Surface Only, 1 Entire Radius
  542. */
  543. createSphereEmitter(radius = 1, radiusRange = 1) {
  544. throw new Error("Method not implemented.");
  545. }
  546. /**
  547. * Creates a Directed Sphere Emitter for the particle system (emits between direction1 and direction2)
  548. * @param radius The radius of the sphere to emit from
  549. * @param direction1 Particles are emitted between the direction1 and direction2 from within the sphere
  550. * @param direction2 Particles are emitted between the direction1 and direction2 from within the sphere
  551. */
  552. createDirectedSphereEmitter(radius = 1, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)) {
  553. throw new Error("Method not implemented.");
  554. }
  555. /**
  556. * Creates a Cylinder Emitter for the particle system (emits from the cylinder to the particle position)
  557. * @param radius The radius of the emission cylinder
  558. * @param height The height of the emission cylinder
  559. * @param radiusRange The range of emission [0-1] 0 Surface only, 1 Entire Radius
  560. * @param directionRandomizer How much to randomize the particle direction [0-1]
  561. */
  562. createCylinderEmitter(radius = 1, height = 1, radiusRange = 1, directionRandomizer = 0) {
  563. throw new Error("Method not implemented.");
  564. }
  565. /**
  566. * Creates a Directed Cylinder Emitter for the particle system (emits between direction1 and direction2)
  567. * @param radius The radius of the cylinder to emit from
  568. * @param height The height of the emission cylinder
  569. * @param radiusRange the range of the emission cylinder [0-1] 0 Surface only, 1 Entire Radius (1 by default)
  570. * @param direction1 Particles are emitted between the direction1 and direction2 from within the cylinder
  571. * @param direction2 Particles are emitted between the direction1 and direction2 from within the cylinder
  572. */
  573. createDirectedCylinderEmitter(radius = 1, height = 1, radiusRange = 1, direction1 = new Vector3(0, 1.0, 0), direction2 = new Vector3(0, 1.0, 0)) {
  574. throw new Error("Method not implemented.");
  575. }
  576. /**
  577. * Creates a Cone Emitter for the particle system (emits from the cone to the particle position)
  578. * @param radius The radius of the cone to emit from
  579. * @param angle The base angle of the cone
  580. */
  581. createConeEmitter(radius = 1, angle = Math.PI / 4) {
  582. throw new Error("Method not implemented.");
  583. }
  584. /**
  585. * Creates a Box Emitter for the particle system. (emits between direction1 and direction2 from withing the box defined by minEmitBox and maxEmitBox)
  586. * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
  587. * @param direction2 Particles are emitted between the direction1 and direction2 from within the box
  588. * @param minEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox
  589. * @param maxEmitBox Particles are emitted from the box between minEmitBox and maxEmitBox
  590. */
  591. createBoxEmitter(direction1, direction2, minEmitBox, maxEmitBox) {
  592. throw new Error("Method not implemented.");
  593. }
  594. }
  595. /**
  596. * Source color is added to the destination color without alpha affecting the result
  597. */
  598. BaseParticleSystem.BLENDMODE_ONEONE = 0;
  599. /**
  600. * Blend current color and particle color using particle’s alpha
  601. */
  602. BaseParticleSystem.BLENDMODE_STANDARD = 1;
  603. /**
  604. * Add current color and particle color multiplied by particle’s alpha
  605. */
  606. BaseParticleSystem.BLENDMODE_ADD = 2;
  607. /**
  608. * Multiply current color with particle color
  609. */
  610. BaseParticleSystem.BLENDMODE_MULTIPLY = 3;
  611. /**
  612. * Multiply current color with particle color then add current color and particle color multiplied by particle’s alpha
  613. */
  614. BaseParticleSystem.BLENDMODE_MULTIPLYADD = 4;
  615. //# sourceMappingURL=baseParticleSystem.js.map