It’s time to put the skills we just learned about to the test; this chapter is about creating a realistic campfire simulation and learning how to create sparks in Blender! Creating fire is easy, but creating fire that looks realistic is a whole other story. You need to think about the settings for the domain, the flow object, any collisions you have, the lighting, and the materials. It takes a bit more than setting the resolution in the domain to 1,000 and hitting Bake. Remember, setting the resolution super high doesn’t necessarily mean the fire will look good; plus, we’re pretty sure Blender would crash if you did that.
Here are the following topics we will cover:
We have a lot of things to cover in this chapter so let’s jump right into it!
This chapter requires you to have Blender version 3.0 or above installed.
To download Blender, visit www.blender.org.
This tutorial is a bit more advance, and we won’t be covering everything. It assumes you know the basics of Blender and how to render animations.
Make sure to download Campfire Setup.blend to follow along with this chapter from the following link: https://github.com/PacktPublishing/Learn-Blender-Simulations-the-Right-Way/tree/main/Chapter03.
To get a head start on this chapter, we have already created a 3D model of a campfire called Campfire Setup.blend for you to download. This .blend file includes some logs, rocks, and materials already in place; that way, we can jump straight into creating the simulation.
When you open the Campfire Setup.blend file, you will notice that the campfire is very large. The reason for that is because Blender doesn’t simulate very well at a small scale and can cause you problems. We’ve had problems where the fire fills up the entire domain, then the fire looks very noisy and the bake will take a super long time. In general, it’s usually a good idea to simulate at a large scale.
What if you already created a scene at a small scale? Well, a solution for that would be to create a simulation in another blend file, then import that simulation as a volume object. At that point, you will be able to scale down the fire and move it anywhere in the scene.
For now, let’s create the domain object and start setting up the simulation!
With the Campfire Setup.blend file open, let’s create a domain object and change some of the settings to get the desired look as follows:
Figure 3.1 – Domain size
And there we go, we have set up the domain. Now it’s time to create all the Flow objects!
Now that the domain is set up and ready to go, let’s create the flow objects. If you take a look at real campfires, you will notice that not all of the sticks and logs are on fire; only the ones that are near the bottom are.
Figure 3.2 – Real campfire example
Let’s replicate that by only selecting the logs that are on the bottom of the fire and setting those as the inflow objects. The objects that we can select as inflows are Cylinder.001 through .006. You can view the names by looking at the top right of Blender as follows:
Figure 3.3 – Inflow selection
Once we create the first inflow, we can apply those same settings to the rest of the objects. Let’s get started as follows:
Now let’s enable a texture. This will allow us to control where the fire will emit on our object. Check the Texture box, then head over to Texture Panel (it will look like a checkered pattern).
Figure 3.4 – Texture example
Here is where we can create and set up textures for our objects as follows:
The following is what your texture should look like now:
Figure 3.5 – Texture preview
Figure 3.6 – Inflow Texture selection
Now the texture will move around as the animation plays.
What is an active object?
When you have multiple objects selected in Blender, there will be one that has a yellow outline. This is your active object. The rest of the objects will have an orange outline.
Then, press Ctrl + L or Cmd + L and click Copy Modifiers. Now all of those objects will have the exact same settings we just created!
And there we go, we have successfully created all of the inflow objects. The next thing we need to do is assign some Effector objects. We don’t want the fire to go through the logs, so let’s assign some collisions!
This part is pretty simple. All we need to do is assign an Effector Collision to all the logs that aren’t inflows, as follows:
Figure 3.7 – Effector selections
If you hold Shift and select Cylinder.014, it will automatically select everything in between.
We don’t need to assign the collisions to the rocks because the fire will not reach over there!
With that done, we are ready to bake in the simulation. To do that, select your domain object and click Bake Data. Look at the following figure to see what your simulation should look like so far!
Figure 3.8 – Baked simulation
Now that the simulation is complete, we are ready to create a nice fiery material!
Now that the simulation is finished, we are ready to create the fire material. One thing we wanted to mention here is that for this scene, we will be using Cycles to render the animation. There are a couple of reasons for this.
One of the main reasons is that when using Eevee, lamps are the only things that emit light. This means that the fire will look like it’s just glowing and won’t light up the rest of the scene. Since we are going for a realistic simulation, we want to use Cycles so that the fire actually emits light to the surrounding area.
Another reason is that there are a couple of features in the material that only work in the Cycles render engine. So, head over to Render Panel and switch the engine to Cycles, then we will be good to go!
With that out of the way, let’s create this fiery material as follows:
Figure 3.9 – The Shading workspace
Figure 3.10 – New material
Figure 3.11 – Principled Volume
Attributes
Heat, along with many other attributes, can be brought into the material and used however you like. For example, you could take the velocity attribute and plug that into the emission value. Then, you will be able to see the values of the velocity in the simulation. Flame, density, temperature, and velocity are just a few of attributes at your disposal. Also, the heat attribute only works in the Cycles render engine.
In order for this to work, we need to add in Attribute Node. To do this, press Shift + A > Input > Attribute.
If you go into Rendered View, the following is what the node setup should look like so far:
Figure 3.12 – Heat attribute
If we look at real flames, you will notice that the edges have this red tint, and as you travel closer to the, it goes orange then white.
Figure 3.13 – Real flame example
To get the same look, select the black handle and set it to a red color, then set the white handle to an orange color. Play around with the positions until it looks good. You can always change the colors later to get different looks for the fire!
Figure 3.14 – Fire material example
And there you have it! We have finished creating the fire material. And just in case you got confused in this section, the following figure is a full preview of all of the nodes:
Figure 3.15 – Full material preview
In the next section, we will learn how to add sparks to our flames using a particle system!
Now that the simulation is complete with a material, it’s now time to work on creating sparks that fly out of the fire. This is very easily done using a particle system. Using particle systems in Blender can be very useful and save a lot of time compared to adding the objects in manually. It works by emitting the particles from a mesh object, normally in a great quantity. Things such as sparks, dust, hair, grass, and many more can easily be created using particles!
Now let’s create the sparks as follows:
Figure 3.16 – Adding a circle
Figure 3.17 – Creating the particle system
Figure 3.18 – Scaling the particles
Figure 3.19 – Gravity
Figure 3.20 – Fluid Flow settings
We have now finished creating the particle system! Feel free to play around with the number of particles, the strength of the force field, and whatever else you like to get your desired look! Before we talk about rendering, we need to create a material for our sparks.
The next thing on the list is creating the particle material. In real life right when sparks are emitted from a fire, they are in a very bright white color. As they rise and cool off, they turn to more of an orange red-ish color. We can create this same look by adding a couple of different nodes in the material as follows:
Particle Info node
This node allows us to take certain data from the particle system and have it influence the material. For example, you could take the Random output and plug that into ColorRamp. Now each particle will have a random color based on ColorRamp. One thing to note is that this node only works in the Cycles render engine.
Play around with the handle positions to control when the particle will change colors. The following figure shows the full node setup:
Figure 3.21 – Particle material
Now we have basically finished this tutorial. The last step is just to place the camera and set up some render settings!
Congratulations on making it to this part of the tutorial! Hopefully you have learned some new tricks and techniques along the way.
In the last part of this tutorial, we will be adding in a ground plane and a lamp to help brighten the fire, and we will enable motion blur, as follows:
Figure 3.22 – Lamp settings
Figure 3.23 – Motion Blur
That is basically all we really need to do. We encourage you to add a bit more to the scene. Maybe scatter some leaves around the ground, set up a background, add a couple of sticks and logs around the fire, or even have a character sitting down – it’s all up to you! If you want a bit of a glow around the fire, you could also add some Glare in Compositor.
Once you are happy with your scene, just set up the camera and hit Render Animation! The following figure is one frame from our animation:
Figure 3.24 – Final scene frame
To view the final result or to download this scene’s blend file, visit https://github.com/PacktPublishing/Learn-Blender-Simulations-the-Right-Way/tree/main/Chapter03.
That concludes this tutorial. We hope you learned a lot and made something cool along the way!
We have covered quite a bit in this chapter, so let’s do a recap. At the beginning of the chapter, we learned about creating a fire simulation, adding textures to flow objects to create variation in the fire, and how to apply those same settings to multiple objects at the same time. After that, we discussed how to add a lot of detail to the fire using the heat attribute in Shader Editor. We also created a particle system and learned how to make the particles follow the flow of the fire using the Fluid Flow force field. Finally, we made the particle material so that it changes color as it rises into the air!
In the next chapter, we will be moving away from smoke and fire. Instead, we are going to learn how to use the liquid simulation to create a really nice waterfall in Blender 3.0!
While it is great to follow a tutorial and learn how to do things, it’s also important to try and create things yourself. Not only is it good practice, but it will also help you remember everything we just learned! So, take a look at the following figure and try to think about how you would go about creating it.
Figure 3.25 – Green fire example
3.22.27.45