Add a musical notes and fireflies effects to your Spatial 3D worlds
Particle systems in video games and virtual worlds are essential tools for creating evocative visual effects. They allow you to add elements that add immersion to experiences, such as fire, smoke or magic spells. And anything else you can think of.
They can also respond to player interaction and are used to tell stories and create specific environments. All in all, a powerful tool that adds detail and doses of love to our 3D creations.
In this guide we will explain how to create a particle system in Spatial with its Unity SDK, a pack for creators that facilitates the development and creation of experiences.
Specifically we will talk about how to use from a simple particle system without mesh to one with mesh. This is a procedure we used to add a musical notes and fireflies effects to one of our most recent Spatial developments: Bora Boring, Shilly's tropical archipelago of urban islands.
First create in effects a particle system and place it in the scene where you want. Remember to add the material with the effects you consider necessary, for example I have created a material with a glowy effect. If you use the fireflies at night the effect is more magical and beautiful.
Some of the options you have to modify to get the effect of fireflies:
Start speed: we will set it to 0, in this way we will get the particles to move around the area we have created and they will not scatter to follow the gravity. If you later need to scale the area, remember that you will probably also need to add more particles.
Emission ⮕ Rate over time: number of particles you scatter at the same time.
Shape: select the shape of your choice although to get the firefly effect using sphere is great.
Radius: whatever you need.
Color over time: you can use a gradient.
Size over lifetime: with this option you can have more control over the particle size using different types of curves.
Velocity over lifetime: if you require a little more movement you can activate this option, but if you need a directional movement you can modify the linear in the x, y, z axes.
Noise: gives motion to the particles. For effect of the fireflies is better slower, so the strength and the frequency should be low.
How to create music notes effect
Preparation of the textures and meshes
For the musical notes I created three different types of musical notes. This is not necessary, but afterward you can randomize them and that way you won't always see the same one.
I made the music notes in the same texture with alpha then I created three planes in Maya with the three different notes and export them to unity with the correct axis. Remember to create the material for the notes and put the material in blending mode: alpha.
There are some particle system options that change from fireflies to musical notes, for example the first part in the music notes is not the same that the fireflies.
Configuration of the particles
Start speed: we can set it to 10, in this way we will get the particles to move around the area we have created but not scatter so much
Start size: the size of the particle along the animation
Gravity modifier: you can set -1 the particles if you want them to go up because if you set 1 they move in the direction of gravity.
Simulation speed: from here you can control the speed of the particles. I have used 0.06 because it is a slow speed and this way you can see the notes well.
The next step is very important: select the renderer option to put the different notes randomize.
Render mode: I have selected mesh because I have created a plane for the particles, but you can put whatever you need
Mesh distribution: I have selected non-uniform random in this case because I think it is better to make it look more organic.
Meshes: you must select ➕ as many times as you need. In this case, three because I created three different musical notes so in each section you have to put the mesh of the corresponding plane.
Material: I put the material of the music notes.
One of the problems I found was that the particles would go through the building and get lost in the sky. To solve this problem I went to lifetime by emitter speed and selected it, in multiplier I selected curve.
Further down there is a screen that says: particle system curves. In the different types of curves I selected the one that is a completely straight line, the first one. Once it was created I selected the entire line and lowered it until I got the result I wanted. That in my case what I was looking for was that before reaching the ceiling the particles disappeared.
The image on the left side is how it looks before apply the lifetime by emitter speed and on the right side the after.
Beautiful details to your 3D worlds
With the particle system you can create a wide variety of things and if you stop and try each option you are sure to make many beautiful things.
Here is a little guide on how to start using particles with or without mesh and how to get straight to the most important things without getting lost!