New Particle System Editor
In this new version, Evergine improved its particle system: From now on, it will be an asset with its own editor, easing and helping the development when dealing with multiple instances of the same particle system. This new particle system editor contains some interesting tools for your particles creation, and it’s also the foundation of many new features in the future.
The new particle system workflow?
The previous version of Evergine approached the particle systems as a set of components. We had ParticleSystem and ParticleSystemRenderer components (force components aside). While it was a great improvement from our old WaveEngine particle system, we realized that we didn’t want to rely heavily in prefabs in complex scenes where many instances of a particle system are involved. We also realized that we could optimize better when we could easily group all the particle systems of the same type, so we changed the workflow like in the following diagram.
Now the developer:
- Creates a ParticleSystem asset.
- Edits it in the new Particle System Editor.
- Places it in the scene creating an entity using the ParticlesComponent and ParticlesRenderer components.
Particle System Creation
Creating a new Particle System asset is similar to creating other assets from Evergine Studio. Just right-click in the Assets Details panel and select Create particle system.
This will create a new asset in the Evergine project that can be opened for editing.
Particle System edition
Clicking the particle system asset will open its editor, showing the following 4 differentiated areas:
The main area shows the particle system simulation according to its parameters and some viewport configuration. It also shows:
- Emitter shape, showing from where the particles are being emitted.
- If the particle system uses an entity shape emitter, a teapot will be shown for orientation purposes.
- Grid for scale orientation that can be disabled.
This is the area where the particle system is configured.
All their properties are grouped in different sections to make the edition easier:
- Particle Material sets the properties for the particle rendering (its texture, render layer, and sampler state).
- General groups all the main properties that control the most important aspects, like the maximum number of particles, the initial color, speed, etc.
- Shape has properties that control where the particles are emitted and in that direction. It allows to choose among a set of different shapes:
- Spawn manages how many and when the particles are created. It can be chosen as:
- A normal Rate emission (particles per second).
- Burst emits all its particles at the same time (explosions!!!!)
- Distance emits the particles proportionally to the emitter movement.
- Color over life manages the color animation of the particle.
- Size over life does a similar job, animating its size.
- Noise group manages the particle’s turbulence properties.
- Force enables the force attraction and its category.
This toolbar controls some aspects of the particle editor visualization.
- Grid visualization on / off
- Emission Gizmo visualization on / off
- Force CPU particles on / off, even when GPU particles are available.
- Resets camera position.
- Background color of the viewport.
This bar controls some aspects of the particle system simulation life.
- Reset all the particles, returning to an initial state.
- Play / Stop the particles simulation.
- Time factor slider that allows controlling particle’s time.
Using particle systems in your scene
Dragging the particle system asset into our scene will create an entity with that particle system.
That new entity contains 2 new components (in addition to the Transform3D).
This component manages the simulation of that specific instance of the particle system. It contains:
- ParticleSystem property where we set the source asset.
- Force CPU Particles to explicitly use CPU particles and avoid compute shader ones.
- Emit Automatically starts emitting from the beginning. Otherwise, we would manually have to start its emission.
- Life Factor for aging the particles faster or slower.
- Time Factor for speeding or slowing the particle simulation.
The component takes the assets and generates all the graphics resources, meshes, and buffers necessary for the simulation.
This component just renders the mesh defined by the ParticlesComponent and its material.
The creation of the particle editor is a solid step in our desire to offer the best possible particle simulation in Evergine. One of the next steps in our particle system would support multiple emitters per particle system and establishing relations between them.