Particle System Improvements (2018.3)
Legacy Particle System Retirement
The Legacy Particle System continues to be a development burden for each Unity version where it continues to be supported. New engine feature such as VR, and multi-threaded rendering, require time to be spent to ensure continued compatibility as the engine evolves. There are always new engine features, requiring maintenance of the Legacy Particle System code.
We began retiring the Legacy Particle System in 2018.1, by removing its script bindings. In 2018.3, the final steps have been taken, and the Legacy Particle System is no more.
If this will affect you, here are some options which may help you:
Set/GetParticles with offset
This script API has been improved to allow a new optional parameter called offset. It allows you to only Get or Set a sub-region of the entire particle array.
Particle Lights now support Realtime Global Illumination
When emitting lights via the Lights Module, those lights can now contribute to the scene’s Realtime Global Illumination. Simply configure the Light Prefab as you would any other light that contributes to the Global Illumination.
Flip Particle System meshes
It is now possible to use the flipping options to flip particle meshes, instead of only billboards. We have also moved the Flip U/V options out of the Texture Sheet Animation Module, and into the Renderer Module, as it is a rendering option and should always have been in the Renderer!
Be aware that when flipping meshes, the winding order of the geometry may change. This can cause particles to appear “inside-out”. To fix this, make sure to use a double-sided shader (the Standard Particle Shader supports double-sided rendering).
Ordered Mesh shape emission
Similarly to how the procedural shapes support non-randomized emission, meshes can now also spawn particles in a predictable order. For procedural shapes such as circles, the particles will spawn incrementally around the edge of the shape. For meshes, the same principle is applied, but the order of the vertices (or faces) in the mesh dictates the order.
If the mesh contains faces, each face spawns particles in order, otherwise the order of the vertices dictates the order. The best way to ensure control over the vertex order, is to set it up via script. To configure faces, use Mesh.triangles, and to configure vertices, use Mesh.vertices.
Disable Roll (VR)
We have added a new checkbox to the Renderer Module, which stops camera-facing particles from rolling with the camera. This is particularly useful for VR applications, where particles can look strange when the user tilts their head, without this functionality.
Burst Probability
It’s now possible to provide a random chance that a burst will not trigger. This can be used to create more unpredictable bursts of particles.
Particle Standard Shader is the new default
In Unity 2018.3, create a new Particle System and it will be using the Unlit Particle Standard Shader by default. All the old shaders have been moved to the legacy menu.
Shape Module Gizmos
The Scene View visualization of the Shape Module has been improved to show the Radius Thickness property. This allows you to accurately see where in the volume particles will be spawned.
Ringbuffer Mode
We have added a new option to the main particle settings module, to change the behavior of how particles die and are recycled. In this new mode, particles are no longer removed when their lifetimes elapse. Instead, 2 new modes are provided which are tied to the Max Particles property. The new modes are Pause Until Replaced and Loop Until Replaced. Pause mode means particles will remain visible at the end of the lifetime, and their age will no longer advance. They will disappear when newly spawned particles would cause the Max Particles property to be exceeded. Loop mode is similar to Pause mode, except that particle ages will play in a loop between the start and end time you specify, until they are replaced. This means any curve properties that animate over the particle lifetime will loop between the defined range.
This allows the Particle System to be used for persistent effects such as footprints or bullet holes, whilst maintaining an overall budget for performance. The looping mode means that you can create effects such as glowing embers, which continue to animate forever until they are replaced.
New Texture Sheet Animation modes
Unity 2018.3 brings 2 new modes to the Texture Sheet Animation Module. The first is a fixed-FPS mode, where animations can be played at a constant frames per second, regardless of the lifetime of the particles. The second new mode is based on speed, allowing frames to be chosen based on the speed of particles, within a user-defined range.
External Forces module upgrade
We are finally able to bring you the new External Forces module in Unity 2018.3. It comes with a new component, the ParticleSystemForceField, which can interact with Particle Systems to apply a variety of forces to the particles.
Shadow Bias
Particle billboards, lines and trails could all suffer from self-shadowing problems, originating from the fact that they are imposters faking 3D objects. In order to solve this, there are new shadow bias options in each Component, allowing you to move the shadow away from the object slightly, to prevent incorrect self-shadowing.
Sub-Emitter Ratio Property
Sub-Emitters in Unity now have a new property, called Ratio, which determines the likelihood of the sub-emitter event from firing. A value of 1 guarantees that the sub-emitter will fire when triggered, and a value of 0 means it will never fire. Using values in between 0 and 1 allows you to assign a random probability to your sub-emitter events.
Culling
Unity 2018.3 introduces a way to control what happens when Particle Systems are offscreen. In previous versions, we tried to make automatic decisions on whether to pause, or keep simulating your Particle Systems. This could lead to performance spikes, or just general wasted performance. The new Culling Mode option gives you the ability to make a better decision.
The new default behavior will be to always pause the simulation of a Particle System when it is offscreen. This is ideal for most looping effects, where the user wouldn’t notice this pause. However, for one-shot effects, such as fireworks, you may want to use one of the other modes: Pause & Catch-up, or Always Simulate. The first will stop running the simulation whilst offscreen, but performs a single large catch-up of the simulation when an effect reappears, giving the impression that it was never paused. However this can cause a single frame performance spike if used incorrectly. (for example of a very long effect, that may need to perform a large catch-up). The second option will simply carry on simulating the system whilst offscreen, which spreads the performance cost over multiple frames.
Non-uniform Scale
We have fixed some bugs that were preventing non-uniform scale from working as expected. It’s now possible to use non-uniform scale with local or world space aligned particles, and get predictable results. It is still the case that camera facing particles will still behave strangely with non-uniform scale, due to the ambiguity of whether to apply the scale in local or camera space.