Skip to main content
Version: 0.11.0

UeParticleSystem

UeParticleSystem manages a group of particles, their emitters, and behavior modules. It uses a Data-Oriented (SoA) architecture to maximize performance in GML.

As of version 0.7.0, UeParticleSystem inherits from UeObject3D, allowing it to be integrated into the scene graph and participate in the shadow mapping pipeline.

Constructor​

var pool = new UeParticlePool(maxCount);
var system = new UeParticleSystem(pool, [data]);

Properties​

PropertyTypeDescription
timeScaleFloatMultiplier for the system's update speed.
sortedBoolIf true, particles are sorted by depth (back-to-front). Required for correct transparent blending.
softFactorFloatControls soft particle fading. 0.0 disables the effect. Recommended: 5.0.
castShadowBoolWhether the particle system casts shadows.
receiveShadowBoolWhether particles receive shadows from directional lights.

Methods​

addEmitter​

Adds an emitter to the system.

system.addEmitter(emitter);

update​

Updates all emitters and particles in the system.

system.update(dt, [camera]);
  • dt: Delta time.
  • camera: (Optional) The camera used for depth calculation if sorted is true.

kill​

Removes a specific particle (used internally).

system.kill(index);

depthSort​

Performs manual sorting of particles (used internally if sorted is true).

SoA Architecture​

The system does not store "Particle" objects. Instead, it stores properties in separate arrays within UeParticlePool. This reduces object overhead and improves cache locality.

// Example of accessing data in the pool
var px = system.pool.posX[i];
var py = system.pool.posY[i];