Intro to Cascade: Creating a Sprite Emitter | 04 | v4.2 Tutorial Series | Unreal Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
♪♪♪ Zak Parrish: Greetings and welcome back. In this video, we are going to create a basic sprite emitter. We will create a simple particle system that looks like some sparks to get things started and get your feet wet. To keep things organized, the first thing I want you to do is create a new folder. Click the New button and select New Folder inside the Content Browser under the Game folder. Call this "MyParticleSystems". I will open this folder. The first thing I want to in here is click New and select New Folder. We will call this "Sprite". This folder will be for a sprite emitter. Many particle systems you create are going to be part material and part particle effect. I don't want to spend a lot of time on the material side of things, but we do need to keep it in mind. Right-click in the Content Browser and select Material. I will show you how to make a really basic Material that is good for things like sparks and whatnot. We will call this "Mat_Sparks". Double-click Mat_Sparks to open it up. I will drag over the Material Editor and maximize it. First things first, this does not need to be an opaque surface. Select Translucent from the Bleed Mode drop down. Select the Shading Model drop down and set it to Unlit. That means we only really worry about Emissive Color and Opacity. All I want for a spark is a fuzzy circle of some color. I can define the color in the particle system. We will stretch it out to make our spark a little bit later. This will be really simple. Right-click in the graph and type, "radial". Select RadialGradientExponential. We are not going to change too much about this. We could plug this RadialGradientExponential right into Emissive Color and Opacity. Click the icon to preview this on a flat plane so you can see what that looks like. That is pretty good, but we are going to make it a little more useful for a particle system. Right-click in the graph, type "Particle Color". Select a Particle Color node. This is going to take in inputs from a particle system and use whatever colors we feed into the particle system to drive the Material. Drag off the RGB data pin, type and select "Multiply". Plug the RadialGradientExponential into B of the Multiply. Plug the result of the Multiply into Emissive Color. Drag off the Alpha, type and select "Multiply". I can also press M and click to create a Multiply node because it is faster. Drag off the result and plug it into Opacity. That is really all we need to do for this material to work. Click Apply and click Save. We are done here. We can close the Material Editor. We are going to create our particle system. Right-click and select Particle System. We will call this "P_Sparks". Double-click to open up P_Sparks. We are inside Cascade. We have our default Material on these right now, which is the little crosshair sort of thing. Select the Required module. The Required module is always going to be there and you can't get rid of it. It contains your Material. Select the Required module. Click the Material drop down and search for "Mat_Sparks". There it is. Select Mat_Sparks. and it will drop that in. It will take a second to load. There we go. You can see our little circles doing their thing there. There are all kinds of fun things to be aware of in the Required module. We have some controls for the emitter. In this case, we have changed the Material. Use Local Space means if we rotate the emitter, the particles would move in the direction of the rotation. Or if we were to move the particle system around the level, the particles would move as if they were parented to the emitter. If we scroll down a little bit, we have Duration. Duration is how long this emitter is going to work. We have Delay and Sub UV. We are going to talk about Sub UVs a little bit later. Sub UVs are useful for things like fire and smoke, or anything powered by a flipbook. We are going to set the Screen Alignment, which is how the particles are rotated as they face the camera. We are going to set the Screen Alignment to Velocity. That means they are going to rotate in the direction that they are moving, which is very useful for us. Next, we are going to select the Initial Size module of the particles and decrease their size. Inside the preview window in Cascade, it can be a little tricky to know how big your particles are, or what the particles look like, or what their movement is really doing in the real world, etc. It is very useful to take your particle system and drag it into your level early on, so you can get an idea of what things really look like. Be sure to check your particle systems early and often. Select the Initial Size module and we are going to change this. Right now it is 25.0, which is pretty big. Set the Max X, Y, and Z values to 4.0. Set the Min X, Y, and Z values to 2.0. That will give us a little bit of a random range. I think that is working fairly well. We can leave them emitting from a single point. We can spread them out so they emit from more than a single point. Right-click, go under Location, and select Initial Location. Now, I like my Initial Location to be up near the top so I generally move it up. It doesn't change anything or make anything behave differently. It just makes me feel better to have all my initial settings up toward the top, and then all the over life effects happen afterward. Select Initial Location. Expand Start Location. Expand Distribution and it already has Max and Min values. That is kind of cool. Set the Min X, Y, and Z values to -20.0. Set the Max X, Y, and Z values to 20.0. Now, it is kind of spread out a little bit all over the place, as you can see. If we take a look over in the level, you see what that looks like. These particles are a little bit hard to see right now, but we are not worried about that just yet. Initial Velocity is the direction the particles are going to be traveling the moment they are spawned. Right now, they are primarily being pushed upward. I would like to push them on the X-Axis. Set the Max value for X to 200.0. Set the X Min value to 100.0. That will give us some nice variation. Let's even out Z. Let's change Y and Z a little bit. Set the Max Y and Z values to 20.0. Set the Min Y and Z values to -20.0. We have a lot of variation, but generally speaking we are just pushing out on the X-Axis. You can see here; it is starting to look kind of like snow is blown out. There are a few things we can change. I am going to make use of my screen as much as I can. Select the slider for this panel and slide it over. Press the Windows key and right arrow. to tack Cascade to the right-hand side. We are only going to be using one (1) emitter here, so we can do this for now. Now we can kind of see it in the level while we work, which is pretty cool. I am also going to rotate my view around to the other side. If I don't, it looks like the particles are going in different directions and that confuses and therefore irritates me. Select the Lifetime module. I am going to change the lifetime of my particles. They need to live longer than they are. Set the Min to 4.0 seconds, and the Max to 5.0 seconds. Just a quick pro tip for those who are keeping track. Make you stay aware of the order in which Min and Max are listed. It is a known thing that back in the days of UE3, Max would be often be listed before Min because it appears first in alphabetical order. Sometimes, it is swapped around. Check it out. For Initial Velocity, it is Max and then Min. The Lifetime module has it as Min, then Max. I am not saying I am super happy about that. It gives us things to improve in the future. I want you to be aware of it, so you don't accidentally trip over it. We have Lifetime set for the particles between 4.0 and 5.0 seconds now. You can see those particles are now moving on to the next area. I feel like the particles could be bigger. I don't want to do that just yet. Let's make the particles fall first. I feel like they need to fall. I want sparks that fall and bounce. Once you know what you want the particles to do, the order in which you add things is really up to you. Right-click and go to Acceleration. Select Constant Acceleration. Set the Z value to -980.0. I think -980 would be gravity. That is a little extreme for what I had in mind, but it is not bad. I am going to drag the emitter over. I feel we could use a lot more particles now Select the Spawn module. Under Spawn, change the Constant value to 300.0. There are a lot more particles. That is way too many. Change the Constant value to 50.0. There we go. It is still pretty thick, but not overdoing it. Let's make them stretch out the way sparks do. Let's change the color first. That could be good. I am going to maximize Cascade for this so you can see the Curve Editor. Seeing the Curve Editor is really important for this next part. Select the Color Over Life module, which came in by default. We are going to add that to the Curve Editor by clicking the curves icon. We have two (2) sets of curves here. We have the AlphaOverLife curve, which is a scalar value so it only has one (1) curve. Then we have the ColorOverLife curve, which is a vector. It has R, G, and B data, so it is going to be three (3) curves all in one. Let's say I am not worried about Alpha right now. For now, I will turn off Alpha by clicking on the little yellow box at the end of the tab for AlphaOverLife. For Color Over Life, we have the numerical data. I will often start off by adding in the numerical data first, and then I will clean it up in the Curve Editor. That is a personal preference. You can start over in the Curve Editor by pressing CTRL + left-clicking to add keys that way. That is your prerogative. It is important to know how these values work inside of a curve if you are editing it numerically. You are really only concerned with the In Val and Out Val. I do not recommend you edit tangents using the numbers if you don't have to because you will find editing tangents is a lot easier in the Curve Editor. You have a visual representation of what that tangent is doing. Unless you are a lot better at vector math than I am, and if you are, then I applaud you. Your In Val represents where you are in time. Your Out Val represents the actual value given to the key at that given point. Here at Point 0, In Val would be the moment the particle is spawned. The Out Val would be the color the particle has the moment it is spawned. For Point 1, our In Val is 1. This is the moment the particle dies. The Out Val is what color the particle will be at death. Let's set the Out Val color at Point 0 to a bright and intense red. Remember we are driving Emissive Color, so we can really push this value. Set X to 30.0 for red. Set Y to 3.0 for green. Set Z to 1.0 for blue. We start to get something that is very red. If we change Y to 10.0 for green, we start to get something that is orange and still glowing pretty heavily. If we take a look, you can see those sparks starting to come out which is pretty cool. At the moment of death, right now everything is fading back to white. I don't really care for that at all. Let's leave it the same color. If you know you are going to be doing the same color, you could make this value a constant. Just to show off a little bit, let's say we change the color of our sparks as they fall. In the Out Val, leave X at 1.0 for red. Set Y to 5.0 for green. We will increase blue. Set Z to 25.0 for blue. Now as the particles fall, they transition from white and then eventually to blue. We need to shorten the lifetime considerably to really see that. Under Lifetime, change the Min to 1.0 and the Max to 2.0. Now, you can see those particles starting to turn blue as they fall. This is kind of cool, but I would like to see it be a little bit more ostentatious. Set Z to 40.0 for blue. Set Y to 20.0 for green. They will start to become more of a teal color, which I feel like is going to jump out more. I am also not seeing the sparks enough. I haven't set when the sparks streak out. I know when the sparks streak out will change how much we are able to see them. My gut tells me to increase the Initial Size value. Select the Initial Size Module. Set the Max to 6.0. I only need to worry about the first number. I can lock the axes. I am changing everything out of habit. There we go. The sparks are much bigger. Now you can really see those sparks starting to fall, which is pretty cool. For example, let's decrease the Lifetime value a little bit more. Everything lives for exactly 1.0 second and now you can really see that color shift starting to take place. Now let's add that stretching behavior where the particles actually stretch out in the direction they are moving. This is done by going into the emitter. Right-click and go down to the Size module. Select Size By Speed. There are two (2) settings you need to be aware of: Speed Scale and Max Scale. We are going to change these in size on the Y-Axis. Set the Speed Scale Y value to 1.0. We want to turn it pretty far. Set it to 3.0. We are not going to get that much of a change until we increase the Max Scale as well. Max Scale kind of works like a cap. By changing the Speed Scale, you can see our particles are starting to stretch out. Set the Max Scale Y value to 6.0. There we go. Now, the sparks are really starting to fall. However now the particles themselves are larger, you will probably want to go back and make some tweaks. That color is very bright. It probably doesn't need to be that bright. We can decrease the Out Val at Point 0. Instead of 30.0 x 10.0 x 1.0, set X to 20.0, set Y to 7.0, and set Z to 1.0. At Point 1 for the blue, set Y to 10.0 and Z to 20.0. We will cut the original values in half. This will cut back some of the intensity. I think I want our initial location to be more from a singular point. Instead of making it just one point, I will tighten this up. Set the Max X, Y, and Z to 5.0 and the Min X, Y, and Z to -5.0. There we go. That is working pretty well. The next thing I want to do is have these particles collide when they hit the ground. Right now, they are just passing right through the ground. That is cool, but it is not what I want. Right-click in the Emitter List and go to Collision, which is up near the top because of alphabetical order. Select Collision. This automatically stops the particles. The particles are hitting the ground and then dying. They are not passing through anymore. We need to change the collision behavior. First, we want to go into the settings. I will move this slider so everyone can see the Details panel. Max Collisions is the maximum numbers allowed. Set the Max Collisions Min to 2.0 and the Max to 3.0. Now, the particles are colliding. Then we have a collision behavior. What happens after we have collided the max number of times we can? We kill the particle. That is all well and good, but we are not getting any bounce from that collision. Bounce is controlled in the Damping Factor. Damping Factor is kind of how much of the energy you are going to retain on each bounce. Right now that is set to 0, which is not particularly useful to us. Set the Damping Factor Max value to 0.3 for X, Y, and Z. Set Min for X, Y, and Z to 0.1. There you go. The particles are bouncing a little bit at the end. This is showing off some different behaviors. With that, we have created our first particle effect. It is not going to win any sort of effects awards, but it does get your feet wet. You created an emitter. You created some different modules. You edited several settings. You tested it in the level. Go into Cascade. Line up a representative shot in the Viewport. Click the Thumbnail button. Now in the Content Browser, we have a thumbnail that actually looks like our particle system. I want to show you how to make this particle system emit light. It is a single module and it is pretty cool. If you haven't seen it or don't know it is there, then you don't know what you don't know. Double-click to open the particle system up. I will maximize Cascade. Let's say I want these sparks to illuminate my scene in some way. I can right-click. Since this is a standard particle system and doesn't an extra type data module, I can go down to Light and select Light. This will add a Light module. If we take a look at this in the level, the effect is now adding light. The light is actually a little bit on the intense side. Let's make some changes to it and tweak it. I like the Use Inverse Squared Falloff. Deselect the checkbox for Affects Translucency. It can keeps things simple there. It does not need to spawn 100% of the time. Ever single particle does not need its own light. This will still look just as good without so many lights. Set Spawn Fraction to 0.2, and now only 20% of these are emitting light. You can see it still looks really nice. We can tweak the Radius value, and increase it. We can decrease the Brightness value slightly. You will see that light is automatically inheriting the color we applied to our particle. That will wrap things up for this video. Thanks a lot. ♪♪♪ ♪♪♪
Info
Channel: Unreal Engine
Views: 158,276
Rating: undefined out of 5
Keywords: UE4, Particles, Particle effects, Sprite Emitter
Id: 7hC_QT4GLiU
Channel Id: undefined
Length: 19min 15sec (1155 seconds)
Published: Tue Jul 08 2014
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.