Blender 2.9 Mantaflow fire and smoke simulations: an asteroid falling on a city | Stefano UnreaLab team | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Blender 2.9 Mantaflow fire and smoke simulations: an asteroid falling on a city

teacher avatar Stefano UnreaLab team, Professional 3D artists

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

18 Lessons (1h 20m)
    • 1. Introduction

      2:52
    • 2. How to create simple smoke

      3:18
    • 3. The "timesteps" parameter

      2:12
    • 4. Let's model the city

      3:42
    • 5. The textures of the city

      4:04
    • 6. HDRI and other settings

      2:19
    • 7. The last materials

      4:18
    • 8. The asteroid and the fragments

      6:48
    • 9. The animation of the asteroid

      4:27
    • 10. More rigid bodies properties

      2:50
    • 11. How to add the fire to the asteroid

      2:53
    • 12. Fluid settings

      2:49
    • 13. Others smoke and fire properties, part 1

      3:45
    • 14. Others smoke and fire properties, part 2

      3:34
    • 15. The noise property

      6:06
    • 16. Let's continue with the asteroid

      6:04
    • 17. Final steps of the simulation

      6:14
    • 18. The material of fire and smoke

      12:11
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

34

Students

--

Projects

About This Class

In this class we'll see how to master smoke and fire simulations in Blender, and as an exercise we'll create a simulation of an asteroid falling on a city.
So, we'll also see how to create a city in a very simple way and how to manage rigid bodies physics.
Finally, we'll see how to create a proper fire shader and how to use attributes to have more flexibility in the fine tuning of the material.

I assume that you have a basic knowledge of Blender, as I won't go in much details for every single operation.
This class wants to go straight to the point of how to create and manage simulations in Blender, giving you a quick guide and reference for you next simulations.

d1d5e39a.jpg

Meet Your Teacher

Teacher Profile Image

Stefano UnreaLab team

Professional 3D artists

