Transcripts
1. 1.1 - Introduction: So what is going on, guys? Hope you are ready to create explosions in Unity because that's what we are going to do in these course. So what are you waiting for? Come on and join me on these awesome lectures, where we are going to dive into stylized visual effects and see how to create from scratch these stylized explosions, which is super cool. We are going to use the great O.G. Particle System used in all the games made with Unity, and we are going to see so many things, for example, how to create simple and complex shaders with Shader Graph Shader Graph. So that we can scroll mask, erode, animate vertices, distort and even use Parallax Occlusion and so much more. Such a powerful tool to create shaders. We are also going to see how to use Material Maker, a Substance Designer *free* alternative that will help you a lot to create procedural-node-based ground crack textures, burnt mark textures and actually all the type of textures that you can use as a visual effect artist. It's a great tool for you! Oh, and check out this stylized smoke that we are going to create and this ground crack and so much more. So come on and join me am Gabriel Aguiar, your host and founder of the YouTube channel. Gabriel Aguiar Prod., which has more than 6 million views related to Game Dev, but mostly focused on Visual Effects. And if you are new to this area, actually highly recommended to check out my previous courses. They will certainly help you to get started. Nevertheless, this one is also great for total beginners. I'm going to guide you through and make sure you don't get lost. And if you do, there is always the Q&A section where I'm super active answering questions for everyone. But if you are interested in other courses, we got this one which is super useful to get started with this amazing new Unity tool that is Visual Effect Graph. And then we got this last one, also with VFX Graph, where we create an entire set of abilities for Thunderlord a MOBA game character. So what are you waiting for? Come with me on this explosive adventure! It will be a blast! Certainly.
2. 2.1 - Download Project: So welcome once again. And now that you have enrolled in this course, we just need to set up a few things before we move on to the stylized explosion. And the first thing is to download the project, attached to this lesson, which is a zip file. And it's the same scene that I have used throughout the course. You can download it and unzip it. And it's really important that, let me just get this project out of this folder. Like I was saying, it's really important that you open this with Unity Hub because it will tell you the Unity version. It was made with. In this case, I already have the Unity version 2021.2.11 installed. That's why it's opening. But I highly recommend you to use the same version or a very close one. And if you don't find it here in the installs, you can always go to archive. Click on this Download Archive link and it will redirect you to the Unity Download Archive where you can get all of the versions of Unity. And if you scroll down here, we have the Unity 2021.2.11 and if you can get this version, it will make your learning process much easier and you can follow this course in a comfortable way, without worrying if Unity has changed something. Because you see, what really matters here is the knowledge that you are going to get from this course, and you can apply it to whichever unity version you want. And you can even apply these to different game engines because, the techniques that we are going to see and the tricks are pretty much the same. So yeah, if you can get this Unity 2021.2.11 version, that would be great. Once you have it, Unity will compile the project and then we will have a quick overview of the project.
3. 2.2 - Project Overview: So once the project opens This is probably how it looks. There isn't much going on and I think it's really important to mention that I use a very different layout from the default one and it is the 2 by 3 layout in case you want to follow along with the same layout. I only change the project, position the tab. I attached it down here. Oh, and I have set this to one column layout. That's pretty much it. So in the scenes folder, let's open the VFX_StylizedExplosion. And as you can see, this is the entire scene that I've used it for the course. Well, one of the first things that I can tell is that as a VFX artist, gizmos are not really useful. So I'm going to turn them off up here. And the grid, is also not that useful because it gets in the way when we are trying to understand if the visual effect is looking good. So I'm going to disable them just like this. And I'm also going to close this game window because we are not going to need it. Right. So this is our scene. We have a camera, a light and a global volume, which is very important because in here this is post-processing effects. We have a bloom, a vignette, a motion blur and chromatic aberration, even though the chromatic aberration is not being used at the moment. But those are the post-processing effects. And then we have the scene with the mountains and the ground. Nothing much, but we have a cube here, disabled, which is not left by mistake. This cube right here, it's used as a reference to a character. It has more or less the same size. This way we make sure that the effects that we are going to create are not too small or too big. Right. So that's pretty much it in our scene. By the way, makes sure that in window in package manager in the Unity Registry tab, you have down here the universal render pipeline installed. 12.1.4 is the version at this moment and shader graph up here with the same version 12.1.4 is the version. All right. So once you have those things installed, what we have down here, if you see anything in the console, that's probably nothing, you can clear this out. And if by chance you press play, what you will be able to do is move around while holding right mouse button and navigate as if it was an FPS with W A S D. Right. It's kind of useful to see the effect up close, nothing much. And in our project we have well materials for the scene, models for the mountains, the scene itself. And we have the scripts. We have the simple camera control, which is. What I used to move the camera around. But we have here the particle system controller, which is quite useful. We will see how to use it. Most likely closer to the end of the course. It's quite useful to change color of several particle systems at the same time. And a few more things that we are going to see. And yeah, we have the settings, which is quite important by the way, if you go to edit and in project settings, make sure that in graphics you have this universal render pipeline asset assigned, which is the one that comes with the project. And yeah, that's pretty much it. This asset also has the forward render assigned up here, and the rest is a few empty folders that we are going to need along the way. So that's it. In our next lesson, we are going to have a quick overview of the particle system and create some sparks in case you are a total beginner with the particle system. And I'm going to give you some tips, by the way, as well. Before we move on to the stylized explosion.
4. 2.3 - Particle System Overview - Quick Sparks: So on this lesson, we are going to have an overview of the particle system just in case you want to refresh your memory or simply because you are really starting from scratch, which by the way, I highly recommend to check out my previous course. It will help you a lot. Well, the first thing we want to do is add a particle system to our scene and we can do it with right click. And the first thing I'm noticing is that we still have the selection outline turned On. And as a visual effects artist, this gets in the way of our art, of the process of creating visual effects. So I'm going to turn it off for now. And then we can reset the transform of the particle system. And let's imagine for a second that the sparks are coming out of this cube, for some reason. So one of the most common questions is, why is this particle system looping? Well, it's looping because looping is turned on. We have all of these basic settings of the particle system, and then we have quite a few modules. And in here, if you turn off looping, well, it will stop eventually. If you play this now, the particle system will emit particles for 5 seconds because that's the duration of the entire particle system. The particles have a different duration. That's the start lifetime we are going to see it in a moment. If, for example, we decrease the duration to 0.2, it will probably emit only one particle. For example, we can say that the particles could have a random lifetime between 0.3 and 2 or 3 seconds. And every time you play this now, this particle will have a random lifetime between those values. But, let's set the duration to 5 again and turn On looping. Oh, and let's rename this to vfx_SparksLooping_v1 So you know what we are doing. So as I said, we have quite a few modules down here and a default particle system comes with three fundamental modules that are enabled, which are the emission, the shape and the renderer down here, which is very important and takes care of how the particle is going to look and it already has a material assigned, which is default material that comes with Unity. And then we have this Shape module, which we don't always use. But in this case, as you can see, we have quite a few shapes. We have mesh, mesh renderer, skinned mesh sprites and so on. In our case, cone is a good fit for these looping sparks. The radius, as you must imagine, is way too big. Let's decrease to 0.1 or 0.2 And then, as you may be wondering, this keeps on emitting particles thanks to the looping because it's On, but also because we have rate over time in the emission. On this module you can control the quantity of particles you want. Let's increase to 30 for the rate over time, which is 30 particles per second. We can also set the maximum number of particles for the entire particle system in these max particles. If we set it to 10, it will manage the amount of particles. It has alive, so it doesn't get higher than 10. It depends on the rate over time and on the lifetime of each particle as well as it can see down here, it limits the particle system to 10 particles. But let's set it again to 1000. And let's go down here, take care of the aspect of the sparks, because sparks well, they aren't round, as you can see, they are not a circle as we have right now. And we actually want to stretch them. Down here, there's 2 very important things, which is the material, it already as one and the render mode, which is set to billboard. And then we have the render alignment which is set to view. So it faces always the camera. In the render mode, we have quite a few, horizontal, vertical, mesh, stretched and none, even none. And yes, we can even use mesh, which is for 3D objects. In this case, we want the stretched billboard and the speed scale will control, how much the particle is stretched. If we set it to 0.05, we don't see much of a difference. But if we set it to 1, as you can see, it gets way stretched because it's a speed scale. It's based on the speed of the particle as well. We want a tiny value because we are also going to decrease the size, by default it comes as one in the start size, so all the particles will have the same size. And in this case we want to say it's going to be between 0.05 and 0.2, for example, it's a better size for this sparks and we have a start speed as well, which is giving motion to these particles. Right. If we set it to zero, we don't see any particle being rendered because the stretched billboard, it requires velocity, it requires speed to render the particle. Let's make it random between 5 and 40. As you can see, there is some particles that become more stretched than others because the speed is higher. And the speed is higher, we need to decrease the lifetime so they don't go further away. Let's set it to 1 the maximum. And then we can decrease the angle, for example, of this code. Let's create some focused sparks And in case you are wondering why, they always go straight forward and if you want to make them fall down and hit the ground, we have something that does exactly that, which is gravity. But be careful because gravity will also influence a little bit the performance. For example, if you set it to 9, they fall down immediately. And 3. Well, it's okay. Let's create a random value between two and six, for example. And decrease the maximum speed to 30. And let's give some orange to these in the start color, which is where you control. Well, the color of the particles. Right. And as you can see, they are bright and sparks should be bright, something really bright. And if you go down here to the renderer, which is where you take care of the aspect of the particle in this material, we cannot control anything. So let's create one just to test things out. New material. And. Let's simply assigned to the base map the default part that comes with nudity. And then drag and drop this new material to our particle system. And as you can see, they become black and without orange. And that's mostly happening because there are materials, there are shaders, more specifically that only works with the particle system. If you go up here to this dropdown menu in the Universal Pipeline section, we have these particles section and we have unlit, which is the one that we want to select. And unlit means that it won't be affected by lights of the scene. And as you can see, it becomes orange because this shader is prepared to receive information from the particle system to influence the color. And we have the black background mostly because the surface type is set to a PAC. If we switch it to Transparent, it works nicely and we can choose a blending mode which is alpha pre, multiply, additive or multiply alpha. It is useful to render black colors and additive as the name suggests. It will add something in front of what's behind, and that we have the color mode. And by the way, we are not going to use this shader along the course. We are going to create one from scratch so you can learn how this works and make a few improvements to our benefits and neat. So yeah, we can set the color mode to, for example, additive. And if you wanted to control the intensity of the base map, you cannot. You have the mission down here which you can turn on. And yeah, here you can control the intensity. If it is white, it will become white. And it's actually a problem because this should have received the color from the particle system and then we should be able to control the density. But for example, if you select an orange and increase the intensity normally you always want to set the color in the particle system and not in the material, because if you want to use the material in another particle system that will emit blue particles, well, you cannot because the material is set to orange. So yeah the color always comes from the particle system or from the textures most of the times. Not always, always, but most of the times. Once you got a nice orange, really bright, as you can see in the start color. You can set it to white and it doesn't change the color. And in fact you can even choose blue and something like that. And nothing will change. Because the color comes from the material and we cannot override it. Let's decrease the start size. This is way too big 0.01 and 0.1 and we need to adjust the speed scale as well. Down here. 0.02 So now if you are wondering how to make this particles collide with the world, collide with the ground, it's very simple with a particle system, we have the collision model down here. If you turn it On, all you've got to do is set the type to world and it will collide with anything that has a collider. And then there's three very important values, which is the damping bounce and lifetime loss. We are going to talk a little bit more about them throughout the course, but a good value is 0.5 for dampen and bounce. And as you can see, they slowed down when they hit the ground and they don't bounce that much. And then we have the lifetime loss, which basically, if you set it to one, it will totally kill the particle because as soon as the particle hits the ground, it loses the remaining lifetime it had. If you set it to 0.5, it will only lose half of the remaining lifetime it has. That's what the lifetime loss does. But yeah, that's pretty much it. You can increase the rate over time to something crazy, like 100 to get a really nice effect. And then you can control the start speed to be less like 2 and 10, for example, which means that the gravity should also be less. And the speed scale probably we need to adjust it because as you can probably see, when we have the stretched billboard, the speed will influence the size of the sparks, how much they are stretched, the speed, scale and everything plays together, the start speed. Then the start size and the speed scale in the renderer and the gravity and the lifetime as well. But yes, that's basically it. That's a quick overview of the particle system and how to create some quick sparks as well. Throughout the course, we are going to see much more things and you are going to learn many more tricks. There's quite a few module that we didn't use. For example, color over lifetime, size over lifetime. They are quite useful and a few more. So, I hope you are ready to learn how to create explosions because that's what we are going to do in our next chapter.
5. 3.1 - Explosion Studies: So welcome to the third chapter, the core chapter of this course. And on this first quick lesson, we are going to see what a typical pre-production work looks like before creating anything in unity. So normally you would well, gather some reference and visually cultivate yourself before jumping into sketching. In this case, I'm using Google to search for explosion reference. Videos or images are always welcome. It's useful to understand colors and what elements are the most common and so on. You could as well use Pinterest, for example, and the few other tools. For example, we got the real time VFX forum where there is always good reference and then you got the Artstation as well and a few other places. Basically you would gather some reference and from there you would sketch something, right? And the sketching part, normally focused on the core elements of the effect in question. In this case, there's going to be an anticipation, something, maybe a projectile, an arched projectile. Then it's going to hit the ground. We are going to see this bright explosion, this bright impact, with some particles flying everywhere really quick. Probably the explosion shape would be something like these. some, that looks like clouds, you know, and some spheres, maybe. And probably there's going to be a shockwave as well. And it would expand like this. It will go up and it will look like a pyramid, basically. And maybe there's a few more shockwaves along the way. And particles still, keep on flying. But then eventually that was the climax, right? We would think about the anticipation, the climax, and now we would probably sketch a few things for the dissipation, for the aftermath. For example, the smoke could dissolve away. It would rise up, obviously, and it would dissolve as it rises and there is a ground crack left behind. We start seeing those bright cracks on the ground and some particles coming out of it slowly. For example. And eventually the last picture would be the bright ground crack on the ground with some smoke trails coming out of it, as well as some particles flying over. This would probably be a typical preproduction process if we didn't know what we would create, right? That's what a VFX artist does before jumping into an effect. It would gather reference, it would think about the anticipation, and then it will think about the climax and eventually how the aftermath, how the dissipation would look. So this is just for you to get an overall perception of what the workflow would be if we didn't know what we would create. And I highly recommend it to check out my previous courses where you can get a better perception of pre-production. And like I said, it's a great beginner course, especially if you are new to this area or if you want to feel more comfortable before this stylized explosion. And you can obviously check out my channel, plenty of tutorials, great tutorials that can help you as well. But yeah, in this case, since we already know what we are going to create, now we can take advantage of this and go into unity and create all of these elements. And for example, clearly the core of this effect is the explosion, those clouds, those spheres, you know, the smoke. So in our next lesson, that's going to be our starting point.
6. 3.2 - Starting the Explosion: So let's get started with the creation of the stylized explosion, as we have seen previously. We are going to start with the explosion itself, the core, the spheres. And that's exactly what we are going to start with, with the spheres itself. And then we will move on to create the mesh, a proper mesh. But what we really want to achieve with this lesson is the proper motion and location of this part of the explosion. And as a good rule of thumb, we want to start with an empty gameobject. And from there, we are going to parent everything we need to create this specific effect. So with the right click, we can go ahead and create an empty and rename it to vfx_StyilizedExplosion_v1 vfx_StyilizedExplosion_v1 and then make sure that your Reset the transform so it goes to the center of the world. From there we can add a particle system. With right-click, we go to effects and select particle system. And as we have seen, the core explosion is composed of three parts and this one is going to be for the explosion top. As you can see, the particles are going sideways. So we need to rotate this in the x axis -90 degrees so it goes upwards. And we also want to push this a little bit up in the Y axis, a value of 1.5. As a good practice. You should have a character around to see the proper proportions. If you don't have a character around, you can always use a cube with around two metres, basically something that represents a character so you can have a better notion of scale. I'm going to disable the cube for now. And since this is going to be far a mesh. The first thing we wanna do is go down here in the renderer and switch this from Billboard to Mesh the render mode It will automatically assign a cube and we can switch it to a sphere which is a little bit closer to the final mesh that we are going to create. So yeah, as you can see, it keeps on emitting particles. And that's not exactly what we are intending here. We want this to have a burst. So if we go to the emission module, as you can see rate over time, it means it will keep on spawning 10 particles per second. We can set it to 0 and down here add a burst of around 10 particles. That should be enough for the explosion top. This will obviously influence the performance of this effect. If you are developing for mobile, make sure to have this value in mind. So as you can see, the particles are already going up, but we want to slow them towards the end and we can do it with the velocity over lifetime. If we increase the Z value to 2 or to 10 as you can see, they go up much faster. But this is also influenced by the shape. We are using a cone by default and we actually want to switch this to a circle. We have many shapes if you want to play with, but we need a circle and it may seem like it's the same thing, but they only go up thanks to the velocity over lifetime. If we decrease it to zero, as you can see, they go sideways. So what's happening here is, they are being influenced by the start speed, which is at 5 and that's great. We also want them to go a little bit to the sides. As a matter of fact, we want this to be random between two constants between 0.8 and 1, super slow because the rest of the motion we are going to control it with the velocity over lifetime. If we increase the Z value to 2 as you can see they go up, but they keep on going up forever and we want them to slow down towards the end of their lifetime. They also go up forever, mostly because of the start lifetime, which is way too high. Each sphere is living 5 seconds and we want to say that this is random between 1.7 and 2.1. Very precise values. Yes, indeed. So yeah, more a less around here, we want them to slow down and the way we do it is in the velocity of a lifetime yes but not with a constant. Instead, we want a curve. Using curves is extremely important to create nice motions and refined motions. You can disable the X and Y so you don't see them down here. If you don't see this, you can push it all the way up from the bottom. You can also remove curves on this button. If you want to add the curve, you can click on the curve and it will automatically add to the particle system curves and we can control the range of this curve up here, is set to 2, but we can switch it to a 3. We can also right click on the first key, go to edit key and say that the value is 1 which is the maximum of this graph, which is 3. And as you can see, it's already slowing down towards the end, but we don't want it to stop. So what we can do is in the last key, we can right click and say the time is 0.5 or 0.55. And the value is not 0.5 because that represents 1.5 but 0.5 down here instead. To be more specific, this is going to be at 0.55 for the time and for the value 0.25, or 0.27 more a less. That's basically where I found the perfect balance for this explosion. In this case, we also don't want the spheres to disperse way too much, to get away from each other way too much. So to fix that, we can decrease the radius of the circle instead of 1, 0.4 And don't forget that we are mid air. We are going to add more spheres below. For the start size. It's also going to be random, but with a small variation 0.8 and 1. And finally, we can also control the size over lifetime, basically. animate the size with this curve right here. Yeah, we can remove this curve and add to the size overlifetime curve. In this case, we want it to start above 0.5. And towards the end, it's going to have its full size, which is between 0.8 and 1. And last but not least, we can also control their color over lifetime. For example, we can say that towards the end it becomes black, which will represent the smoke. More a less around here. All right. So we pretty much have the motion and the location of the spheres, right? Let's just create a prefab out of this. Simply drag and drop to the prefab folder. And don't forget to press Ctrl+S from time to time so you don't lose any progress. And then we are going to create our first mesh with blender, the explosion mesh.
7. 3.3 - Explosions Mesh: So for this course we are going to use Blender since it's free and it's quite easy to pick up. I'm here to guide you the best that I can, so if you don't have it, installed. You can Google it blender, click on the first link, click on the download button, and then you can select for which platform you want. If it is the installer, the portable version, or even the Microsoft Store version once you have download it and installed it. This is Blender. I'm using version 3.00 It's pretty much the same. But before we proceed, I've got to tell you something very important. If I go here to edit and in preference, I'm using a different key map. You see, I've been using Blender for quite a long time. So in the Keymap tab, I'm using the shortcuts from Blender 2.7 It's probably fine if you use the new blender shortcuts because I'm going to guide you through. But you should also know that the spacebar in my case, I'm using it to search and I select with the right click as well. So with that being said, now I'm going to turn on the screencast keys so you can see on the bottom left corner what I am pressing, the first thing we are going to do is select everything with A and press Delete and then with Shift+A we are going to add an Icosphere. You can also add stuff up here, by the way. And without moving it. On this bottom left corner in the add icosphere, we want to set the subdivisions to 1 because now we are going to use a modifier. You can press this little icon. And add a subdivisions surface. It's not the same as 2 subdivisions for the icosphere. It becomes rounder. And with this type of geometry now, with Shift+D we want to duplicate this more or less to around here, a little bit more inside. I am using Shift+D to duplicate and then Shift+Z to only move it in the X and Y. And I'm going to duplicate this a couple of times like. Like this, for example, four times. Push the one in the middle a little bit up. With G and lock it in the Z-axis you can press Z so it moves only in the Z axis. And basically what really matters here is that you create a shape that you like. We're going to do a few more adjustments with G. And once you have something that you enjoy, you can select everything with B Make sure everything is selected and then press Ctrl+J to join everything into one mesh. If you press Z to see through. As you can see, we have a lot of faces inside this and it's not useful in terms of performance. And we also want to make this rounder, in the outside. So we have a modifier that can do it, which is the Remesh modifier. Once you add it, as you can see, it becomes smoother. You can also use this for blocks, which is funny, but we are going to go with voxels in this case. And turn On Smooth Shading. Nice. At this point, you can adjust whatever you want. You simply need to press Tab to enter edit mode. You can press A to unselect everything. And then if you want to select one of these spheres, you can press L. In a vertex or close to a vertex, and it will select that specific sphere. And then you can use G to move it or S to scale it as well. You can make adjustments. No problem. What's also important is the is the voxel size and adaptivity. I'm going to set the voxel size to around 0.2. As you can see, it becomes smoother. The curvature of this mess. So 0.15 or 0.2 is fine. The adaptivity will cut down on the faces count. I'm going to leave it at 0, by the way. Okay. So 0.2 and then go ahead and rename this in this little icon. I'm going to call it the SmokeSphere01 or ExplosionSphere01 And for the next part, we actually need to apply the modifiers we created. So let's start from the top. In this arrow, in this dropdown menu, we can go ahead and press apply to the subdivision and then apply the remesh. Great. This way we can edit properly the UVs. But before that, it's also wise to press Ctrl+A Ctrl+A to apply all of the transforms, basically the scale, the location, and the rotation. Otherwise, when importing to unity, it may look different. So Ctrl+A apply all transforms. All transforms. And then. To create the Uvs, we are going to use a trick. Let's first drag a new window from this bottom left corner old mouse one and drag to the right. And then up here in the top left corner, we want to select the UV editor. In order for us to see the UVs, we need to enter edit mode with Tab and select everything with A on the left window. We don't see anything because we don't have UVs and UVs are extremely important, so we can map textures to our geometry. That's how it works. We are creating UVs so a shader knows how to map a texture to our smoke mess. And it's a little bit complicated to create UVs for this specific object in Blender We are going to use a trick where we can press U to enter the UV mapping dropdown menu, and we have quite a few options. And one of them, it's useful in our specific case, which is the sphere projection. Basically, blender will map this mesh as if it was a sphere. Once you select it, as you can see, it's very well unwrapped. There's only a couple of vertices that are not right. So on the left up window with A we can select everything and we S we can scale it only on the X by pressing X just a little bit, and then with G we can push it to the left. Make sure all of the vertices on the left side are inside the UV area. And then for the vertices on the right side, we want to select them with B and push them with G. Unselect everything. Select the ones that are still outside and push them, with G you can click X to lock them in X axis. And repeat it, select with B, push with G until everything is inside the UV area. It's a quick way to fix the UVs, and it will still look very nice in unity with our shader. And then in File, we want to go to export, select FBX And choose selected objects. So it exports only the smoke sphere, which is the only thing we have right now, for now and navigate to the project, to the models folder. We have the mountains there and we can rename our object same name SmokeSphere01 and press export fbx. You can also press Ctrl+S to save this blend file. You can save it to a folder. I already have one. I already have one. I'm going to call it the same thing, but 02, press save Blender file. If you go back to Unity now. You'll notice in your models folder that you have the smoke sphere. Cool. Just make sure that up here in scale factor, you set it to 100. Otherwise, it will be too small and you won't see it. And then you can press apply, by the way. Okay, great. In our next lesson, we are going to start with the shader, with the erosion shader, so we can dissolve away the smoke object.
8. 3.4 - Erosion Shader - Part 1: Erosion: All right. So now that we have created the basis of our effect, we have the motion and we have the geometry. Now we can proceed to create a shader so we can interact with all of these elements however we want. In our case, we want this to erode procedurally. Just make sure that the scale factor is at 100, and now we can assign this to our explosion top particle system. So down here in the renderer, in the meshes, we can click on the circle and select our smoke sphere. And if we test this out, as you can see, we have the mesh we just created. Great. There's just one thing we need to change. They are all of the same rotation as it is and it kinda doesn't look that good. And it's very simple. Up here in the start rotation, we can say it's random between 360 and -360. So it's random, clockwise and counterclockwise. Okay, great. Now we have everything we need to proceed, to the erosion shader. So with the right click in the shaders folder, let's go to shader graph and we can start with a blank shader graph or with a lit shader graph. I'm going to go ahead and select blank shader graph and rename this to ErosionVoronoiShader, yes, we are going to use a Voronoi noise. Now let's double click to open it up and this is shader graph, on the top right corner. We have the graph inspector. The blackboard button, where we can add properties, for example, and the graph inspector controls the features of the shader. In this case, we need to tell it which target we are going to use. We are in the universal render pipeline, so we are going to use the universal set up and we have all of these options. The first one, material lit is, if we want this to be influenced by lights or not. In this case, yes, we want. Then we have metallic, opaque and quite a few things that we are going to see along the way if we need to change them. And the last button is the main preview button where we can have a preview of how our shader is looking. All right. So like I said, we are going to use a voronoi noise and to add nodes we can press spacebar and then search for voronoi. And as you can see, the cell density will control the scale, which is going to be a quite useful parameter to control. So let's add a float as a property and call it the voronoi scale. And if we select it in the graph inspector, you can assign a default value, among other things. We can go ahead and start with 7. And then connect it to the cell density. But there is another very important property that we are going to need, which is a color. So let's add one and push it to the top of this list. And in this case, we want to say the mode is going to be HDR, which will allow us to control the intensity of this color. It's the high definition range. And for the default color we can select white with alpha or transparency at 100. This is just the default color. And well now you may ask, how do we use it? Well, it's very simple. In fact, we can drag and drop the color property. Drag a line and search for multiply. That's all we gotta do for the color to influence the voronoi. As you can see. And for now we can connect this to the base color of the fragment function. And we are going to need to control the alpha and the alpha clip. And by the way, alpha clipping is used to create the transparent effect with hard edges between the opaque and transparent areas. For example, a threshold of 0.1 means it doesn't render alpha values below 0.1. Sometimes unity documentation can be quite useful. If you have doubts, make sure to check it out. That's exactly what's happening here. I think you should also know that it goes from 0 to 1. 0 is black, 1 is white, everything in between is a greyscale, which means that the black values are first clipped and then less black, and then gray and then less gray, you know, and so on until it reaches white. So that's what we are going to use here. But if you look closely in the fragment block, we don't have any of that. That's because if you go to the graph inspector, to the graph settings, the surface type is set to opaque. If we switch it to Transparent, we will now have the Alpha. We just need to turn on alpha clipping and here we go. We have the two inputs that we need to create the erosion effect, because now if we connect the voronoi to the alpha. As you can see in the main preview, if we play with this value from 0 to 1, it's already eroding the sphere on the preview, which is great. By the way, if you want to better organize your shader graphs, you can double click on the line to create this little node and then you can drag it to around here and you will have a better looking shader graph. So Alpha clip is a very important parameter that we want to control outside of the shader. So let's create a property for that, a float, and call it the alpha clip. If we select it, in the graph inspector, we can say the mode is going to be a slider between 0 and 1. 0 is no erosion and 1 is fully eroded. Okay, so let's test results. And once you connect the alpha clip to the alpha clip threshold, now we can save these assets so we can test this out. I'm just going to drag this window just like this to around here so we can see what's happening and control the shader at the same time. So what we want to do now is, since we are working with the particle system, we want to create a material out of the shader. So right click on the shader and choose material. This one, we can rename it to Explosion01_orange and we can drag this material to the materials folder so we can keep everything nicely organized and we can drag and drop this to our explosion top particle system. It will automatically assign this material to the renderer. And down here we also have access to the properties we have created in the graph, which is super useful, for example. If you press play on our particle system and then pause it there. If we increase the alpha clip, as you can see, we are already eroding the smoke mesh. That's great. But if you think about it, how do we animate this value? Well, the particle system has something called custom vertex streams, which allows us to control variables and parameters from the shader itself. But in order for us to control those parameters in the shader via the particle system, we need to first in, shader graph, create a new UV note and why a UV node? Well, if we turn on the custom vertex streams. In this plus sign. If you go down here to the custom section, we will have custom 1 and custom 2, and this refers to the UV UV node inside the shader graph. We can, for example, add the custom one dot x, y, z and w. It's basically four parameters since it's custom one, we also need to set the channel to uv1. And as you can see, we also have four parameters here. We can access them with a split node. And RGB and A represents, in this case, the X, Y, Z, and W. For example, if we connect to r channel, the Alpha clip threshold, which is basically the X in the custom vertex streams. And by the way, we can delete this alpha clip. As well as the property itself, because we are going to control it via the particle system so we don't need it, which means that this shader now only works via the particle system, at least the alpha clip part. We just need to add another custom vertex stream, which is the uv2. You can push it above the custom one. And to work with this now we can turn on custom data up here and we have two modes with a vector or with a color. We want to use the vector one. As you can see, we have four components X, Y, Z and W once again, which is the RGBA from the UV node. And if you remember correctly, we have connected the R channel, which is the X. So in other words, if we now play with the X value, as you can see, it's already dissolving. And that's awesome because in this dropdown menu, in this little arrow, we have access to curves. And if you remember correctly, curves allows us to create awesome animations. Let's just remove this curve down here and then switch this to a curve. Set the range to 1. And with right-click on the first key. We want to say that the time is 0.5 and the value is 0 basically for half for the time of this smoke, it's not going to be eroded and the other half, we are going to erode this mess, which means that for the last key, we can push it all the way up until it reaches one and with handle create this curve. If you play the particle system now, as you can see towards the end, it will erode away this meh and that's pretty cool. We are getting closer to having an explosion and in our next lesson we are going to add a few more functionalities to the shader and start playing with the color.
9. 3.5 - Erosion Shader - Part 2: Voronoi and Dissolve: All right. So now that we have created the basis of our effect, we have the motion and we have the geometry. Now we can proceed to create a shader so we can interact with all of these elements however we want. In our case, we want this to erode procedurally. Just make sure that the scale factor is at 100, and now we can assign this to our explosion top particle system. So down here in the renderer, in the meshes, we can click on the circle and select our smoke sphere. And if we test this out, as you can see, we have the mesh we just created. Great. There's just one thing we need to change. They are all of the same rotation as it is and it kinda doesn't look that good. And it's very simple. Up here in the start rotation, we can say it's random between 360 and -360. So it's random, clockwise and counterclockwise. Okay, great. Now we have everything we need to proceed, to the erosion shader. So with the right click in the shaders folder, let's go to shader graph and we can start with a blank shader graph or with a lit shader graph. I'm going to go ahead and select blank shader graph and rename this to ErosionVoronoiShader, yes, we are going to use a Voronoi noise. Now let's double click to open it up and this is shader graph, on the top right corner. We have the graph inspector. The blackboard button, where we can add properties, for example, and the graph inspector controls the features of the shader. In this case, we need to tell it which target we are going to use. We are in the universal render pipeline, so we are going to use the universal set up and we have all of these options. The first one, material lit is, if we want this to be influenced by lights or not. In this case, yes, we want. Then we have metallic, opaque and quite a few things that we are going to see along the way if we need to change them. And the last button is the main preview button where we can have a preview of how our shader is looking. All right. So like I said, we are going to use a voronoi noise and to add nodes we can press spacebar and then search for voronoi. And as you can see, the cell density will control the scale, which is going to be a quite useful parameter to control. So let's add a float as a property and call it the voronoi scale. And if we select it in the graph inspector, you can assign a default value, among other things. We can go ahead and start with 7. And then connect it to the cell density. But there is another very important property that we are going to need, which is a color. So let's add one and push it to the top of this list. And in this case, we want to say the mode is going to be HDR, which will allow us to control the intensity of this color. It's the high definition range. And for the default color we can select white with alpha or transparency at 100. This is just the default color. And well now you may ask, how do we use it? Well, it's very simple. In fact, we can drag and drop the color property. Drag a line and search for multiply. That's all we gotta do for the color to influence the voronoi. As you can see. And for now we can connect this to the base color of the fragment function. And we are going to need to control the alpha and the alpha clip. And by the way, alpha clipping is used to create the transparent effect with hard edges between the opaque and transparent areas. For example, a threshold of 0.1 means it doesn't render alpha values below 0.1. Sometimes unity documentation can be quite useful. If you have doubts, make sure to check it out. That's exactly what's happening here. I think you should also know that it goes from 0 to 1. 0 is black, 1 is white, everything in between is a greyscale, which means that the black values are first clipped and then less black, and then gray and then less gray, you know, and so on until it reaches white. So that's what we are going to use here. But if you look closely in the fragment block, we don't have any of that. That's because if you go to the graph inspector, to the graph settings, the surface type is set to opaque. If we switch it to Transparent, we will now have the Alpha. We just need to turn on alpha clipping and here we go. We have the two inputs that we need to create the erosion effect, because now if we connect the voronoi to the alpha. As you can see in the main preview, if we play with this value from 0 to 1, it's already eroding the sphere on the preview, which is great. By the way, if you want to better organize your shader graphs, you can double click on the line to create this little node and then you can drag it to around here and you will have a better looking shader graph. So Alpha clip is a very important parameter that we want to control outside of the shader. So let's create a property for that, a float, and call it the alpha clip. If we select it, in the graph inspector, we can say the mode is going to be a slider between 0 and 1. 0 is no erosion and 1 is fully eroded. Okay, so let's test results. And once you connect the alpha clip to the alpha clip threshold, now we can save these assets so we can test this out. I'm just going to drag this window just like this to around here so we can see what's happening and control the shader at the same time. So what we want to do now is, since we are working with the particle system, we want to create a material out of the shader. So right click on the shader and choose material. This one, we can rename it to Explosion01_orange and we can drag this material to the materials folder so we can keep everything nicely organized and we can drag and drop this to our explosion top particle system. It will automatically assign this material to the renderer. And down here we also have access to the properties we have created in the graph, which is super useful, for example. If you press play on our particle system and then pause it there. If we increase the alpha clip, as you can see, we are already eroding the smoke mesh. That's great. But if you think about it, how do we animate this value? Well, the particle system has something called custom vertex streams, which allows us to control variables and parameters from the shader itself. But in order for us to control those parameters in the shader via the particle system, we need to first in, shader graph, create a new UV note and why a UV node? Well, if we turn on the custom vertex streams. In this plus sign. If you go down here to the custom section, we will have custom 1 and custom 2, and this refers to the UV UV node inside the shader graph. We can, for example, add the custom one dot x, y, z and w. It's basically four parameters since it's custom one, we also need to set the channel to uv1. And as you can see, we also have four parameters here. We can access them with a split node. And RGB and A represents, in this case, the X, Y, Z, and W. For example, if we connect to r channel, the Alpha clip threshold, which is basically the X in the custom vertex streams. And by the way, we can delete this alpha clip. As well as the property itself, because we are going to control it via the particle system so we don't need it, which means that this shader now only works via the particle system, at least the alpha clip part. We just need to add another custom vertex stream, which is the uv2. You can push it above the custom one. And to work with this now we can turn on custom data up here and we have two modes with a vector or with a color. We want to use the vector one. As you can see, we have four components X, Y, Z and W once again, which is the RGBA from the UV node. And if you remember correctly, we have connected the R channel, which is the X. So in other words, if we now play with the X value, as you can see, it's already dissolving. And that's awesome because in this dropdown menu, in this little arrow, we have access to curves. And if you remember correctly, curves allows us to create awesome animations. Let's just remove this curve down here and then switch this to a curve. Set the range to 1. And with right-click on the first key. We want to say that the time is 0.5 and the value is 0 basically for half for the time of this smoke, it's not going to be eroded and the other half, we are going to erode this mess, which means that for the last key, we can push it all the way up until it reaches one and with handle create this curve. If you play the particle system now, as you can see towards the end, it will erode away this meh and that's pretty cool. We are getting closer to having an explosion and in our next lesson we are going to add a few more functionalities to the shader and start playing with the color.
10. 3.6 - Erosion Shader - Part 3: Vertex Animation: So our shader already has a few things. We have the procedurally generated voronoi, which is dissolving towards the end, and then we erode it with the alpha clipping. And now we are going to see a very cool technique to animate the mesh specifically, which is a vertex animation, or vertex offset technique, which by the way, I don't really recommend it to use it for mobile games or low end platforms because this influences the performance. But it's still a very cool technique and it's actually not that hard to use it. So in our shader we are going to focus on this vertex function, on this block, up here, more precisely in the position input. And with spacebar. If you actually search for position, you will find a block which provides access to the mesh vertex position and on the dropdown menu we can actually select the coordinates space of this position of the output. In our case, we want this to be specific to the object position. And if you think about it, we want to add something to this block. We want to change the position of each vertex. So, we can use an add node. And since we want some random values between 0 and 1, we can, for example, use a simple noise which will provide that. Visually, you may see it as a grayscale, but that represents values between 0 and 1. And we can take advantage of that and use it to change the vertices of our mesh. Let's set the scale for now to 10. And we can connect it to the add block. And if you connect it to the position input, we will get way too much distortion. So we need something to control the amount of vertex distortion or vertex displacement. Theoretically we could use a power node to control the simple noise, but that wouldn't be very much effective because in some places it's still going to displace more than others. We want to have an uniform control, so there's a very useful mathematical function that we can use for that, which is a linear interpolation. We can abbreviated to lerp node and an lerp node works in a very simple way. The T value will control the mixed amount between A and B. 0 is only A, and as we go towards 1, it will switch to B. That's why we see it going from black to white and all of the grey values in between. So in our case, the A is going to represent no vertex displacement. The original position of each vertex. So let's connect the position block directly. And for the B option, we can connect the vertices, completely displaced. And for the T option, this is going to be a useful value to control in the control in the inspector. So let's create a float and call it the vertex amount. And it's going to be a slider between 0 and 1. And then we can connect the lerp to the position. As we increase the vertex amount, we get more vertex displacement. We can also go towards negative values. So this range can be between -1 and 1. More than that, I think it's way too much. Let me just rearrange this. But yeah, as you can imagine, this is very static, the noise, it's not moving around. If we were to use this as it is, we would only see some vertices displaced while the explosion would look much better with some wobble. So once again, every time we want to animate something, we use a time node. But contrary, to the voronoi noise, we don't have an angle offset. So. We are going to need a tiling and offset node to control directly the UVs of the simple noise. Well, basically the tiling. It's not going to do much. We already have the scale of the simple noise for that. So we are going to focus only on the offset. And if we want to animate this once again, yeah, we are going to need a time node. Multiplied with something. In this case, we have to access the X and Y, so we are going to use a vector2 for the vertex speed. And once we connect it to the offset, if we increase the vertex speed, the X value. And also increase the vertex amount. As you can see, in our main preview, we get the wobble effect. The mesh is moving around more precisely each vertex and this will really add a nice touch to our explosion. Let's set these values to 0. The vertex amount and the vertex speed and finally create a vertex scale. So we can connect it to the simple noise with a default value of 10. And then save this. And here we go. In our material, for example, we can say the vertex amount. Is 0.2 That's what I'm using. You can use more, obviously. And for the vertex scale, you can say it's 20. And the vertex speed, you can say the X is going to be 0.5 or the Y 0.5. It could be higher, by the way. No problem. Like 1 or 2. You can give it a try, but that's mainly it for our shader, our erosion voronoi shader. For now, in our next lesson, we can move on to the body of the explosion. Basically add the mid and the bottom part.
11. 3.7 - Rest of the Explosion Body: So in his short lesson, let's finish the body of the explosion. For the other two parts. We can duplicate the explosion top. Rename it to Explosion mid. We are going to push it down in the Y. Set it to 1. For example, the start life time could be shorter between 1.4 and 1.6, so it dissolves away from the bottom to the top. Basically, the explosion top is going to be the last one eroded, creates a very interesting effect and the start speed could be slower: 0.6 and 0.8 but for the start size, we want this to be a tiny bit bigger like 0.9 and 1.1 For the emission 10 particles is fine but in the shape increase the radius quite a bit compared to the explosion top. Let's set it to 1.2. This way the explosion top is at the center while the explosion mid is all around. Make sure the explosion mid is all around as well by setting the radius thickness to 0.3. This way we create a range, an area for these particles to spawn. Nice. As you can see, it kind of moves way too fast, at least in the Y axis. The explosion mid. That's because of the velocity of a lifetime. In this case, we don't need to slow it down towards the end. We can simply use a constant value of, for example, 0.5 in the Z axis, leave the other axis at 0, By the way. This way it only goes up a little bit. It's slow and nice. Cool. Maybe 0.75. 0.75 So it's closer to the explosion top. Okay. That's better. And the rest is pretty much the same. The color over lifetime, as well as the size over lifetime. And in the custom data, we also don't need to change anything. By the way, let's select both the explosion top and explosion mid and add some rotation over lifetime. It really adds a nice touch. We are going to make it random between 45 and 90. That's enough. It's almost unnoticeable, but it's there. And you kinda see the smoke mesh rotating slowly as it goes up. We don't want it to spin way too fast. This is without rotation. And this is with the rotation. It's there. If you look closely, you can see it. Cool. Now we can duplicate the explosion mid For the explosion bottom explosion bottom or bot. And we are going to do pretty much the same changes. For example, we are going to lower in the Y axis. We can say it's 0.5. Lifetime is going to be shorter between 1 and 1.2. We can make it slower as well, a tiny bit 0.4 and 0.6. But we can increase the size to be between 1 and 1.2. The count is going to be the same and the shape it can be larger, actually. Like 1.6 for the radius we can leave the radius thickness as it is, that's fine. We are basically making it larger at the bottom and thinner at the top. That's why we increased the size and the radius. Oh, and for the velocity over lifetime, it can be slower like 0.2. For example, it just moves a little bit up. Not too much. And if we play all of this together. Looks really nice, really interesting. You can see it dissipating away from the bottom to the top and that's great. So, yeah, as you can see, we have the body of the explosion, the main part, the core. Now, from now on, we are going to add quite a few elements to make this really cool. So that's it. Just don't forget to apply the changes to the prefab and press Ctrl+S, from time to time as well. In our next lesson, we are going to add some sparks.
13. 3.8 - Particles Impact: So let's spice this up with some sparks and we can start with the new particle system with right click and rename it to Particles Impact. They are going to the left. So let's rotate them -90 degrees in the X so they face up. And as you can see, it's looping continuously. We actually don't want that. So let's select all of this particle systems and disable looping. And one of the first things we can do is shorten their life time. They appear and disappear very quickly. So 0.2 and0.6 for the lifetime seems to be a good value. And yeah, as you can see, it's still emitting particles for 5 seconds because that's the duration of this particle system. But we actually want a burst instead of a rate over time. So let's set it to 0 and add a burst of yeah, 30 particles seems to be a good value. But as you can see, they are quite big. So let's take care of that. Let's go to the start size and say it's random between 0.05 and 0.2. We need them to be really small. They are round, but we will stretch them in a moment. For now, we need to fix the motion. As you can see, they are going in a cone shape. That's the default shape, the particle system use, and that's normal. But in our case, an hemisphere is a better fit. We have the sphere and the hemisphere, but we want the particles to only go up. We don't need them to go below the ground. So hemisphere is fine. It seems to me like the radius is a little bit too small, so let's increase it to 2. Let's see how it is with the rest of the particle systems yeah. Okay. That seems like a nice value, a nice proportion. They are obviously going all at the same speed. We can already take care of that. We want them to be really, really fast. At least some of them. We are going to create a big range between 5 and 40. And now, yes, they are all over the place. That's fine. That's normal. We are going to limit their velocity in a moment. It will create a very interesting motion. But for now, let's take care of the aspect a little bit. We want them to be stretched. Then we can do it in the renderer. And instead of a billboard, we can say the stretched billboard and the speed scale, we can set it to 0.05. If we test this out, we have a really nice size. If you set speed scale to something like one, as you can see, this is what happens they get really stretched. But 0.05 is a good amount. Now to limit the velocity, it's actually a very cool trick that we can do because sparks in an explosion tend to slow down towards the end of their lifetime and we can mimic that behavior with the limit velocity of our lifetime. And this works in the following way. The speed is set to 1, and if we increase the dampen to 0.5, a damping value of 0.5 will decrease the exceeding velocity by 50 percent, for example, and the target speed becomes 1. If we say 0.25, which is 25%, they go a little bit further. But if we increase, for example, the speed, we don't see much of a difference because we are trying to dampen their value. We are trying to limit their velocity to a quite big speed. So a good relation, a good proportion is 3 in the speed and 0.15 for the dampen. As you can see, towards the end of the lifetime, they slowed down and that looks very nice. Another thing we can take care of is their size over lifetime. They have always the same size. We are not going to fade away. We can simply decrease their size along their lifetime. And we can do it. With a curve similar to this one from big to small. But it will look a little bit better if we use this one with a curvature. You can obviously try different curves. And one of the last things we can already take care of is the color and the values that I used is 23 for the U, 94 to saturation, 100 for value and 100 as well for the alpha. And as you can see, it doesn't look quite the same. They are not bright and we cannot increase their brightness. We have this material which is the default material applied to the particle system. If we change it to, let's say, a default particle system, it still doesn't look that good. If we test with everything else. Yeah, this is what we have. The motion is great, but the intensity of the sparks should be much brighter. They are really hot, this sparks. And we are going to create a shader in the next lesson to control that. A simple one. Now there's a little thing that we can already do, which is duplicate the particles impact for the particles impact circle. Which are going to be very close to the ground. It will add a really nice touch. The only thing we need to do is in their shape instead of an hemisphere which goes 180 degrees. We can use a circle and it goes 360 degrees, but snap it to the ground. As you can see, we can decrease a little bit the radius so they don't start at the middle. Something like 0.5 seems to be good. The rest, we can leave it as it is. And if it does everything together, by the way, you can hide the shape by closing this tab. So if he we test it all together, the explosion becomes much more violent. It's a little detail, but as you can see, without them, it's still good. But if we add some particles in a circle shape, we really improve the impact of this explosion. So you had the remaining thing to do is to increase their intensity. And that's something we are going to do in our next lecture where we will create a simple particle shader.
14. 3.9 - Simple Particle Shader: Since we don't have any way to increase the brightness of these particles, not even the start color. Or in the default particle material. What we are going to do is create our own shader and it's going to be very simple. We can actually start with a blank shader graph, or in this case with an unlit shader graph. And we can call it the simple particle shader. Let's double click to open it up. And as usual, we need to tell it which target it's going to be for. And in this case, it's going to be for Universal Render Pipeline. We want this to be unlit. We don't need light to influence this. And we can turn on allow material override so we can control all of these options in the inspector directly. We can also turn on alpha clipping. It may become useful. And now we can start by adding a color property, which is going to be quite useful because in some way we are going to kind of recreate the unlit particle shader, but with a few improvements to our benefit and needs when it comes to creating visual effects. In fact, if I create a material just to show you something up here in the shader dropdown menu, we can go to Universal Render Pipeline and we have this particle section and we can select only one. And in here, as you can see, the color doesn't have the HDR value, the intensity controller, and we have a few extra things that we actually don't need. And it's a good practice for you to create a simple particle shader. Let me just delete this material. Okay. So back to our shader we wanna say the color. We want to say the color, the mode is going to be HDR so you can control the intensity and the default color can be white with alpha at 100. The next property we are going to need is a texture2d for the main texture which is abbreviated off main texture. We can actually select the default particle. And every time we have a texture, in a shader, we are very likely going to need to sample it first. We have a few options, but the one we want is to sample texture2D. And now we get access to the RGBA values of that texture and we can also influence. The UVs, among other things. But in our case, we simply want to multiply this with the color. As you can see, the color also as 4 properties, which is RGBA. So they are perfect for each other. And the way we do it is by, well, multiplying with each other. And if you want the particle system to influence the color of this shader. Do you remember what we did in the last shader? We used a vertex color so we can access each vertex color literally and influence it outside of the shader. And that's going to be quite useful because the color is going to come from the particle system to the shader. So simply need a vertex color node, multiplied with what we have and connect this to the base color. We are missing just one thing, which is the alpha or the transparency, and this shader will handle alpha by splitting this last node, so we can get access to the RGBA values and we want to pass the alpha information. To the fragment function and that's it. As you can see, the alpha clip threshold, it's well clipping already, which is its function and by default we want it to be 0. So let's actually create a float for that. We can call it Alpha Clip and we can say it's a slider between 0 and 1. Connect it like this and simply press save asset. Now. And now we can go ahead and create a material out of this shader with right click. This one, we can rename it to well, Beam01, for example, and drag it to the materials folder, not forget to keep everything nice, clean and organized. It's useful. And then we can assign these material to the particle impact and the particle impact circle. And let's play these and pause the sparks midair so we can adjust the values of the shader. For example, since we allowed the material override, we can control the surface options in the inspector. And in this case, we don't want this to be opaque. We want it to be transparent. We also don't want this to be in alpha mode. Can change the blending mode to additive. And that's pretty much it. We don't need the Alpha clip, but it's there. At least for now. We don't need it. And now we have a very important parameter that we can control in the color, in the HDR color, which is the intensity. If we increase it to around 6, 6.5 or 5.5 around those values, as you can see, we really get those bright sparks looking very nice and very appealing. Now, if you play everything together, that's when we get an impactful explosion! Just because we added some quick sparks. It becomes already much more interesting. You can obviously adjust the intensity as you wish and change the color as well. Or you can keep with my values and get some really cool explosion. Okay, so that's it for this lesson. And in our next lesson, we are going to add some floating particles all around the explosion.
15. 3.10 - Particles Floating: So in this short lesson, since we already have the simple particle shader, let's add a few more particles. More precisely, some particles floating around the explosion. And yeah we can start with the particles impact, press Ctrl+D to duplicate it. And in this case, they are going to be much slower. So we can decrease the start speed to between 0.5 and 1.2. And you can imagine that this is some embers flying around. So we don't need to limit their velocity. What we actually need is to add velocity over lifetime, more precisely in the Z axis. So they go up. Something between 0.5 and 1.8 should be fine. We can also add some randomness to the sides in terms of velocity. Something between 1.2 and -1.2 for the X and Y axis will do the trick. And then still in the velocity over lifetime module. We have a very interesting feature, which is the orbital x. We can say it's random. And if we increase it to 10. This is what we get. You got a few sparks orbiting around the Y axis and that looks awesome. Ten is maybe a little bit too much. So 1.5, maybe 2, between 0 and 2. Yeah, that looks nice. But if we play everything together as you can see, we don't even see these particles. So we need two things. One is to increase the radius and the other is to increase their lifetime. Oh, let's rename it, by the way. Particles floating. Yeah. So in the shape module, we can go ahead and increase the radius to 2.4 or 2.5. And the radius thickness to 0.5 so they don't spawn in the middle of the hemisphere. And we can then increase the start lifetime to 1.8 and 2.3, which is more a less the same time the explosion lasts. And we want this to be small. We also need it to be stretched so, in the renderer, we can say it's a billboard. Simple. As you can see. Really nice. I think it's way too big. Let me see. With everything together, close the shape model. Yeah. It's looking interesting. What we can do is actually drag the U to be closer to the red value's something like 10. As you can see, it really adds that reddish touch and then we can actually decrease their size. They're all a bit too big. 0.025 for the minimum. And the maximum 0.18 maybe. Yeah. We have those flying embers all around. That looks really nice. I'm actually going to increase the radius to 2.6, so we have a few more around the explosion. Exactly. Very nice. It adds a nice touch. This could be one of the things that we could leave to the end. But since we were adding particles, it is still a nice moment to do it. Now there's a little trick that we can do, which is. Go to the color over lifetime and we are going to make them blink. And the way we do it is by adding three keys up here and the one in the middle. It's going to be 0 for the alpha and then three more keys around here, and once again, zero for the alpha of the middle key. And as you can see, we have them blinking towards their lifetime. And yeah, that adds a really nice touch to the explosion. Yeah, now that I see it, I'm going to decrease the start size, the maximum to 0.15. I think they were way too big and dragging too much attention. We don't want this to be too predominant. It's just a nice detail. So yeah, we are pretty much done with particles. In our next lesson, we are going to move on to the smoke part. We are going to add a ring of smoke.
16. 3.11 - Ring of Smoke - Mesh: So like I was saying, we are going to add a ring of smoke closer to the ground all around the explosion. But for that, we need the mesh, a 3D mesh. So once again, let's open up blender. We can still pick the same project we used for the smoke sphere. Let me just turn on screencast keys and we can hide the smoke sphere by pressing H. But you must have it selected. So the way we build this ring of smoke is by starting with the cylinder. So Shift+A, cylinder exactly on the left panel, we can actually control the vertices. As you can see, I'm going to still leave it at the 32 vertices. And then we can press spacebar and search for shade smooth. Or you can go up here in objects and you can find the shade smooth. Right here. So now we need to make this hollow. We need to remove the top and the bottom faces. So let's enter in edit mode with Tab and we are going to switch the mesh select mode to face. We can use Ctrl+Tab for that. We are going to select the top face hold Shift and select the bottom face and then press Delete and select faces. Exactly. So now if we select everything with A we already have the UV editor open and let me just we can turn on this UV sync selection, just click it. It's useful to see what we are selecting in the UV editor directly in the viewport. Let's switch it to vertex select mode with Ctrl+Tab. And if it's like this top vertices, as you can see, it represents the top of the cylinder. So that's correct. That's what we want. Make sure it's like that. And then we want to go ahead and select the bottom vertices with B, by the way, and push them all the way down with G. But as you can see, it's possible to go out of the UV area and we actually don't want that. So, we could go up here to the UV dropdown menu and select constraint to image bounds. Once you do it, you can press G again, but this time lock it in the Y axis so you can go only down and not to the sides. And now as you can see it doesn't get out of the UV area. And that's perfect. That's exactly what we want. Now, from here, we can actually already take care of the pivot of this mesh. As you can see, it's centred to the object. We can fix it by selecting this bottom vertices while holding Shift and Alt and then press the select button in your mouse. And then will Shift+S, we can say cursor to selected. And now we can go to object mode with tab. And press Shift+Ctrl+Alt+C to select origin to 3D cursor. Basically the origin, the pivot of this mesh is going to go to the 3D cursor, which is at the bottom. By the way, you can go to object in set origin, you can select origin to 3D cursor as well. And we are doing this in case we want to animate the size of this ring. It will animate from the bottom to the top and it will look much better. Right. So we still need to make a few adjustments to this mesh. It's very simple. Let's actually select the top vertices while holding Shift+Alt. You can press 1 in numpad to go the top view, top orthographic view and we want to increase this by 3. You can scale these with S, by the way, you can literally press 3 in your numpad and then press Enter. That's the kind of shape you are looking for. Now, we can actually still with the top vertices selected Press G, lock it in Z and push it down by a value of -1 You can literally type -1 in your keyboard and then press enter. And that's the shape you are looking for. Great. Let's rename this on this tab. We can call it the Ring01 And let's also press Ctrl+A so we can apply all transforms. Basically the location, rotation and scale. They all become uniform. The pivot may change. So make sure you go to object again. Set origin and select origin to 3D cursor so it goes back to the bottom of the ring. Then we can export this. If you go to file, you can select objects. And navigate to the models folder of your project. We can rename this to the Ring01 Turn on selected object, so we make sure we export only this ring. Now in unity, we can already go ahead and select the ring and make sure the scale factor is 100 right and then apply. So that's very cool. It's going to be a super useful mesh. In our next lesson, we are going to see how to use it with the particle system and apply the proper motion and the proper size as well.
17. 3.12 - Ring of Smoke - Particle System: So before we create a texture and a shader for this, we are going to create a particle system so we can use the smoke ring and apply the proper motion and size, etc. and we can start from scratch with a new particle system. Right click, call it the smoke ring. And as you have already noticed, we need to rotate this -90 in the X so it faces up. We can also turn off the looping option. We don't want this to loop. It's only going to play one time. As a matter of fact, in the emission, we can say the rate over time is 0 and then the burst with only one particle. Great. As you can see, it's moving up and we kind of don't need this to move or to spawn in a different position. Then it's own transform. So let's turn off shape. And then decrease the start speed to almost 0. Something like 0.1. So it moves a little bit up. Not much. It's living a little bit way too much for the explosion. We have probably 2 seconds. Should be fine. Okay. So let's apply the mesh down here in the renderer. In the render mode, we can say it's a mesh. Click here and assign the Ring01 And the first thing you will notice is if you move around, it's always facing the camera, this mesh. And that's because of the render alignment, which is set to view. So that's why it's always aligning with our view. With our camera, we can switch it to a local, render alignment. Exactly. It seems like it has disappeared. But if you go up here and turn on shaded wireframe, what you will notice is that the mesh is still there, but we only see one side of it. And that's normal. The default material that comes with the particle system only renders when face. Fortunately, we already have a material shader that we created and we can control that. Let's select the Beam01, for example. And just to make a point, if you go to the material settings, to the surface options. This is the cause of only rendering one face, which is the front one. As you can see, we can select both and it will render the inside and the outside of the mesh. Great. It's actually super bright. We are going to fix that in a moment. We can turn off the wire frame, by the way. And let's actually duplicate this Beam01 for now, call it Beam01_AB, which is alpha blended. We can switch the additive mode to alpha so you can have dark colors. And let's set the beam. 0.1 went to what it was, which is rather face to front. It won't cause any problems, but let's leave it as it was. We should never modify materials that are applied to other particle systems. We may cause problems. So in the Beam01_AB. We can also decrease the intensity to 0 and assign it to the smoke ring. Simply drag and drop, for example, so yeah, this is what we have right now. Don't worry about the flat faces that we are seeing. We are going to fix them. We are just taking care of the motion and the size. And if we select everything, as you can see, the size is small. So there is actually one thing that we can do. Since it's a mesh we can. Turn on 3D start size, it's going to be useful. For example, for the X and Y we can say, which is the radius, we can say it's 2.8. And Z will control how tall it is. So maybe 1.5. We can also say the rotation is random. Every time it spawns, it will have a different rotation between 360 and -360, for example. And then we can play with the size over lifetime. Let's select this curve right here the second one and push the first key above 0.5 And as you can see, it grows slowly. And then the idea is to fade it away with an erosion shader that we are going to create for now. We can actually go to the color lifetime and say that the last key is going to be almost black, more or less around here. A that gray. We can push the first key to around 30% and add another key in the beginning and say it's a black one. Exactly. So it fades in the beginning a little bit and then it fades away slowly. You can actually add another key completely white, exactly like this. So it holds on to the color a while longer. All right, all right. Looking good. So in our next lesson, we are going to create a texture for this and we are going to use Krita for that. So don't forget to apply the changes to the prefab and press Ctrl+S in your scene.
18. 3.13 - Ring of Smoke - Texture: So to create textures we can use Krita, it's free and it's very simple to pick up. But you can also use different image editing softwares if you feel comfortable with them, like Photoshop or GIMP, etc.. So in case you want to install Krita, you can go to Google and search for Krita. Click on this link. Press the get Krita now button and then you can download whichever version you prefer. Once you installed Krita, you can open it up and the first thing you want to do is create a new file. In this case, with 2048 by 2048 pixels, don't forget to switch it to pixels. Everything else, we can leave it as it is. And then we can press create. And make sure that you have an empty layer and a black background layer. From there, you can pick up the brush tool or press B for shortcut. And then go to the brushes preset. And we want to start with the hairbrush soft. Make sure you select a white color on this little icon. And then decrease the capacity to around 40 with a size of 600 or 500 pixels. And now the cool thing about Krita is that it's super easy to create seamless textures, to create tileable textures. We simply need to press Shift+W Shift+W And as you can see, if we paint something, it repeats really nice and that's exactly what we need. So the trick. Now, I'm going to try my best to guide you, of course, with one stroke is to create these spikes, as you can see. And then the second time you are going to pass. You can decrease the brush size radius. Pass it again, as you can see. Repeat this for the third time. Decrease the brush size, then pass again. And the fourth time as well. Decrease the brush size and pass again. We are kind of creating a gradient that goes from black to white and the white parts are going to be the last ones to be eroded, by the way. Now, the idea is to increase the brush size and add a glow to the parts you want to be more white. For example, in my case, I'm going to give an overall glow. First. Just like this. It's kind of bright. No problem with that, because now if you go to the brush library. We are going to go down here and select the blender smear brush, this one. It's a very useful brush. We just need to first go to this brush editor and in the fade decrees it all the way down to zero, so it becomes smoother and then the opacity should be at around 40%. The idea with this brush is to push the white values, as you can see, to smear, to smudge this altogether. So it kind of blends nicely. Instead of leaving the brush marks behind. We don't want to see the brush strokes. In this effect, at least for this case. What we want to do is smudge this, is blend this, until it's very well faded and very well blended. And in the meantime, you can also push certain areas. For example, this tip of the spikes, they could be pointy, even more pointy. And the idea with this texture is to have some very sharp edges as if it was a saw wave. There's another trick you can do, which is decrease the brush size and then pass quite a few times from the bottom to the top and then from the top to the bottom, to kind of give this motion effect, which is really nice as well. I passed all over the texture. So what I'm going to do now is pick the previous brush this one, but press E or click on this icon to turn On the eraser and decrease the opacity to around 40. Maybe even less, and then, yeah, maybe even less. And then remove some of the excessive parts we have. More precisely, the white values. There should be less. We should have gray areas and almost black areas, and then some very strong whites. So that's the purpose of using the erase tool is to kind of remove the excess. In some cases, you can even break the line we have, this saw line. Just like this. I know it's not an easy process, but if you follow my steps, you should probably be fine. But if you have some experience with this, it's also not that hard. So yeah, I'm removing a lot. And then I'm going to switch back to the smudge tool. Push a few more parts. It's a repetitive process until we get to something we like. In this case, I'm only pushing with the smudge tool the pointy part. Really that spike exactly like this. And then create some gaps as well. In my case, I arrived at a nice point. And one of the last things we can do still in wrap mode. Is go to filters and in blur add a motion blur motion blur In this case, the angle we want it to be, from the bottom to the top, basically 270 degrees and the length, which is the strength. In my case, it's almost close to 100 to see some effect in action. So we can see something basically, as you can see, you can enable and disable thr preview mode and you can see the influence of the motion blur. In this case, it's looking nice. I'm going to leave it at 90 a little bit above that, just so it blends everything nicely together and adds a little bit of motion blur. So yeah, that's pretty much it. You can turn off wrap mode by pressing Shift+W, and now you can hide the black background, you can first actually save this, Krita file, by the way, to a folder. I already have one impact here I'm going to call this one impact02. So yeah, now you can go to file and go to export as a PNG, don't forget about it. You can actually export this directly to your unity project to the texture folder more precisely, which is what I'm going to do just like this. Exactly. The compression could be lower, by the way, like two or one. So you can have the maximum quality. Exactly. And then, yeah, if you go to unity, you should probably have your texture in the textures folder and then you can select it and turn on alpha is transparency. And yeah, that's pretty much it. We have done now the impact texture which we are going to use in our next lesson with a new erosion shader that we are going to create for textures.
19. 3.14 - Erosion Texture Shader: Since we don't have any way to increase the brightness of these particles, not even the start color. Or in the default particle material. What we are going to do is create our own shader and it's going to be very simple. We can actually start with a blank shader graph, or in this case with an unlit shader graph. And we can call it the simple particle shader. Let's double click to open it up. And as usual, we need to tell it which target it's going to be for. And in this case, it's going to be for Universal Render Pipeline. We want this to be unlit. We don't need light to influence this. And we can turn on allow material override so we can control all of these options in the inspector directly. We can also turn on alpha clipping. It may become useful. And now we can start by adding a color property, which is going to be quite useful because in some way we are going to kind of recreate the unlit particle shader, but with a few improvements to our benefit and needs when it comes to creating visual effects. In fact, if I create a material just to show you something up here in the shader dropdown menu, we can go to Universal Render Pipeline and we have this particle section and we can select only one. And in here, as you can see, the color doesn't have the HDR value, the intensity controller, and we have a few extra things that we actually don't need. And it's a good practice for you to create a simple particle shader. Let me just delete this material. Okay. So back to our shader we wanna say the color. We want to say the color, the mode is going to be HDR so you can control the intensity and the default color can be white with alpha at 100. The next property we are going to need is a texture2d for the main texture which is abbreviated off main texture. We can actually select the default particle. And every time we have a texture, in a shader, we are very likely going to need to sample it first. We have a few options, but the one we want is to sample texture2D. And now we get access to the RGBA values of that texture and we can also influence. The UVs, among other things. But in our case, we simply want to multiply this with the color. As you can see, the color also as 4 properties, which is RGBA. So they are perfect for each other. And the way we do it is by, well, multiplying with each other. And if you want the particle system to influence the color of this shader. Do you remember what we did in the last shader? We used a vertex color so we can access each vertex color literally and influence it outside of the shader. And that's going to be quite useful because the color is going to come from the particle system to the shader. So simply need a vertex color node, multiplied with what we have and connect this to the base color. We are missing just one thing, which is the alpha or the transparency, and this shader will handle alpha by splitting this last node, so we can get access to the RGBA values and we want to pass the alpha information. To the fragment function and that's it. As you can see, the alpha clip threshold, it's well clipping already, which is its function and by default we want it to be 0. So let's actually create a float for that. We can call it Alpha Clip and we can say it's a slider between 0 and 1. Connect it like this and simply press save asset. Now. And now we can go ahead and create a material out of this shader with right click. This one, we can rename it to well, Beam01, for example, and drag it to the materials folder, not forget to keep everything nice, clean and organized. It's useful. And then we can assign these material to the particle impact and the particle impact circle. And let's play these and pause the sparks midair so we can adjust the values of the shader. For example, since we allowed the material override, we can control the surface options in the inspector. And in this case, we don't want this to be opaque. We want it to be transparent. We also don't want this to be in alpha mode. Can change the blending mode to additive. And that's pretty much it. We don't need the Alpha clip, but it's there. At least for now. We don't need it. And now we have a very important parameter that we can control in the color, in the HDR color, which is the intensity. If we increase it to around 6, 6.5 or 5.5 around those values, as you can see, we really get those bright sparks looking very nice and very appealing. Now, if you play everything together, that's when we get an impactful explosion! Just because we added some quick sparks. It becomes already much more interesting. You can obviously adjust the intensity as you wish and change the color as well. Or you can keep with my values and get some really cool explosion. Okay, so that's it for this lesson. And in our next lesson, we are going to add some floating particles all around the explosion.
20. 3.15 - Smoke Rings: So for this lesson. As you can see, this is what we have and it's looking very interesting already. We are just going to add a few more details when it comes to smoke. And it's very simple in our case. First thing we can do is select the smoke ring and I'm going to decrease the size over life. The first key I'm going to push is below 0.5. Okay. That looks nice. And I'm also going to increase the start size to 3 in the X and in the Y and down here, the tiling, I'm actually going to set to to 2 or 2.5. Okay. Now we are ready to duplicate this. Smoke ring particle system. And the changes we are going to do are mainly focused on the lifetime and on the 3D start size. So this one, we want it to be smaller, like 2 for the X and Y. And the lifetime could be 1.8, for example. Exactly like this. Now we can duplicate the last smoke ring. And say the start size is 1 and the Z 0.6 or 0.8. We forgot to change the Z on this one. Let's change it as well. So it isn't as tall as the first one, to 1.2. Okay. And now for the smaller smoke ring, we can say the start lifetime is 1.6, for example. So yeah, we start from the big one to the medium one and then the small smoke ring. And if you play all of this together. This is the kind of effect we create in actually going to say the smallest ring, which is the last one. Start lifetime is going to be 1.7 and the size like 1.1. For the X and Y, the radius, actually. Yeah. Like this. Okay. Looking good. That's very interesting. We may make a few adjustments later. For now, let's create a quick shockwave smoke from the first smoke ring. This one, you can press Ctrl+D and rename it to Quick Smoke Shockwave. First thing we need to change is the lifetime. It's going to be much faster like 0.3 and it's going to be bigger, like 4 for the X and Y. But it's going to be flatter. So 0.5 for the Z if you play this this is but we get, very quick shockwave, in this case for the color over lifetime. We want this to fade quickly towards the end. So, let's say the last key is completely black. And this key right here, we can push it closer to the first one, make sure it's white as well. This way, what we will get is a much quicker shockwave that fades throughout the end of its lifetime. And we also want to change the size of our lifetime. We want this to really grow from 0 to 1. As you can see, it makes it look faster and more impactful. And if you play everything together, this is the kind of impact it has. The shockwave, as you can see, it, really adds that punchy feeling to the explosion. Yeah. Looking very nice. I'm actually going to select the tree smoke rings. Go to the color over color over lifetime. And the last key. I'm going to push it closer to black value so it fades away towards the end. It was a little bit too predominant. Exactly like this. I'm actually going to increase by 0.2 the start lifetime of each smoke ring. So yeah, the first one is going to be to 2.2 The second one is going to be 2 seconds. And for the smallest smoke ring 1.8. This way, we still see some smoke after. The core explosion is gone. Yeah. Like this. Cool. Let's apply the changes. Actually. And as you have probably guessed by now, this requires a lot of adjustments. So what I'm going to do for this quick smoke shockwave is go to the custom data the X which controls the erosion. I'm actually going to select this curve right here, which goes from 0 to 1 in a straight line to create this kind of effect. It dissolves away faster. You can play with this dissolve line and it should play it. For example, if we do the same for the three smoke rings, this is the kind of effect we create. Personally, if we play everything together, I don't think it looks better. So what I'm going to do is do a Ctrl+Z Until the smoke rings have this curve for the erosion. But I'm going to leave the quick smoke shockwave with the curve that goes from 0 to 1. In fact, for the three smoke rings. I noticed that if I select the last key and push the handle a little bit down like this. It will look better. We will see the smoke for a little bit longer before eroding away. Yeah, that's very interesting. Let's apply the changes to the prefab. And in our next lesson, we are going to add some orange rings.
22. 3.16 - Orange Rings: So now that we have the mesh and the erosion texture shader, we are going to take advantage of these techniques that we used to create the smoke rings and we are now going to create some orange rings, which will be much faster and brighter as well. So let's start by duplicating the first smoke ring and renaming it to Orange Ring, for example. And this one is going to be smaller. This size should be something between the bigger and medium smoke rings. So 2.6 For the X and Y seems to be a good value. And yeah, like I said, it's going to be faster. So 0.8 for the lifetime. You can also make it flatter in the z-axis the value of 0.5 0.5 Right. So for the color, I used a value of 18 for the U and 74 for the saturation. And since we want this to be impactful. I'm also going to change the size over lifetime curve so it doesn't grow in a straight way and it has a different motion than the smoke rings. We can actually turn off color over lifetime. And now there's a very important step, which is the material. We want to go ahead and duplicate the impact 01 material, rename it to Impact01_bright, for example, because we are going to increase the intensity value to around 3. Okay. Let's drag and drop this to the orange ring. And as you can see, it looks very interesting, actually. Maybe a little bit too bright. And yeah, for the curves. I'm actually going to make it less round the size over lifetime like this. Because it was holding on to the same size at the end for too long. Now, despite the fact that we use this car for the smoke ring, I think we would have a better result with something like this. Maybe we can push the first key above 0. A tiny value above 0 like this. So it clips in the beginning. Let's see how it is with everything. Okay. Yeah, very interesting. Like I was saying, maybe it's a bit too intense and it drags too much attention. So let's decrease the intensity to 2 instead. All right. That's better. It's a little bit more discreet, and it still looks nice. I think it could be bigger. So in the 3D start size 2.8 for the X and Y. And for the size over lifetime, the first key, I'm going to drag it to around 0.3. So it's a little bit more impactful. Yeah. Exactly like this. As you can see, it is between the smoke shockwave and the big smoke ring. All right. So looking very impactful. It's turning out great. Now we can add another orange ring, but this time a smaller one closer to the core of the explosion. As if it was following the core of the explosion. So let's duplicate this one with Ctrl+D and rename it to Orange Ring smaller. It can also live less like 0.6 And for the size much smaller yeah 1.6. If you play these two together this is what we have. Maybe it could be smaller. Let's try 1.4 for for the X and Y. Yeah. 1.6 seems to be a good value because we cannot see it with 1.4. Now we can see it, in the base of the core of the explosion. We see a small orange ring. Okay. Looking good. Now let's add another orange ring. But this time we can duplicate it from the orange ring as well. But this time it's going to be a quick vertical impact. Very quick indeed. And since it is vertical, you can actually increase the Z. Something like 7, which is maybe a little bit too much. But the lifetime to 0.1, it's going to be like super fast and it's going to make this explosion even more impactful. Let's decrease the X and Y to 1.2 or 1.4. Yeah. And let's see how it is with everything together. So yeah, as you can see, we have those vertical spikes in the beginning very quick. If we see it in slow motion by setting the playback speed to 0.2 You can see every element and how it works together. So yeah, this is some nice touches that we are adding, makes the explosion tstand out even more. Now, one of the last things we can do is. Make the first orange ring lets duplicate it. We are going to make it, make it stand out by adding a darker orange ring. Let's call it orange, light, dark ring. And it's going to be a tiny bit bigger like 3 for the X and Y. But the main difference is the value of the color. We are going to decrease it to around 36. And if you play this two together, as you can see, it kind of works like a shadow for the big orange ring. If you play everything together, it looks very nice. Kind of adds another layer of dust or of smoke. Depends on how you see it. And it's very good. Actually, I'm going to make the quick orange ring vertical z-axis smaller. Like 6.7 for example. Just want to see a little bit of it. Not much. And yeah, I think it's looking very good. So let's call it today day for the orange ring. Let's apply the changes to the prefab. And in our next lesson, we are going to create an impact flipbook.
23. 3.17 - Impact Flipbook - Part 1: Frame 3: So in this lesson the idea is to create an impact. Flipbook, so the explosion in the beginning becomes really bright. It's going to be a flipbook of only four frames, something fast. This way you will also have the opportunity to create a flipbook in Krita and you will see how easy it is to create interesting flipbook effects in Krita. So let's open it up and with Ctrl+N I'm going to create a new document 2048 by 2048 as well. You can go to content and make the background color black as well. And you can press create, make sure you have a paint layer and a background. And since it's a flipbook, we are going to need the animation timeline. So let's go to settings and in dockers we want to turn on animation timeline. It will appear down here. Probably. And as you can see, we also have the layers right here, the paint layer 1 and the background, and this is the frame selection. For example, if you go to the first frame zero, pick the brush tool. Select the hairbrush soft. Make sure this softness curve is similar to this one. If we do this and choose a white collar. If we paint in the first frame, go to the next few frames. As we can see, it is the same. But if you paint something else in the first frame, for example, you still see it in the first frame. And that's happening mostly because let me just do a Ctrl+Z We need to create down here with right click a blank frame. As you can see. And this becomes a blueish square, which means that we can select it. And, if we paint something here, move to the next frame. Do another brush stroke. Go to next to the same. And so on. As you can see now we have a simple animation and we are using one layer only which is quite useful. If you press play, this will go to, it doesn't stop basically. And the way we can fix it is, if you click on these three lines, we can say that the clip end is in our case 3. We are simply going to create 4 frames and it starts counting at 0. So it's 0, 1, 2, 3, 4 frames. Now we can select all of these and with right click remove keyframes so we can start fresh. And we actually want to start in the third frame. More a less, in the middle. So with the right click, let's create a blank frame. By the way, make sure the opacity is around 40 - 30%. And now you can imagine you are painting a circle with spikes with only one stroke as you can see. And yeah, in this case, I'm going to push it up. I'm going to select the arrow, press Ctrl+T and try to center this more or less. It's actually very important to center this properly. Otherwise it may look like it has an offset in unity. I'm going to push this anchor to the center of the drawing. And then in the tool options we're going to say the X is 1024 pixels as well as in the Y. And and now as you can see, it's a little bit more centred. But along the way, we are going to make sure it's centered. Now we want to focus on repeating the same process once again. It's basically the same technique. We want to add a little bit more white to this. And then we can shrink the brush size, the brush radius. Pass again another time, as you can see. And basically we are starting to define the shape of our impact. And now we can shrink even more the radius and add a few more details to this. I'm going to repeat the same process. Pass again. And then I'm going to give it a little bit more glow by making the radius bigger. And add in a few spots that I want to highlight. Okay. Once you have arrived at this point, you have a good balance between white and greys. The idea now is to select the eraser, increase the opacity to around the 80%. And we are going to remove the excess. In my case, I'm going to make the ends a little bit more pointy, as you can see. By erasing from one side and then from the other. It kind of creates these triangles all around this circle. Then from here, we want to go ahead and select the the blender smear brush. We want the press here to enter in the bruh editor and make sure the fade is 0 so it's smoother so it doesn't create hard edges. Then we can decrease the opacity, which is basically the strength to around 40 or 50. And now the idea is to go from the inside to the outside. Pass simply one time and make sure you go exactly from the center. In pass in the middle of the spike, as you can see, just like this one time, it's enough for now. Then you can pass another time all around and push this. And basically we are highlighting these spikes and these pointy end by blending these white and gray values, by blending together these white and gray values. And it kind of creates this very interesting texture, as you can see, and we can actually go ahead and already save this Ctrl+S Make sure you save this to a folder that you know what it is. I have a folder with everything that I created for this course, for example, all of the textures and all of the meshes. You can go ahead and save it there. I'm going to call Impact zero one and underscore two by two because it's going to be four frames. So it's going to be a grid of two by two frames. And now we have created the first frame of our flipbook. In the next lesson, we are going to create the first and the second and retouch the third frame.
24. 3.18 - Impact Flipbook - Part 2: Frame 1 and 2: So in this lesson we are going to finish the impact flipbook and we can start by copying with right click the third frame we have created select the second frame and with right click again paste it. And the idea now is once again with the blender smear brush. We are going to push these parts right here to the center, always to the center. We're also going to push the spikes just like these, make sure it's around 50% of capacity, which is the strength. So you don't push everything all at once. We want to keep on pushing and keep on pushing. By the way, there is this onion skins button. That will show the previous and the next frame. In this case, the next frame is green. But yeah, in my case I don't really like to use it for this type of flipbook because it blends everything together and we kind of understand much of what's going on. What I like to do is switch between the next and the previous frame and compare which parts do I need to change, for example, in this bottom right corner. I need to push this a little bit to the center, even more like this. And now with a smaller brush size, I'm going to push these parts even more to the center, because basically in the first frame, you are going to make this much smaller. So I need to go towards that objective. Okay. Yeah. The first frame will need to be adjusted sooner or later. For now, what I'm noticing is. This is not quite well centered. So what I'm going to do is. Go to the third frame and push the guide from the left until it's exactly at 1024 pixels in the X. And then push another guide from the top until it's exactly at 1024 pixels. This way we know the center of this document. Now we simply need to push this, as you can see, until it's centered. We are going to do the same for the second frame. More or less like this. You can switch between the two frames and make sure they are centred. It's very important. Once you have done it, you can go to view and turn off show guides. For example, instead of removing the guides, we can simply hide them. Great. Okay. Back to the second frame. Now, the idea is to shrink these with Ctrl+T Exactly like this. Until more or less of this size. And now we can copy the second frame. Go to the first frame and paste keyframes. Exactly like this. Well now. And basically we repeat the same process. We are going to pick the blender smear brush. And with around 40, 50% of capacity, we want to push this to the center even more. Just like this. Make sure you go all around your texture and push everything to the center. Always from the outside to the inside and then a little bit from the inside to the center like this. Now we can compare it with everything. The first and the second frame are matching well, but yeah, the third frame will need some adjustments. That's fine. You obviously need to switch between the first and the second frame and make them more related to each other. For example, I'm going to go to the first frame. And decrease even more the size with Ctrl+T just like these, as you can see. If you switch between the first, second and third frame, you can see it's growing. And now once again, I'm going to push this even more to the center in the first frame. It's a repetitive process. But I think that's mainly it. Now I'm going to do a small trick. I'm going to switch to this brush and. With around 40% of capacity and with the white color selected as well. I'm going to click a few times around here to add... To make this brighter, as you can see. Looks very good. The idea is that the first frame is super bright and then it kind of fades away. We can also do that with the particle system, of course, with color over lifetime. We could also increase the size with the size over lifetime. You always have the two options, but in our case, we are taking care of that directly in Krita. Okay, so let's adjust the third frame really quick. We are going to pick once again the blender smear brush. At around 40, 50% of capacity. Now we are going to do the same, which is push these parts right here towards the center. And then push the spikes towards the center as well. Exactly like this. Push the spikes even more. Yeah. That now looks related to the first and the second frame. Much better. Cool. Maybe push even more from the inside to the center. I'm noticing that it's not matching quite well. Okay. We are only doing four frames, so and it's going to be super fast. So yeah, this is a good exercise for you to have a taste of how to create flipbooks in Krita. Obviously I'm switching between the first and second and third frame to see if I can make them even more related to each other and basically trying to make sense between each frame. And we are almost done now. Let's leave it as it is. And in the next lesson we are going to do the last frame and probably adjust a bit more the other frames and then export as well.
25. 3.19 - Impact Flipbook - Part 3: Last Frame and Export: All right. So this last lesson of the flipbook, we are going to create the last frame and then export these as a PNG sequence and join everything into a flipbook. So without further ado, let's copy the third frame and paste it to the fourth like this. Then the idea now is to push this all the way outside. With the blend smear brush. As you can see, you can push this all the way outside. From the center to the exterior. Make sure you push those spikes really well. And then you can push. The parts that are closer to the center. Right. So if you want to play this, you can press the play button. But as you can see, this is super fast. You can slow it down in this speed percentage. I'm going to leave it at 30% and play this. Yeah. So you can have a better idea of what's happening. It's only four frames. You cannot perceive it very well. But for example, in my case, I'm noticing that the third frame. It's quite different from the second. So in the third frame, I'm going to push a little bit more from the center. Towards the pointy end of the spikes. So it kind of matches with the second frame, so it makes more sense. Okay. Looking good. And now one of the final tricks we can do is select the first brush. This one, pick the eraser, set the opacity to around 30, increase the brush size, go to the second frame and all around we want to remove a little bit, not much because it is the second frame and we still want this to be bright. Now in the third frame, we can erase a little bit more. But still always around our texture And then a little bit in the inside. Only in the first frame. In the last frame now the idea is to erase even more. We can erase in the inside area and then as well in the outside area, we really want to make this much more dull, much more dissipated away. We don't want this to be super bright at the end. Actually noticed that I did the changes in the fifth frame. So that's fine. I'm going with right click on the fifth frame press copy key frame. And paste it to the fourth frame. And that's it. Problem fixed. Now, if you play this as you can see, I think it's in a good state. So what we can do now is export this. And the first thing we want to do is hide the black background. As you can see it hides in all of the frames, which is great. And then we can go ahead to the file, select the render animation. And make sure you have image sequence selected and the first frame is 0 and the last frame is 3 and the file format is PNG image. And now we can select the folder to where it's going to be exported. And I'm going to create a new folder and call it the Impact01_2x2 And the baby's name. It's going to be something like Impact01_ We want this to start numbering at 0 and then we can press. Okay. We may need to wait a little bit for Krita to export this, but once it is done, as you can see, if we navigate towards the exported folder, we have all of the four frames. You want to make sure that the frames don't have any background. Okay. Now, to join these 4 frames into a flipbook, we are going to use a free software, which I have been using for quite some time, and it never disappoints me. You can go to Google and search for GlueIT and if you don't find it, please let me know in the comments. We could go to the first link, the GitHub link, and in here in the green button we can paste download zip. Once you download this piece of software, you can open the program. And it's very simple. The first step is to add the frames we want to join. We can navigate to the folder we have exported the frames, select the four, add them, and then the second step is to tell it how many columns we want. This is going to be 2 by 2. So we want two columns and then we can press the glue it button. This window appears, the preview window appears. We can close it because now we can go ahead and save this and we can rename it, for example, to Impact_2x2 Impact_2x2 And that's it. We have now, as you can see, the four frames in a flipbook texture style. And now we can animate this with a particle system. We can play this let's just import this texture to unity, drag and drop it. And in the inspector we can turn On alpha is transparency and that's it. You can press apply. In our next lesson, we are going to use this with the explosion.
26. 3.20 - Impact Flipbook Particle System: All right. So now that we have this flipbook impact texture, let's see how to use it with the particle system and how to apply it to our explosion. This is going to be at the base of the explosion, by the way. So let's start with a new particle system, right click, effects particle system. We can rename this the quick orange shockwave. And as usual, we don't want this to loop. Right. And we also don't want this to move. So the start speed is going to be 0 and we can turn off the shape. And then we only want one particle. So let's set the rate over time to 0. And the burst of one particle. And if you play this, here we go. We have one particle that doesn't move at the base of our effect. Now the way we use this texture well, first, we need to create a material for it. So let's duplicate the Beam01, which is using the shader we created the simple particle shader and rename it to Impact01_2x2 We can drag and drop the flipbook texture we created and then for the color. For now, let's set the intensity to 0. Okay. So yeah, as you can see, we have the flipbook being displayed and we use it by turning on the texture sheet animation. It is in grid mode, which means we can tell it the tiles, the columns and the rows. It's 2 by 2 in the X and in the Y. We just need to adjust the frame overtime curve, which goes from 0 to 4. But this would mean it's 5 frames and it isn't. It's only 4. So let's set it to 3 because, it starts counting at 0. So it's 0, 1, 2, 3, 4frames. Great. Now, if you play this, yeah, you may need to wait a little bit because this is 5 seconds and it takes some time to switch between each frame. So let's decrease the start lifetime for now to 0.5 And if you play this, as you can see, we get the flipbook animation. Let's increase the size to something crazy like 16. We will see how it is with the rest in a moment. And as you can see, yeah, it's always facing the camera. We already have fixed this in the previous lessons. We simply need to go to the render aligment and say that it's local. Now these will be perpendicular with the ground. And in this case, we can go ahead and rotate the whole particle system in the transform. We can say it's 90 degrees exactly like this. Looking good. So we are playing the flipbook. It's at the base of our explosion. It's not facing the camera. Now we can test it with a very short lifetime, like 0.1. As you can see, this is going to be fast. Let's try 0.15. 0.15 for now or maybe 0.12, something in between. So for the color, I'm going to give you my values once again. And I used 18 for the U and 74 for the saturation. This is what we have, it's very dull because we don't have intensity in our material so we can go down here. Let me just scroll back the playback time so we can see it. So let's say that this is 3 for now. Yeah, maybe 3.5. Uh, that's a little bit too bright. But we'll see how it plays with the rest. Let's do a little trick and turn On the size over lifetime so it grows only a little bit. Click on the second template and push the first key to around 0.75 or 0.70. Yeah. If we play these, it's bright. If we see it with everything else. It's quite impactful. Just slow it down the playback speed to 0.2 Yeah. As you can see, it's a little bit bigger than the shockwave. So what I'm going to do is set it to 14 in the start size. Okay. That's. That's better yet actually did this call is great because it really adds that bright feeling in the beginning and that impactful feeling that comes out really nice. Let me set the playback speed again to one. I'm just going to decrease the start size to 13. Actually, we just want this to be at the base of the explosion. Yeah. As you can see it really adds that punchy feeling. Looks really cool. So yeah, guys, that's it for this lesson. As you can see, creating a flipbook. It's not that hard in Krita. We just need a little bit of patience, and it adds a really nice touch to our explosion. What we are missing now is the aftermath of the explosion. So that's what we are going to take care in the next few lessons. For now, let's apply the changes to prefab and press Ctrl+S in our scene.
27. 3.21 - Material Maker Overview: All right. So now that we have the climax of the explosion pretty much done, it's in a good state. What we are missing here now is the aftermath of the explosion, the dissipation. And as you have seen before, we are going to leave a mark on the ground. We are going to leave a ground crack, which means we need to create the texture, a specific texture, and we could actually use Krita for that and start from scratch and draw out the ground crack and the ground impact and a few other textures that we are going to need. But there is a tool that every VFX artist should use, and it's a free version of substance designer. It's called the material maker. And personally, I think it's an awesome tool that you are going to enjoy very much. It will streamline the process and revolutionize the way you create textures for your effects. And it's fairly simple to use. So let's go straight to Google and search for material maker. You can go to their websites and as you can see, you have an awesome library of materials which you can learn from. I'm really amazed with what's possible with this software. So let's click on the download on Itch.io button. It will redirect us to Itch.io. And in here. Well, you can download it. You can make a donation if you want as well. I think it's totally worth it. Down here you have a few versions, as you can see, for different platforms. So I have downloaded the Windows version. But once you have the software, you can open it up. And this is material maker. So let's have a quick overview before we proceed to creating a ground crack texture and a few other textures we are going to need along the way. So basically this is node based and we start with this PBR material. If you are familiar with shader graph, or other node based tools. This is super similar. I think it's worth mentioning that up here you have the grid option. It's awesome. If you want to keep your materials, organize it. The notes, you can obviously increase the size of the grid, which is awesome as well. And then you have this grid mini map, which is super useful. When you have a bunch of nodes and you want to navigate around. Now, one of the most important panels here is the library where you have all of the nodes you need. And that's one way to search them by categories. We have transforms. We have noises which are so useful. We have patterns as well and shapes. And there's a bunch of things. If you click appear on the icons with left click, it will open that category. But if you click with the right click, it will hide that section. And down here we have one of the most useful windows, which is the preview 2D and the preview 3D. As you can see, the previous 2D doesn't have anything. You can change the environment here. You can even change the the mesh. In this case, it's a cube by default. But a really awesome feature is the preview 2d window. For example, you can add nodes with the right click or with spacebar. And if we add a circle, if we select, as you can see in the preview 2d window, well, we can have a preview of the selected node. And that becomes super useful when you are creating combinations, when you are blending stuff, when you are multiplying or using a power or using a voronoi, you can get a preview of the result when combining nodes. For example, if you add a noise node, you can have a preview of that noise and its resolution. But then there's another awesome thing. For example, if you connect to the Albedo input. On this bottom left corner, we have two buttons. One is for 2D preview and the other for 3D preview. 2D preview will basically set the background to whatever state the material is in. And then we have the 3D where we have the cube. You can rotate down here and it will show you how the material is looking, applied to a cube or any other mesh. It's basically the same windows we have here on the left, but the preview 2D will give you a preview of each selected note, which is super useful, for example. We can join the shape and the noise nodes by using a blend note. And if you select this blend node, now you can have a preview of what's happening there. In this case, the blend node will have several options on how to blend with multiply and overlay similarly to Photoshop or other image editing softwares like Krita. Then you have the opacity, which is the influence in this case, as you can see. In this case of the shape, you have several parameters where you can control the radius and so on. And now if you connect the blend to the albedo. 2D preview doesn't have much, but the 3D will give you exactly what's happening in the material right now. The result. For example, if you want transparency, you can connect this blend to transparency input down here and in the background, we will see the cube updated. You can also use this preview 3D panel window. So that's a quick overview of this awesome tool. You can then go to file and export your materials, as you can see in unity, blender or godot or unreal. But yeah, that's basically it we already have what we need to progress. Now you are going to learn much more when you move on to creating the ground texture.
28. 3.22 - Ground Crack - Part 1: Voronoi Nodes: So in this lesson, let's start the ground crack in material maker. By the way, you can go to file and new material or simply close and open again Material Maker. Once you have only the PR material. Well, what we are going to recreate is this kind of texture. So as you can see, we need something to procedurally generate these lines, these cracks. Right. And then another procedurally generated noise to create that distortion in the middle. And this type of lines they can be achieved with a voronoi noise. It's a super powerful type of noise that can create a lot of different effects. Oh, and by the way, last lesson I forgot to tell. You can move around by pressing the mouse wheel down and holding, and you can zoom in and zoom out while holding control and scrolling up and down. Okay. So like I was saying, the voronoi is a super useful noise texture, procedurally generated noise texture and material maker as one. In fact, it has several noise textures which I highly recommend you to check out actually if you have the time. So let's with spacebar, search for a voronoi And if we select it as you can see in the preview 2D window, that's how I like to work with the preview preview window open. This is what we have and we want to take advantage of these random lines. As you can see. We can control the scale right here in the X and in the Y, you can actually squeeze this in the Y, for example, or stretch it in the X. Let's start with 6 by 6. And then you have this randomness slider. If it's 0, they become squares, as you can see. Let's make sure it's 100 or 1. Now if we hover this output, the first one, as you can see, it says grayscale pattern based on the distance to the cell center. If we drag a line from here, we can control the black and white levels, not with the level node, but here it's called the tones node. As you can see, we get the spectrum of black and whites. If we push the first key, we are clipping the black values and the key in the middle will control the grayscale values. And the last key, well, it controls the white values, as you can see. But just by playing with this, as you have noticed, we cannot extract only the lines. So there must be another output that we can use. And there is in fact this border's output, which is a grayscale pattern based on the distance of the borders. If we connect this to the tones, that's what we get. We get the borders of the cell, but they are black. And would it be cool if we could invert this? Because that's exactly what we want. The opposite of these black values. So let's try with spacebar to search for an invert node. And here we go. We have one. The first one which is in filters. And if we select it, as you can see, that's exactly what we need to do. White lines of the voronoi cells. Now we just need to adjust the tones values. And in this case, what we want is to extract the white values. I'm only playing with the grayscale value, the key in the middle, because I'm trying to clip the excessive amount of white. I'm going to leave it around here closer to the black key, to the first key to the left. And then we can use another tones after the invert to extract exactly only the white values these lines. Basically, if we push the first key, if we clip the black values, that's exactly what we get. We get a very similar texture to a broken glass. And if you push the grayscale key to the right closer to white, as you can see, we get exactly the lines only, without the glow. But yeah, we want some glow. So let's push this key more a less to around here. Yeah. Something like this seems to be a good. We have a nice white line. That's great. But now there is another problem. As you know, the crack the ground crack that we are trying to create is in a circular shape. And this is in a square shape. So if you think about it, there's probably a transform node that can transform this well literally to a circle shape. And we have, for example, let's go to the transform dropdown menu. We have quite a few things. For example, let's use the shear just to see what it does. You can test things just like these by connecting them and then as you can see, the shear will basically tilt this. There's a mirror, there's a kaleidoscope. There's always values to play with, as you can see. Kaleidoscope is kind of crazy. But there's this one, which is the circle map. And it's exactly what we need. It has literally transformed our square image to a circle one. And you could control the radius and how many times it repeats. The square texture. Don't worry about these radial lines around our circle because we are going to mask this out. That's our next step. I just want to say that this repeat option. You can control it here. Zero. It becomes a circle if you leave it at one. You can then go to the voronoi and increase the scale, for example, and you get a different feeling. But yeah, I'm going to leave it at 6, the scale and the repetition at 2. Of the circle map. So yeah like I was saying, we need to kind of mask this out, extract only the circle and erase or hide the radial lines that we have all around our texture. The way we do it is actually very simple. We have shapes, and if we connect something to a shape, it will adapt, well, to that shape. So we have a circle shape that will be very useful to us. As we can see, it's already masking things out, but everything has become super white. So we need control. These values, not the first one. That's the sides and the circle as an infinite amount of sides. So you can leave it at 2 or 0. That's the same. As you can see, you have other shapes as well, by the way. This is really a complex software with a lot of options. It's amazing. But let's focus on the circle shape. Let's say that this value, the radius is around 1or 1.2, more a less, and then we have this fall off option. We want to leave this in a way that is faded from the center towards the outside. Like this, more or less not looks fine. And now we have the first step of the crack texture, basically, which is creating the lines of the ground crack. Now, in our next lesson, we need to subtract the center of this voronoi, which is too predominant and add a little bit of noise to this and some glow as well.
29. 3.23 - Ground Crack - Part 2: Noise Nodes: So in this second part of the ground crack texture, let's add some noise to this. And that's exactly what we are going to search, the noise keyword. And as you can see, we have quite a few and we got to use the FBM node. For example, we can set the scale to 3 by 3. And up here. In this dropdown menu, you have even more noises that you can play with. We are going to leave it at the value. Nice. Then we want to mask this out, to a shape. If we use this directly connected to a circle shape like we did before, well, this is what we get. And personally, if we were to remove this to the ground crack, it won't look that good. So let's disconnect this. And we are going to use a new node, which is from the transform section. It's called the warp node. And it does something pretty cool, which is it will warp an input according to a height map texture or according to a noise texture. So if we connect the shape and then the FBM noise, what we will get is a distortion of the shape according to the noise. As you can see, this could be already a texture that, for example, for a particle, for a beam, it's used quite a few times. But we want to, for example, increase the first value, which is the strength to 2.8, the strength of the slope, and then decrease to the minimum the epsilon, which is the offset to 0.05. As you can see, we want to get this shape, this texture. We can adjust the shape, the radius, something like 0.6 and the falloff as well. to 0.7 or 0.6, something like that. We will adjust these values when we have the whole ground texture, by the way. And now we want to go ahead and subtract this image to the ground crack, to the voronoi, that we created earlier. So with a math node, we can do exactly that. Let's connect it like this. If we select the math nodes, we can see the preview and it's exactly adding two textures to one another. Basically, we actually want the opposite. We want to remove A from B. And we actually want the opposite of this. We don't want to remove the ground crack to the FBM noise. We want the opposite. So let's switch the Voronoi to A and the FBM noise to B. And here we go. We got something very interesting. The middle of the voronoi, was super persistent and too bright. And now we eroded it. We removed something from it, we remove the noise, and it looks much better. But yeah there's a few more things we can do. For example, we can control the white values of these FBM noise. We can use the tones like we used before. There's another one I'm going to show you just out of curiosity. And we could basically clip black values, as you can see, because it was too big. We just want to remove a little bit in the middle. And then there is the tonality node, which is a curve. It's very similar to the other one, but in this case, we control a curve, the angles of this curve, if we push it like this all the way down, as you can see, we are clipping gray values and white values as well. We could obtain the same, or more a less the same result with the tones node. Yeah. By the way, you need to press okay on this curve. Otherwise it will disappear too. Will not apply the effect. And we could basically get the same thing with the tones node. But if you look closely, you'll notice that the tonality node gives us a little bit more of gray values we can adjust as well, the tones for that. And it will work well. They are very similar to each other. But when we remove, the tonality node, from the voronoi we get these, we get these nice gray noise all around the texture as you can see, while with the tones since we clip them, we don't get those values. So that's why in this case we are going to use a tonality node. Because, it doesn't clip as much the gray values and it creates this very interesting outcome. You can then obviously play with the shape of this FBM noise, the circle, the radius and the falloff, as you can see. It will yield different results. Very different results. And yeah, you can as well play with the circle map of the voronoi down here. You will get a different result with the repetition. If you play with the scale of the voronoi only in the X, you get a different feeling or only in the Y. So yeah, as you could see, this is super, hyper mega customizable. I'm going to give you my values, which is 6 by 6 for the voronoi. And then the shape here of the the circle. I'm going to leave it at 1 more or less for the radius and 0.9 for the falloff. And then we can connect this to the albedo. Now, if you go to the preview 3D window, as you can see, we don't have transparency, but to obtain it, it's actually easy. You can simply connect this last node to the transparency input and we will get only the crack. I'm going to change the environment to studio so we can have a better perception of what's happening here. And I'm also going to switch the model from a cube to a plane. And there's a little problem here because it's repeating the ground crack. And the way we can solve it is by going to this configure option and say that the UV scale is 1 by 1. Just like these. And now we get simply the ground crack texture looking very nice actually. And, well, we are pretty much done at this point. In our next lesson we are simply going to add a glow to this and then export this texture.
30. 3.24 - Ground Crack - Part 3: Glow and Export: So in this very short lesson. We are going to do the final touches of the ground crack by adding a glow. And then we are going to export this. So to add the glow to this. If you think about it, it's super simple. We already have the nodes we need to control the white values. If we select this tones node after the invert, we can easily control the amount of glow we want. But we also don't want to add too much. So what we can do is copy this node right here. Connect the invert Connect the invert And now we can control the amount of glow we want by pushing the black key a little bit back and then adjust the grayscale key, which is the one in the middle to more or less around here. And we get a nice glow, but how do we add this to what we already have. Well, we need, as well, the circle map so it becomes round. And then we also need the shape node to mask this out, we basically need the same nodes. We simply needed to adjust the tones value. Okay. So as you can see now we have some much thicker lines and we can add these and kind of give that glow sensation to our ground crack. And yeah, we also need to remove the FBM noise from this voronoi. Copy this node, the A minus B node exactly like this, but now we need to join these two together. Let me just rearrange a little bit the nodes. I could be using the grid, but it's fine. So now it's only a matter of joining these two textures. In here, we can do it with a math node with the A plus B option connected to the A, and that one to the B that one to the B And if we select it, we get a really nice glow, as you can see, maybe a little bit too much, but. The way we control the amount of glow we want, it is, in fact, very simple. If we multiply this last node. Let's switch this to A, multiply it by B, and in this case it becomes completely black because it's multiplying with 0. So we don't see anything. But if we increase the B option to around 0.8 or 0.7 and then replace the connection to the A plus B node, what we will get is an interesting glow and we can control its amount as well and even control the thickness of that glow. If we go back here to the tones note, as you can see. So it's really crazy the amount of control you have on these textures. I think it's awesome and it's powerful. Every VFX artist should use this and yeah we are done. Now it's a matter of you choosing how much glow you want and then replacing the connections to the static PBR material. Node. Replace transparency as well. And here we go. You may not notice it here, how much glow it has, but those gray values, those gray pixels around the cracks in Unity, they are going to glow. This is how it was. Only with the crack lines. And this is how it becomes with the globe. Really nice stuff. Okay, so let's export these. It's very simple. We can go up here to file. In export material, we can choose Unity 3D and then it's all a matter of choosing the location. And in my case, I'm going to rename this to Ground Crack 04 because it's the fourth ground ground crack texture I have in this folder and press okay. If you navigate towards that folder, you will notice that material maker as that this as an albedo. If we were to connect more stuff to the normal input, to the metallic input, it would also export those textures as the metallic, as the normal map, as the ambient occlusion map. So that's what we get. We can do it. This method file. We don't need it, by the way. Exactly. Now, yeah, if we open this up, you get a really nice texture, awesome stuff. Let's import this to unity. And then turn on alpha is transparency and apply the changes. And that's it for this lesson. In our next lesson, we are going to see how to apply this to our ground crack and use the erosion and then use another trick, which is the parallax occlusion.
31. 3.25 - Ground Crack Particle System: So let's apply this ground crack texture to a particle system and see how it goes with the rest of the explosion. So let's start by duplicating the Beam01 material and renaming it to GroundCrack04 in my case. And then drag and drop the texture to the main texture slot just like this. And then with right click. Let's go ahead and create the particle system in effect. Far the ground crack Add, which is additive because we are going to create one bright and then leave a mark on the ground (Alpha Blend). Let's turn off looping. We don't want this to move. So start speed at 0, and shape turned off. And as usual, no rate over time, but a burst of one particle. Great. So let's go ahead and assign the material to the ground crack 04. As you can see, it's facing the camera. We could, in the render mode, use an horizontal billboard as a you can see, it snaps to the ground. But let's do it like we did before. Render mode at billboard and the render alignment to local so it doesn't face the camera and then we can rotate it up here -90 degrees as you can see it disappears. But if it's 90 degrees, it's visible. So that's only happening because of the shader. Let's leave it at -90 degrees in the X and go to the ground crack 04 material and say that the render face is both so it renders the front and the back face. It's basically two sided. Great. Let's increase these. Something like 7. Yeah, maybe we'll see. And then yeah choose an orange, just look how awesome it is A really nice result thanks to material maker. So start lifetime 4.5 so we can see it after the explosion for a little while. And let's erod this away. Let's turn on custom vertex streams. If you remember correctly, we need the UV2 stream and the custom1.xyzw custom1.xyzw stream Then we can turn On custom data and say it's a vector. And we have the simple particle shader selected, but it's not possible to control it with custom vertex streams. And in a moment, we are going to create parallax shader But for now, let's go ahead down here and change this shader to the erosion text shader. And now we can say that this curve up here. It goes from 0 to 1. Edit last key. Edit last key. Say it's one the value. I'm going to push the handle of the last key like this. So it erodes away faster towards the end. And if we test this out, it doesn't do nothing. That's right. Because in the material we need to turn on alpha clipping. And once we do it, as you can see, it erodes away. That's okay for now, obviously. Let's now create another particle system, which is one that's going to leave a black mark on the ground. You can duplicate with Ctrl+D Call it AB, which is alpha blended. Change the color to black, start color. And start life increase it to 5.2, for example. Start size is going to be the same. Pretty much everything is going to be the same except down here. We need to duplicate this material, for example, ground crack 04 AB, because now in the blending mode, we want to say it's alpha and we want to decrease the intensity to 0. Just like this. Great. Let's drag and drop this material to the ground. Crack AB particle system. Play both, and yeah it dissolves way too fast. We could, for example, say the ground crack additive is 4 seconds and the ground crack alpha blended is 6 seconds, for example. This way we create an offset between each other. Takes more time to dissolve the alpha blended . Or. We can actually do a Ctrl+Z, leave the lifetime as it was. Then down here in custom data of the ground crack AB We can push the first key. to around 0.5. And adjust the handle of the last key and his way. If you play both, it takes much more time to dissolve the alpha blended. But as you can see, this is kind of flat. It doesn't have any depth. And we want the shader, a very special shader, which is a parallax occlusion shader. I never did one in my channel. Where we are going to fake that depth. And it's going to add a really nice detail to this ground crack. So that's what we are going to do in our next lesson.
32. 3.26 - Parallax Occlusion Shader: So let's give it a depth feeling to this ground crack. And it's a technique known as the Parallax Occlusion. And for that, we can use a shader. With one texture so we can create depth. So right click in the shaders folder and in shader graph. Create a blank shader graph that we can rename to parallax occlusion, two Ls and two Cs. So double click to open it up. And as usual in the graph inspector, we want to tell it the Target, in this case, Universal. Let's allow a material override. So in the inspector we can control all of these properties. And let's already turn On alpha clipping so we can still erode this away because we are going to erode this away. Still, we could adapt other shades for this, but in a learning perspective, this is way better. So we are going to use the usual setup this way. You also practice creating new shaders which is great for you color property in HDR mode with white and alpha at 100 for the default color. And then we need the main texture. So texture2d the property. And well as usual, we need to sample the main texture and multiply it with the color. And if we want to influence the color of this via the particle system, we need the vertex color. We can multiply this two. Let's actually assign the ground crack to the main texture. Exactly. So you can see something. But this time it's different. This that we created right here is only for the alpha. So let's split it and use this alpha channel to connect to the alpha down here. We get a nice preview of something, as you can see, the alpha clips already clipping. And since we want to control that via the particle system, we want to use custom vertex streams. So we need the UV node with the channel set to UV1. And then we can split these and say that the R channel is going to control the alpha clip threshold just like we did previously. But the main big difference here is that we want to add depth to this with one texture. And for that, we can use a parallax node. You can search for Parallax. And you will have two. We want the parallax occlusion mapping. It has several inputs. Yes, it's true. And you can do a few things. But the main input we need to worry about is the height map. In this case, it requires a texture. So let's create a texture for that. You can rename it to height map. Well, the texture, it's going to be the same in this case. But theoretically, you could use a different texture with different white and gray values to create different feelings. But for this, it's fine. And this can be connected to the height map and this parallax occlusion map. The cool thing is that it outputs a parallax UV, so it means that we can connect this to, for example, the main texture. Yes, it's kind of weird, but this will control UVs of the main texture and give that depth sensation. So let's sample the main texture and connect this to the UV input. If you connect this directly to the base color, we will see the changes immediately. And it's awesome because we can have that depth feeling as you can see. Really cool. You can switch this to a quad. And if you go back to the parallax occlusion mapping node. We actually have this amplitude that if we increase, we have more depth. So that's the value that we want to control in the inspector. Let's create a property for that. Parallax amplitude, for example. But with a default value of 1. Connect it here. But we also want to add color to this. Right. As you can see, if you play with the color, the only thing that happens is the alpha, that influences, because that's the only thing we connected. Now up here, we need to do pretty much the same, which is a color and a vertex color node. And to multiply nodes and multiply it like this, it's the same setup. Then connect the base color. By the way, there different ways to go about this. But this way it's fine, now we can create a group of these. Actually, by the way, down here, group selection, we can call it parallax occlusion. If you want to have your shader graphs more organized, that's a cool thing to do. Right. So now the only thing we need to do after we press the save us. Button. In the shader is to switch the shader of the ground crack material to parallax occlusion. As well as the AB version. To parallax occlusion We don't need to do pretty much anything else. If we test this out, we will have out of the box some parallax occlusion. We just need to make a few adjustments now. And one of the things that I noticed is that we probably only need one of these particle systems. Actually, let me just stop the ground crack AB ground crack AB And now we the ground crack additive selected, as you can see, it is not perfect. And that's mostly happening because down here in the blending mode, we have additive if we switch this to Alpha. We get the full effect, much more interesting and it looks great. So basically from here we can do the whole ground crack effect. For example, let's copy the start color with right-click, turn On color over lifetime and paste the start color to this color right here. And for the last key, we can select black. Now let's push it to more or less 66%, two thirds, and I'll set to the start color to white. And then down here for the erosion curve. And now with right-click on the first key. We can say the time is 0.7, for example, and then adjust the last key, the angle, so it becomes like this. This way it only dissolves like really towards the end of the lifetime. And if we play this, as you can see, it's bright in the beginning, then it switch to black and then it erodes away. Very interesting effect we get. There's a couple of adjustments that we can do. For example, let's increase the intensity to 7 or 7.5 So we have these really bright colors in the beginning and they look awesome. Exactly. And then in the color over lifetime, the first key, we can push it to more a less 20% to 50% 50% So it holds on to that color for a little bit longer instead of starting to fade away at the beginning. And then, well, we need this to live a little bit longer. For example, 5.5 for the lifetime should do the trick. And yeah, as you can see, it's looking pretty cool. Let's just rename this to Ground Crack and the Ground Crack AB we can delete it. I'm going to remove it in a moment. For now, if we test this out with everything. As you can see, it looks awesome. I think the ground crack is a little bit too big, but we will probably adjust it in the next lessons. Other than that, I think it turned out great and we have ourselves a ground crack with some depth thanks to the parallax occlusion shader. Right. So don't forget to apply the changes to the prefab and save your scene. Because in our next lesson we are going to practice a little bit more material maker and create a ground impact texture.
33. 3.27 - Ground Impact Texture: So as you can see, we have a beautiful ground crack, but it's still a little bit too alone. We need to add some burn marks around it to complement the whole idea. And once again, for that, we are going to use material maker. It's super useful and it's a great way for you to practice a few more things. So let's go ahead and create a new material. And once again, we are going to use the voronoi noise. It's quite useful. And since we already know we want this to be in a circle shape, let's connect this to a circle map and it will transform this to a circle shape. But this time let's increase the X, let's stretch these in the X, to something like 28, for example. As you can see, it's super stretched, and we can increase the intensity to around 1.2 or 1.4 along those values. So it becomes a little bit brighter from here now, just like we did before, we want to mask this out. So, we are going to use a circle shape just like we did previously. And we want to increase this falloff the last value to around 0.7. And then the is could be 1 or 1.2. No problem. But in between this, there's something that we can do which is add a blur so it doesn't have that crispy look. You know, it's a burnt mark on the ground. It should be a little bit blurred. So let's connect this to a Gaussian Blur and increase the grid size to 2048 by 2048. And the sigma, which is basically the amount of blur, we can leave it between 30 and 40. And as you can see it blurs this out. It looks like a bloodstain in some way. Awesome. Looking good. But, this on its own, it won't look much like a burnt mark on the ground. We need something that really captures the impact feeling of the explosion. Basically we need some stretched lines in a circular shape. So for that, we can use another noise. This time the value noise. And let's already connect to the Circle Map. We want this to be circular. And to get the stretchered lines, we can increase the scale X to 30. And then decrease the scale Y to 2 or even 1. And as you can see, we get some really nice stretched lines, greyscaled. If we increase the iterations, we basically get a more detailed noise texture. Let's set it to eight or ten more a less. And yeah, as you can see the circle map, we can increase the repeat to 2. So we can have a little bit more rays. And that looks nice. And there is actually another way to mask things out, for example. You could use a gradient. We can control the direction of the gradient. And if you hold control, you can even snap it to 15, 30, 45 degrees and so on. The way we mix these two together is with a blend node. As you can see. Well, we are using the normal blending mode, but this one doesn't work any way for our specific case because it's circular. So we want the radial gradient. And the nice thing about the radial gradient is, for example, let's say that these keys around 0.3 0.3 and then. The last key. It's going to be black. Exactly like this. And if you connect it to the source 1 of the blend. And change the blend mode to multiply. As you can see, it's masking our noise. Great. Just push these keys to more or less around here. We have a very bright edge in our radial gradient because of this curve right here. If we change to the last one, for example, it becomes smoother. That's nice. That's better. And the nice thing with this technique is you can control the mask with these radial gradients and that's awesome because it can do some pretty nice tricks. For example, in our case, it's blending nicely, but if we switched this curve to the third one, we get a much smoother gradient, as you can see, much better. Right. So let's join thistwo, the voronoi and the value noise with another blend node. Connect it like this. And switch it to a multiply, blending mode. And for example, now we can control the amount. We want this to blend. And 0.7 is a good value for what we are creating. There's another cool thing that you can do after the blend down here. You can connect this to a power node which is inside a math node. Here it is the pow value and for the B option, for example, if you increase it, you will get less and less white values. That kind of adds a different feeling to the whole thing. Yeah. I'm going to leave it at the round 1.2, more or less. And if we go to the preview 3D, yeah, we don't have anything, let's connect this to the albedo and then connect it to the transparency. And here we go. It's looking very nice as you can see, similar to a burnt mark on the ground of an explosion. That's what we need at this point. Great. So let's save this file. I'm going to call it the ground impact01 Press save and then we can export this. Let's select Unity 3D and, well, rename it to pretty much the same name, which is Ground Impact 01 and then press save. Great. We get the albedo and it's looking very, very nice. Let's import this texture to unity. And turn On Alpha is Transparency and then press apply. In our next lesson, well, we are going to use this with a particle system and adjust it to the whole effect.
34. 3.28 - Ground Impact Particle System: All right. So let's apply these to the whole effect, to the explosion. We can start by duplicating with Ctrl+D Ctrl+D the ground crack We can rename it to ground mark. And then duplicate the Beam01 material and rename it to GroundImpact01. Yeah, I could have renamed the particle system to ground impact to0. Let's set the intensity to 0and change the blending mode to alpha. And drag and drop this to the ground, mark. Just going to add an AB in front of this. Rename this to Ground Impact and then drag and drop the material. If we test this out, nothing happens. Because, let's set the start color to black, by the way, turn off color over lifetime, turn off custom vertex streams and custom data because this shader doesn't have it. And oh yeah, down here in the material, we need to say that the render face is both. And here we go. Nice looking. Very good. That came out really good. Okay, so we need to fade this out towards the end, so let's remove this key. Last key Alpha at 0, and then we can drag this to more or less around 66%, more or less. And yeah, it fades out towards the end. Great. Now, if you play both of these together, the ground crack and the ground impact, what we get is this. The ground crack, in my opinion, should be smaller. I'm going to set it to 6and the ground impact. to 8 or 8.5 Let's see. Yeah. This needs to be much bigger. If you play everything together, it looks nice, but the ground crack is still a little bit too big, so. And I think it should live less like 5 seconds. For example. Let's see how that goes. Yeah. Ground impact. I'm going to say it's 8.5. I think it should be even bigger. Okay, that's starting to look nice. Okay. Yeah, we are having a better proportion of everything. Let's actually add random rotation every time this spawns. We can select the ground crack and the ground impact and in start rotation we can say is random between 360 and -360. This way it's always random. Yeah. If we play everything together, it looks very cool. Just going to set the ground impact to 9.5 and I think that's it. Yeah. Okay. That's a good size. Let's actually add an additive ground impact. So let's duplicate with Ctrl+D and rename this to underscore additive and the other one to underscore alpha blended a bit. The material, we can duplicate it as well. The ground impact 01 say it's additive. And drag and drop to the ground impact additive. I'm going to copy this color from the color of the lifetime of the ground crack. And based it to the start color of the ground impact. And yeah, we just want a little bit of this. Not that much. Decrease the size to six and see how it goes. Yeah. Nice. Maybe increase the intensity of the color of the material to 2.5, for example. Yeah. I'm going to test it with 3.5 So yeah, it's still too visible and I think it should fade a little bit sooner. So I'm going to decrease the lifetime to 4. And in the color over lifetime, I'm going to push this key more or less to around here. So it starts fading slowly. Exactly. And the intensity. We can say it's 2. Yeah. Perfect. Looking very good. Everything fits very well with each other. It doesn't attract too much attention. And the whole explosion. Now it's starting to look a little bit more composed. We have an aftermath. All right. In the next lesson, we are going to add the now the ground impact. It's very simple now to create variations out of the material we have in material maker. So that's what we are going to do and add a little bit of glow to the ground as well.
35. 3.29 - Ground Impact Variations: So let's have a look. On how we can create quick variations from this ground impact. So if we don't want to mess this up, what we can do is go to the folder where we saved this material. Press Ctrl+C then Ctrl+V We created a duplicate and now we can rename it to Ground Impact 02, for example, and drag and drop to the material maker. Otherwise it will open another material maker, as you can see. Okay, now we are free to do whatever we want to this. For example, I'm going to decrease the scale X of the value noise value noise So we don't get too many rays to around 19, even less probably, and then increase a little bit the voronoi scale to 32 in the X. And I want to make this Voronoi a little bit more visible. So I'm gonna go to the shape and increase a little bit the radius. And decrease the falloff. And then in this power node that we have here, I'm going to increase it to around 2 maybe around 1.75 so it dissolves away the value noise value noise Okay. And I think that's pretty much it for the blend. I'm going to set it to 0.82 So we get a little bit more of the voronoi and that's it. We can export this unity 3D. Rename this Ground Impact 02, for example, and we have created ourselves another variation of the ground impact. You can obviously play a lot more than we did. You can create new nodes and test new things. That's how you learn, you know, by testing out trial and error to learn new stuff. All right, so let's drag and drop this to our textures folder, turn on alpha is transparency. And then duplicate the ground impact alpha blended the two in different. And for the material we can duplicate this one. Rename this to Ground Impact 02 underscore AB. And then drag and drop the texture that we just created like this and assign this to the ground impact AB 2, and let's see how it goes. So yeah, this one is a little bit more dissolved because I have increased the power node. That's fine. Totally fine. I'm actually going to make the voronoi even more visible by increasing the blend to 0.9. Increase a little bit the radius of the shape. The falloff can be the same, but I'm also going to increase the blur to around 50. And then I'm going to export this and replace the current material ground impact 02. And in this case, we need to copy this ground impact 02 albedo Go to our textures folder to our project. And replace it directly. Exactly. And. Yeah. Nice. This one looks different and we can see the voronoi more clearly. Great. If we combine these two together, yeah, we need to increase the AB 2 to something like 13, for example. Yeah. Really nice. As you can see, it's almost all around the ground impact 01. But in this case I'm going to decrease the alpha to around 70 if we test this out. It looks very nice, very, very nice. Really pleased with this. But I'm going to decrease the alpha of the ground impact AB 2 to 50. And yeah, if we test all of these. This is what we have right now. Looking awesome. I'm just noticing that it would look better if we add a little glow to the ground because it was an explosion and we see the ground impact and the ground crack additive. But a little glow to this would look awesome. So let's duplicate, for example. The ground impact additive and rename it to ground glow and then we want to duplicate the beam01 Because it's super bright, this one, and let's call this one the less bright, for example, and say the intensity is one. And then drag and drop it to our ground glow ground glow And yeah, it's a bit too bright. What we can do is actually decrease the value of this orange to around 30 or 40. Yeah, that's better. Way better. Now, let's increase the size to not 83, but to 9. Yeah, let's try it out with 9. Yeah. Really nice. I'm going to decrease the lifetime of these to 2.5 something a little bit faster and adjust the value a little bit. Okay. Okay, okay. Yeah, I think it turned out great. We have a little bit of glow on the ground. We are also going to add lights to this. So yeah, it's going to complement the whole effect, the whole idea and with a light, it's also going to make the explosion even brighter. So we will see how it goes. For now, let's apply the changes to the prefab and press Ctrl+S. And in our next lesson, we are going to keep on working on the aftermath of the explosion. We are going to add some floating particles and a few more things as well.
36. 3.30 - Floating Particles on Ground Crack: So on this very short lesson, we are going to add some floating particles above the ground crack. We are basically still improving the aftermath, the dissipation of our explosion. The idea is to have some particles floating after the explosion. And since we already have a particle system that pretty much does exactly that, the particles floating, we can start by duplicating this one. But in this case, rename it particles floating crack so we can distinguish them. So one of the major changes it's going to have is, a start delay. If you set it to 2, it will wait 2 seconds until it plays the particle system. Great. Another major difference is if we want this to be closer to the ground, we need to decrease a little bit the start speed. Something between 0.2 and 0.6, and then we got the velocity over lifetime, which also well influences the velocity. And in here we can say that X and Y it's going to be between 0.5 and -0.5. And in the Z, the axis that controls vertically, the particles motion we can decrease the minimum to 0.2 and the maximum to 1.5. And if we test this, well, that's what we get. The spiral motion comes from this orbital x, which we can say it is between 0 and 0.2. Let me just remove the start delay so we can see this immediately as soon as I press play. Okay. Yeah. The shape. I think it's way too big. The radius, the hemisphere. So, let's try 2 and the radius thickness 1. So it spawns in all of the volume of this sphere. Oh and in terms of bursts we want less, something between ten and 15 should be enough. It's a little detail that we are adding to the ground crack. Right, that looks great. You see, it's always going up and it never stops. And I think with the limit velocity over lifetime module, we could improve this. For example, the speed we can say it's 0.7, it could be less and the damping could be 0.15. Other than that I think we can increase the start lifetime to 3 the maximum. And that's pretty much it. If we play everything together. Oh, yeah. We need the start delay. Let's try 2. Okay. That's way too much. So maybe 1 second. Okay. That's much better. I'm going to try 1.5 and yeah, I don't think it works. 1.5. So. 1.2. I'm also noticing that the radius of the shape, it could be smaller, like 1.8. Yeah, as long as it isn't bigger than the ground crack. Okay. Let's set the start delay to 1.1 And I think that's pretty much it for this short lesson in our next one, we are going to add something very cool. And you can do a bunch of things with this technique, which is adding smoke coming out of the ground crack.
37. 3.31 - Smoke Trail Mesh: All right. So in this lesson, we are going to add smoke coming out of the ground crack. But we need a mesh. And every time we need a mesh, we are going to use blender right, because it's free and it's awesome. So let's open up the blender file with all the meshes we created, which was only two. Let's hide the ring 01 And we can start by adding we Shift+A a plane. In this case, we want to rotate these 90 degrees in the x axis. You can press R and an X to lock it into the x. And then scale this down in the X to more a less 0.3. Now let's model this a little bit. We want this to be curvy. Arched. So for that, let's enter in edit mode with tab And with Ctrl+R we can add to edge loops and then press enter. Right. So let's select with B these two vertices up here. And now if we press O we turn on proportional editing and you can scroll up and down to control the radius of the influence and we want to push this only in the Y axis with G, something like this. A very tiny amount, not too much. And then still with the proportional editing on, we want to scale this in the X axis more a less. 1.5. Seems like a good value. I'm also going to scale with a much smaller radius of influence. These two vertices like this. And yeah, that's pretty much it. I'm just going to push it a little bit in the Y. So it becomes a little bit more arched. And we are good to go. Let's take care of the pivot. Let's select these two vertices down here and then with Shift+S we want to say cursor to selected. Now let's go to object mode by pressing Tab and we Shift+Ctrl+Alt+C We want to set the origin to the 3D cursor. This way we can scale this up and down from the bottom of this mesh. Right. So let's rename this to Smoke Plane 01 And as you can see, if we go to the UVs, we have these two vertices in the bottom part of the UV area, which is correct. But in our case, it's going to be a little bit more useful if this would be a horizontal, because we are going to create a texture for this and it is easier, well, to create it horizontally. So let's rotate this. Let's select all of these with A. And rotate 90 degrees with R, we want the bottom vertices to be on the left side in the UV area. Just like this. Okay. Once you have arrived at this point, well, you can try to use a shade smooth. Just like this. And then we want to apply with Ctrl+A all of the transforms, the location of rotation and scale, just to make sure that this goes exactly like this to Unity. Now, up here we can export this. Oh, and I have noticed that the pivot goes back to the world origin. So in the object mode we can do again a Shift+Ctrl+Alt+C and select origin to 3D cursor. Okay. So we are good to go. We have the smoke mesh. The smoke plane. Let's export this in file FBX. Let's navigate to the models folder. Rename this to Smoke PLace 01 and turn on selected objects and then press export fbx Now, if we go back to unity, let's set this up in Unity. Well, first, we need to select the mesh and say that the scale factor is 100. Otherwise, it will be too small. And. Well, the idea. Let me play just the ground crack so you can see these in action. Well, the idea is to add 3 or 4 smoke meshes coming out of the biggest ground cracks we have. So let's start from scratch and add a new particle system. We can rename it to smoke and we want to rotate this -90 degrees in the x. And well, as usual, we don't want this to loop and we don't want this to move. So start speed at 0 shape, we can also turn it off, otherwise it doesn't spawn in the same position and for the emission no rate over time, but a burst with one particle instead. And then yeah we need a mesh down here in the render mode. Let's select our smoke place mesh. And for now let's add the beam 01 less bright as the material. Just to test things out. And well, if you play these. Yeah. We don't see anything if this happens to you. You can always go up here in the shading mode and turn on shaded wireframe this way. Well, you could see if the mesh was being rendered or most likely. Our shader is only rendering when face and the back face is facing the camera. So we don't see anything. Well, in this case we can say the render alignment. It's local. And here we go. We can see this in action. And even though we have random rotation in the ground crack, which I noticed now that we need to turn off, let's, for example, drag this smoke, mesh the particle system and align it with one of these ground cracks. And for now we can duplicate the beam. beam 01 less bright. And call it the smoke trails 01 smoke trails 01 And well, in this case, the simple particle shader will not do, because we need to scroll this and do a few more things. So let's use the erosion texture shader. For example, the idea is to say that we want this to scroll -1 or much lesser in the main tex speed and then drag and drop this to our smoke. And well, with a proper texture, this will look great. For example, we actually have the impact 02 texture. Which is kind of tripping a little bit, but let me just rotate this properly. Okay. And this is going to be scrolling much slower, like -0 25, for example. But yeah, we need to make a few adjustments to the shader and we also need a different texture. So in our next lesson, let's first start by making those adjustments to the shader and then we will place a few more smokes around our crack.
38. 3.32 - Erosion Texture Shader - Mask: So let's improve this shader a little bit more so we can create a nice smoke coming out of the crack and in our shader. We actually already have something that we can play with, which is the tiling of the main texture. If we decrease it to 0.5, as you can see, we get a different feeling from this texture, or 0.2, for example. Yeah, so that's quite useful to know. Let's also adjust the color set the intensity to 0 of this shader. And I'm going to push this too gray more or less like this. Yeah. Look at this. Nice smoke already. So we are going to see also a few difference between the alpha and the additive versions and how to deal with them. For now, the improvements we need in our shader is, for example, a mask. We need to mask these out, so we don't see that cut up there. And we can press edit right here. And you will open this shader, which is the erosion texture shader, by the way. Do not mistake it. And, well, the first thing we need to locate in our shader is our main texture, because that's what we are going to mask. So it's right here. And then we can create a texture2d, call it mask. And do you guys remember what we do when we have a texture? Exactly we need to sample it. So let's use a sample texture2d. And the way we mask the main texture is by multiplying these two together. Let me push this to the front a little bit and then replace this connection right here. We have a connection to the Alpha. That's no problem. We can split the result of the mask and the main texture and use this A channel which is the alpha. And that's it. And yeah, now we need the mask texture. So let's go to Krita. And actually for this one, we can use the file with 1024 by 1024. It doesn't need to be too big, these gradients, the mask that we are going to create is basically a gradient, by the way. Right. So make sure you have a black background and an empty layer. And like I said, we are going to create the gradient, basically. So let's pick the gradient tool and up here in the fill gradient. Well, we have a bunch of them already done. Let's start from scratch and let's press this add button down here. You can rename it, for example, to white to black. And that's exactly the idea we want here. The first key is going to be white. And last key, black. And that's it. You can press. Okay. Now to use this gradient, we want to go almost to the extremity on the left first. And if you don't hold shift, as you can see, the gradient is crooked, it's tilted. So make sure to hold shift, drag, and if you drag to earlier, you will have too much black space at the end. Black space means it doesn't render the main texture. Let's start from scratch. Hold shift to create a straight gradient and then go almost to the extremity. And that's it. We have now a mask that we can use. We can now go to file, in export. Navigate to our texture folder in our project. Choose PNG for the type and well, I'm going to rename this to gradient horizontal 01. We are going to create a few more, so you can see how things work. Now back to Unity. The first thing we can do is actually save this shader, don't forget to save it, because now in our scene, if you go to our smoke material. You can already assign the gradient we created to the mask. And when you look at that, it's almost perfect. We have a cut up here, that's simple to fix. Every time you see something like that, an artifact. You probably need to select the texture, in this case, the gradient. And in wrap mode. We want this to be clamped so it doesn't repeat the texture. And if you apply, there you go. We have now masked the main text and we have a nice fade towards black. Looks awesome. Really cool. So that was first. Share the improvement to create a mask so it can mask things out. And in the next lesson, we are going to do the second improvement, which is creating a distortion to the main texture.
39. 3.33 - Erosion Texture Shader - Distortion: So when it comes to smoke, it's always nice to have a little bit of distortion to the main texture and it's not that hard to do it. So by the way, I actually noticed that I set the color of the material to gray, but don't do it, set it to white. And then up here in the start color is where you can choose the color. All right. So let's go back to the erosion texture to shader. And we want the distortion to be applied to the main texture. Right. So, everything is going to happen before all of this. It's going to happen right here. As you can see, we have a UV input for the tiling and offset and this UV input. It's literally do UV node basically. If you connect it. Nothing will change. It's the same. And the distortion happens when we change how the UV is mapped, how the main texture UVs are mapped. So that's how you create a distortion. We are going to add something to these normal UVs and the something that we are going to add in this case. It's a simple noise. You can set it to 20 more or less scale for now, connect to the add and replace connection to the UV. And as you can see, the main texture gets completely distorted. We don't even recognize it. So now we actually need something to control the amount of distortion we want and that something is a lerp node. a lerp node. As you can see, the T value will blend between A and B. Once T value is closer to 1, which is B and 1 is white, it becomes white. Once the T value is closer to A, which is zero. It becomes black because 0 is black and 1 is white, and all the values in between are grey values. So in this case, the A option is for the UVs without distortion. Basically the UV node and the B option is for the UVs totally distorted. If you connect this to the UVs, nothing changes. And the T option now will control how much distortion we want. So let's create a float for that because that's super useful. You can call it the distortion amount. It's going to be a slider between 0 and 1, but it could be between -1 and 1. And actually, 1 is a lot of distortion between -0.2 -0.2 and 0.2 would be enough. Connect it to the T value of the Lerp. Yeah. As you can see, we can play here with the value and if we go to negative values, we also get distortion. I think something above 0.3 is way too much or below -0.3 But let's leave it as it is. And then we can create a few more things. For example, we want to control the scale of the simple noise. So let's create a distortion scale the float for that. And we can already create a vector2 for the distortion speed. We want to animate this simple noise, which is, in other words, animating the distortion. And every time we need to animate something, well, we need to time node, probably, right, and we can multiply these two together. And now we are missing one node, very crucial node, which is the tiling and offset node. Oh, by the way, let's connect to the distortion scale. Set the value to 20. Okay. Like this. Yeah. So for the UVs tiling and offset, because the offset part will allow us to control how it scrolls. The tiling we basically control how many times it repeats itself in the X or in the Y. Yeah. So let's connect to offset. It's scrolling. And well, since we have the tiling option, let's create a vector 2 for that as well. Why not? Make sure the default value is 1,1 of the distortion tiling the vector2. Exactly. And that's it we can save now. And test things out. Actually, if you want, you can organize your shaders. For example, select all of these nodes right here, right click and group selection or Ctrl+G And this is for the distortion, for example. This part right here. These nodes are the main text. Up here we have the mask. And all of these represents the color. The color set up. Oh, and down here we have. Well, the erosion via the custom streams. Right. It gets really well organized. And maybe it's easier for you in the future to revisit this shader. Right. Let's save it. And now. Well, now we can play a lot with this. And now if we increase the distortion amount, well, we get that. As you can see, it's cutting our main texture because the distortion is too much. So, yeah, I'm going to leave it at 0.1 for now. We can also increase the distortion speed to -0.5. A little bit faster than the main tex speed main tex speed. Could be faster. -1, for example. A little bit more of distortion and what not. We will see in our next lesson, because in our next lesson, we are going to make a few more tests and then spread a few smokes around our crack.
40. 3.34 - Smoke Trail Improvements: Okay. So before we proceed to make some smoke improvements, as you can see, we have random rotation in our ground crack. And if we are trying to add smoke to these ground cracks, well, we need to say the rotation is constant. So let's do that and say it's 0 or 360 You can use any angle as long as you don't change it. So you can place the smoke in the right position. And yes, now we need to reposition our smoke, going to place more or less around here in this bright crack just like this. By the way, you can scale this in the X or in the Y or in the Z or in all of the axis. As you wish. Obviously. So the first thing I'm noticing is that our mask doesn't mask everything else. As you can see, we have some artifacts all around our mesh. So let's improve the mask, the gradient. Let's go back to Krita. Let's add a new layer. And the idea now is to select the gradient tool once again. But this time we need a new gradient. In this new gradient, the first key is going to be white. The opacity is 0. And the last key that one is important needs to be black. So it goes from transparent to black, because what we are going to do now is from more a less around here while holding Shift we can go to the top of our texture in this new layer. By the way, don't forget to select new gradient that we created so we can have these type of gradient. Cool. Now let's duplicate this layer. Select the cursor and press Ctrl+T so we can rotate this 180 degrees. You can hold Shift to rotate this properly. Make sure it doesn't go below the texture area. And here we go. We have a proper texture to mask everything that we don't want to show. Great. So let's export this as a PNG. I'm going to call it the gradient horizontal 02 And I'm going to bump this distortion amount value. And then assign the new texture we just created. And as you can see, the extremities of the mesh are masked out. By the way, let's say this gradient horizontal is clamp the wrap mode and apply. So yeah, here's the difference. As you can see, we are masking the extremities and the top part of our smoke mesh. We are only showing the most interesting parts and fading out the parts that don't look good. But yeah, like I said previously, I think the distortion amount shouldn't go above 0.3 or 0.25. I'm going to leave it for now at around 0.2. I'm going to decrease it later. The distortion speed is actually a little bit too fast. -0.5 seems to be better. And the tiling 0.6. We'll see how it goes. And if we wanted to make a dark smoke, a black smoke, actually, and set the start color to black, as you can see, this is becoming more and more transparent because we are using the additive blending mode. If we wanna switch this to alpha mode, as you can see, it renders the mask. So let's see how to fix that with a new gradient. It's actually fairly easy. I'm going to add these layers and create a new gradient, but this time the first key needs to be white. With 100th of opacity. And the last key also needs to be white, but with 0 opacity. And now in a new layer, I'm gonna go and do the same thing, which is more or less around here. While holding shift, I'm going to drag to the extremity of the right and then hide the black background. That's very important because as you can see, it goes from white to transparent. So let's export this as a PNG. I'm going to call it the 03 And in Unity, I'm going to say that alpha is transparency and the wrap mode is clamp and apply. Now we can test this with our shader. Great. Looking good now. Yeah. We can have a black smoke. Because we are using alpha mode. Great! But yeah, the distortion amount, in case you want it to be high, you will get some artifacts. So we kind of need to create the same gradients that we have created previously where we fade the borders. But this time, instead of using a gradient, we can simply go ahead and use the selection tool. Make a square more or less of this size, I'm basically following the squares that we see in the back of the transparency. And then we can go to select so we can choose a feather selection of. 25 radius. And now you can press delete. And here we go. Let's do the same for the bottom part of this texture. Selection, We can push it down. As you can see, we can move it, more a less a square and a little bit down here in this position, we want to press delete once again and here we go. We are ready to export the four gradient horizontal as a PNG. Let's do the same thing, which is alpha is transparency set the wrap mode to clamp, press apply. And now if we assign this to our mask in the material of the smoke, as you can see, it fades those artifacts. And it looks very nice. All right. So we have seen how to use the blending mode in additive and in alpha and how to adapt the masks. So it only renders what we want, so it only shows what we want. Now my final values are pretty much 10 for the scale, 0.18 for the distortion amount tiling at around 0.4 and maybe the distortion speed -0.8 and that's for now let's see if we don't make any changes later. We are pretty much done now. And yes, in our next lesson, we are definitely going to place a few more smokes around the ground crack and adapt the timing as well.
41. 3.35 - Smoke Trail Placements: So in this lesson let's place a few more smokes all around our ground crack. Now that we have the shader ready and the smoke is looking good, we can finally do that. So let's select the smoke particle system and press Ctrl+D to duplicate it. And in this case, now you'll want to find the best cracks, the ones that are brighter, because that's probably where the smoke would come out. Obviously, we are not going to put smoke in every crack, but a few like 5 or 6 should be enough. So what I'm going to do now is place one right here and you can obviously scale this down in the X, Y or Z or in all of the axes. I'm also noticing that, well, the distortion amount is too high, so I'm going to set it to 0.1 As you have guessed by now, this requires quite a few adjustments along the time. That's normal. And in the main text tiling, I'm actually testing with 0.8 for the Y, so it isn't closer to the border. You could as well use the offset for that. And for example, this smoke right here, it could be taller in the Z axis and in the Y as well. We want to create different scales for each smoke. It will add a really nice touch to this. And for the first smoke, I'm going to still duplicate the original smoke. I'm going to place the third smoke trail around here. This one, I'm going to rotate it in the opposite direction. And I'm going to make it a little bit smaller. Something like this seems good. And for the fourth smoke. I'm going to try. More or less. Well. More or less around here. Yeah. And I'm going to create a fifth smoke as well, duplicate the last one and place it closer to the middle. I don't have any in the central area and that would definitely add a nice touch. Once you have placed 4 or 5, 6 smoke trails around your ground crack, you can go ahead and select all of the ground elements, basically the ground crack, the ground impact the glow and play this just to see if it looks nice. For example, the first thing that I'm noticing is that the lifetime of the smoke is way too big. So I'm going to select the 5 smokes. And say the start lifetime is between 2.5 and 3.5. Yeah, that seems to fit a little bit better with the ground crack. And just out of curiosity, if you select the smokes in the material, you can turn on alpha clipping. The shader is adapted to work with alpha clipping. In this case, you would need to turn on custom data, select vector, for example. And down here in custom vertex streams, we would need to add the UV2 which is the channel of the UV node and a custom1.x, y, z, w stream so we can control it up here in the X and well, basically this means that we could animate the alpha clipping with the curve or use a constant value. But let's try with the curve. Let's set this to 1 the maximum. And basically we want this to go from 0 to 1 with this curve like this. And that's the kind of effect we get. Now, that's kind of a personal taste that I'm going to leave to you. You could, for example, as well, use the color over lifetime up here. And, well, the last key, for example, it could go all the way to black. It kind of creates a different feeling as well. You could offset. The erosion in the curve to around 0.4 instead of starting immediately eroding away. You have a few options here. I'm just showing you a few ideas. If you try this with everything else, this is what we have. Personally, I think it looks better with simply fading away. Instead of using the erosion for this specific case. And you could as well use the blending modes in additive. This way the color over lifetime would fade away the smoke. Actually, I think I'm going to leave it just like that with additive and with color over lifetime fading to black. So the smoke fades away. If you play everything together that looks very nice. We may make a few adjustments later on, but for now, that's it. We have a really nice aftermath with a ground crack, some particles, burnt mark and smoke coming out of the ground crack. Really cool. Our explosion is getting better and better in eac lesson. In the next lesson, we are going to add some quick orange floating rings all around the fire explosion.
42. 3.36 - Orange Floating RIngs: So on this lesson, we are going to add a little detail, which is some orange rings floating around our explosion, as it expands throughout the air. We are going to add two orange rings, one closer to the bottom and the other closer to the top. And we can actually start by duplicating the orange ring. This one. And then rename it to orange floating ring. Since we want this to be a little bit above ground, let's push it to 0.7 is in the why. And let's actually play the explosion top meet and bottom press play and pause. More or less around here, so we can see how the orange gloating ring is looking. So the first changes are actually in the 3D start size. We want this to have a smaller radius and not so tall, like 2 for the Z and 1.4 for the Y Y and X or 1.5. And we actually want to duplicate this material so we don't make any change to anything that is using this material. Right. So let's duplicate it and drag and drop to our orange floating ring. And now let's play and pause this like this, and down here. well, the trick happens in the tiling. We don't want this to be, we don't want this to repeat too much in the X. So something like 1 or 0.5 for the X Is a good value. If we test this with everything else, it's kind of small. So what I'm going to do now is increase to 1.7. The radius. Yeah. And what I'm noticing is that this mesh that we are using the ring 01, it kind of doesn't fit in what we are trying to achieve here. So let's open up Blender, the project where we created the other meshes this project right here and I'm actually going to hide everything by clicking here on the eye of each mesh. And then with Shift+A We want to start with a cylinder once again. And there's a cool thing that I want to show you, which is the Cap Fill type is set to nothing. Normally it comes as N Gon, but if you set it to nothing, we don't have the top and bottom faces, which is great. Okay, so let's smooth this out. I'm going to press spacebar, search for shade smooth. And instead of being in a cone shape, so much in a cone shape, we want this to be more. More like a ring. So what I'm going to do is press 1 in numpad to go to the front orthographic view and then with S, I'm going to lock it in the Z axis and I'm going to scale this down by a value of 0.5 basically half of the size. And then we can enter in edit mode with Tab, and with Ctrl+R we want to add one edge loop right in the middle. You can press Enter and Escape so it stays in position and then up here add another edge loop with Ctrl+R Now while holding Shift and Alt, we can select these top vertices and with proportional editing on which is O for the shortcut. We want to scale this up just a tiny amount. All right. So that's more or less the shape we need. Now, let's increase the radius. We want to go ahead and press S and then Shift+Z to exclude the Z axis and only scale in the Y and X axis just like this. Yeah. I'm actually noticing that this is too much. So I'm going to select the top edge loop. And still with the proportional editing on, I'm going to scale down this button and loop. Yeah, this is a great shape. That's what we are trying to achieve. Once you have arrived at this point, we can rename it to Ring02 and let's press Ctrl+A so we can apply all of the transforms, the location, rotation and scale. And yeah the pivot goes up here and we can fix it as you have seen by entering in edit mode. In this case we can select the bottom edge loop while holding Shift and Alt and then we Shift+S we want to say, cursor to selected. Then we can go to object mode by pressing Tab and we Shift+Ctrl+Alt+C. We want to select origin to 3d cursor exactly like these. Looking good. Let's export this as an FBX. Make sure that selected object is on. You can navigate to your models folder. Rename this to Ring02 and export, cool. Let's select the Ring02 and say the scale factor is 100 and press apply. Okay. And now we can go ahead and replace the mesh that we are using in the orange floating ring. Cool. Look at this. Much better. It's kind of big, but we will fix it for now. I just want to show that the offset in the Y axis will enable you to position the main texture a little bit above or a little bit below the center of our image. Great. I'm going to leave it at -0.2 And if you play everything together, it is kind of big. It doesn't look that bad. But I want this to be closer to the explosion. So I'm going to say 1.5 or 1.55. Which is still too big. Maybe push it a little bit down to 0.6 in the Y axis. So I'm going to decrease it to 1.4. And that's really nice. That's okay. Just going to fix the name. I want this to be the orange floating ring bottom. Because now we are going to duplicate this with Ctrl+D for the orange floating ring top. Exactly like this and for the y axis position of this one 1.5. Maybe more. Let's see how it goes. 1.7 yeah. And the radius could be 1 in the X and Y and not so tall. Something thinner like 1.3 for the Z. And it leaves a little bit longer because the smoke goes up. And the smoke at the bottom dissipates away faster. So 0.9 just a tiny bit longer. And if you play everything together, this is how nice it is. Awesome. What a great explosion we have here. Very nice. Looking good. Don't forget to apply the changes to the prefab, apply all And as you can see if you want to rearrange, by the way, this particle systems Unity tells you that you need to go to prefab mode. We can go up here as well in the arrow. And for example, what I'm going to do is organize this a little bit better. These two orange floating rings could be below the orange ring. Smaller, for example. So you can select all of the orange rings and play them at once, and the particles floating crack could be closer to the other particles as well. So you can play them all at once. And these quick particle systems, we can group them as well. Quick smoke shockwave. Quick orange ring vertical and quick orange shockwave. And then the ground glow could be yeah above the ground crack, for example. And the smokes are there. The explosions up here. The particles are next, then we have the smoke rings, orange rings, quick particle systems. And everything else is related to the ground crack. Great. Really nice. So that's it for this lesson. We have now added a cool detail. In the next one, we are going to add some kind of the debris coming out of the explosion.
43. 3.37 - Particles with Smoke Trails: So on this lesson, we are going to add something pretty cool, which is debris coming out of the explosion. We want them to fly up and then go down until they hit the ground. We could use one of these particle systems that we already have, but let's start from scratch. So right click effects and in a new particle system. We kind can rename it to Particle Trails. We need to rotate it -90 in the X so it faces up. And well, yeah, it's not going to loop. But they are going to have an interesting amount of speed. Something between 10 and 20 should do the trick. And if we open the shape, as you can see, we have a cone shape. Okay. That's not a bad shape. But an hemisphere is a better fit for what we are trying to achieve. This will emit 180 degrees all around. Let's try 3 for the radius. And we got particles going everywhere and it keeps on emitting those particles. We don't want that. That's because of the rate over time in the emission. Let's set it to 0. We want a burst of, well, let's try with 3 particles for now. So yeah, 3 particles. That's what we got. Now we want them to fall down, right? They are going up, but they never come down. The way we do it is with the gravity modifier up here below the start color. If we set it to 3, which is a good value in our case, as you can see, they have a really nice motion. They go up, they follow a nice curve, but they still need to go up with a little bit more strength. So in the velocity over lifetime, we can use the Z axis random between well let's try between 3 and 7. Right? Yeah. That doesn't look that bad if we try with everything else. Let me close the shape module. Okay. Yeah, that seems like a nice motion. Let's. Let's move on and see where this goes and let's change the material. Actually we can set the max particle size already to 3. If we get closer to them, they don't shrink. That's what we want. And we can actually use the Beam01 material. It's a perfect fit for this. That's the one we use in the other particles as well. Yeah, it's super bright for now, but we are going to fix it. We are just trying to understand if the motion is right and it seems to be okay. Yeah, they are huge. So let's say the start size. It's between 0.15 and 0.55. Very precise value. Yes. Those are my final values already, by the way. Yeah, they still seem like they are too big, but that's mostly because we don't have color. If, for example, we change this to an orange, a value of 16 for the U and 91 for the saturation. I found out to be a great orange color for these flying ambers. All right. So we have motion. We have a nice aspect to this, but it would look much better if we leave a trail behind of smoke. And since we already have the smoke shader and everything ready for the smoke, we simply need to turn on the trails and out of the box. We get a trail immediately, but we can improve this by using the smoke material for the trail material. So let's duplicate it, rename it to smoke trail 02 And assign it to the trail material of our particle trails. And if we open these up, well, first thing I'm going to do is turn off alpha clipping. I don't think it's necessary for this. And I also think that the tiling should be bigger, something like 1, which is the default value. And the blending mode. We can set it to Alpha. So make sure you have these gradients with transparency instead of the black one, which is great for the additive. Okay. Yeah. For the distortion. Maybe 0.4. We actually don't need that much distortion because this is going to be fast. What we actually need is speed in the distortion. Speed -2, maybe 20 for the distortion scale is a little bit too much, but we also need main text speed, the X to be -1 X to be -1 So every time these moves we can have a better perception of smoke being left behind. Otherwise it will look a bit static if the speed is slower. Yeah. Distortion scale is way too high. 15 seems like a good value. And the tiling maybe 0.8. Yeah. Okay. But there are still a few options that we can play with when it comes to trails in the particle system. So let's go up here to the trail module and for example, the ratio. Well, we can leave it at 1. It means that every particle is going to have a trail. But the lifetime could be half of the particle of each particle which currently is set to 5 up here in the start lifetime, which is way too high. Let's decrease it to be between 1.2 and 2.5. We also want some trails to die mid air. That's normal to see in an explosion. And down here now, we can say the lifetime of the trail is going to be half of that now, but that doesn't look that bad. Maybe it could be less like 0.4, actually. Well, and we actually don't want this to inherit the particle's color. We want to create our own gradient for this trail. So in the color over trail, and not the color over lifetime, in the color over a trail, we actually want to say that this is going to be a gradient. And on that gradient, the first key, you can say it's 16 for U and 80, 82 for the saturation. Then we want another key more a less around here. But this one is going to be towards brown, as you can see, something more or less along these values in the 16 in the U, but with a lower saturation around 25 and a value of around 30 or 40, that creates a nice brownish gray color orange, something like this and last key, well, it can be black. And up here we want this to have transparency. The last key, the alpha around 120, which is half is okay and one last key we can add is more or less around here, but then push it a little bit closer to the end. And if we test this out, that's the gradient we get. I'm actually going to pause this mid-air because we want this to be brighter, closer to the particle. So I'm going to push this orange a little bit more to the right. Exactly like this. And that's okay for the smoke trail, the color. It looks like the particle is illuminating the smoke. That's great. Now let's take care of the shape. We have the width over trail which is set to 1, and we can actually change it to be a curve. So it becomes thinner towards the end and it's a little bit bigger closer to the particle. It doesn't need to go all the way down to 0. The last key. And if you want to control the size, by the way, you can do it right here. As you can see, 3 is huge for this one. So yeah, I'm going to leave it at around 1 and that's fine. Okay. Let's increase the count up here of the particles to 7 the burst. Cool. And let's test with everything else. All right. That's looking very nice. It really adds a nice touch to this. And with the orange rings mid air as well, this is pretty much done. We are very close to finishing our stylized explosion. I hope you guys are enjoying, by the way. I'm just noticing and, and probably you too, the particles are going through the ground and there's actually a module in the particle system that tells the particle to collide with anything in the world. We can turn it on and we can say the type is world. And if we leave the dampen at 0 and the balance at 1, this is the kind of motion we get. It's ridiculous, for example, the dampen at 0.5. It will slow down the particle every time it hits the ground. And the bounce. It's still bouncing way too much. If we set it to 0.5. We get a really nice balance. The particle when it hits the ground, it slows down and it doesn't bounce. That much. Looks great. Right. So one of the last things we can do is use the size over lifetime, because throughout the lifetime it has the same size. And we actually don't want that. We want this to slowly disappear and not disappear out of nowhere. So from big to small, we this curve seems to be a great thing. And yeah, that's cool. I think the radius is still a bit too big. So I'm going to say to 2.5 or 2.6. Yeah. All right. If we test with everything else, that's quite something we have here. Pretty cool. I have already highlighted this, but if you want to decrease the lifetime of the trail, you can do it down here. It's at 0.4 If we try 0.35 or 0.1, as you can see, it lives much less. You can also play with the sides in the curve of the width over trail. And yeah, that's pretty much it. We have some cool debris. Some cool ambers flying around and leaving a trail of smoke behind. It really adds a nice touch. We're going to push it up here to the particles. So it's grouped with everything else. I just noticed that we have the particles floating crack here, and it doesn't make that much sense because it's something that belongs to the aftermath. So I'm going to push it down here. Just keeping everything nicely organized and yeah, that's pretty much it. You can apply the change to prefab and save your scene as well. And in our next lesson, we are going to add an arched projector. So it creates a nice anticipation.
44. 3.38 - Arched Projectile: So on this lesson, we are going to add an anticipation to this, so the explosion doesn't happen out of nowhere. And for that, we can create an arched projectile. For example, we could use some code, but to make things easier, we can actually use the particle system and delay the explosion. So, and sense, we already have the particle trails. That's a perfect start for our project. Let's duplicate it with Ctrl+D rename it. And the major change in here is the shape. In this case, we want to use a cone. With a very small radius and 0 for the angle or 1. If you play this, it goes up and down, we simply need now to rotate this, for example, -120 degrees in the X. Exactly. We've got a bunch of projectiles. And let's move it in the Z axis. A value of 13 and yeah, we have a lot of projectiles right now. So in the emission, we only want one particle for the count. Now we've got to make sure that it goes always the same spot, which means that in the lifetime we can say it's 2 seconds and for the speed, 15 is great. As you can see it goes almost always to the same position. The only thing that's messing with the position is the velocity over lifetime module. We also don't want randomness in here. Let's say it's 6.5 in the Z constant value. And as you can see now, it goes pretty much always to the same spot. The only thing that's happening is that the size is not always the same, but in the start size we can say it's 1.8, which is. Too much. So maybe 0.9 Let's see how it goes with 0.9 Let me just play the ground crack to see if it is going to the center of the ground crack. Exactly. Maybe 0.5 or 0.6 for the start size will look a little bit better for this projectile. And. If we play and pause this, as you can see in the play back time pretty much takes 1.2 seconds. To hit the ground. So this means that we can delay all of the other particle systems. 1.2 seconds. I'm going to select one by one carefully, and I'm looking at the start delay to make sure that each one is at zero, because I think there's one here. Yeah, the particles floating crack already as a start delay. So I'm not going to select it and I'm going to select everything else that doesn't have a start delay and say it's 1.2 And then for the particles floating crack, what I'm going to do is we can literally say + 1.2. So it gets the exact same delay. And now if we test everything with the arched projectile and disable the shape module, this is what we have. Super cool. You get a very small anticipation of a projectile that it's going to hit the ground, and that gives us a really nice feedback on what's going to happen. And yeah, the timing is pretty much perfect and it looks very, very good. Great. There's one last thing that we can do in here, which is adding a lights. Let's apply the changes to the prefab first. And I'm going to go inside the prefab and push the arched projectile all the way up here. And now, as you can see, we have a lights module. We just need a prefab of a lights. It's very simple in our scene. With right click, we can say lights. Create the point light. And simply drag and drop it to the Prefabs folder, for example, and delete the point light in our scene. And now back to our arched projectile in the lights model. We can drag and drop the prefab of the point light. And yeah, the ratio basically means that every particle is going to have one light. In this case you only have one particle. So let's set it to one so it gets a light, as you can see, we immediately see the changes happening and it gets illuminated. That's great. The only thing we need to do is say the range is 2 and the intensity around 100 crazy value. Yeah. The color comes from use particle color boolean, and that's pretty much it at this point. And now, yes, if we test everything together, this is what we get an arched projectile with lights. And the cool thing is that if you look closely, you can see the light, the arched projectile, illuminating the core of the explosion, the explosion top, mid and bottom. Since they are lit objects, they are influenced by lights and this is what it creates. Once it has lights around, it's really cool. As you can see, we have some glow inside the explosion as well, thanks to the arched projectile. And that is beautiful. Really adds a nice touch to this. Really cool. So, yes, that's it. Guys, for this lesson, we have added a quick anticipation. It's very simple, but it does the job of telling anyone that is going to watch this that something is going to happen once the projectile hits the ground. And it does indeed. And it looks awesome. And we are very close to the end. Now in our next lesson, we are going to see how to create some color variations from this explosion.
45. 3.39 - Color Variations: So at this point, our explosion is pretty much done. And I think it turned out great. And I hope you have enjoyed what we are going to do in this lesson is very interesting and it's about color. We are going to see how to create some variations. And it's fairly easy since we have these scripts right here that will allow us to control the color very easily of any VFX prefab. And I'm going to show you how this works. For example, let's rename this to stylized explosion orange so we can distinguish them and now we can duplicate this prefab withCtrl+D and rename it, for example, to Green. Let's create the green version. So the way this works is by entering in prefab mode, so double click and then up here in the parent of all the particle systems. We want to go ahead and add a component, particle system controller component, and you are able to control the size, the speed, the duration. And the first step is to fill the lists. It's going to find all of the particle systems in all of the children, attach it to this parent, and it's going to add it to this list. From here now we can, we could, for example, change the size, the speed, the duration, the loop, prewarm In this case, we want lights. So let's start it on. We also want trails because we are using in some cases, let's let's turn it on and we want to change the color. And we have two colors, new max color and a new minimum color. For maximum color, we can choose something like this, a greenish color, and it this case we have two colors. In case there is a gradient, it will adapt the gradient with these two colors. And once you have selected the new color, you can press the apply button and the script will create a folder and save the original settings of this prefab inside that folder. If we do a Ctrl+R here in the prefabs, as you could see, we have we have a file without the previous settings of these particle systems saved right here. Now, if we test this out, well, it's almost perfect. There's only 2 or 3 things happening. The first one is that the arched projectile, the script doesn't change the color over trail in the trails module. So we've got to go there manually and for example, we can copy the start color. And paste it to the first frame. And the second frame is going to have a greenish U and so on. And now we can copy this gradient and paste it to the particle trails as well. And then we have the explosion top, mid and bottom, which is still orange because we changed the color on the material instead of changing in the particle system. But that's also easily fixable by duplicating the explosion 01 orange and creating a explosions 01 green and then select a greenish color, something more or less like this around 100 for the Hue more or less. And for the emission a green as well. And now if we assign that new material to the explosion, top, mid and bottom. We can apply the change to prefab and we should have everything green. Indeed we have. This now looks like a scene from Game of Thrones where they blow up all the boats with a green chemical. Great scene. So as you can see, that's super easy to create a color variation thanks to the script. Let's create another one. Let's duplicate from the original the orange and rename this to purple. Oh. I just noticed that the green one was the original orange. Which means that in our scene we have two greens. Indeed. No problem. We can drag and drop this orange to our scene. This is the original one. I'm going to remove this last one. I'm going to remove the other one. We have two greens we don't need. Okay, so for this purple, it's also enter in edit mode. And in the parent, we want to add a particle system controller. Well, we don't want loop nor pre warm, but we want lights and trails and change the color. And for the max color something more or less around 266 for the Hue, more or less around here. I'm going to copy and paste this color to the minimum color as well and simply drag a little bit to the right. Yeah. Like this. Okay. Let's see. Once we have filled the lists, we can press the play button. And as you can see in the original settings folder, we have the purple original settings. Oh, and let's already take care of the arched projectile trail color. Let's copy the start color paste it right here. And the second key, I mean, it doesn't necessarily need to be only the Hue that changes. We can also change a little bit the color, something a little bit more blue, for example. Why not a little bit more saturated than usual? Let's copy this gradient and paste it to the particle trails as well. Yeah. We just need to duplicate the explosion01 orange for the explosion01 explosion01 purple. Something around this color. And then assign that material to explosion top, mid and bottom, and that should be it. So let's see how it is in our scene. Let's drag and drop the prefab. And if we test this, here we go. Purple explosion. Crazy one. And we can make a few changes to this. Why not? For example, I think the ground elements should be bigger. So I'm going to increase the start size by a value of two. Let's start with the ground glow. Becomes 11. The ground crack becomes 7.5 The ground impact becomes 11.5 the additive one becomes 9.5, the alpha blended version becomes 15. And yeah, that should do the trick. Oh, yeah. Now we need to adjust the smoke positions. Very quickly, something like this. I'm actually going to make them bigger as well and change a little bit the rotation of some. Why not? Since we are already adapting a few things. Why don't we change the smoke as well a little bit? Yeah. More or less around here. It doesn't necessarily need to be in the same positions as the orange one. And if we test everything together now. Yeah, I don't think it looks that bad, actually. But I think it would look cool with a little bit of blue. It's all purple and whatnot. So I'm going to go to the Particles Impact, select Render between two colors. And for the second color, I'm going to go ahead and choose a blue around 210 for the Hue. I'm going to copy this color and paste it to the particles impact circle. But not for the particle trails. particle trails. And if we test everything together, we get a little bit of blue. The particles. Let's convert a few more elements to Blue. For example, the orange light dark ring. That one could be a bluish. Something like this. And the orange floating rings, the ones that are around the explosion, those ones that could be blue as well. Yeah. That looks interesting. Maybe around 200 for the Hue Something really blue. Light blue. Yeah, exactly like this. Damn That's crazy. That's looking nice. Maybe we can add another ring at the bottom. Let's duplicate the orange ring. But this time. We are going to duplicate the material so we can change the tiling. We are going to set it to 1. And then we are going to choose a light blue like this one. Oh, and the lifetime should be small like 0.4 and with a bigger radius. Something like 3.2 3.2 for the X and Y. Oh, yes, indeed. That looks interesting. So as you can see, we can make a few adjustments. Add a few more elements, change other elements and play with this. For example, the ground crack. I think it should be brighter for longer. And I'm going to add some blue in the beginning in the color over lifetime exactly like this. I'm going to push the dark key a little bit more to the right and add another purple here, more or less around here. Yeah. Now I'm actually going to duplicate the ground crack material. Assign a new ground crack material so we can increase the intensity to something like 8 or 9 or 8.5 so it becomes brighter. Awesome. Looking good. Yes. I can see you have a lot of possibilities. Don't forget to apply the changes to the prefab and save your scene. And feel free to do a few more tests along the way. I would love to see the results. You can share them with me in all of the social media. But yeah, that's pretty much it in the next lesson. It's the conclusion lesson and we are going to have a few words and that's it, guys. We have come to an end.
46. 4.1 - Conclusion: So after all these lectures, you finally arrived at the last one. And if you truly finished the course and followed through each lecture. Congratulations! Well done! I hope you have enjoyed it and learned something new. Now, what else can you do? Well, I'm a bit suspicious when I say this, but I'm going to recommend my channel Gabriel Aguiar Prod. Gabriel Aguiar Prod., really, as a lot of videos that can help you. And every two weeks, there's something new that comes up. Or maybe if you want to access a big repository of visual effects from shaders to projectiles to cool VFX Graph or explosions, a lot of assets really. Then I recommend it to check out my Patreon page or my website. gabrielaguiarprod.com And there is a lot of cool assets that can help you in learning something new. You can study them up close or simply even use them in your projects or games. And definitely you can share your results on social media, on YouTube, Twitter, Artstation, Facebook, Insta, or even check out the Discord of Gabriel Aguiar Prod. Yeah. Feel free to share the results with me and with the world. And there is also this great forum, Real-Time VFX. It's the best spot for game visual effects artists, it's a form, and if you want to challenge yourself, there's a new challenge every month. But if you are in for a great challenge, then I highly recommend it to check out my other courses. We have a lot of cool effects that you can learn. For example create an entire set of abilities for Thunderlord Or create this Orb Explosion. And this one the beginner course as well. Oh, and by the way, attached to this lesson. There's two projects. The first one is the original version, basically the first version that I made before recording the course. And then there is the second project, which is the result while I was recording the course, and you can download them and open them up with Unity Hub and make sure to use one of the closest versions possible. Now to conclude, I hope you have learned something new, and I truly hope that you have enjoyed this course. And it was a great adventure. Stylized effects are awesome and you can do a lot of things with the techniques that I've shown you on this course, you can create very different type of effects with this. And of course, I would really appreciate your feedback if it's possible. A word of appreciation is always welcome here on Udemy or on any other of the social media. So, yeah, that's it, guys. I hope you enjoyed once again. And thanks for watching and keep on learning.