Particle System

Particle systems represent smoke, fire, rain, fireworks... Usually phenomena composed of many small discrete elements that combined appear as a single entity or follow some common dynamics.

The emitter is a location where the particles are created. Usually each particle has a time counter. When the timer expires the particle is recycled and eventually reemitted as a new particle.

We can render particles in multiple ways. This example uses individual quads. This results in a drawcall per particle which is very inefficient but keeps the code simple for illustration purposes.

Draw Calls: 0

Particles Texture

Apply a texture to a particle to change its appereance and simulate the desired effect.

This example renders the quads using a technique called instanced drawing to reduce the number of draw calls. Compare the number with the previous example.

Draw Calls: 0

Combine Particle Systems

This is a simple representation of the SpaceX Raptor engine exhaust. It combines 3 particle systems: One for the brighter exhaust coming out from the nozzle, one for the purple plume and a last one to represent the shock diamonds

Chaining Particle Systems

When the timer expires for the shell particle an event triggers the firework sparks

Complex Particle Behavior

Redefine the init and tick methods to animate the particles. A few lines of code can describe very complex behavior

This particle system is a simplification of the Density Wave Theory that describes the formation of spiral galaxies. Notice that the galaxy rotates while the arms remain stationary. Arms are formed by areas with higher density of matter (planets, stars, dust...) due to overlapping eliptical orbits. Astronomers initially thought the spiral arms were material but it turns it's just areas of congested traffic of orbiting objects. A cosmic traffic jam!

TOGGLE ORBITS