Transcripts
1. Intro: Blender is an amazing tool, and it is giving you access
to so many different tools, and one of those tools
is fire simulation. Fire simulation is a beautiful
tool that will help you to add some awesome smoke and
flame into your animations. However, as great as
fire simulation is, it can also be a little intimidating for new
Blender users to learn. If you are trying to learn
how to use fire simulation, this is a class for you. In this class, I will
show you how does the fire simulation
work, how to set it up, different settings
that will give you different appearances
for your fire, how to texture your fire, how to set up the effector, and all other things you need to know in order to use
fire simulation. So sit back and allow me to show you how to use fire simulation.
2. Flow object: In order to add a fire
simulation in blender, simply add a UV sphere. Press Object. Quick effect, and select quick smoke. By doing this, Blender
automatically gave us this very simple
smoke simulation. Now, before we actually start
talking about the details, let's first do a breakdown of how does the fire
simulation even works. Whenever you want to add a
fire simulation and blender, what you will need
are two objects. You will need one object
that is going to be the flow and one object that
is going to be the domain. If we select this UV sphere, and if we go under the physics, you can see that under the type, it is set as the flow. And what flow
objects are is they are the source of fire and
smoke in your simulation. All fire and all smoke you will get is going to come
from your flow object. Next, what you need is A domain. If we select this cube, you can see that it is set as
the domain under the type. And what domain
represents is basically the area within which your
fire and smoke can function. If we let display,
as you can see, smoke is rising into the sky until it reaches
the top of this domain, and at that point, it can't
go any higher than this. If we move this flow object
halfway out of the domain, you can see that only
the half that is within the domain is emiting
fire is emiting smoke. And if we remove it completely, we are no longer getting
any fire at all. So every time you are working
with five simulation, make sure that your
domain is covering all the areas where your
fire and smoke need to go. Since, like I said,
they will only be able to exist
within the domain. Okay. Now, both the domain
and the flow objects have a lot of cool settings that can help you to make beautiful
fire simulation. However, in this lesson, we are going to mostly
focus on the flow object. First, big problem we have. This flow object is
only a meeting smoke, not fire, how to fix that. To fix that, under
the flow type, simply switch this from smoke
to fire plus smoke Now, as you can see, now this flow object is
emitting fire as well. And also you have just fire. This fire is pretty
self explanatory. Now, even if you set your
flow object to fire, you are still going to
get some of the smoke. But still, it is a lot fewer than when we had
fire plus smoke. Let's switch this back
to fire plus smoke. And next, we need to talk
about flow behavior. Flow behavior is
going to control how your flow object
is adding fire. By default, this
is set to inflow. And what inflow is going to
do is it is going to cause your flow object
to constantly add more fire and smoke into your simulation for
every new frame. So every other frame, this flow object is adding more fire and smoke
into your simulation. Next, we have the geometry. Now, geometry is going to
do something interesting. Let's let this animation play. Okay, as you can see, geometry added some fire, but that fire lasted for
a very short period. Why is that? Well, what geometry setting is going to
do is it is going to cause your flow object to be
filled with fire and smoke. But it is only going
to emit fire and smoke for the first frame
of your simulation. As soon as you move
past that first frame, your flow object will
stop emitting fire. This setting is actually really useful if you want to make
something like the explosion. But if you want to cause your object to
consistently burn, you will need to use the inflow. Now, last setting we
have is the outflow. But to explain
what outflow does, we will need a new object. So select your domain, make it bigger because we will
need more space for this. And also what I
recommend you after you finish setting the
scale for your domain, press Control A, and
select the scale. That is going to reset
the scale of your domain. And I found that
fire looks a lot lot better when your domain
has a reset scale. Now, let's simply add a cube. Move it up. Let's
scale it like this. Move it a tiny bit closer. Control A, scale. Now, go to the
object properties. Under viewport switch displays to wires for better visibility. Go to physics, enable fluid, switch this to flow, switch flow type to fire plus smoke and switch this
flow behavior to outflow. Now, let's see what is going to happen when we play
this animation. Okay, as you can see, something strange is happening. Let's let this animation play. Actually, Okay, this is good. Now, watch carefully
what is happening here. This fire and smoke rising. They're going up until
they get close to this until they get
close to this cube. As soon as smoke
reaches this cube, it disappears. Now, why is that? You see, guys, flow object
What outflow setting does is it is causing your object
to behave like a sponge. The second, your fire and smoke. Touch the object that is set
that is set as the outflow. The smoke is going
to be sucked into that outflow object and it
is going to be deleted. So outflow is a really
cool setting to use. If you need to quickly
get rid of some of the smoke in your simulation,
since like I said, as soon as your smoke
touches the outflow, it is going to disappear and be cut out of
your simulation. Okay. Now, few more things. In case your file
simulation stops working, or it is not behaving according to the changes you added
in your simulation, there are a few things
you can do to fix that. First, what you can
do is you can reset your simulation to do
that, select your domain. Change any setting in
the domain and then change that setting back
to how it was previously. Doing so will cause your
simulation to be reset, and that should fix your issues. In case this doesn't work, in case your fire still
doesn't work properly. If your fire just disappears
out of your simulation, another thing you can
try is you can also increase the resolution of the fire if for whatever reason, your fire disappeared when
you added flow object you can simply increase
the resolution of your fire of your domain, and that should also
fix your problem. However, guys, keep your
resolution relatively low. Don't set your
resolution too high. I'm going to set it to 50, and I'm not going to set
it any higher than this. I'm going to talk about
I'm going to talk about a resolution in the
next lesson a tiny bit more. However, all you need
to understand for about the resolution for this lesson is that you shouldn't
set this too high, keep this at a low value. And if your simulation
doesn't work, you can fix that by changing this resolution
and then changing it back to how it
was previously. And if that still doesn't work, you can increase
your resolution. However, once again,
do not I repeat, do not set your
resolution too high. Now that we explained what
outflow setting does, we can actually
delete this cube. We don't need it anymore. And now, looks like my
simulation is a little glitched. So I'm just going to quickly
reset this simulation. Okay, this fixed my problem. Okay, the next setting we have to talk about is
these subframes. However, in order to properly
explain what subframes do, we need to cause this simulation to be set into the motion. We need to cause this flow
object to move around a bit. To do that, press the psychon that is going
to enable auto king. Now, press spaceNG
and simply move your flow object around and try to move it really,
really fast. H. Okay, by enabling out a king, we told Blender to
add a keyframe. Every time we make a
change in our scene. And as you can see,
by doing this, Blender added one keyframe. For every time we move
this flow object, let's disable out a king. We won't need it anymore. And now we let this
animation play. Now as you can see,
our flow object is copying every movement
we made with it. However, let's now explain
what subframes do. Let's let this
animation play. Uh huh. Okay, it is happening here. Now, watch carefully what
is going to happen here. Our fire is here, then here, then here, then here. However, the problem
is our flow object is not adding fire into
our scene consistently. We have one ball of fire here, then here then here, and the next one is
all the way here. Why is this happening? Why is our flow object not
adding fire consistently? Well, you see, when you have flow object
that is moving fast, what can sometimes happen is blender can be
a little confused about how should your
fire move between frames. And if that happens, what you will get is this
broken fire where flow object is adding a new burst of flame for every frame
of your simulation. And sub frames are going
to help us to fix this. Sub frames are basically
going to cause blender to calculate how should our
fire move between frames. Let's increase this
to a value of five, and let's see how
does this look now. Okay, let's go back a tiny bit. Okay, this looks
a lot lot better, but we still have a
small issue with fire. Let's increase this to eight. Okay, now our fire looks
really, really, really good. So basically, the higher
you set this value, the more smoother your
simulation is going to look. However, guys, do not
set this value too high. Why? Because this value is adding pressure
to your blender, not much pressure, but that pressure is
definitely present. And if you set this
value too high, you are going to
crush your blender. Simply give this value, simply give subframes value that is going to give
you a decent result, but make sure to not set this up too high and you shouldn't
have any issues. I'm going to set my sub
frames to the value of 12. I believe that is going to
give me the best result. And now let's
actually move on to the next important
setting density and fuel. What do these two settings do? Well, to explain, actually, let's test sub frames before we start talking about
density and fuel. Okay, with sub frames,
as you can see, we now have nice
pretty fire where this flow object is
adding fire consistently. However, now let's talk about density and fuel and
to talk about them, we need to cause
this flow object to now be standing still. So let's select all the key
frames and delete them. Now what do density
and fuel control. Density and fuel controls, how much fire and smoke you are going to have
in your simulation. Let's increase this fuel
value to a value of ten, and let's see what
is going to happen. Okay, as you can see, now we are having a lot of
fire in our simulation. And if we set this to
a value of zero, Okay. Now, as you can
see, now we are no longer getting any
fire, just the smoke. So basically what fuel
value controls is how much fire you are going
to have in your simulation. Fuel value controls
how much fire your flow object is going
to add into your scene. And next we have density. Let's set this value
to something like ten, and let's actually set fuel to zero because I believe
that without fire, the result of density is
going to be the most obvious. Now, density does
very similar thing like a fuel only for the smoke. What density is going to
control is how much smoke you have in your sind blender and how thick that smoke is. The higher you set this value, the more smoke you
are going to get, and that smoke is also
going to be thicker. And if we set this
value to zero, as you can see, we are no
longer getting any smoke. And actually, if we give
our fuel some value, but keep density at zero. And if we let display, you can see if you
just add fire, that fire is going to automatically add some
smoke into your simulation, but that smoke is going to
be in a very low amount. So what you need to know, density controls how
much smoke you have in your sin in blender and how thick that
smoke is going to be, and fuel controls how much fire you are going to have
in your simulation. Next, we have flow source. With flow source, we
need to talk about this thing called
surface emission. What surface emission
controls is how far from your flow object is
fire going to be emitted? If we set this
surface emission to a value of seven, filet display, you will see that this
fireball is now a lot bigger, since now fire is being emitted further away from
your flow object. If you set this surface
emission to a value of zero, you will lose all the smoke. But if you give it a
low value like 0.1, now you will get this, um ball of fire, but that ball of fire
is going to be very, very small since now your
fire is being emitted really, really closely to
your flow object. This is just one very
simple setting to use if you want to control how big your fireball
is going to be. Next, we have initial velocity. Now, to best explain what
initial velocity does, we will once again need to set this flow object
into the motion. So simply pick a new
movement pattern for your flow object. And now, let's watch how
does this fire behave? Okay. I actually think that smoke is actually
getting in a way, a little of our visibility. So let's let this flow
type to just fire, and let's see how is
our fire behaving? Okay. Now, as you can see, our fire is now moving
like a shooting star. It is very, very smooth and it is moving in
one straight line. Now, if this is
something that you want, then there is nothing wrong
with this fire behavior. However, realistic fire
doesn't move like this. Realistic fire
isn't this smooth. It's random, it's unpredictable, and it's moving in
all directions. And to recreate that behavior, you can simply enable
initial velocity. And now that we enable this, let's see how is this
fire going to behave now? Okay, now this looks
a lot lot better. Now our fire is random, it's unpredictable, and it's behaving like a real firewood. So yeah, this is just
one very simple tool to use if you want to get a
realistic looking fire. With this explained, we can once again delete
these key frames. We need to cause our fire
to once again be still, and we can also switch the
flow type back to smoke. Okay, however, there is one more thing you can do
with initial velocity. However, to explain
what that one thing is, we need to increase the
size of this domain. So select your domain, increase its size, and press Control A to
reset the scale. Now, if you look carefully, you can see that here we have X, Y, and Z axis. And under initial velocity, we also have X Y and Z value. Let's see what is going to
happen if we give X value, the value of 15 50 or 59. Let's play this. Okay.
Now as you can see, now fire is getting pushed
into this direction. Basically what initial
velocity settings also controls is in which direction the fire is getting emitted
from the flow object. The stronger you set
this initial velocity, the stronger this
effect is going to be. If we switch this to ten, you can see that fire is still getting pushed
in this direction, but now no longer
with such a force. Also, if we switch this initial velocity to
the value of negative 19. Now as you can see, now this fire is also
getting emitted, but in the opposite
direction, so yeah, this is just one very simple
tool you can use if you want to get your fire to be emitted
from a specific direction. And with this, we covered
pretty much all you need to know about flow objects. In the next lesson, we are going to talk about
domain in bit more details. However, before we
end this lesson, there is one more
friendly advice I would like to give you, and that advice is
save, save constantly. Save every time you make some big change in
your fire simulation. Why? Because fire simulations, especially the ones that
are bigger and more detail, are going to put a lot of
pressure on your blender. And if you don't save, what can happen is your
blender can crash, and then you will lose all
the progress you have made. But if you save, you can be 100% sure no progress
will be lost. So simply save your file, save your sin in blender, and also make sure to save every time you
make some big change. Okay, with this, we covered everything
for the first lesson. See you guys in the next lesson when we will be talking
about the domain.
3. Domain settings: Welcome back. In the
previous lesson, we were talking about the
flow object and how you can use it to get an
interesting results for your file simulation. However, we are
only halfway done. There is still one more
thing we need to discuss. We need to discuss
about the domain. The flow objects are useful, but the domain objects also
have a lot of cool settings, which we can use to make
very good fire simulation. However, to best demonstrate how can Domain help us get a good looking
fire simulation? We first need to once again
set this Usphere into motion. So once again, enable Ato king and set a new movement pattern for
your fire simulation. H. Okay. I believe this
is going to be good. Okay. But we have one problem. This domain is way too small. So let's press to scale it up. Actually, let's make
it wider a bit as well and taller a little more. Okay, now press Control
A to reset it scale. And let's see how is
this looking now? Okay, this is looking
relatively good. Now, it's good enough for now. Okay. Okay, so let's start
talking about the domain. First, under the physics
settings of the domain, first, we have the resolution. Now, in the last lesson, I told you not to set
resolution too high, and here is why. What resolution
controls is what is going to be the quality
of your fire simulation. The higher you set
this value here, the higher is going to be the quality of your
fire simulation. Now, the reason why
we needed to keep this resolution low
is very simple. You see, guys, the higher
you set up your resolution, more pressure is your simulation going to put on your blender. And if you put your
Resolution two. Hi. What is going to happen is your blender is
going to crash. So this is what I recommend you. While you are setting up
your fire simulation, I recommend you to keep your resolution at a
relatively low value, and only once you finish
setting everything up. Only then give it a
higher resolution and give it a higher quality. That way you are going to minimize the risk of
blender crashing and minimize the risk
that you are going to lose any progress
if it does crash. However, even with
the resolution being kept at a low value, I still recommend you to
constantly save your file. That way you are always going
to be sure you are never going to lose anything even
if blender does crash. Okay. Next, we have timescale. Now, timescale is pretty
self explanatory. It controls how fast your
simulation is going to move. The higher value will result
in faster moving simulation. The lower value will result in a slower
moving simulation. Next up, we have
adaptive domain. Now, guys, listen to me
very carefully because what I'm going to tell you
now is very important. Let's let this animation play. As you can see, our FPS
is red and that means that our blender is struggling to keep this
animation going in real time. Now, if we go under the output, you can see that
FPS is set to 24. The fact that FPS here is red, it means that blender
is struggling to run this animation at 24
frames per second. Now, why is that?
Well, you see, guys, Blender is right now calculating this entire domain as if it is completely filled
with fire and smoke. However, in reality, we only have fire and smoke in the
center of this simulation. So there is a lot of unnecessary unnecessary space
that is being calculated. And what you can do
to solve that problem is under the physics
properties of the domain, you can enable adaptive domain. And let's see what is
going to happen now. As you can see, this
domain is shrinking. It's only wrapping itself around the areas where you actually
have fire and smoke. And this is going to be a
huge time saver for us, since this is going
to lift a lot of pressure off of our PC. Now FPS is still
struggling a bit, but still it is a lot better
than how it was before. I always recommend you to
enable adaptive domain. It is going to cause your blender to run
a lot more smoother. However, there is one thing you need to know about
adaptive domain. Adaptive domain can cause your domain to shrink
but not to expand. If we play this animation, you can see that this
domain is only covering the areas where we
have fire and smoke, but let's disable
the adaptive domain, and let's see what is
going to happen if we move domain somewhere
where flow object will be right next to its edge. Renable adaptive domain and
let this animation play. As you can see, domain is
expanding on the right, but it's not expanding
on the left. Smoke is acting like
it's hitting the wall. Why is this happening? This is happening because adaptive domain can cause
your domain to shrink, but it can't cause
your domain to expand. That is why smoke is acting
like it's hitting a wall. When we set a scale for domain, this is where we put the
edge of our domain and fire can't move in this direction anymore than it already does, even with adaptive domain enabled so always make sure that your domain is covering all the areas where your
fire and smoke need to go, since domain will only
be as big as you set it, adaptive domain will not
cause it to grow beyond that. Now, next, we have
this dissolve setting. Let's watch this simulation. As you can see, right
now in our simulation, we are having a lot of smoke, and that smoke is
not fading away. It is just sticking in this simulation and
it's not going out. So how are we going to cause this smoke to slowly
fade out of our scene? Simply enable this
dissolve option. And now if we play
this from the start, now you can see our smoke
is slowly fading away. But now we actually have
the opposite problem. Now our smoke is fading
away a little too fast. So to cause our smoke to
fade a little slower, open this dissolve value and you can simply increase this
time to a higher value. The higher you set this value, the slower the smoke
is going to dissolve. Let's see how does
this look now? Okay. It looks good. We still have a lot of smoke. Actually, I think we still
have a little too much smoke. Let's increase this to 18. Let's see how is this
happening now because I don't want my simulation
to have too much smoke. Okay, let's decrease this to 15. Okay, this is fast enough. We are getting smoke, but we are not getting
too much smoke. And this is a good
time to mention. Don't blindly copy every value I put into this simulation. Right now, my goal
is to get you to understand what
do these settings do and how do they work. However, once you're working with your simulation
and blender, don't just blindly copy all
values I'm going to put in. Depending on what
you want to achieve, you will need to add
different settings. If you want a lot of
smoke in your simulation, you are going to set this
time to a higher value. If you want very little smoke, you will set this
to a lower value. And this is true for
all other settings I talked about here
in this class. So play around,
experiment a bit, and don't blindly copy every value I put
into this simulation. Okay. Okay. However, guys, even with dsolve enabled
and adaptive domain, we still have one more
problem we need to discuss. Let's see if we can see it
when it is, wait, wait, wait. Let's go back. Okay.
Here is one problem. Do you see what is
happening here? We have this circle
of the cloud. We have this circle of cloud. But what's happening here? I between frames, it gets
pretty much cut in half. You see, we have this
entire ball of smoke here, and in the next frame, it is getting cut in half here. Now, why did this happen? Why did this smoke get
cut in half in one frame? Well, it is because of the
adaptive domain and dissolve. You see, adaptive
domain and dissolve, these two settings are pretty much at war
with each other. Dissolve wants to cause
the smoke to slowly fade away over time,
but adaptive domain. Adaptive domain is constantly
looking for areas where it where it could reduce
the size of the domain. So what can happen
is if you have a really low amount of
smoke in some area, adaptive domain can be like and there's barely
any smoke here. It won't be any problem if we cut that smoke out
of the simulation. But no, that is a problem because that is not how
real smoke behaves. Real smoke doesn't just gets
cut out of the existence. It slowly fades away over time. So to get rid of that problem, open adaptive domain setting, and let's increase this
threshold to a value of 0.005. Let's see if this problem
is going to happen now. Smoke is still
getting cut out here, but this does look
a lot lot better. So let's decrease
this value even more. 005 0005. Let's see how does
this look now? Okay. Now we are
no longer having this problem and smoke is
nicely fading away over time. So yeah, this is good. So, the lower you
set this value, the smaller this
problem is going to be, simply put any value you
think works best for you. Okay, now next what we
have is we have the noise. Now, I already told you that resolution controls the
quality of your fire. But what you can do to
increase your quality even higher is you can
also enable the noise. The noise is pretty
much going to add a little more realism
to your fire. It is going to make it
look a little better. Actually, it will make
it look a lot better, but it's not going to add too much pressure
on your blender. Simply enable noise. Open these noise settings, increase this factor to three, and decrease the strength. Actually, let's leave
strength as it is. Let's see how does this look. Noise is a tiny bit too
strong here for my taste, let's decrease this
strength to 0.5. Still a tiny bit too strong, decrease it to 0.3. Okay, this is going to do. We have now the good noise
that is going to add just a little more
randomness and a little more realism
to your fire. Okay, we are almost done, but there is still one more
problem we need to discuss. Let's actually let this
animation play from the start. Now, as you can see, our
frame rate is still really, really low adaptive domain, it is helping us to
speed up the frame rate, but this is still a
very big problem. Now, usually in the view port, having low frame rate in the view port is actually
not that uncommon. It actually can
happen very often. However, when you
are working with fire simulation or when you
are animating in general, having this slow
frame rate can be a little problematic
the problem with low frame rate is that as long as this frame
rate is this slow, it is impossible to get an accurate sense of how is this fire behaving and moving? The only way to get that sense is by watching this
simulation in real time, and how are we going to do that? One word, actually two
words, viewport render. We are going to render the
viewport of this simulation. Now, how to render
the viewport position your viewport somewhere from which you can nicely see
your entire simulation. Go to output, switch
your frame rate to any frame rate you
are using when you are making your
animations in blender. I usually use 50
frames per second, but you can use any frame rate that you use when
you are animating. Switch this file format to
FFVDL under the output, pick a place where you want
to save your viewport render. After you picked
a place where you want to save your
viewport in render, make sure that you save, so that way you won't
lose anything if anything crashes,
press viewport, select viewport
render animation, and now just wait for this
viewport to finish rendering. All right, guys, my viewport
has just finished rendering. And while I would say
this does look good, this simulation still
has a few problems. The first problem is that my domain is still
way too small, especially on the sides. So I'm going to
select the domain, and I'm going to expand it
a little more like this. Now I'm going to press
Control A to reset it scale. And I also have a feeling that this fireball is moving
a tiny bit too fast. So to fix that problem, I'm going to once again
delete all the key frames, and I'm going to just redo the movement for this fireball. However, to make sure I won't have to deal with
low frame rate, I'm going to select the domain, go under physics properties, and press this icon. Actually, even better, scroll
down under the chase and switch this type from
replay to all and now, once again, I'm going to pick a new movement pattern
for this fire. Okay, under the domain, let's switch this
back to replay. Let's reset this domain by changing any setting and
then changing it back. Let's turn off adaptive
turn off auto king. Now we are going to make
a second viewport render. However, guys, one
thing I need to warn you about setting
up viewport render. When you are making a
second viewport render, make sure to give your
second viewport, a new name. You need to give it a new
name here under the output. Why do you need to do that? Well, it's because if you don't, what can happen is
Blender is going to cause your old viewport to get overlapped with the new one and you will lose your
old viewport render. It is going to be replaced
with the new one. But if you give your new
viewport render a new name, you are going to get
a new viewport render and you're still going
to keep the old one. Once again, nicely position your viewport and viewport
render animation. My second viewport has
just finished rendering, and I would say that my animation looks
really, really good. However, the only problem I
still have with it is that I feel that my simulation is
still a tiny bit too short. Now, that is only
problem for me. If you are watching
this tutorial, then don't make simulation
that is too long. Keep it a little, keep it relatively short
because the main point of this class is to get you to learn how to
use fire simulation. So you keep your simulation
relatively short, but I'm just going to
make mine last a tiny bit longer to make it
look more attractive. So once again, I'm
going to switch this type to all
under the domain. And now I'm going to set
the end value 250-500. That is going to double the size or double the length
of my animation. And under the timeline, I am going to press Control
T. That is going to switch the timeline
so that it is no longer showing me the frames. It is showing me the
length of this simulation. And now I can see
that this animation lasts for about 10 seconds. So once again, I'm
going to delete all the keyframes and I'm
going to set new keyframes for my view put render. Okay. I believe this is going
to be good enough, and now it is time we start giving a finishing touch
to this simulation. Let's go to the smoke domain, switch this type back to replay. And now, guys, it is
time that we talked about one of the most important
settings under the domain. Let's scroll all the way down to the bottom and here
we have the chase. Now, what does the chase do? Now, there is one thing you need to understand about
fire simulation. Fire simulation is treated
as its own separate file. Yes, you do have
your sin in blender, which you save every time
you press file and save. But blender treats your
fire simulation as something that is independent from the rest of
your sin in blender. As a result, you need to save your fire simulation
separately from the rest of your sine and this chase setting is
going to help you do that. Simply press this icon and
simply pick a place in your PC where you want to
save your fire simulation. After you did this, we have
frame start and frame ends. Frames, these settings are
pretty self explanatory. They control when
is this simulation going to start and when
it is going to end? This simulation
starts at frame one. But if we set this
frame start to a value of 100 and let display, you will see that this
simulation will not start. Until we reach the
frame hundred, only at that point,
this simulation starts. And the same thing happens
with this end frame as well. So let's set this frame
start value back to one. And since I want my simulation to last
until the frame 500, I'm going to set this end
value to frame 500 as well. Okay. Next, we need to start
discussing the baking. You see, guys, whenever
you have fire simulation, you need to bake it, and there are three
ways to do it. To. There are actually
two ways to do that, and that type is set here. By default, you have
this replay option, and this replay is perfect while you are setting up
your fire simulation. What replay setting is going
to do is it is going to cause your fire simulation
to be baked in real time, while this animation is
playing in the viewport. For example, if I let
this animation play, then this simulation is
being baked right now at the same time while this
animation is playing, that is actually the main
reason why viewport is so slow. Blender is trying to simultaneously bake
this simulation and keep the animation going. And like I said, this option is good while you are setting
up your sin in blender. However, after everything
has been set up, then you need to switch
to something else. At that point, you need
to switch this type from replay to all and that is going to give
you this ball button. By pressing this button, what you are going
to do is Blender is going to bake your
entire simulation. And yeah, after that, this simulation is going to
be more or less finished. However, before we start
baking this simulation, there are two things we need
to do. Let's scroll up. It's time that we
give our simulation a higher resolution now that
everything has been set up. I'm going to give my
resolution the value of 250. Now, guys, listen to me. Listen to me very closely. This resolution of 250 is very big and it's going to put a
lot of pressure on your PC. If you have a weaker PC, I recommend you to give your resolution
slightly lower value. Simply pick any
value that is high, but at the same time a value
that your PC can handle. So don't just blindly copy 250. You don't need to
set your resolution this high to get the
best possible result. Simply pick any
resolution value that is good and that can be
handled easily by your PC. So yeah, after you set
up your resolution, we are going to save our file. And before we actually start
baking this simulation, there is one more thing
I would like to set up. Right now, this ov sphere is burning constantly,
but what I want, I want my fireball to slowly fade into existence and
then to slowly fade out. So to do that, this is what I'm going to do. Actually, for best
demonstration, let's once again
lower the value of your resolution and switch
this type back to replay. I'm not sure did I show you this setting in
the last tutorial. Do you see this use flow
setting under the flow object? This is basically an on off
setting for your flow object. As long as this
setting is enabled, your flow object is
going to emit fire. So if we disable it, as you can see, we no longer have any fire in our simulation. But if we enable it, you can see fire is
coming right back. So what I'm going to do, I'm going to disable
these settings. I'm going to wait till the frame where this flow
object starts to move, and that is this frame here. Now I'm going to press this dot. This is going to add a
key frame to this value. Move one frame forward, re enable use flow,
press this dot. To add a key frame again. And now, now that we
have set this up, our flow object will turn itself on when we reach
the frame to 25, but this is still not good. This fire still just
pops into existence. I want this fire to slowly grow, so to do that, let's actually go to the frame, frame,
frame, frame. Frame 800, why not? Now, I don't want my simulation to have too much smoke in it. I'm going to send density
value to value of 0.5, and I also want my
fireball to be big. I'm going to set this
fuel value to two. Next, I'm going to press these two dots that are
next to these two values, and then I'm going to
go back to the frame 26 when our use node
setting is enabled. Now switch both of these
values back to zero. Press these two values again. Let's reset our simulation to make sure everything
works properly. If we play this animation now, what you can see is that now our fireball is slowly appearing into our scene
and it is slowly growing. But we also want to do this for the end of the
simulation as well. Let's go to the frame 400 close to the end
of this simulation. Actually, let's go here
slightly more back. Press these two dots for
density and fuel value. Move here close to the
end of your simulation, set both of these
values to zero, press these two dots
to add new keyframes, add a keyframe for
use flow value, move one frame forward, turn it off, press
keyframe again. Now when we play this animation, what is going to happen is
that our fireball is going to slowly grow and it
is slowly going to shrink and disappear around
the end of this animation. So now that we have
set everything up, select your domain,
increase value, increase resolution
back to a higher value. Make sure to save your file. When you are getting ready
to bake your simulation, always save your file
before you start baking. That way you are
going to be 100% sure you won't lose anything
even if blender crashes. Scroll down, enable this
easy zoomable option. Press switch this type
to all, press bake all. And now let's simply wait for this simulation
to finish baking. Yeah, my simulation has
very high resolution, so this is going
to take a while, so Let's just wait for
this to finish baking. My bake has just finished, and I also rendered my viewport, and I think this looks
really, really good. Now, there is only
one thing I would like to change about my
viewport simulation, about my fire simulation. And that is, I would like my fireball to be
a tiny bit bigger. So what I'm going to do, I'm going to select the domain. I'm going to free the bake. That is going to cause everything
we baked to be deleted. I'm going to select
my flow object. I'm going to go back to frame, this frame where we set the
value for density and fuel. Let's increase this
fuel value to something like four, four, why not? Preside to add new
key frame value. Let's go here where we have a next frame for the viewport. No, not here, little bit back. Okay, here, let's increase
this value to four as well. Press AD to add a new keyframe, open the domain,
reset your domain. Make sure to always reset
your domain before baking. And now let's press Baikal, and once again, let's wait
for this to finish baking. And also, if you're
wondering why we need it to enable
is resumable Well, to show you that, I will
need to pause my bake. To pause my bake, I will need to press escape. Simply press escape
to pause the baking. Now that we pause the baking, we have two buttons. We have free and resume. Resume will cause the
baking to continue as if it was never
stopped and free is going to basically erase
all your progress you made up until this point and you will need to
start from the scratch. You'll basically need to bake your entire simulation
from the scratch. However, if we haven't enabled
this resumable option, then we would have
only this free button. We wouldn't be able to continue. The baking, we
would have to free and then bake everything
from the scratch. However, guys, I
strongly advise you to avoid pausing your baking
as much as possible. Why? Because when you pause the baking and then
continue what can happen is your simulation can be a little buggy and glitchy. However, if you don't
pause the baking, if you simply let it play from start to finish
without pausing, then you will not
have those issues. So I would strongly advise
you to avoid pausing the bake as much as possible and only to do it when it is
absolutely necessary. So I'm going to free the bake. Now I'm going to
reset my simulation. Press bake, and let's wait for this simulation to once
again finish baking. And I think this is going to be the last bake we
are going to make. All right. My viewpod
has finished rendering. Then I'd say that this looks
very, very, very good. There is only one thing I would like to change,
but only one. I think that this fire appears
a tiny bit too quickly. It needs to grow a
tiny bit slower. So I'm just going to once again, delete my bake free,
my bake, sorry. And now, this is what
I'm going to do. Let's look for a frame where this appears. It's this frame. Press these two dots to
delete these keyframes. Let's go to this frame here. Okay. Now press this to 4.5
and press these two dots, and I believe this is
going to be good enough. Let's reset this scale. Let's reset this simulation, and let's bake it one last time. I'm actually so confident that this is going
to work that I'm not even going to bother to make
the fifth viewport render. So yeah, let's just wait
for this to finish baking. The latest fire has
just finished baking, and I know I said I'm not
going to render the viewport, but I changed my mind. Okay, looks like this
looks really, really good. We are finally getting a
really nice dancing fireball. So yeah, there is only
one thing left to do now, and that is to give this
fireball a texture. We are going to do that
in the next lesson. And for now, if you
manage to get this far, I want you to tap yourself on the back a little
because congratulations, guys, you just passed the most difficult part of
making fire simulation. Texturing in comparison to
this is a piece of cake. So see you guys in the next
lesson where we are going to discuss how to give your
fire a decent texture.
4. Texturing and compositing: Welcome back. In the
previous lesson, we finished making
this fire simulation, and we made a really good one. However, there is still one thing this fire
simulation is missing, and that one thing is texture. We still need to give this fire simulation a
very decent texture. So how are we going to do that? Well, first, what we need to do. We need to switch our
render engine to cycles, switch these to cycles, and simply prepare
everything as if you were preparing
for the final render. Now I'm not going to talk too much about how to
set up your render, since that is a topic that
deserves its own class, but I can make that
class in the future. Okay. After you have finished setting up
your render settings, go to shading like this,
select your domain. And here we have
our fire texture. Let's allow this to load. We already have a pretty good. We already have a decent
texture for our smoke. However, we only have our
smoke. Where is our fire? Well, to make our fire appear, we need to use this
black body intensity. If we increase this from a value of zero to
a value of 0.5, you can see that our
fire has came back. If we set this to
the value of one, you can see that our fire
is now even brighter. However, you can set these
to values higher than one. You can set this to a value
of 25 or to a value of 50 you can basically
go as far as high as you want with this
black body intensity and higher you set this value, the brighter your
fire is going to be. Now, this is a tiny bit
too bright for my taste, so I'm just going
to set this to 25. Okay, this fire already
looks pretty decent, but there is actually
so much more we can do to improve this
texture even more. To improve this texture, we need to add volume info. Simply add that
node and then take this flame and plug it into the black body
intensity. All right. Now, our fire is a
bit too dark now. So to fix that, let's
add a mat node, switch this node
from add to multiply and place this node between volume info and
principal volume. All right, our fire is
still a tiny bit too dark, but by changing the value
on the multiply node, we can control how bright
this fire is going to be. Let's switch this
to a value of 25. And this is giving us a very
decent value for our fire. And now, just to demonstrate, this is how our fire looks
with volume and with multiply and this is how it
looks without those values. And as you can see,
with volume info, this fire looks a
lot more detailed. However, there are still
a few things we can use to make this fire
look even better. Let's put some distance
between these two nodes, and next, we need to
add a color ramp. Okay. Now plug color ramp
between these two nodes. And now by changing the
values on the color ramp, we are changing the set of
fire in this simulation. First, let's switch this
from linear to constant, and now look carefully, select your light value, and by changing its position, you can basically control how much fire you are going
to get in your simulation. If we set this to a
position of 0.75, we have a little value. If we set this to
the value of 0.5. Now as you can see,
we are getting more fire if we set this
to a value of 0.25, now, as you can see, we have a lot more fire. So simply play
with this position until you get the amount
of fire that you like. Now, I think this is a
tiny bit too much fire, so I'm going to
switch this to 0.35. Okay, I believe this is going to give us a
very decent result. And now, guys, at this point, what we can also do
to get a better fire, let's actually move to get
a close up of the fire. Now, at this point, what you can do is
you can also press this plus button to
add a new black color, make sure this new
color is black. Let's actually zoom
out a tiny bit, just so this view port
can render faster. Now, if we play with this value of this new
black color we made, we are going to get
a different result. If we move this black color
to the position of 0.5, if you look carefully, you will notice
that we are getting a new shading effect
for our fire. If we move this fire, if we move this black color, a bit closer to the left
to the bit like 0.4. Okay, you can see
that our fire now has a lot more controlled
brightness than it did before. And if you move it all
the way to the right, you can see that
our fire now has a lot stronger brightness
than it did before. So simply, move this black
color around until you get the contrast of brightness
on the fire that you like. All right, I believe
that the value of 0.4 is going to give me a very
decent result for my fire, but there is something I would like you to know at this point. Don't blindly copy
everything I'm going to do. Simply play with these
values around a bit, play with these colors, and see what works best for you. For example, if I switch this
from constant to B spline, the colors are now
looking a lot different. Now, what has exactly happened? When this color ramp
was set to constant, the contrast between
bright and dark areas of our fire was
very, very sharp. But now that we switch
this type to be splint, what is happening is the dark and light values are
blending into one another. As a result, we are
getting this fire that is looking
very different now, since we change
this to be splint, we will need to once again
put a different values of fire on this color ramp. So simply play
with these values. And, as you can see, by rearranging the way these colors are set up
and by changing this type, you can see that we
are also getting a different look for our fire. So the point I'm trying to make, don't blindly copy
all I'm going to do simply play with color ramp
and play with multiply. Try getting different
values for these two nodes, and that way you are going
to learn something new, you are going to learn
new tricks that are going to help you to make
a lot better fire. The fastest way to learn fire simulation is by playing
with it and experimenting. So experiment with
different combination of colors here and with
different values of multiply, and you are going
to get something that looks really,
really beautiful. Okay. Now that we
set this B spline, I think that this
fire looks a lot better when this color
ramp is set to B spline. But there is still
one more thing we can do to make this
fire look better. Move this color ramp up a bit and pull these three
nodes to this side. Duplicate this multiple
node and place it here. Now, what you need to do add a new color ramp plug this density into the
color ramp and plug this color into the value
of this multiply node. Now, once again, switch this
from linear to constant. And now cause black and white
color to switch places, put white on the left side and put black on the right side. Okay, now by changing the
position of this black color, what you can control is how strong is this brightness
of the fire going to be. If we give this black color, the value of 0.25, you can see that now our fire
is a little less bright, but it also has this
interesting contrast of colors. And what you can also do is you can switch this
also to be spline. And you can also you can also
play with the position of this white color in order to get a good contrast of
color for your fire. Okay. So yeah, this is how
I usually set up my fire. But like I said,
don't blindly copy. All I'm doing in this tutorial, play with different
values on color ramp, play with different positions, and you are going to
learn new tricks that are going to help you to
make a beautiful fire. And one more thing you can
use to improve this fire. Let's add a new Mt node. And place it here between
volume info and color ramp. Make sure that this math node
is set to add basically, basically, by changing the
value of this new node, you are controlling
how strong is going to be the effect of this
second color ramp. If we switch set this
to a value of zero, you can see we have
a lot brighter fire if we set this to negative 0.5 you can see that our fire also became
a lot more bright. Let's set this to negative one. Okay, I'd say that this
value looks really, really good and is helping us make a really good looking fire. Okay, with this, we have
pretty much finished making this fire simulation. We nicely set it up and we
gave it a decent texture. However, there is still one more thing that you can
use to make this look better. Now, I'm not going to talk
about compositing much because compositing is a topic that
deserves its own class. However, in this lesson, I'm going to just briefly
show you how you can use compositing to make this
fire look a lot lot better. So let's go back to layout. And now, in order for this trick with compositor
to look to work, we need to add a camera, simply add camera into
your inning blender and position it somewhere where you can nicely see
your entire fire. Now, open the world properties, and let's open this
render viewport. Now, our fire would, I believe, look best if we
had a black background. However, if we switch the color of the world to pure black, you can see that
we have a problem. As you can see, this
black background looks really, really good. However, as long as this
background is black, we are not getting any
light from the world. The only light we have in this scene is light
from the fire. Now, because of that, we can see the fire, but we can't see the smoke. And on the contrast, if we switch this
background color to white, you can see that now we
have the opposite problem. Now we can clearly see both
the fire and the smoke. But this white
background is very ugly. So how can we both see our smoke and have a
nice black background? Well, we are going to do
that with the compositor. First, open this world
color and simply pick a value that you think is going to give you the
best possible result. I believe this is
going to give me act very decent
properties for the fire. Next, what we need to do, go to the compositor, make sure you have
use node enabled, and after that, go
back to layout. Render image and simply
wait for your image to finish rendering. All right. My image has just
finished rendering. But, guys, I made one mistake. There is one step
I forgot to do. Basically, before you
render your image, go to the render properties, scroll down under the film, open the film properties, and make sure to
enable transparent. What transparent? Let's open this.
What transparent is going to do is
pretty much it's going to make your background
is invisible. It is going to cut it out
of your final render. So now that you
enable transparent, open render and simply
select render image, All right, my new viewport
has just finished rendering, and now we have this
background nicely cut out. Now, what you need to do,
go to the compositor, and now you can see we have
our fire in the background. If you want to shrink
this image, press. That is going to
cause it to shrink. And if you want to
cause it to grow, press this old V, and that is going to cause
this image to increase. Now, we need to bring
back our background, but we need to cause
it to be black. So for that, simply type
Alpha over, plug it here. Make sure that your render view render layer is plugged
into the second image. Switch this image to pure black, and now plug this
Sulfa into the factor. Okay, now, as you can see, now we have this very
beautiful and very decent fire and smoke with black background. And also, if you
want the effect of the compositor to be
visible in your viewport, you can press this con here. If you select this sable, then the effect of the
compositor will be invisible. If you select the camera, the effect of compositor
will be visible, but only while you are looking at your scene
through the camera. And if you select always, the effect of the compositor is always going to be visible regardless of whether
or not you are looking at your scene
through your camera. Okay, with this, pretty much, you conquered the
fire simulation.
5. Effector: One last thing you should
know about fire simulation. I made this very
quick and very simple fire simulation to show you
what I'm going to talk about. And to make this work, I needed to cause fire
to quickly burst up. To cause that behavior
under the flow of object, I gave this initial
velocity Z value 100 and that is going to cause the fire to quickly
burst upwards. Okay. Now, why did
I make this scene? What is it that I would
still like to show you? Well, let's actually add a
simple cube, move it up here. And let's make it
wider, a tiny bit. Now let's press Control A, and let's reset it scale. Now, let's let this animation
play or even better. Let's give this animation
really low resolution. Let's set this to all. And now let's just wait
for this to quickly bake. And let's see what
is going to happen. All right. Now that this
animation has finished baking, let's see what is
going to happen. Now, as you can see, this
simulation has one problem. The second this fire
touches this cube. This fire doesn't actually
interact with it. The second, this fire
touches this cube, it just passes through it like it's not
even there at all, but this is not good. A real fire interacts with
objects that are around it. So how can you
cause your fire to interact with this cube and
with the other objects? One word effector. If you select this cube
and go under the physics, simply enable fluid, switch
this type to the effector. Now, let's actually rebake this simulation from the scratch and let's actually
make it shorter. Let's make it last 125 frames. Because demonstration
this demonstration doesn't require this
animation to be that long. Press Ball, and let's wait
for this to finish baking. Okay, this simulation has
just finished baking. Let's see what is
going to happen now. Okay. Now, as you can see, now that we set this
cube up as the effector, now once this smoke touches it, it is no longer
passing through it. Now it is actually
interacting with this cube. So yeah, anytime you want to add an object that needs to
interact with fire and smoke, make sure to set that
object up as the effector, and that object is
nicely going to interact with your
fire and smoke. However, a factor also has a few settings that we
need to talk about. The first setting
we need to talk about is this surface thickness. By default, this is set to zero, and what surface thickness
controls is how close to your flow object smoke needs to get in order
to interact with it. Now for demonstration, let's set this surface thickness
to the value of two. And now let's free the bake,
reset this simulation. Now let's leave this to bake and let's see what
is going to happen. Simulation just finished baking, and let's see what
is happening now. Okay. As you can see, our smoke is now
behaving differently. Before, when this surface
thickness was set to zero, this smoke was interacting with this cube only once
it touches it. But now when we increase
this surface thickness, now this smoke is interacting with this cube
even before it touches it. So this is basically what surface thickness
setting controls. These settings controls
how close to your how close to your object smoke needs to get in order
to interact with it. If we set this value to zero, smoke is not going
to interact with your object until your
smoke touches it. And if we set this value to two, smoke is going to interact with this object even
before it touches it. But there is still one more
thing we need to talk about. And for this, let's
delete this cube. Now, free this bake. Make sure to reset
your simulation. Now simply add a plane, move it up, scale it, press Controller to
reset the scale, fluid, and set this
type as the effector. Now, let's let this
animation bake. Let's let this
animation to bake, and let's see what
is going to happen. Simulation finished baking
and I let this plane. Now, as you can
see, this smoke and fire are still passing
through this plane, even though this plane is
clearly set up as the effector. Now, why is this happening? Well, effector was
always struggling a bit when was assigned
to the plane. This plane is a surface
that is infinitely thin, and that is causing
some trouble when calculating how should this
smoke interact with it. However, what fixing this
problem is very simple. Simply enable this setting here. And now let's free this
simulation, reset it, rebake it, and let's
see how this smoke is going to behave once
this finishes baking. All right, Bake was finished. And now, as you can
see, now this fire and smoke are nicely
interacting with this plane. So yeah, always just make sure that you enable
this Esplaner. If your object for
a factor is plane, this is just going to help you to get a little better result. Or you can also simply increase
surface thickness to one. That is also going to give you similar result as the
Is planar setting. Now there is also one more
thing we need to discuss, and that is these subframes. Now, if you were
paying attention, you know that this
flow object have subframes and what flow
objects do is they calculate, how should this fire
behave between frames? And now, these subframe settings is giving you also a similar
result on the effector. What subframe settings
are going to do? Is there going to calculate? How should your
smoke behave between frames while it is interacting
with the effector object? The higher you set this value, the smoother this
setting is going to get. Just like with the flow object, I highly recommend you to not set your subframes for
the effect or too high, to not add too much pressure
on your flow object. And with this, we covered everything we need to discuss
about fire simulation.
6. Outro: Congratulations, guys. You made it to the
end of the class. I encourage you to show others your beautiful work in
the class projects below, and I hope that you will put this new knowledge
to good use. Thank you for the attention. And if you have any questions, feel free to ask. See you in the next class. See.