Unreal Engine 4: Part 4 – Particle smoke
Grab the free Unreal Engine software and create your own levels with Rob Redman's video guide; this week – adding atmospheric particle smoke...
If you've been following the series you should, by now, have gained a grasp on how to get started with creating your own game levels in Unreal Engine 4 but there is a lot still to learn. On this instalment I'm going to guide you through the process of building a simple particle system. We will create some simple smoke which can be placed onto any level and while it will be pretty basic it will introduce you to a few new tools which you can then experiment with, including Cascade, the particle system editor that ships with UE4. We will also look at building a basic material for particles that uses spherical masking to help lend some good looking puffs of smoke.
To get a grip on some of the tools available when building particle systems we are going to ignore using textures/sprites and use some of the built-in tools available to us, sin your content browser, in Materials, right-click and add a new material. Rename this to M_Smoke and double-click it to open it up.
I used a Spheremask combined with a constant of .6 to define a falloff for the smoke which drives the opacity of the particles based on the distance from the centre of the texture coordinates.
Adding and editing a particle system
As you probably guessed adding a system is a case of right-clicking in the content browser and choosing Create Particle system, so do this and rename it to w_Particle_Smoke, then double-click to launch the particle system editor. Select the Required field next to the main window and in the Details tab drag your new smoke material into the material preview window (or navigate to it using the standard browse controls).
Color over life
We can get some lovely variation to our smoke by adjusting the color over life parameter, so go to the Color Over Life section and in the Curve Editor uncheck the yellow box for AlphaOverLife, then select the ColorOverLife box above it. Now you can go in and adjust the color curves for the particles. You can also do this in the details tab buy double-clicking the swatch. Close the window, saving if asked. Drag the emitter into your scene so you can check its progress.
The next part of the process is personal taste, so go back into the emitter and go through the various sections, from Spawn to Initial Velocity, changing things on the way. Rather than copy my settings experiment and see how you can affect the look but remember; variation is good. If you prefer to work with curves then click the little Graph button to the bottom-right of each section to add the parameter to the curve editor.
I wasn't initially going to use any textures for this but I think it was begging for more detail, so I imported a texture (included) into my content browser and dragged that into the m_smoke material.
To get it working how I wanted, I multiplied it with the particle color and fed that into the base color and emissive color. I also loaded it into the roughness but this probably isn't necessary. I then saved everything and opened up my level from the previous episode, dragged my Particle system into the scene and added a small point light to the same location to add a bit of interest and a visual queue.
In the next installment we will be looking at the sky, so check back to learn how to deal with moving clouds and changes in lighting.
Top tip: Observing particle behavior
When editing particle systems, drag it into your level so you can keep an eye on it in its environment, to be sure it behaves as expected.
Download Unreal Engine 4
For more from Rob, check out Pariah Studios
Part 1 of the Unreal tutorial series: Setting up a new project
Part 2: Introducing materials and landscapes
Part 3: Adding foliage and rocks