Teacher

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Introduction: Hi, and welcome to this course on fluid simulations in Blender will see how to simulate fire and smoke. The course is aimed at those who already have a basic knowledge of Blender and its interface. At first, creating good-looking simulations can be frustrating as you need to precisely calibrate every single parameter. However, in this course, we will try to simplify all these aspects in order to get the best results. As you can see in the video, we'll create a scene with an asteroid falling to the ground, creating a big explosion. So let's start with some basic concepts related to fluid simulations. The fastest way to create a fire simulation is to add a fluid emitter, for example, a simple sphere. Then in the quick effects of the object menu, select quick smoke. As you can see, blender automatically creates some smoke around the sphere. In addition, we also have a cube around the sphere. This object is called domain. If you also wanted to add some fire, you need to open the quick smoke menu at the bottom left of the viewport and select the smoke and fire option. In this way, some fire is automatically added around the sphere. In order to be able to view the simulation, you have to save the blender file. Now, you have to go back to frame one and start the timeline by pressing the Play button. As you can see, fire and smoke are generated from the sphere. However, when the smoke reaches the edges of the cube, it automatically stops. This domain indeed is the space where the simulation takes place. This of course, is only a basic simulation. In order to get better results, we have to take a look at the simulation parameters. First of all, let's consider the source of the fire, in our case the sphere. Select this object and go to the Physics tab. Here, the fluid button is already selected. Below, we have all the parameters related to the emitter of the fire. In the type menu, the option flow is already selected. And this because the sphere is the emitter of the smoke. On the other hand, if we select the cube, the type menu is domain. Well, now let's try to create the same simulation this time starting from scratch. 2. How to create simple smoke: Open a new blender file and add a new object, this time a cylinder, that will be our fire emitter. Now, at a cube, this object will be our simulation domain. We have to position and scale the cube in order to fill the space where the simulations should take place. However, be careful not to make the cube too big. Otherwise, the simulation will be calculated even where it shouldn't. And this means more computation time. Now open the Physics tab and select the fluid button in the type menu select domain. Finally, as domain type select gas. The other type of domain is for liquid simulations. Now select the cylinder and assign a fluid physic property. Then select flow as type and fire and smoke is flow type. Save the file and starting the simulation, you should see the fire and smoke as before. But in some cases nothing happens. This because sometimes the simulation needs to be reset manually. The best way to do that is to change the value and the resolution divisions property of the domain. This is a simple way that we'll use often to force blender to reset the simulation. In the domain object, we have the most important options that control the fluid emission. Most of them are the same also for liquid simulations. The first property is the resolution we just saw. It defines the number of voxels contained in the domain. Consider a voxel as a 3D pixel. You can see the size of the voxel in one corner of the cube. So the higher the number of voxels, the higher the final resolution. And as you can imagine, the calculation time, a resolution division of 32 is fine for a fast preview. However, for the final rendering, consider a value between 128 and 256. The next parameter is the timescale. It represents the global speed of the simulation. For example, it can be useful for slow motion simulations. If you set the value to 0.5, the simulation will be much slower. Remember, as told before, that in order to see the updates, you have to change the number in the resolution divisions property. This will be true for all the times will change a parameter. So I won't repeat this each time. Let's reset the speed to 1. The CLF number parameter is a bit tricky to explain. Basically, it represents the maximum speed that can be reached before increasing the number of the simulation steps. Let's explain this in a simpler way. 3. The "timesteps" parameter: When the smoke moves, Blender has to calculate the direction of the volume contained in each voxel. For example, consider this case of erasing smoke. Each cell has a direction and velocity based on the dynamics of this specific simulation. Also, suppose that in a single frame, the fluid contained in this specific cell moves from point 1 to point 2. If blender performs only one calculation per frame, the final position can be this. But if we allow blender to calculate more times for a single frame, the final position could be different because in the space of a frame, there may have been forces that have caused the smoke to change direction. This is even more true when the smoke moves fast. In this case, the cell covers a greater distance in a single frame. And if we allow only a single or few computations per frame, we can lose all the variations of forces or collisions that occur in that space of time. Now, the meaning of the CLF number should be clearer. For example, the default value of four means that until the cells reach this speed, the time steps are kept at the default value. If the velocity is greater that this value, for example, in the case of a fast moving fluid, the timesteps are increased to more precisely calculate the velocity of the fluid. And the maximum and minimum number of timesteps are defined in the properties below the time-steps maximum and minimum. The default values mean that in case of additional time steps per frame, only a maximum number of four can be set. Generally, there is no need to change the value of CLF number. On the other hand, it can be useful to increase the number of maximum and minimum to get the best results. We will see this later when we'll set up the asteroid simulation. The US adaptive timesteps ensures that blender automatically sets the right time steps in each condition. That empty space property may not be considered at the moment. The next parameter, delete an obstacle option, deletes the fluid inside an obstacle. This can be useful to avoid fluid computations were not necessary. 4. Let's model the city: Well, after this long description of some of the initial properties, it's time to start modelling the basic scene. We will then continue with all the other available options in the project files. You can download the basic landscape. Here I created a basic city. It wasn't model from scratch, but with the support of a very useful add-on named blender OSM that allows to import real maps data such as terrains, cities in building. Here is a brief explanation of what I did. I won't go into too much detail in this explanation as this course is related to simulations. However, this can be useful if you want to create the city yourself. First of all, you have to download the plug-in that you can find at this link. You can download the plug-in for free. After installing the plugin, you should create a Mapbox access token by pressing the button and following the instructions. Also, select a directory where you want to store the Maps Data. Now you can access the plugin settings opening the related tab at the right of the viewport. The first step is to choose the location where you want to extract the map data from. So press the Select button and choose an area you want. For example, I selected a small area near Central Park in New York City. Now copy the coordinates and paste them inside Blender. Then select terrain is type of imported data and click Import. You should see a big terrain. If you have some clipping, please increase the clip and value of the viewport. Now we have to import the buildings, change the import data to Open Street Map and uncheck the options for importing water, forests, vegetation, and roads. We only need the buildings. After a few seconds, you should see all the building of your city. Now we have to create a basic material for our buildings. If you move to the materials panels, you can see a lot of different materials already created. Enter the edit mode by pressing the Tab key. Now, select the faces associated with the roof material and separate the selection by pressing the P key. In this way, we have two objects, one for the roofs and the other for the walls. You can also delete all the materials associated with these objects. 5. The textures of the city: What we want to do now is to create the texture of the walls by projecting the related UV map on a real photo of a city. This is the fastest way to create the texture. So let's choose a photo of an interesting night skyline. You can find it in the textures folder of the project file. Now, select the walls and create a new material. Then assign the photo of the city as the basic texture. You can easily do that with the Node Wrangler add on. Finally, in the object data property tab, delete the existing uv maps and create a new one. The idea is to create a UV map in order to assign the walls of our building to the real walls in the photo. So first of all, open the UV Editing tab. The 3D view port, set the front orthographic view by pressing 1 in the numeric keypad. Also set the photo of the city is background in the UVs panel. We also have to rotate the view in order to try to match the rotation of the buildings in the photo, you can press the left and right arrow key of the numeric keypad. Remember that we also need the orthographic view. So if blender automatically switches to the perspective view, press the button five. Now select all the faces by pressing the a button. Then from the UV menu, choose project from view. In the UV panel, you should see all the UV phases corresponding to the walls. Now you have to move and scale the UVs in order to match the photo below. In the 3D view port, select the viewport shading button in order to see the material. Of course, you need to fine tune the position of the different UV islands in order to have a better texture projection. You can also select a single wall and move it to the corresponding building in the photo. Consider that in the project file, I have correctly positioned the UVs only of a few buildings around the place where the asteroid will fall. I leave to you the exercise of correctly positioning all the others. A fast way to do that is to move the mouse over a building, then press the L key. This selects all the linked faces. And so basically a single building. Now in the UVs viewport move and scale the island to match the image below. You can also move the single UVs vertices to best match the perspective. 6. HDRI and other settings: The material is not completed yet. We have to add some realism. First of all, we have to add an HDR image to the world in order to have a beautiful night illumination. In the project file, you can find the image in the HDR folder. Now we have to add some reflections and emissions to the material of the buildings. Also, we could add a procedural texture in order to mimic the windows we have in a typical glass building, you can find this material setup and the project file here, a brief description of what I did. First of all, I used the city texture as an emission shader. In this way, the texture of the city also emits some light. Then I mix the emission shader with a glossy shader. This is useful to simulate a glass material and have some reflections. You can fine tune the strength of the reflections by changing the roughness value. Then I added a brick texture in order to have something that looks like Windows. The wall between the windows have to be metallic. So I added a principled shader and set metallic to one. Now we have to mask the original material with the metallic material using the brick texture. In this way, the metallic material will be visible only in the space between the windows. As told before, I won't go into too much detail in the explanation of modelling and materials. You can take a closer look to the material in the project file for further details. 7. The last materials: Finally, we have to create the material of the roof. This is much easier. We can simply assign a basic texture. For example, one of the concrete textures that you can find in the project files. In this case, shoes object in the texture coordinate node and adjust the corresponding scale. The object mode is useful when you don't have UVs and you need a fast way to apply a texture in my project file. I also mix two different textures in order to have a less visible repeating pattern. When we have seamless textures, there are chances that repetitions are clearly visible. In this case, it's a good idea to mix different textures using a noise pattern as a mask. This is the first texture. And this the second one. Repetitions are clearly visible. So I added a noise texture. If we mix the two materials with this mask, repetitions are less obvious. I also created a material for the terrain, this time using the paving stone texture. This is a very simple material with only one texture. Now it's time to choose the place where we want the asteroid to fall. This is important in order to have a location with enough space for our simulation. I chose this place near this nice tower. Let's add a camera in order to frame our composition. In the final rendering, I created two cameras, one for the view from top, the other for the first-person shoot. You can position them as you prefer. I also tried to refine this building because it is close to the camera and will be visible for the most of the time. It has to look better than the others. So the simple texture we created is not enough. In order to do that, I selected the building in the edit mode and separated it by pressing the P key. You also have to separate the related roofs and then join them together. Now I created a copy of the material and tweak the parameters for a better looking material. The most important change was the replacement of the texture with a glass shader. In this way, the building has some transparency in nice reflections. You can take a look at the material in the project file. Finally, I added to Sky images in the background. I imported this images by simply adding the Images as Planes object. You can find the sunset image in the texture folder. You should place those planes far away from the city and scale them up. If they were too close to the city, there would not be enough parallax effect when the camera moves. They also have to be placed in order to appear as a background of the camera framing. So their exact location depends on the position of the camera. As a final step, we have to preview the entire scene and fine tune some parameters. For example, you can change the strength of the HDR image or the intensity of the reflections of the building. You also have to set the film is transparent. In this way, the HDR image will not be visible in the rendering. When you are satisfied with this, we can move on to the simulation of the asteroid. 8. The asteroid and the fragments: The first thing we have to do is to create the asteroid itself. We can start by adding a sphere and placing it where we want the simulation to start. Set the number of subdivisions to three. Now we want the sphere to fall to the ground and break into a hundreds of pieces. This is exactly what we can do with the dynamics of rigid bodies. For those who don't know, Rigid Bodies simulations are those that simulate the physics of real life objects. Basically objects with a specific mass and subject to the force of gravity. Also objects that can interact and collide with each other. So we can select the sphere and in the Physics tab, activate the rigid body button. As default, the body is marked as active. This is fine as the object has to be subject to the forces of the simulation. If you start the simulation, the ball falls down as we expect to do. But we want the sphere to collide with the ground. So we also have to add the terrain to the simulation. However, it's a good idea to add to the simulation only the portion of the ground we really need and not the huge terrain we have. So duplicate the terrain, switch to the edit mode and select an area around our location. Then invert the selection and delete the other faces. Finally, select the object and add it to the simulation. However, this time we want to set it as passive as it only has to act as a collider and has not to be subject to gravity and other forces. Now the ball hits and stops on the ground. Remember that when you change a parameter in the simulation, you have to rewind the timeline in play from the beginning. However, the collisions seems a bit strange. The ball should have a little bouncing or a slight movement when it hits the ground. The strange behavior is related to the way the dynamic shape of the ball is computed. In order to simplify the computation of collisions, blender automatically creates around our mesh a collision object that approximates the real shape of the original object. You can see the different shapes in the shape menu. The default shape is the convex hull that creates an envelope around the object. However, this envelope doesn't match perfectly the original object. And this is the reason of the strange behavior. In order to have the most accurate collision, you have to choose mesh. You can set this type of collision both for the ground in the sphere. This means that the original mesh is used for the computation. Be careful to do that with complex objects as this can slow down the simulation. Now the ball hits and moves on the ground. We can also modify some physics properties such as friction and so on. We will tweak those properties later. For the moment, you can set again convex hull for the sphere. Now we have a problem. We want the asteroid to fall obliquely and not vertically. A way to do that is to add an external force, for example, the wind. So from the force field list, choose wind. Now we have to rotate it and increase the strength. For example, 2000. Well, the ball now moves obliquely exactly as we wanted. The next step is to find a way to make the sphere break when it hits the floor. The only way to do that is to have a ball already broken before dropping it. In order to do that, select the sphere and choose the cell fracture action in the quick effects menu. Here we can choose the way we want the object to be broken. At the top of the window, we can set where the fractures have to occur. We can leave the default value. It can also be a good idea to increase the noise value in order to have a more random distribution of the points. In the source limit parameter, we can define how many pieces we want. So let's decrease it to 30. In the recursive shatter panel, we can also break the generated particles in a recursive way. However, we can leave it as it is for now. As a last thing, enter a name for the Scene Collection. In this way, all the pieces will be placed inside that collection. Finally, press Okay, and as result, the sphere is fractured in many pieces. With the objects still selected, open the rigid body menu and choose Add active. All the pieces become active objects in the simulation. Now, remove the original sphere from the simulation. If you play the animation, the ball should fall down and break when it crashes to the ground. 9. The animation of the asteroid: However, we have a problem with the simulation. When the pieces of the asteroid hit the ground, they are moved by the wind. Also, it's difficult to calculate the position where the sphere hits the ground. We should change the force in direction of the wind, restart the simulation and see what happens. In this case, it is more convenient to manually animate the position of the asteroid. The best way to do that is to add an empty object and link the other pieces to it. Before doing that, delete the wind force we created. Now add an empty inside the collection and place it near the asteroid. Then add two keyframes to the empty, the first and the starting position, and the second just above the ground where we want the asteroid to fall. Also set the interpolation mode is linear. Finally, parent all the pieces to the empty. Select all the objects inside the collection starting from the empty. In this way, the empty becomes the active object. Now, press Control P and select object and keep transform. But if you start the simulation, the asteroid moves as before, and it seems to ignore the Parent ship with the Mt. This because the objects are rigid bodies and they are only subject to the physics properties of the simulation. In order to animate the asteroid, we have to enable the animated property in the rigid body tab. In this way, the motion of the object will be defined only by the key frames of the animation. But of course, we don't want to manually set this property for each of the pieces. You have to wait to apply the same settings to multiple objects. First of all, in the outliner shift click to select all the pieces of the asteroid. The first object you select is the active object and is displayed with a lighter orange color. Now, press the Alt button and then click on the animated property. In this way, the same setting is applied to all the other objects. The second way is to change the property you want. Then right-click on the property you have to change and select Copy to selected whatever method you choose. The asteroid now should follow the empty. However, it doesn't hit the ground because for the moment, the animation is only driven by the keyframes we created. What we have to do is to switch the animation type just after the second keyframe. We have to keyframe the animated property, unchecking it in the next frame. You can do that in the first object inside the collection. In order to copy the same animation to the other pieces, select this object and Shift click the last one. In this way, the first object is the active one. Open the link and transfer data menu and click on Link animation data. Now, the asteroid follows the empty in the first part of the animation. And in the second part, it will be subject to the physics properties of the simulation. You only have to fine tune the final position of the empty in order to have a smooth animation. 10. More rigid bodies properties: Now let's take a look at some of the other rigid bodies properties in order to fine tune the simulation. In the surface Response tab, we can change the way the objects interact each other. For example, by increasing the bouncing property and reducing the friction, we have more bouncing and sliding pieces. You also have to change the same parameters in the ground. Often in these simulations, the objects continue to move and rotate for a long time. This is a common issue and often there is no way to stop them, even by reducing the bouncing property or increasing the friction. This is the reason why we have the following properties, namely the damping and deactivation. The damping is useful to reduce the movement and rotation of an object as if there was a force in the opposite direction. For example, if you set the damping rotation to one, all the objects stop rotating soon. The deactivation property on the other hands literally deactivates the dynamics of an object. The deactivation occurs when the linear and angular velocity decrease below the values in the related fields. So basically, what we want to do is to change these parameters until the pieces of the asteroid break move and rotate in a realistic way. There is another place where we have additional dynamics property. This is the scene panel. Here you can find the rigid body world tab that is automatically added by Blender when we create a rigid body object. As for the other dynamics properties, we won't go into too much detail about each parameter. I simply want to point out the sub-steps per frame property if basically increases the accuracy of the simulation. So it can be a good idea to increase its value when the simulation has some strange behavior, especially when objects collide. In the cache tab, you can define the starting and ending point of the simulation. Below, we have different options to bake the animation. As told before, when you change a parameter in a simulation, you have to go back to frame one and play the timeline. In the timeline, you can see a light brown line. If you click the back button, blender automatically calculates the simulation and stores the result in memory. This is visually represented by a dark brown line below the timeline. It is generally recommended to bake the simulation before rendering or before adding more physical effects, such as the fire and smoke will see in a moment. This ensures more stability in the simulation and avoids potential glitches. 11. How to add the fire to the asteroid: Very good. We completed the first part of our simulation. Now we can move on to the simulation of fire and smoke. As we saw at the beginning of the course, we have to add the domain to the simulation. So let's add a cube position and scale it in order to be placed where the simulation will take place. Remember to apply the scale by pressing control and a and selecting scale. Then go to the physical properties tab, select the fluid button and choose domain is type. You should also set the path of the cache folder. Otherwise, Blender will use a default path for the cash. Now we have to set all the asteroid fragments is fluid. Select the first object, assign the fluid property and set its type is flow. Also set the flow type is fire and smoke. Finally, set the flow behavior to inflow. Now we have to copy this modifier to the other fragments. As usual, select this object in the outliner and Shift click the last one. In this way, we select all the objects and the first becomes the active one. In order to copy a modifier will take advantage of an add-on named copy attributes. Go to the Add-ons menu and check that it was installed. Now press Control and C and click on Copy Selected modifiers. Then select the fluid modifier. This modifier will be copied to the other objects. However, for some reason, not all the properties of the modifier were copied. So with all the objects still selected, right-click on the properties we changed before and choose copy to selected the properties we're flow type and flow behavior. Now, if you start the simulation, a lot of fire and smoke or emitted from the asteroid. Each asteroid fragment is a flow source. So when the asteroid breaks falling to the ground, each fragment will continue to emit fire and smoke. This is exactly what we want. In the following lessons, we will see how to adjust most of the parameters in order to have a good-looking simulation. 12. Fluid settings: In order to explain the other settings, will put aside for the moment our asteroid, and we'll take a look at specific examples. We already talked about the flow behavior property, but let's take a closer look at it. It represents the way the fluid is emitted. Inflow means that the object emits smoke continuously. On the other hand, geometry means that we only have the volume contained within the object. It is more useful for liquid simulation, for example, a water glass, a liquid tank and so on. For example. This is a simulation where on the left we have a geometry emission while on the right, the inflow type, the geometry source, the total amount of smoke is the same as the volume of the emitter. Finally, outflow represents an object that subtracts smoke or liquid from the simulation. For example, the sink drain or a suction fan. For example, here on the left we have an object that subtracts the smoke from the simulation. You can take advantage of this in order to control the global quantity of fluid inside a domain. In our case, we want fire and smoke to be continuously emitted. The sampling sub-steps property is useful for increasing the quality of the simulation. For example, when you have a fast moving object. To better understand this, let's create a new file at a simple sphere and add the quick smoke effect. Now animate the object so that it moves quickly along a curved path. You also have to scale the domain. I set the divisions to 128 in order to have an higher resolution. Starting the simulation, you can clearly see the gaps between the smoke generated in each frame. This because blender has not enough information between each frame. So let's increase the sub-steps value. For example, 20. Remember to change the divisions value in order to reset the simulation. Now we have a much smoother animation due to the fact that we increase the samples between the frames. So remember, when you have a fast-moving emitter, it is better to increase the sub-steps value in order to have a smoother flow. 13. Others smoke and fire properties, part 1: The smoke color property may be useful when you want to animate the color of the smoke. Indeed, the global color of the smoke can be changed in the material of the smoke. But if you want to change the color at the emission level, you have to animate this property, as you can see in this example. When we have to deal with smoke and fire, one of the most important aspects that we need to consider is the way in rate at which the smoke and flames move. This can dramatically change the energy of our simulation. We have many different way to change the velocity and the direction of the fluid. Basically, as we already saw, the smoke and fire properties can be set both the domain and emitter level. When we change a property at the domain level, we are changing a particular behavior for all the fluid emitters inside it. This is very useful when we want a globally changed the look of the simulation. For example, here we have three emitters. If we change a property IT domain level, we are changing the flow of all the emitters. We will see this in a moment. But we can also have different emitters with different behaviors. And this is exactly what we did, changing the parameters at the emitter level. So let's go back to our exercise that is how to change the velocity and movement of our smoke or flames. Let's start by considering the properties we can change at the emitter level. The initial temperature attribute refers to the temperature difference between the smoke and the domain. So the higher the temperature, the faster the smoke rises. In this example, the emitter on the right has an initial temperature ten times greater than the one on the left. But this parameter only affects the speed of the smoke upwards. If we want to set the exact direction of the smoke, we have to deal with the initial velocity property. This parameter is useful in two different situations. The first one is when we want to set an initial velocity regardless the real physical forces in the simulation. For example, in this animation, I want the fire to flow from left to right as if there was a wind. We can easily do that by activating the initial velocity and setting the proper value in one of the three axis. We also have the normal property. This refers to the velocity along the vertex normals of the object. In this example, clearly visible how the smoke also moves along the normal of the vertices. You can see the normals if you switch to the edit mode and in the viewport overlay menu, activate the display vertex normal option. In this example, the flow of the smoke is obviously to regular and symmetrical. But if you have a more complex object, this can add some variation in the movement of the fluid. 14. Others smoke and fire properties, part 2: There is another situation where the initial velocity property is useful when we have a moving fluid emitter. The source velocity means that blender adds the velocity of the emitter to the movement of the smoke. In this example, on the left, we don't have any initial velocity. The smoke is generated in the position of the emitter in each frame. On the right, the smoke has an additional velocity from the movement of the emitter. So this can be useful to add more realism to the simulation. This example is also interesting to see how to add multiple domains in a simulation. In order to do that, you have to specify which flow emitters belong to each domain. First of all, you have to create a collection of emitters for each domain, in this case, fluid one and fluid two. Then in the domain properties, you have to select the right collection for each domain. In this way, each domain bakes the right flow. Very good. The next step is to see how to change the flow direction and movement at the domain level. This is useful when we want to change the behavior of all the emitters inside the same domain. The first property to consider is the buoyancy density parameter. This refers to the tendency of the fluid to go upwards or downwards. Do not confuse this with the density parameter in the flow properties, which represents how thick the smoke is. In this example, we have three domains with different buoyancy density parameters. Remember to set three different collections for the flow sources. Also, if you want to bake the simulation, as we'll see later, you have to set three different cache folders. In the first domain, we have the default value of one. In the middle, there is a greater value, and as result, the smoke has a lower physical density. In this way, it moves up faster. In the last domain, there is a negative value. This means that the flow has a higher density than the surrounding environment. This causes the smoke to move downward. The next parameter is the heat. It is in some way similar to the temperature property we saw in the flow object. Indeed, higher values cause the smoke to rise higher. This can also be useful when we have different flow in a single domain and we want a globally multiply the flow speed of smoke. Here we have three domains with higher heat values from left to right. The last parameter in this group is the vorticity one. It adds some turbulence and rotation to the smoke flow. 15. The noise property: Another important parameter we have to consider is the noise property. As the name suggests, it adds some noise to the flow. But this property is also useful for another reason. Indeed, it is generally used to add some fine details to the smoke and fire flow. For example, let's consider this simulation. This is an interesting example, as I will show you many others properties related to fluid simulations. First of all, I created three domains and the related flow sources. As we already saw, you have to create a collection for each of the sources. Then we have to correctly manage the cash at each simulation. We have already talked about this topic, but it's time to take a closer look. Basically, you have three way to play a simulation. The default one is the replay type in the cache tab. This simply means that the simulation is computed when you play the animation. The result is stored in the RAM of your PC. So if I start the simulation, it is computed in real-time. However, if you close the blender file and open it again, the simulation is lost and it has to be computed again. This is the reason why we can also store the simulation data to disk. Indeed, the other two types all in modular store the simulation data in the hard drive in the path that you can set here. The all type means that all the components of the simulation, for example, the smoke noise or the fluid mesh data are computed at the same time. This is the type that we can set for the first domain. In order to compute the simulation, you simply have to press the bake all button. The simulation is cached on disk so that you can easily play it even when you reopen the blender file. The other type is the modular 1. This means that each component of the simulation is computed separately. So in the second, third domain, where we also have the noise component, as we'll see in a moment, I set the modular type. It is also important to check these resumable property. This ensures that you can stop and then resume the baking process. In this way, as a first step, we can bake the general simulation, move upwards and click the baked data button. Then we can also make the noise component by pressing the bake noise button. This is useful as we can change or fine tune and only this particular property, in this case the noise and bake again only it. Now we can go back to our noise simulation test. In the second domain, I activated the noise parameter and set the strength value to 0. In this way, Blender only add some details to the simulation without any additional noise. The extra detail is defined by the uppers factor. As we can see in the second domain, there is more detail and resolution compared to the first one. This is exactly what I said at the beginning of the lesson. That is to activate the noise property is a way to increase the fine details of the simulation. In the last domain, I also increased the strength value. This is what this parameter is supposed to do, which is to add turbulence to the simulation. So let's also bake this domain. In the center of each domain, you've surely noticed and moving arrow. This is a force field and in this particular case, a wind force. It is important to know that you can add real forces to a simulation. In order to do that, go to the Add menu and choose one of the force fields objects. In order to add some power to the simulation, I animated the direction and strength of the wind. I also set a falloff distance so that the wind only acts in a defined range. If you want each wine to affect only a specific domain, you have to create three different collections, as we already did for the emitters. Then we have to assign each collection to the related domain. So in the field effector collection, choose the right collection for each domain. Very good. We have seen most of the properties we need to complete the simulation of our asteroid. In the next lessons, we'll go back to our initial simulation in order to add the last details. 16. Let's continue with the asteroid: This is the simulation we came up with in previous lessons. The first thing I want to do is to remove this building in order to have more room for the asteroid. Now, let's take a closer look at the flow emitters properties. Remember, in order to update the same property for all the objects, you have to select all the pieces of the collection and press the Alt button before pressing the enter key. Or you can right-click on the property and select Copy to selected. So let's increase the sampling sub-step parameter. As we have seen, this is more useful when we have a fast-moving object. So in this case, a slight increase can be enough. For example, for however, we can leave this parameter as it is for now. Indeed, this can slow down the simulation playback. If you take a look at the asteroid, the smoke and fire are emitted far away from the asteroid surface. We can reduce this gap by decreasing the surface emission property inside the Flow Source tab, for example, 0.5. The fire is now closer to the surface. Another useful parameter is the initial velocity. We want the fire and smoke to have an additional velocity from the movement of the asteroid fragments. So let's check the initial velocity property. If you set a positive value in the source field, the smoke has an additional velocity in the same direction of the movement of the asteroid. But in this case, I want the smoke to move in the opposite direction in order to have a more energetic smoke trail. A value from minus 0.5 to minus one is okay. I will set to minus 0.5. You can also play with the other properties, such as initial temperature or fuel, in order to change the smoke and flames appearance. We'll leave the default values for now. We can move on to the domain properties. The first parameter we should change is the resolution divisions. For the final render, it should be at least 128 or higher. We can leave as it is for now. In order to speed up the simulation. We can also increase the time steps maximum and minimum. For example, 10 and 6. This is useful to increase the accuracy of the simulation. But if you start the simulation, the smoke and fire seem to flow in a completely different way than before. This is an important aspect to point out and is strictly related to what I explained about the time steps. Meaning when we increase this value, blender is forced to increase simulation steps for each frame. As a result, the motion and flow of the fluid can be different than before due to the increased accuracy of the simulation. In our case, we can set 64 is values for these properties. Now we can go back to the properties of the emitters and try to change some values in order to have a nice smoke flow. For example, I want the smoke trail to be narrower and move faster upward. So we can reduce the surface emission value to 0.2 and the source initial velocity to minus 0.8. Now it's also time to slightly increase the resolution divisions value in order to have a more accurate view of the final result. Let's set this value to 64. It is also a good idea to turn on the adaptive domain property. As you can see now, the domain is resized in each frame, and this allows the simulation to be much faster. We can leave the properties in the gas tab as they are, but feel free to experiment with different values. 17. Final steps of the simulation: Now it's time to set the proper cash method in folder. So in the cache tab, switch to modular and check these resumable property. Then choose a cache folder. Now you can press the Big Data button in order to save the simulation to disk. As we have checked these resumable property, we can stop the simulation baking at anytime by pressing the Escape key. In this way, we can take a look at the simulation without having to wait for the end. Then you can press the Resume button in order to complete the baking of the simulation. Otherwise, press the Free button to delete the actual bake. As a last step, we have to activate the noise property. As we already saw, this is useful to increase the fine details. You can leave that uppers factor to the default value of two. I also suggest to reduce the strength factor to something like 0.1 as we don't want to add much noise to the smoke and fire flow. Now, you have to separately bake the data and then the noise. Of course, if some of the fragments come out of the domain, you can resize it. We can still improve the simulation in two ways. First of all, it would be better for the smoke to gradually disappear. We can do that by activating the dissolved property. Before doing that, you have to free the baking data. Now click on the dissolved checkbox and set a proper value for the time parameter. Consider that the higher this value is, the slower the smoke disappears. A value of 50 can be a good choice. We can bake the simulation again and see the final result. At first glance, it seems all fine. But sometimes there might be a strange issue in the domain movement. Basically, at some point, the domain suddenly shrinks, for example here, and consequently, the smoke is cut out. We didn't have the same issue when played the simulation and the replay mode. In this case, we didn't activate the dissolved property. So this may be an issue related to this. In some cases, this can also be due to the way the size of the domain is computed. When the density of the smoke in a particular space is below a defined threshold, the domain is scaled down in order to save computation resources. We can reduce this issue in two ways. First of all, we can add more margin around the domain, for example 10. And we can also reduce the threshold value at which blender consider the space inside a cell is empty. For example, let's set a value of 0.01. Let's bake the simulation again. If the issue is not solved, as in this case, you can simply disable the adaptive domain option. It will take a longer time to bake, but it should also definitively solve the issue. The last improvement we can do is to add some energy and power to the simulation when the asteroid hits the ground. In order to do that, we can take advantage of the properties inside the fire tab. These parameters are related to the intensity and height of the flames. For example, increasing the reaction speed property will result in smaller flames. You can also tweak the temperature maximum and minimum in order to have higher flames. So the idea is to animate these properties when the asteroid hits the ground. We can add a key frame for all these properties to frame 92. To add a keyframe, move the mouse over a field and press the I key. Now move a few frames forward and change the related values. For example, 0.4 for the reaction speed, 1.5 for the flame smoke, 0.7 for the vorticity, and finally, five for the temperature maximum property. Very good. We completed all the main steps to have a nice asteroid simulation. As a final step, we have to create the material for the smoke and fire. And I will show you this in the next lesson. 18. The material of fire and smoke: Now it's time to create the material for the fire and smoke. Consider that in order to have more details, I baked again the smoke with a resolution divisions of 128. Select the domain and in the material panel, create a new material. Then open the shading workspace. For this topic, I assume that you already have a basic knowledge on how to create materials and nodes. First of all, delete the principled shader and add the principled volume shader. Indeed, we are dealing with a volume, so we don't need the surface shader. Now select a proper view and move to a frame where the smoke and fire are clearly visible. Finally, select rendered as viewport method. Check that you have selected cycles as rendering engine. You can also temporarily hide the buildings, the sky images, and the collision plane. The principal volume shader contains all the parameters we need to create a realistic fire and smoke material. The color parameter is related to the global color of the smoke. But if you have animate the color, as discussed some lessons ago, you have to write color and the color attribute field. This is an important question to point out. In a fluid simulation, blender automatically creates many attributes that stores different types of data. We can see some of these attributes in the Viewport Display tab of the domain object. Let's go back to the solid view port mode for a moment. Then activate the grid display option. In the field tab, you can see all the attributes related to the simulation. The default attribute is the density, and it is basically the density distribution of the smoke. If you select flame, you can see the distribution of the flames in the fire component. We don't see the color attribute as it is related to the fluid emitter. However, what is important to know is that we have some attributes that can be used to our advantage in the fire shader. Let's uncheck the grid display option and activate again the rendered viewport method. The density field is useful to globally multiply the density of the smoke. However, do not increase too much this parameter. If you want to increase the density a lot, you should physically add more smoke to the simulation. For example, increasing the density and the flow emitter, the flame smoke and the fire tab of the domain, or increasing the volume of the emitter itself. The density attribute in the volume shader is related to the appearance of the material and can produce some artifacts if increased too much. Below, we have the density attribute. This is the attribute that blender uses to compute the distribution of the smoke. If you delete this field, there is no more data on how to distribute the density of the smoke. And as you can see, each voxel is completely filled with smoke. The interesting thing about attributes is that you are free to use them as you want. For example, you can use the heat or temperature attributes instead of the original density. This, although not physically correct, gives you more freedom from an artistic point of view. Another way to stylize the shape of the smoke is to use the density attribute as an input value for the density itself. Currently, the density attribute is uniformly multiplied by the value and the density field. So if we set to as density value, the actual density value is uniformly multiplied by two and each position in the space. But we can take a step forward. First of all, add a new attribute node in the field name type density. In this way, we are using the density attribute, then plugged the factor value and the density field of the volume shader. As you can see, the shape of the smoke slightly changes. Basically. Now we are multiplying the density by the density itself. We can also add a math node and set it to the power operation. By increasing this value, we are increasing the contrast and the smoke. You can also add more mathematical operations to find the best shape for you. And you can also change the input parameter, for example, heat. Anyway, the concept to keep in mind is that you can use any of the volume attributes as input values for the actual properties. This is also true for any of the following attributes of the volume shader. For now, let's unplug this attribute from the density input. The next parameter is the anisotropy one. This refers to a different physical property of a material in relation to the different directions. This can be useful to add some variety to the material. And in the case of the smoke, mostly in the way it reacts to the backlight. So we can set any value above 0, for example, 0.3. The emission strength attribute is very interesting. It refers to the ability of the volume to emit some light. If you set one is value, the smoke becomes a fully emissive volume. However, it seems that each voxel is a full light, but we don't want to do that. As in the case of the smoke, we want to correctly shaped this light. And again, the right way to do that is to plug one of the volume attributes as input values. For example, let's try with the density attribute. This means that the density of the smoke defines the emission power of each point of the volume. But the emission shape is now exactly as the original smoke. If you change the attribute to heat, a smaller portion of the smoke becomes emissive. And if you change the value to flame and even smaller part is included. This is useful to control the portion of the smoke you want it became an emission volume. This will be clearer when we see how to add fire. We can also change the color of the light. Let's unplug the emission strength for now. The next parameter, the blackbody intensity, is the one that controls the fire material and color. If you set the value to one or any value you want, you can finally see some beautiful fire. The color and intensity of the fire is controlled by the temperature attribute. As in the real life, the higher the temperature, the more yellow and white the flames become. On the other hands, the lower the temperature, the more red the flames become. So now we have some smoke and fire. But there is another improvement we can do. The fire seems to end up very close to the asteroid. How can we extend the flames? We can take advantage of what we already saw, the emission property. Let's plug the heat attribute in the emission strength property. The heat attribute is useful in this case because it gives the right distribution of density. If you try with the flame or temperature attributes the emission in soon. However, the emission has not the right color. In order to have the same color as the original fire, we have to add a blackbody node and plug it into the emission color property. As a last step, we have to shape the emission value. Otherwise it completely overlooks the smoke below. So let's add again a Power Math node and increase its value until you get the desired shape. Now we can show again the other buildings and the sky planes and have a look at the final scene. I hope this course has provided you with the basic concepts of fire and flames simulation. And of course, if you have any questions, I am available to help you.