Getting started with the Particle System | Unite Now 2020

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
♪ [MUSIC] ♪ [NARRATOR] Welcome to Unite Now where we bring Unity to you wherever you are. [TIM] Alright. It looks like it is time, so let's go ahead and dive right in, everyone. Thank you, for coming. Big welcome. I'm looking through the chat right now, and everybody who is attending, it looks like we've quite a few familiar names, it looks like we've a few new names as well For those who are just getting here for their first Unity Learn Live, welcome. And for those who are coming back for a second or third, tenth... we certainly see quite a few familiar names. Big welcome back to you guys as well. So,you are here to learn about Particle Systems. What exactly does that mean? We're here to learn about Unity 3D, obviously, and within that, there's special tool called the Particle System. We're going to learn how we can create different effects, such as rain, snow, as well, fire and smoke with these Particle Systems. If you haven't already, let us know where you're from in the chat. And if you're planning on following along today, go ahead and start downloading the Particle System Assets at the bottom there. James, thank you for dropping those in. And let's go ahead and dive in. Who's the voice? Tim, here, calling in from Florida. Usually calling in from San Francisco. I'm here for a few weeks. And I am the Director of Design at KairosXR. That is a development agency for occupational training solutions where we use Unity as our primary development tool. I work alongside the Unity team, as well, very closely, leaning more towards design. And joining me today, we have some really awesome Unity Developers, as well. We have James, Brian, Khushboo, Aaron, and Daniel, as well. For those who are coming back, again, you know the main advantage, the primary advantage of these sessions is access to the instructors. And having an effective training, this is a session you have all of your questions answered. With that said, feel free to ask any question. Feel free to ask any question that you have, and we'll get to those questions as soon as possible. How do these sessions typically break down? We start with a little bit of housekeeping. A quick overview, we will be working in 2019.4 today. We'll go over some of the session guidelines, and we're going to go into some of the tips and tricks getting started with Particle Systems. Today we have an hour and a half together, that's 90 minutes. Not two hours. [LAUGHS] Typo. We will be going through four distinct challenges here, with a little extra challenge in the end, time permitting, then we'll wrap up a few minutes in the end, talk about next steps, and additional resources as well. We recommend this Zoom layout. You can keep the chat in the upper right. That's how I do it, as well, so I can keep an eye on all of the questions and comments coming in. Then expanding the screen... go into full screen, I should say, for the rest of the Zoom window, so you can bounce back and forth to your Unity window as well. How do we make the most of these sessions? I did mention when introducing the other instructors on call, are direct access to get all your questions answered. To get most out of these sessions, we recommend that you follow along. You have a Unity window open, we'll interact, we'll go back and forth, I'll demo a little bit, and we'll work together. The TAs will help you along the way, if you get stuck. But either way, we are here as a resource for you. Yeah, James. [JAMES] Hey, Tim. I don't think you're sharing the right screen, because we still see the title screen. [TIM] Oh, right. [CHUCKLES] Thank you, James. Thanks for hopping in there. It looked like it was... It wasn't sharing. The share was locked. Thank you for hopping in. Which slides were I talking Was I not speaking to you there? Again, here's my face. [LAUGHS] I'm very sorry for that, everyone. This is me. I'm Tim. Here are our fabulous TAs. This is the slide I was referring to. And again, we will be working in 2019.4. We'll start out with a few tips and tricks in the Particle Systems. This is the slide I was speaking to you before. And here are the four distinct challenges that we'll be going through. We'll be setting up Particle Systems, we'll be setting up smoke effects, fire, rain, and we'll be setting up snow as well. Then we'll wrap up. Lastly is the actual format here. Typically, I'll go through a demo, you can watch that, and then, you will follow along and you'll do, then explore together. Cool. Here's the Zoom layout I was thoroughly describing before. And here's the last slide. If you're new, you'll be able to catch up on the recordings later. These sessions are recorded. We'll be distributing that after this session as well. If you don't want to follow along, that's fine. You can just watch. Some of us come here just to watch, others come here to work together and collaborate on this. Again, this session is here as a resource for you. One last note there on that slide before we keep on going, If you look at the bottom of your Zoom screen, there is an icon for the Q&A. And you'll see that the Q&A feature is a Q&A button. Go ahead and drop all your questions in regards to Unity or the topics we're covering in that Q&A window. Then TAs will go through and get to those as soon as possible. We tend to have an active chat channel, as you can see from all the new messages. It's possible your questions will get lost in there. Go ahead and use that Q&A button at the bottom. Alright. We made it through. I wasn't sharing the entire presentation, but we made it through. Let's go ahead and let's start diving in. I mentioned in this session, we'll be working together a few examples of different use cases for the Particle Systems. We'll start with snow, moving to smoke, moving to fire, and then rain, then in the end, we'll work on a few gas planets. We'll use the sun as an example, but we can make planets, or any planet out of the Particle Systems, too. Time permitting, we'll dive into that, but for sure, we will hit these four. As always, we want to create a space for you to set up the project. If you haven't done so, download the Asset Package from Learn. Just make sure that... I'm taking a look at the chat to make sure that the Assets are in there. James, if you wouldn't mind dropping those Assets one last time. Would be appreciated, thank you. And once you download the Assets, open up a new Unity Project. We'll be working in 2019.4. Extract that Package, and import it into Unity. As you're downloading it, let's go over some of the basics. Why do we care about Particle Systems? It's a handy tool for special effects. Now, with the release of the Universal Render Pipeline, the High-definition Render Pipeline, Unity has a new tool called the VFX Graph, which is a new Particle System, or effectively a new Particle System that renders out on the GPU. Which means now we have access to millions of particles rather than thousands. But in this case, we are starting with the first Particle System. This Particle System is capable of rendering thousands of particles and is locked to the CPU. That's the distinct difference between the VFX Graph and the Particle System. VFX Graph, GPU; Particle System, CPU. Why does that matter? When it comes down to deciding which one you should use, if you require an effect with a ridiculous number of particles, then certainly, you should lean towards the VFX Graph. With that said, if your project is GPU-bound, you may not have that as an option. Thus, you'll need to use a CPU to render these out for the Particle System, in this case. Common use cases for the Particle System: we can simulate liquids, and smoke and clouds, flames as well. If you're in the gaming world, you can simulate magic spells, and a whole other set of effects as well. This is why we're excited. It's all base in the Editor as well. I will hop into my Editor and start creating the snow particle. How we will do that? We first add the Particle System to the Scene. If you work through the challenges ahead of this session, these will look very familiar. We will work through those challenges together, but we will elaborate, and we'll build on those as well. We'll open up a new Scene. We'll add a new Particle System. Then we will modify a few of the general particle settings as well on parameters. Such as Noise, Collision, the Emission and Shape. Alright. I will create a new share here. Go over to my Scene. Alright. Here is our Scene. As you open up your project, you can have a few different Scenes that you can take a look at. I'm just double-checking to make sure we're on the right one. If you open up your Project, you'll have the Scenes folder, and you can open up Starter, or you can open up Examples. As a first step, I'm in Starter. I'm sorry because that's where will be building out the majority of all of our Particle Examples. A great way to get started with the Particle System is by looking at professionally done Particle Systems. One way you can do that is by downloading the Unity Particle Asset Pack on the Asset Store or the Package Manager, if you're in 2020, and taking a look at how some of these were done. If we click on one randomly, we'll see that we have these bugs flying around, with the tails as well. We have the Fireflies, and then within the Inspector, we can look at all of the different parameters that they're using, and engaging to create these effects. You can see in the Renderer, we're using a FireFly texture, or a FireFly material. We have a Trail material as well. If you're not excited about that, we can look at another one. Looks like we have some slime here, or some green slime. Some more slime, and you could see they have all these use cases and examples of particles. As we go through them, we can click through all the parameters and see what exactly did the Visual Effects Artist use or do to create these effects. Alright, so that's the first step, as we're going through the project, you've now imported the Package, you are in the Examples, and you're exploring. You're exploring some of the different features here. If you already explored, you found a few that you liked, you can hop back in to the Starter Scene. Let's start creating our snow effect. You can see here, I have a few other particles as well. This was from before, when I was playing around. Let's create our first particle. Cool. Once you create a first particle, let's drag it in. Another hack as well. If it spawns way off in the camera field of view, you can select it and hit Ctrl+Shift+F, and that will spawn where your camera is. As a pro tip, if it becomes too cumbersome to try to use the Gizmo here to rotate, I highly recommend when you're working with particles, just use rotation transform values. Alright, so we are creating snow. What does that mean? First step, we've added particles to the Scene, let's rename it to "Snow." Now, we will modify the first set of parameters, the first module. The first step is reduce the Speed to 0 because we don't actually want anything flying up. As you can see, reduced to 0. And we'll increase the Gravity Modifier. We won't increase it much. We'll just increase to 0.1 so that the snow starts to gently fall. I suppose we're starting to get the right shape. We're starting to resemble some snow. For those who come from snowy places, which frankly, I'm not sure, except for Antarctica, where in the world would be snowing? However, you can start to see some of the similarities there. What's the next step? The next step is to change the Start Size. These are pretty big snowflakes. Let's make those a little smaller. You can go to the Start Size, and either scrub that down or set it a little more precisely. We will set it to 0.2. Alright. Then the next step... How do we expand the area, and this is a small cloud of that, is the only area where it's snowing. What we can do is expand the Emission, or excuse me, we can modify the Shape. The Shape, by default, is set to Cone. We can change this, let's say, we wanted to expand it across the ceiling here. Again, if our goal is to expand it across the entire ceiling, how do we do that? Well, we change the Shape from a Cone to a Box. Then from there, we can modify the Shape by adjusting its Scale. We'll tighten it up a bit. And now, we have our snow coming off the ceiling. Of course, snow doesn't come off the ceiling, so what we can do is let's pull it out, let's bring it up, and let's expand it across the entire top. Oops, wrong value. Alright. I pulled the particle, I just manually brought it up, and very imprecisely, I might add. I brought the Particle System so it sits above, next to the roof, and then expanded the Box, because we're now emitting from a Box shape. Cool. Alright. How do we get more, how do we make this a storm? We can increase the Rate over Time so we're emitting more. But as we go up each second, we're not telling it that the Particle System, for every second, we need to emit another 55 particles, and that's quite a bit. We could also make it a larger blizzard. And eventually, we will cap out. How do we increase the number of Max Particles in the Scene at once? If we look back up at the first module, you'll see that there is a Max Particles parameter. And we can increase that, let's increase that to 3000. Again, relatively arbitrarily chosen right now. But we're here just to explore. Alright. When you are ready, let's hit Play and take a look. How does it look? As you hit play, you'll find you already have player controllers attached, you can use WASD, and your mouse as well. We have something that resembles snow. But as many of us know, from living in a snowy environment, snow does collect on ground, unless it's hot around. Let's update a few parameters so that it collects on the bottom. The parameter that we will explore now is Collision. Let's update the Collision... excuse me, enable the Collision. We enable the Collision, and we're changing the type from Planes to World. It's important to know the difference between World and Planes. If we keep it on Plane, then we can precisely choose which Plane the particles will interact with. However, if we move to World, it will interact with all the GameObjects in the World based on the Bounce and Geometry. As we make this change as well, you'll notice a bunch of other parameters popped up. What do these parameters mean? The ones that are important now would be Dampen. Let's hit Play on these, you will see this bounce and sporadic behavior that doesn't look like snow. [LAUGHS] I don't know about you guys, but I don't think I've seen snow that bounces quite like this. That's not our desired behavior. But what we can do is reduce our Bounce down to 0 because we don't want it to bounce, and we don't want these to roll; these are not marbles, these are particles. It's supposed to be snow. Let's increase the Dampen to 1. Now, they're stopping and are not moving. That's a lot more accurate. The last bit we'll look at before we move to the next challenge is the Noise. We can add some Perlin Noise, and other types of Noise as well, to create some kind of wind effect as well. As we know... when it snows, typically, there's a bit of wind, and snowflakes, unless it's heavy snow. It doesn't necessarily fall directly to the ground. How do we add the effects of a little bit of wind and that movement? We can add the Noise. Go toggle on Noise. We can increase the Strength, if it's a blizzard, or we can decrease the Strength, just so that there's a bit of character that's falling. Awesome. That is our intended effect. That's all you need to do to create snow. As you saw, it wasn't that complicated. We didn't need to animate anything, we didn't need to customize any features. This is a nice warm-up activity as we dive into more particle effects. Alright. Let's kill that for now. I'll look at the chat. I'll hop back to the presentation before we continue. Just want to be sure we are doing okay, there aren't any questions, or any notifications that I'm not sharing my screen. We have a few questions there. Also, Mendisi pointed out, thank you. Yes, in the southern hemisphere, you're absolutely right, it is winter. Listen, I'm in Florida right now, it's ridiculously hot. I'm a little tunnel-visioned here, but yes, in the southern hemisphere, it is winter, so hopefully, there's some snow down there. We're creating a simulation for them, for our friends coming from the southern hemisphere. The next question there, is there any way to change color? Yes, absolutely, there's a way to change the color. This will be quite limited if there weren't. Let me go back to the Project. How do we change color? Let's hit Play. We have a Start Color here. We have a few ways to change color. We can either modify the Start Color. Let's create blue. Actually, something a bit more apparent here. Let's make red. As we look at these, we will have some embers coming down. We can also randomize. Your next question may be, "Okay, we can modify the Start Color, but what does this arrow do right next to the Start Color?" We have a few drop-downs here. We can make it Gradient. If we wanted to... Let me start with the other ones. We have a Random Between Two Colors which will automatically assign a randomly assigned color value to each particle between the two color values. If we go Random Between Two, some of them may be white, some of them may be red. Random Between Two Gradients is the same thing, but we also have the gradient values that we can assign. For instance, if we wanted to start as red, and we want to add another color, that may be blue, then we will have some of the particles blending between, eventually hitting that nice purple. Then we have a Random Color as well. Perhaps you want to assign a random color to the particle somewhere in this whole gradient. You have a few options, right now, we're playing around, we're just exploring. But what if we want to create embers from a fire? Or sparks coming from a fire? And each spark should look a little different. Some of them are orange, some are yellow, some are red, that's when the Gradient becomes interesting, or perhaps Random Between Two Colors becomes more interesting. Alright, let's keep moving on here. There are a few more important parameters within this first module. There is the Simulation Speed. If we want everything to move really quick, this is an interesting effect if you're building out a game, or for whatever reason, you go to a particular area, you want the effect to accelerate for whatever reason. You can use the Simulation Speed. Additionally, let's say that everything is almost perfect, but things might be moving a little too fast, we can reduce the Simulation Speed as well. We can reduce it to half the speed. And things move even more slowly. There are a few more important parameters here. For instance, Duration right now, we have Looping, but if we turn off Duration, then we can set the amount of time that the Particle System will emit particles. There's Looping, once it gets to the end of the Duration, we set it to 5 seconds, by default it's set to 5 seconds, but if you like the Particle System to keep on Looping, keep on moving, then we can hit this Looping feature. Then Prewarm is the last important one that we'll keep an eye on before we continue exploring additional exercises. Prewarm... as you turn on particles, if you keep Prewarm off, then they will start from the origin point of the Particle System. However, and let's Restart, you can see now because the origin point is at the top, the particles will begin to fall. Let's hit Restart with the Prewarm on. As I hit Restart, the particles are already landing on the ground. Why is that? Because it pregenerates the particles, it precalculates where they land. And now I've lost the particles. Here we go. Let's move on and create some smoke. Because now, we'll use textures and we'll create more realistic-looking effects. Let's reset it back to white because it's snow. Cool. We toggled that off. Why? Because performance matters. And eventually, you'll have so many particles in your Scene that performance will take a hit. Alright. The next step is to create some smoke. Let's go ahead and follow these very similar steps, but instead of making them fall, we will make them rise. How exactly will we do that? We will create a new Particle System. We will modify a few of the general particle settings in the same module where we are working. We will modify the Emission and Shape again. But this time, we will modify something called the Renderer or the Render Module. And the Texture Sheet Animation. We will move into new territory here. We will add textures to each particle. Then we will be using a Texture Sheet to animate different effects so that each particle doesn't look exactly the same. And yes, we will use some Noise again. I'm seeing a few comments here. Somebody says, "I totally see the potential to becoming obsessed with this. It's a really deep space." This is fun for hours, effectively. That's really the best way to get better is continue to dive deeper and continue to explore. Dissecting the particles that exist on the Asset Store, then continue playing around with your own exploration. Let's create another Particle System. Again, it spawned way over there, so let's bring it back. I'm going to position it right under this light. Remember out trick: Ctrl+Shift+F, so we could spawn it exactly where we like to. The next step, we will create some fire. We will be placing fire directly under the smoke. Alright. We have a Particle System. The first step is to make it look like smoke with the color. Let's look at this Start Color and make it smoky gray. Even make it look brown. And let's decrease the Start Speed and increase the Start Size. Alright. Right now, we're ripping through the Particle System. We're not very precisely creating any of the target effects. That's totally okay because so much of it is more of an art rather than a science, and that's the beautiful part of working with VFX. We won't touch the Duration. We'll make sure it's Looping. And let's make sure it's Prewarming as well, because why not in this case? We modify the Start Speed, we modify the Start Size. That might be a bit too big, so let's bring that down a bit. And let's look at the Emission. We would like to increase the amount of particles emitted at once. Let's double this. Again, relatively arbitrarily chosen. In the context of the entire system or the final piece, we found that 20 starts to look a bit better. But again, this is something you can play with. We want every second the Particle System to emit 20 particles. And now, let's modify the Shape. The Shape, by default, is set to a Cone. But let's close out that starting point, make it a bit narrower. By adjusting the Angle, as you can see, with the blue icon or the blue Gizmo here, if we increase the size of the Angle, we increase the direction that the Particle System may emit particles. And if we close it out, eventually, it becomes more of a cylinder. And we can reduce the width of that cylinder by adjusting the Radius. We will bring that Radius down to 0.2, then the Angle will be, it doesn't need to be 0, let's make it 0.5. [LAUGHS] Let's make it more than 1 because, clearly, that doesn't have much of an effect. Then it's moving out a bit. Alright. So we have modified the Emission, we have modified the Shape, and let's modify the Renderer. I mentioned we have a new module we'll play with, and that is called the Renderer. At the very bottom, you'll find the Renderer module, and this is the module responsible for housing all of your materials. We took the liberty of creating the material for you. It's of type, I believe... I believe called SmokeLight. Yes. You'll find that if we zoom in to SmokeLight, it looks like a Texture Sheet, because it is a Texture Sheet. I'll show you how to adjust this in just a minute, but let's find SmokeLight quick, so we can take a closer look at the material. You'll find that SmokeLight... it's one of the Unity Standard Asset materials, or rather, in their Standard Particle Pack they built for us. The Shader, in this case, is a Standard Surface Shader, that's a Particle Shader, made a bit special for us. Of course, you can create any Shader or any material and add it on there as well. Let's go back to our Particle System. Forgot to rename it to "Smoke." Let's rename it to "Smoke." Alright. Let's kill the Texture Sheet Animation. The next step is to move up and enable Texture Sheet Animation. Right now, when we enable it, it's set by default to Tiles 1 by 1. This particular Texture Sheet is 5 by 5. Go ahead and update that to 5 by 5. The Particle System loops through the Texture Sheet. And eventually it hits all 25 Textures... or Sprites. [LAUGHS] All 25 Sprites. Wrong word there. Now you can start seeing we're getting some interesting behavior. It's starting to look a lot more like smoke. It's a little easier to see when we move it out, look at it from... When you look at it against the sky, it's easier to see, but it's not the case. We'll leave it there. Let's make the final adjustment and create a bit of Noise, so that we're not having it go straight up. And yes, when you increase the Strength, it will fly all over the place like it's in a vortex of sorts. But let's reduce that down to something simpler like 0.5. Let's go 0.1 because 0.5 is way too much. Cool. We can bring this down a little more as well, 0.05. Great, now we're seeing some more unpredictable behavior, which is what we like in smoke. Before we take a step back for a few minutes and let you guys catch up and continue exploring on your own, let's look at a few other modules, such as Rotation. We have Start Rotation. If we set this Start Rotation, then we can make the smoke rotate as it continues to move until it disintegrates or until it deactivates naturally through the Particle System. When creating smoke, or something that's relatively transparent, say mist or fog or steam as well, typically, the Start Rotation value is used. We can crank it up if we want to create a lot of rotations. A little harder to see because it is relatively transparent. But that's how you create some kind of twisting effect within the smoke. You may start noticing that as the smoke... reaches the end of its life, or the particles reach the end of its life, they just disappear, and that doesn't look all that great. How do we make the smoke fade? Well, we also have Color over Lifetime. Let's look down through our list. As you can see, there are a few modules we can add here. Again, it's all about familiarity right now, not mastery. But after the session, I recommend you go through, start playing around with the different effects and see what you can create. Here we are: Color over Lifetime. Let's create that, Color over Lifetime. In the beginning, we can start this... or we'll look at the Alpha on the top. The Color is at the bottom. We'll look at the Alpha. In the beginning of the part of its life, the Alpha will be 255 or full. Then let's move towards the last quarter. We'll also have a full Alpha. Let's add... one last tab at the top, so we can reduce the Alpha down to 0. Now, as a particle nears the end of its life, the Alpha starts to become 0. We can play around with these as well. Move this around. If we want a sudden drop similar to how we had before, we can bring this middle tab all the way to the right, or if we want a more gradual disintegration or evaporation, we will... then we can keep it close to the middle. Cool. Now we are seeing more of that fade, we're not just seeing a hard stop in that case. This is something we like. This is what we're going for. Alright. I will take another look at... the chat here, make sure it's still doing well. It looks like we don't have any major burning questions. Thank you to the instructors for handling those. Looking at the chat, looks like we do have one question with regards to Particle Systems for UI. There are a few different tricks you can use there. We won't have a session. The question is, "Will we talk about Particle Systems for UI and how to render Particle Systems over the UI?" Dennis, if you don't mind, please drop that in the Q&A. We can provide a bit more documentation there. But there are a few different workflows you can employ to bring Particle Systems into your user interface. But very possible as well. Those just be 2D, for instance. Alright. I will hop back to our presentation. We created smoke, smoke flies up. We created snow, the snow drops down. Let's change that a bit and create some fire. So how will we create fire? We'll do it following a similar workflow with the Texture Sheet Animations. But instead of having the particles fly around, specifically, because Noise and all that, we will be using Noise. But we will not... the particles are not going to move, they'll just stay in one place. There will not be any movement, it'll just flick on and flicker off. We'll be modifying the Emission, we'll be modifying the Shape, the Renderer, yes, because we need to get that texture in there. We'll bring in the Texture Sheet Animation. We'll be using a flame Texture Sheet Animation. Eventually, we'll get it looking just like the fire on the right. Alright. And before we continue, we went through two challenges, relatively quickly, I want to do a quick gut check, how is everybody doing on speed? I'm looking at the chat. Does anybody want me to slow down? Should I speed up? Is it just right? And if it's just right, mention that. Or don't mention it, and I'll just infer that. Cool. Alright. Alright. It looks like we are doing well on speed. I'm getting a few mentions that we should slow down a bit, which is totally fine. I can slow down a tad. But we'll keep the speed relatively consistent. Let's keep on moving here. Alright. Again, for performance reasons, I will kill the Smoke. Then let's create our fire. Effects > Particle System. Particle System is way off in the distance there. Let's bring that back, start a new Particle System. Ctrl+Shift+F. Or if you're on a Mac, Cmd+Shift+F. Rotate this around, and we'll drop down the ground as well. Because typically smoke is connected to fire in some capacity, we'll drop this Particle System at the bottom. Let's rename it to "Fire." Just so I can clean everything up, I will add a new Empty GameObject and drag the other stuff in there. Right. The first step. What is the first step? Let's start with that Color. Low-hanging fruit, let's make it orange because fire tends to be orange or yellow? Let's make it yellow. Great. I mentioned that the particles, by default, are flying everywhere. But we don't want that in this case. We can turn on Prewarm because when we start the effect, we want it to be running. We want to create that flicker. We want the particle to come alive, then quickly, we want it to die and then get replaced with the next particles. We will reduce Start Lifetime here, which as we can see from the Hint, we can reduce Start Lifetime to control the age or the time that the particle exists. We will bring it down to 0.1. We get some kind of flicker. Cool. Start Rotation doesn't matter in this case. Gravity Modifier doesn't matter. We'll keep that at 0. Let's change the Start Size as well, just a bit, so it's a little larger. Let's bring it to 2. I'm going to update the Start Lifetime to 0.05. Yes, it's quite intense. We'll update that momentarily. Not to worry. That Start Size does not need to be 222. [LAUGHS] Great. Okay. Let's keep moving down. The next step here is to modify the Emission. First of all, let's make sure that the Max Particles is only 1 because we only need one big flame at one time. Then how many will emit per second. We can keep that 10. We'll modify that slightly in a bit. But the big item here is to modify our Shape. We can change the Shape, and let's change it to Circle. Looking at the Shape, we brushed over this on the last one. We went through it very quickly with the snow one as well. But you can see when you hit the Shape drop-down, you enable Shape and you have different options. You have Cone, you have Sphere, you have Box, you have Edge. Then you look at something like Mesh Renderer. What happens if you have a 3D model and you like particles to emit from the entire model for instance, if there's some energy surrounding it? You can use a Mesh Renderer as well and bring in that Mesh Renderer. But in this case, we'll reduce that Angle. We can keep it at Cone. We'll reduce the Angle. Reduce that Radius. Cool. Now, we're starting to see something that is less all over the place than it was, one is much larger, but something that's more closely resembling a fire. You'll notice as well that it's turning off. Why does it continue to turn off? Because we didn't turn on Looping. Let's make sure Looping is turned on as well, then we don't need to worry about this duration. Alternatively, if we keep Duration on, or keep Looping off, we can see that Duration will kill the Particle System after two seconds. Let's keep that on Looping and Prewarm. Alright. Let's keep on moving through. The next step will be to bring in our... Texture Sheet Animation, so let's go back down to our Renderer. Let's make sure that we bring in one of our materials, again, we pre-built this for you. Let's go LargeFlame01. If we take a look at LargeFlame, it has one, two, three, four, five, six, seven, eight, this is an 8 by 8 Texture Sheet. When we go up, yes, you guessed it, we'll go back up to Texture Sheet Animation. We'll update this so that the Particle System moves through all eight rows, then all eight columns individually. Now, we're starting to see something that resembles more of the flames. There's still work to be done. This is not our final result here. But we're starting to see the flame Shape, as you can see. Let's go ahead. Let's keep that down, we'll keep it down to Lifetime as it was before. If we want to slow down the flickering as well, we can reduce the Simulation Speed. If we want to create more flames, we can increase Max Particles under the Emission as well. Now, we're starting to see something that resembles flames a little more. If we turn on the Smoke as well... Let's make sure the Smoke is actually above the flames. Now we have a nice Particle System combination. Alright. The flickering is a little intense. Let's turn it over to you guys. In the next few minutes, go ahead and play around, and the challenge here is to clear the parameters. Let's see if we can figure out how to reduce... the sporadic behavior of the Fire. Let's see if we can keep it closer in just one spot. In the meantime, I will keep playing around with it myself. The first step here, we're thinking about other parameters that change, if we know that the sporadic behavior seems to be from shifting the X and the Y axis there because it's rotated, we can first take a look at the Shape. And the Shape seems to be a little off. As you can see, if the Shape were wider, or if the Radius were wider, then the flames will be popping all over the place. If we reduce it all the way to the bottom, 0.0001, then we'll have a much more controlled flame. If we want it to be raging, let's say this is at the end of a torch, now we can increase the Emission as well. Alright, this is starting to look more like a gas-lit stove than anything. Somewhat of a controlled burn. Now we're getting the target effect that we're looking for. And now we have fire. I will look at the chat here. Just make sure nothing is blowing up. You guys can still see my screen, that's a total win. Alright, and it looks like we don't have any raging questions. We will keep on going. We do have a little question. How processor-intensive is all this? It's very difficult to say. It's processor-intensive, or it's not processor-intensive. There are areas that will be more expensive than others. The more materials that you have, the more expensive it will be. The more particles that you have, the more expensive it will be. The trick here, to measure your bandwidth, for your specific project will be to use the Profiler. We have an optimization Learn Live where we teach you how to learn the Profiler, but it's a handy debugging tool to measure performance in your project. It also determines whether you're CPU-bound or GPU-bound. If you have full project and you're rendering too many Assets for instance, again, we spoke to this in the beginning, that's when you might use the Particle System. Now, if you look at the Profiler, and it looks like you have too many physics calculations going on or you're CPU-bound, your project's locking up and you're CPU-bound, then that's when you need to reduce the number of particles in the Scene as well, or reduce the number of materials you are using. If you'd like to dive into that to use as well, we're certainly happy to dive deeper into it. Let's follow up offline afterwards, or once we get to the end of today's session, we can dive deeper into the designated Q&A time. Looks like we have a request to go over the actual flame part. Remember, in order to achieve this flame, we look at the Renderer. Close these out for simplicity. The first step, it's a two-step process to achieve that flame. The first step is to add the LargeFlame01 material, which is a material pointing towards a Texture Sheet, an 8 by 8 Texture Sheet. So add the LargeFlame material to this parameter. Secondly, in the Texture Sheet Animation, that's when we activate the animation itself by updating Tiles, so that's 8 by 8 instead of the default, which is 1 by 1, which obviously didn't work. We want to keep it at 8 by 8, which matches the Texture Sheet. Let's keep moving on. We now hop back to the presentation. We have one of our questions: can we create rain? The answer to that question, which I saw in the chat a while ago, is yes, we can create rain, we will do that right now. Let's take a look at it. We will modify some general settings, just like we have been, such as the Color, we'll be playing with the Renderer, we will add a rain texture. This concept of Vertex Systems, we will enable it, because the Shader provides this parameter. This is not standard, this is a more advanced feature, so we won't spend much time on the Vertex Systems. It's also not required to achieve the rain look. Yes, we will configure the Shape as well, and the Emission. Let's create a Shape for the effect. So performance, again, let's go and kill it... both of them, and let's create our new Particle Rain Effect. Create a new Particle Effect. Let's rename it to "Rain." Let's bring it back. So Ctrl+Shift+F, or in Mac, Command+Shift+F. Rotate it. In this case, we will rotate it so it's facing down rather than facing up. Let's start off with our basic general module parameters. Let's change that Start Color, we can make it a little more blue. Looks like things are... they're slowing down a bit. Alright, they're back. Let's increase the Start Speed so that it's around 9. Given that's rain, it will be coming out a little quicker before. The Start Lifetime, we can Prewarm as well. We keep the Start Lifetime to about the same, that's fine. Then the Start Size, we'll keep the Start Size to about 0.2, so that we have something rather than a large blue snowflake, or snowball, we'll have raindrops. The important step here is to increase Max Particles to 3,000. We can bump up the Emission. Cool. Let's increase that Emission. Hop down to the Emission parameter. We'll increase it so we have more of that torrential downfall. We'll increase that for now. We can increase that to 500. Again, relatively arbitrary, but we found that to look okay. Now, let's update that Shape. We'll leave it as a Cone, but we'll decrease the Radius to 0.1. When we said rain, we meant a sprinkler. [LAUGHS] That's our goal for you. Now, we're starting to resemble something like that screenshot. We have very narrow output, almost like a water leak or a sprinkler. Alright. Now, we need to update the Renderer. Now, let's start to make this look like rain. And rather than keeping the Render Mode, this is a new value we'll learn, I'll keep it on Render Mode as Billboard, we'll use Stretched Billboard. Let's take a moment to pause on these different Render Modes. By default, our Renderer will render as Billboard, which means that the texture will always... the material, the particle in this case, will always face you, which gives it its 3D look. These are just 2D objects, by the way. But they'll render more as 3D because of this Billboard feature, because it's always facing you. However, how do we now stretch out the particles so that it simulates the velocity or the acceleration or just general speed? We can use a Stretched Billboard to do just that. And we can stretch the Billboard so it's always facing you so that it looks more like rain. Or we can stretch it horizontally, or a Horizontal Billboard, so it's always rotated. And vertical as well. A few different parameters for us to play with. We'll use Stretched so that it elongates the particle. Then, let's add our Water Drop materials. I believe there is something called WaterDropSmall. We can either use WaterDropBig or we can use WaterDropSmall. Alright. We'll go WaterDropSmall, then we'll sort By Distance. Sorting is a rendering feature. We have a few different Sort Modes. This is how the particles render over each other, which is more realistic if we sort by distance, so that the closer particles render over the more distant particles. Great. Now, we'll take a look at these Vertex Systems. Let's find the WaterDropSmall and make sure we apply this Required Vertex Streams... to the particle, which gives us a more... to oversimplify it... it will give us a more realistic look, because of how the Shader is taking the lighting data. Not right now, of course, because we have a few other parameters we have to modify, but it will. Have faith. Let's take a look. What's going on here? It's not quite right. It's moving quickly, so obviously, I missed a step. Let's make sure our Speed Scale is increased as well. Cool. In that case, let's just click around, let's talk about what I was doing. The Speed Scale, we want to be sure the Speed Scale is on so that we stretch in the direction that the water is moving. Let's move this down a bit. We modify the Speed Scale. What does that mean? The Speed Scale... as defined here in our little helper... it defines the length of a particle compared to its speed. As the particle moves quicker, if we were to increase the speed of the particle, so with the stretch as well, and let's test that. We have the Speed, and this should... and we can see it stretching out significantly. This isn't looking like rain now. It certainly is looking like a sprinkler head. But it's starting to look a lot almost like a beam, or a beam of light. We want to simulate, for instance, like photons. Perhaps this could be an interesting tool to use. Let's go back, we don't need to go that hard there. Let's reduce that Speed as well. Cool. We'll reduce the Speed Scale... to, let's say, 0.2. Great. On your own end, as I continue to play around with this and bring us closer to what the target image looks like, tinker around with it yourself. Our goal now is to create that rain or sprinkler head look, or that hose head. We can increase the Length Scale as well. Again, this is stretching it even further. We'll keep that color back where it was, like that blue. Though this is less planned... see here that the, oops... the Rate over Time is high, we don't need 3000, we can bring that down to 300. This Cone does look a little funky with rain. We don't need that. Let's modify the Cone shape. That's coming out of the Box, like it was before. Now we have something that closely resembles a waterfall. Let's expand this out. What are we doing right now? We're just playing around to achieve our desired rain effect. I'll look at the chat real quick. Alright, looks like we're doing well in the chat. I will reduce this Length Scale, just so it's not quite as long. Keep the Speed Scale down at 0.1 as well. And continue to reduce... the number of particles we're emitting at once. Great. Now it's starting to look a little better. But we can keep on modifying in our Renderer. What am I doing right now? I'm increasing... increasing the Start Speed... and decreasing this Length Scale and the Speed Scale. Cool. Now we're seeing what looks a little more like rain. Alright. Let me get... Alright. It looks like we are... seeing some recommendations, Bojan just mentioned that Start Speed of 19, Start Size of 0.2, Speed Scale of 0.1 is starting to look great. Yeah, if you guys find something that looks great, again, it does take some tweaking here. If you find something nice, drop it in the chat and show other people who would like to explore your effects. Alright. We have a bit of time. Let's take a look at our planet examples. I mentioned we can create some planets. This is relatively straightforward to do. We don't need any kind of textures, though we usually like to add some kind of textures to get some sun flares or anything like that. But how might we create a sun or a gaseous planet? We can do so by modifying the Emission Shape. We completed the rain. Let's close that down. Let's create our last Particle System. Let me call this the "Sun." Bring it to the middle. It doesn't matter the rotation of everything. Because if we take a look at the Shape, we'll keep the Cone or modify the Shape, so that instead of a Cone, we'll use Sphere. Now, the Sphere is moving in different directions. Great. With the flames, how do we keep the flame to just one spot? We reduce the Speed. Let's do that here. Let's reduce the Speed and make sure we're Prewarm. And reduce the Lifetime. Increase the Start Size too. And increase the Emission amount. Right now, it's only 10. I reduced that Lifetime to 0.2. We'll bring that down, we'll update the... Start Lifetime should be around 0.1, and the Start Color should be either yellow or orange because, again, we're creating the sun in this case. Alright. The Simulation Speed, let's bring that back to 1. Start Speed, going back and forth here, I apologize. Start Speed should be at 0.1. Now I'll go down to Emission over Time, let's crank it all the way up, let's bring it up to 500. Not enough. Let's bring it to 1000. Now we're starting to see something that more closely looks like the sun, but not really. [LAUGHS] This isn't nearly good enough. Let's make sure our Max Particles are increased. 5000. We can increase the size so that we're filling some of these gaps. You'll notice there are some gaps here as well, so we can increase the Start Size to close that off. Cool. And we'll reduce Simulation Speed to something very slow, because the sun is large and is quite slow or looks slow. Alright. Now, let's change the Start Color. How do we create the effect of the sun's core be orange and the outside of the sun be more yellow? We can do so by changing Color over Time, which as you remember we reviewed earlier. Toggle that on, Color over Lifetime. And in the beginning, we want the sun to be a red. Then towards the end... we want the sun to be more of that yellow. Once you start getting really crafty... Once you start getting more crafty, you can duplicate the sun, for instance, and keep one sun inside of the other so it looks more like a core. Say if you're creating some kind of atom or nucleus. Again, this is still moving quickly, so we can bring that down even more, we can bring the Simulation Speed down to 0.001. That's a little too slow. [LAUGHS] That's definitely way too slow. But either way, we're now just tweaking everything. We're tweaking everything until we start to get an effect that we start to appreciate more and look a bit more realistic. Cool. Let's keep on playing around with the sun for a few minutes. What we do, let's take a look at the chat to make sure we don't have any questions. It has kind of a phony, painted look. In this case, we do need to have, because we're using the default particles in the Renderer, we still get that fuzzy look. If we wanted to make it more accurate, for instance, we could add some kind of texture or another material. If we wanted to create, say, some kind of sun flares, and have those come of the sun, we can do so by creating a mist or some kind of smoke texture. Alright. Looking at a few other questions here, what if we wanted to create water, not as rain, but more like a lake or a swimming pool, or maybe underwater, any advice? First of all, we would recommend you using Shader Graph to create some kind of water effect. If you wanted to create water, for instance... and you wanted to create bubbles in that water, then that would be a great use of the Particle System. You could create bubbles in a similar way that we've been using... for instance, smoke. It'd be the exact same workflow as with smoke to create those bubbles. Now, if you wanted to create waves in a pool, you wouldn't necessarily use particles, you'd use Shader Graph to create an animated Shader. And we do have a Live session on Shader Graph as well, where you learn how to move or animate a flag using a custom Shader. I recommend that you come to that so you can get that waving back and forth. However, Unity's Learn platform does have a few tutorials on that flag Shader. I highly recommend you take a look at those resources. Alright. What else can we do here? A few areas before we start closing out, I will hop back to the presentation in just a minute. A few other key areas to play around with. You can emit particles from within other particles. Let's say we had a Sub Emitter. If we wanted to... Actually, before we start playing with our rain, we're going to emit rain out of the new particle. How would we create particles or why would we create particles out of other particles? Well, if you have some kind of trailing effect. You do have line renderers that you can use that will emit out of the particle. If we take a look at Trails... Let's do that. Create another Particle System. Let's say you wanted to achieve that bug effect, or with the fireflies. We could use this Trail effect. Then we have these ridiculous lines coming out of the particle. Then we can modify them as well. We can modify the Lifetime of the tail... you can modify the actual size of the tail, how it stretches, the actual colors as well, and of course, the texture material. Let's kill that because it's distracting. As I mentioned, we can emit other Particle Systems out of other Particles. Let's say you have a snowball hitting a wall... or let's say, with the rain, you wanted to emit raindrops on Collision, you could emit other rain particles out of each individual particle on Collision. That's one example of using Collision in this case. But if you want other particles to move out of the particle, or the original particles for its entire life, you can do so at Birth or set the parameter here to Birth. Then we can choose which parameter to add. Looks like that one's a Prefab, so we can't use that. Looks like we... for whatever reason, it thinks that it's a Prefab, which is peculiar. Let's just manually drag it in. Certainly strange behavior. But you start to see all of the particles emitting more rain. That's how you would use the Sub Emitters. Alright. Let's close out from there. We'll hop back to our presentation so you can see what other resources you have available. Let me share my screen. Great. Today we learned about Particle Systems. Particle Systems, as you know, it's a very deep tool. We'll hang out here, we'll keep on playing around with it for a little while longer, even though we have 15 more minutes. But if you would like to keep learning more about... say, the Terrain tool or other areas within Unity, we have these sessions every two weeks. This next session will be about the Terrain Editor. How do we use Unity's Terrain tool to build out environments? I'll have my colleague, Andy Jevsevar, running that one on July 28. If you're interested in learning more about the Terrain Editor, the best practices for performance and for environment design, definitely come to that. If you have any other questions, feel free to hop into our Unity Connect Group, so that's this bit.ly link here, the LearnLiveConnectGroup. Again, we love to continue the conversation, so feel free to reach out to me on LinkedIn. It's TimKLinkedIn, there's a bit.ly link at the bottom here. Always excited to continue the conversation around Unity. Again, we're a little early. We have about 15 minutes left in this session. I will hop back to the project and keep on playing around, and if you have any more questions, we'll keep an eye on that Q&A, we'll keep on answering questions for about 15 more minutes. Again, for those who are planning to hop off, thank you very much for coming, and we look forward to seeing you in the next one. Alright. We have one question here. How did you make the sun core effect again? Brian, I will demo that one more time. The sun has a few things going on. Also... [LAUGHS] full disclosure, this is a low fidelity sun. Certainly not trying to pitch this as... the best, or the highest fidelity that Unity can achieve when it comes to creating planets out of the Particle System. But given the assets that we have, this is a quick little prototype. How do we get that core? There are a few different effects we're using. First of all, Color over Lifetime. Make sure the color begins or the particle begins almost red. Then as it finishes up its life, it turns into that yellow. We can make this a little more circular by... tightening up... tightening up the Sphere itself. The Radius Thickness and the Radius itself. Now, it's more a circular shape. What you could also do to create more of that core is duplicate that Particle System and reduce it in size. Now, we have something that looks more like a core. Jeffrey pointed out here in the next question that the sun seems to be pulsing. If the sun is pulsing, it's creating a bunch of particles all at once. Take a look at the number of particles that can be emitted. If we take a look at Max Particles, Unity will stop producing particles if it achieves the number of Max Particles here. Let's say we only have 10. Let's deactivate that second one so we can see this more clearly. This is a rough demo, so I'll start with a brand new one so we can see exactly what this looks like clearly. Great. If you achieve the number of Max Particles, again... what I'm doing here is creating a new particle, increasing the Rate, let's do 1000. You may notice you're starting to get these big bursts. Then it stops. What's going on here? Unity emits up to 1000 particles, then it stops emitting particles. We can either reduce the number of particles emitted or we can increase the number of Max Particles. Let's boost up to 10000. Now, we can see more of that effect. This is great, for instance, if we want to create a waterfall effect. If we want to create a waterfall, for instance, we can reduce this Angle. Now, it looks like a very high volume is coming up. If we wanted to create something with the Gravity Modifier, and use the physics engine, as well, we can increase the Gravity. Then, we can achieve some kind of hose or some kind of leak coming out of the wall. Great. That's how you fix that pulsing problem. James asked here how could we go about having a terrain trigger a ripple on the ground? Again, the Sub Emitter is how you do that. You go to Sub Emitter, where is it? Here it is. If we went to the Rain... you could toggle on Sub Emitters and then you can toggle on a ripple effect. You would have to set up that ripple effect. It'd be very similar to the sun in that there wouldn't be any Gravity, you'd just emit out from a Circle. and it would just radiate out. You'd need to have that ripple texture and material set up, so I can do that right now. But you would use that Sub Emitters and set it from Birth to Collision, so that every time the particle collides, you could have drops fire off from it. Alright, looking at some of the other questions here. Your case, changing the Max Particles... following up with Jeffrey's point here, changing the Max Particles doesn't remove the pulsing. What you can do is take a look at the Prewarm. Let's make sure that the Prewarm is toggled on. There are only a few areas that may be affecting that. If it's pulsing out of the get-go, or out of the gate, go ahead and toggle on Prewarm to make sure that everything's working properly. Or rather to make sure that it's prepopulated or prerendered. Then look down at Max Particles and really boost those up. Boost them up to a ridiculous number. Let's go to like... a thousand, let's go to 20000. Then Emission, make sure that's bumped up. Those are the only areas that could be affecting that, that would be creating that pulse. Keep on playing with those numbers if you're still not getting it. You've added a Collision... Dan's question here is he has added... Collision to the rain, but it's folding to match the terrain before it even hits. It sounds like you're... it sounds like that Time is off there. Take a look at Start Lifetime. Again, Start Lifetime is responsible for determining the age or the amount of time which the particle will survive or exist. Definitely take a look at that, zoom in, see if it helps to expand the Lifetime. If not, let's follow up, and we can keep on troubleshooting that. Alright, Alessandro, your question here is, are there some settings that are particularly expensive in terms of performance, excluding Max Particles and Emission Rate? Sub Emitters is going to be expensive given that you... could have an exponential increase of particles in your Scene at once. Definitely be very careful with the Sub Emitters. Typically, if Unity crashes on me or when Unity crashes on me, it's because of the Sub Emitters in this case. Anything that has to do with physics, I know that's a very blanket answer, but if you're working a bit with... say with Collisions... if you have 20,000 particles emitting, they all hit the ground and they're all responding to Collision, then that's going to be quite expensive as well. Pierre Marie's question: Would you use Particle System to make clouds or do you recommend something else? A few different things. I have made Shaders before for the cloud effects, then I overlay them on a large plane, that I distribute, then you can add certain types of animation. If you look at GitHub, you can find quite a few cloud Shaders. I certainly recommend that you take a look at that. Now, if you didn't want to create some kind of cloud Shader... sorry, a Particle System... that's quite straightforward. You have to find the texture that you would want. But again, you could create an effect. You could increase the size. That's not... [LAUGHS] I won't demonstrate this and then say, "That's what a cloud should look like." But you start getting an idea... you start getting an idea once you play around with the Emission Shape. You can use a Donut. Once you have the Donut, you can expand that Radius. In this case, it will come down to... then, of course, increase in the time as well. The Speed and the Time, let's see... Start Lifetime, here we go. Then all of a sudden, you start to get... I got a Donut, we'd probably do... we wouldn't do a Donut, we would do a Cone as well. They're all going in the same direction there. Again, you start to see how you could create something much larger on the scale of, say, your sky for... for your clouds. Certainly recommend that you play around with that. I would say explore Shaders first. And if you need an excuse to play around with Particle Systems more for your learning experience, then I highly recommend you give it a try, see where you can come up in terms of clouds. But you can start to see how we can start to create some kind of angelic cloud effect. Looks like Jeffrey got to the bottom of the pulsing, which is fantastic. That's great news. Let's close that one out, and then Dan... We already hit that one as well. If there are any other questions, I am happy to answer, or I'm happy to demo any other tools in this. Again, if you need to hop off, no problem, thank you for coming. Hope you all enjoy it. Hope you had some takeaways. But again, we'll be here for another four minutes. One question here with Vibov is... any recommendations for road maps? Can't recommend Unity Learn enough. Unity Learn is Unity's platform, it's the learning portal. It's free. Register, make an account, hop in there, and there are a ton of beginner resources. Generally speaking, I highly recommend Environment Design first. Come to the next ULS, where we'll be learning about terrain. You just learned about particles, soon you should dive into lighting. Start with lighting, start with sound, start with terrain, start building that environment, then once you get a hang of the Editor, and you start to feel comfortable with all the different Editor environment tools, then start moving into the world scripting, virtual reality and augmented reality, some of the other locomotion and interaction stuff. Start with lighting, start with environments, then move into more customization, interaction, locomotion. Alright. Does the Particle System Editor have any feature that we don't have in the Inspector window? Pierre Marie, if you wouldn't mind following up on that? If you're referring to the demo screen here, I have everything that you have access to. Particle System Editor, Inspector, you will have access to everything here. Alright, we're doing a 60-second countdown. If anybody has any final burning questions, go ahead and drop them in, we'll get them as soon as possible. And if we don't get to them today... We have a few questions at the bottom there. The original project template used for all this. This is in Unity's Particle Pack. If you're in 2020, and you go into the Asset Manager, or if you're in an earlier version, go into the Asset Store, you can download there the Particle Pack. They have a bunch of demos there, bunch of examples, and this is an environment taken from that Pack. It's just a Unity Package. Alternatively, go into Learn Live, you can download the Assets, and then pull it all in. This last question, will Particle System support Android and iOS builds as well? Yes, it will. That's one of the main advantages of it. You can get particles onto any target platform, whereas the VFX Graph eventually will be supported by all platforms, but as of right now, I believe there are a few limitations. Awesome. Alright, everyone. We are at time. Again, thank you all for coming. I always have a great time running these. Appreciate you all hopping in. We will see you next time. ♪ [MUSIC] ♪
Info
Channel: Unity
Views: 45,051
Rating: undefined out of 5
Keywords: Unity3d, Unity, Unity Technologies, Games, Game Development, Game Dev, Game Engine
Id: hyBbcFCvDR8
Channel Id: undefined
Length: 91min 0sec (5460 seconds)
Published: Mon Jul 27 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.