Book Image

Learn Blender Simulations the Right Way

By : Stephen Pearson
2 (2)
Book Image

Learn Blender Simulations the Right Way

2 (2)
By: Stephen Pearson

Overview of this book

Blender is a free, open source 3D software that allows you to create stunning visual graphics, animation, VFX, and much more! This book is an in-depth guide to creating realistic and eye-catching simulations, understanding the various settings and options around their creation, and learning how to troubleshoot solutions to your own Blender problems. In addition, this book can also be used to simulate the behavior of certain physics effects, such as fire, fluid, soft bodies, and rigid bodies. You’ll learn how to use Mantaflow, an open source framework within Blender software, to create fire, smoke, and fluid simulations. As you progress, you’ll understand how to easily produce satisfying rigid and soft body simulations, along with cloth simulations. Finally, you’ll use Dynamic Paint, Blender’s modifier, and the physics system to create eye-catching animations. By the end of this Blender book, you’ll have created a number of animations on your own, such as a campfire, waterfalls, and explosions. You’ll also have gained a deeper understanding of all the simulation options in Blender, which you can use to create portfolio-ready animations.
Table of Contents (21 chapters)
1
Part 1: Using Mantaflow for Fire, Smoke, and Fluids
7
Part 2: Simulating Physics with Soft Bodies and Cloth
12
Part 3: Diving into Rigid Bodies
15
Part 4: Understanding Dynamic Paint in Blender

Gas and liquid simulations

You’ve seen me throw around the terms gas, liquid, and fluid, but what are the differences? As mentioned previously, the term fluid is used to describe the entire simulation. Inside the simulation, there are two options to choose from:

  • Gas is the name Mantaflow uses for smoke and fire simulations
  • Liquid is just the name to describe fluid simulations

Let’s talk about each one separately so that you can understand the differences and how each one works.

Gas simulations

Gas simulations allow you to create smoke and fire in Blender. But what can you do with it? Well, you can combine fire and smoke to create a massive explosion. Other examples might include a flamethrower, campfire, steam, mist, or fog – there so are many things that you can create, and the possibilities are almost endless. The following figure shows what we will learn to create in Chapter 5, Creating a Realistic Explosion:

Figure 1.2 – Explosion example

Figure 1.2 – Explosion example

Smoke and fire simulations are made up of what we call voxels. You can think of a voxel as a 3D pixel of the simulation. The smaller the pixel, the better the simulation will look. You can change the size of these voxels by increasing the resolution of a simulation. Higher values will make the simulation more detailed, but that will also cause the simulation to run slower and take longer to bake:

Figure 1.3 – Example of a voxel

Figure 1.3 – Example of a voxel

In the preceding screenshot, the left simulation has a resolution of 8. This is quite small, so that is why the voxel is very large. The simulation on the right has a resolution of 64 and, as you can see, the voxel size is much smaller. You can also tell the size of the voxel by looking at the bottom-left corner of the domain object:

Figure 1.4 – Domain voxel size

Figure 1.4 – Domain voxel size

The domain is the container for the entire simulation. We will cover them in detail in the What you need to create a simulation section.

These voxels represent all the attributes of the simulations such as heat, density, temperature, and velocity, just to name a few.

What is an attribute?

An attribute is simply a term used to describe data that is being stored. You can take this data and use it to influence materials, modifiers, and more.

The smoke that gets created in the domain can be from either a mesh or a particle system. These objects that emit smoke are called flows. They are used to add or remove smoke from the domain. Using a particle system as the emitter, you can easily create an explosion, which we will learn about in Chapter 5, Creating a Realistic Explosion!

The movement of the smoke or fluid is controlled by the flow of air. The airflow can be controlled by the following properties:

  • The settings inside the Domain object, such as Density and Heat, which set how fast the smoke will rise.
  • Effectors, which are mesh objects that will collide with the smoke, restricting its movement.
  • Flow objects, which can affect how fast or slow the movement will be.
  • Force fields, which also offer a way to affect the movement of the smoke. Depending on which force field you add, you can give your simulation a much more dynamic and interesting look! For example, the Wind force field will give a constant force in the direction you point it in. This can be very useful for adding just a little bit of movement to the smoke and making it look a lot more interesting!

Now that we have covered gas simulations, let’s talk about liquid simulations.

Liquid simulations

Liquid simulations are very powerful, and there are many things you can do with them. Do you want to have a glass explode when it hits the ground, causing fluid to fly everywhere? What about creating a waterfall, waves, lava, or honey? All of this is possible with the liquid simulation:

Figure 1.5 – Waterfall example

Figure 1.5 – Waterfall example

These simulations are used to simulate the real physics and behavior of fluids. Unlike the gas simulation, if you increase the resolution of the fluid, it will add geometry to the scene:

Figure 1.6 – Fluid resolution example

Figure 1.6 – Fluid resolution example

In the preceding screenshot, the left-hand side has a resolution of 96; on the right, it’s set at 32. The left-hand side looks highly detailed with a lot of geometry, creating lots of splashes. However, the right-hand side has low detail, giving the look of low poly. Sometimes, a lower resolution might be what you are going for; it all depends on what you are trying to create.

The fluid can only be emitted into the domain using a mesh object such as a cube, sphere, or plane. Particle systems will not work for fluid simulations.

Increasing the resolution of fluid will drastically change the vertex count

The vertex count went from around 8,000 up to 200,000, just by increasing the resolution by 64. This will add to the total memory of the scene, making Blender run a bit slower. You can view the total memory of the scene by right-clicking on the Status Bar area at the bottom of the screen and selecting System Memory.

Both gas and liquid simulations are powerful, and they allow you to create so many different things very easily. Now that we’ve covered the differences between them, let’s get into what you need to create simulations!