Hello Polycount! Here is an article/tutorial I wrote yesterday and basically it's about creating a turbulent-like movement for particles without using a vector field or similar. It felt better reposting it here rather than just linking to my website (good or bad idea? layout got worse). I'd love to hear your thoughts, if this makes any sense, if it can be much improved and if this way of faking turbulence is currently used a lot or has been. It would also be interesting to see performance differences between this movement below and using a vector field. To summarize before you dive into my text below; it's basically about me modulating the wind strenght with the help of a sine functions to create a more natural movement for particles.I used an engine called Nebula, a Realtime 3D game/visualization engine. The same idea can still be applied in other engines. I have also noticed that I should have increased the alpha on the snow particles as they might be hard to see on some monitors.
THE ILLUSION OF TURBULENCE
I want my particles to have a natural, turbulent flow, but the game engine I'm working in at the moment is not supporting vector fields for its particles. How can I do that? I asked myself. I'll now take you through how I made the illusion of turbulence seen in the video below:
This scene has three major effects made with particles:
• The snow particles swirling around
• The snow clouds passing through
• And the sweeping snow along the ground
I will focus on showing how I got a turbulence effect in Nebula. If you are not using Nebula you can still learn from the concept and ideas below and bring them into another engine of your choice.
Below you can see the result of my first snow particle system. For a lot of people this might look good, but I knew something was lacking. I see snow regularly during the winter, and I've seen how some games make snow much more beautiful than this. I also like to remind myself of what Julian Love said during his GDC talk about VFX in Diablo (2014). Their goal was to put the same level of entertainment in a real campfire into their effects. That sounds like a great goal. Looking at my effect I had to ask myself what is missing? How can I improve it?
A great way to find answers to those questions are looking at references and how other artists make snow effects. Don't feel discourage to do so. It's a great way to improve your skills and expand your visual library!
There are a lot of video references on YouTube for both real snow and snow in games. I noticed quickly that the main thing that differ my snow from real snow is its movement. I wanted that movement! It feels random but still has a nice flow. I wanted a turbulent
I looked into other engines and saw that it was possible to simulate this turbulence in real time (Unreal Engine 4 Documentation, Unity Asset Store, Nvidia PhysX Turbulence). The solution was always a sort of dynamic vector field or force field that pushes and directs the particles in a turbulent manner. Although Nebula doesn't have such fields, looking at good snow and blizzard effects in-engine helped in many ways. I noticed that it is common to also:
• Stretch the particles
• Fade in & Fade out particles
• Vary particle sizes
• Have more particle systems than one
Now I have a clear goal. But I still don't know how to create the turbulent movement.
I'm using multiple textures blended together for my particle surface.
Only by having a clear goal in mind I thought maybe I can achieve what I want without a problem. It's worth a try! What I always do in Nebula when I create a new Particle system is resetting most options to zero until I've got spawning particles that stand still. A newly created particle will fluctuate in size, fade in and out, rotate and generally be too wild to start working with. If you have already reset your particle system go ahead and skip the following paragraph.
Go into the particles Shape
and make its size constant, and set it's initial rotation to zero.
Enter its Apparence
and then assign a particle surface. Set the particle color to white and make the Alpha constant.
Go into the Emitter
tab and click "Use single point emitter mesh". Now the particles will emit from one point in space, but we will spread them out later. You can also change the Particle life time to 10 seconds.
Now it doesn't look like much is happening, which is good, because we now have a great starting point to delevop our snow effect. Here is the differences I made:http://youtu.be/7UgxVFmm5lI
Now to the fun part!
Change the Initial velocity to around 4. You can increase or decrease this value later and it will change how far your particles will spread out. I animated my value a little so that they don't go equally far away.
Now change the Emitter spread so that the particles fly out in all direction of 3D space. In Nebula you can easily do this by setting Emitter Spread min to a constant 180.
Now let's make some changes to their sizes. In my case it was suitable to go for a size around 0,035 units. Now I am animating the size with a sine function. It's very easy to do in Nebula, but also quite easy to do with a little bit of code in other engines. If you don't know what a sine or cosine function is or what their curves look like I recommend you to look it up right away! Also learn how frequency and amplitude affects their curves. The values of the sine curve will be added on top of your existing (constant or animated) values. I set my frequency to 1 and amplitude to 0,01. Remember my original value was 0,035. Now by modulating my original value with the sine function the particle sizes will vary between 0,025 and 0,045 during their life time.
This only makes slight changes to the size but it's very important that you learn the idea of modulating values with sine/cosine functions because they are key to the illusion of turbulence. If you find it hard to grasp feel free to increase the values and play around with the particle sizes for a while.
The particles are now much smaller so we want a lot more of them. Change the Emission frequency to 500. I animate the values so that we get waves of more particles from time to time. I lower my Emission Duration to 7 seconds to make these wave more frequent. While I'm on it I set my Precalculation at start to 7 seconds as well, because when I start my game I want my scene to be filled with snow particles already.
Let's add wind and gravity
to the particle system. Under the Motion tab scroll down to Particle Mass. Without mass, the particle won't be affected by wind or gravity. Change the mass to 1, and the particles will start to fall. I think they are falling too fast so I change the gravity to -1. I am choosing to change the gravity instead of their mass because changing the mass will not only affect the downward velocity, but also how they are affected by the wind.
I'm changing the Wind direction to -0.5 in X, and 0,2 in Y. You can choose any direction your want, but having the wind slightly upwards will greatly improve the illusion of turbulence
. Set your Air resistance to 2 to give the wind an effect.
The snow is starting to look quite nice, but the origin of the particles is far too visible. We are also still missing the details that makes snow beautiful.
We want the alpha values to look like this. This will make the particles transparant until they have spread out. They will also fade away before dying.
Now it's time for the magic!
I'm adding a Stretch value of around 0,05. And Stretch detail to 1. Stretch detail will subdivide the particles so that they can bend when changing direction.
Now to add the illusion of turbulence. From research I knew I had to animate the wind somehow. I needed it to be ever-changing. Thanks to Nebula it was easy to experiment with modulating the Air resistance with a sine function. I set the Frequency to 2, and the Amplitude to 5. To make it seem even more random but still keep a nice flow of wind you can add a second animation curve on top of the sine curve.
That's it! I hoped you learned something. Play around with values and functions to make it exactly how you want it. It doesn't have to be snow. It could be rain, dust, smoke or embers!
To recap how I created particles with turbulent movement:
• Emit many small particles in all direction
• Add gravity to the particle system
• Add wind in any X/Z direction, and some slight wind upwards
• Animate their alpha so they are not seen before they are spread out
• Modulate the wind with a sine function to create the illusion of turbulence
• Add stretching to the particles to fake motion blur or trail
Remember that this is not true turbulence but a good way to fake it if your engine does not support vector fields.Here is the result:http://youtu.be/7ZgCxoMQ9hE