Omegastick / bots

1 stars 1 forks source link

Split particle data from rendering #156

Closed Omegastick closed 4 years ago

Omegastick commented 4 years ago

Currently, there is one ParticleRenderer class, which both holds the data of all particles to be rendered and renders them.

This is a little inflexible. It means that all particles have to follow the same behaviours (one shader for all particles). It also means that if you want to create a particle, it has to be done during the draw phase (the only time that game entities have access to the ParticleRenderer).

Instead, ParticleRenderer should only contain code for rendering particles, and handling particle maintenance, etc. should be done by a ParticleEmitter. The ParticleEmitter stores all the data for it's particles, and is passed to the ParticleRenderer during the draw phase for rendering.

ParticleEmitter should be fairly customizable: