ParticleManager: System for a single type of particle. Templated. Owns Emitters, Sinks, Affectors, and the particle storage
ParticleSystem: Top level engine system. Owns all ParticleSystem instances
Emitter: Template base class that creates particles
Sink: Template base class that consumes particles. (Maybe combine with Affector?)
Affector: Template base class that modifies particles. Can also erase them
Renderer: Base class that creates required components, buffers, etc to enable rendering
Details
Spans of particles will be passed into virtual class methods. This allows for parallelization and reduces the number of virtual method calls
Particle release will work with a free list. Sinks/Affectors will run first to populate the list, then emitter will fill the slots. Any free slots after emitters will then be purged
User Provided
The framework will be implemented in the engine, but the user will have to define many of the core components:
Particle types
System plugins (emitters, sinks, affectors)
Via Renderer derived class:
Renderer ECS component (maybe provide a template that can be specialized?)
Renderer descriptor set (again, template may work here as only storage is changing for particle type in most cases)
Renderer pipeline/shaders (No way around it, particles are too specialized)
Rendering
With user provided ECS component, descriptor set (templated, fetches data from ECS component), and pipeline, rendering should be relatively simple. Just need to also provide a drawable component for the draw command. Will probably need to implement instanced rendering support, but that should be trivial if not already supported.
Overview
Classes
ParticleManager
: System for a single type of particle. Templated. OwnsEmitters
,Sinks
,Affectors
, and the particle storageParticleSystem
: Top level engine system. Owns allParticleSystem
instancesEmitter
: Template base class that creates particlesSink
: Template base class that consumes particles. (Maybe combine withAffector
?)Affector
: Template base class that modifies particles. Can also erase themRenderer
: Base class that creates required components, buffers, etc to enable renderingDetails
User Provided
The framework will be implemented in the engine, but the user will have to define many of the core components:
Renderer
derived class:Rendering
With user provided ECS component, descriptor set (templated, fetches data from ECS component), and pipeline, rendering should be relatively simple. Just need to also provide a drawable component for the draw command. Will probably need to implement instanced rendering support, but that should be trivial if not already supported.