Learn Blender Simulations the Right Way - Stephen Pearson - E-Book

Learn Blender Simulations the Right Way E-Book

Stephen Pearson

0,0
35,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Ready to unleash the power of visual effects? From explosive movie scenes to mind-bending game animations, this second edition pushes Blender 4.0+ beyond what you thought possible. Featuring a brand-new chapter on combining multiple simulations for a burning effect and updated guidance on rendering with EEVEE, this book takes your Blender expertise to new heights.
While Blender excels in 3D modeling and animation, this guide focuses specifically on VFX, helping you master realistic simulations using EEVEE and Cycles. You'll explore five physics-based simulations—Fluid, Rigid Body, Soft Body, Cloth, and Dynamic Paint—learning essential settings, troubleshooting techniques, and practical workflows. Through nine hands-on projects, including fire, waterfalls, and explosions, you’ll develop the skills to create stunning digital effects. Written by a VFX specialist who has taught thousands through best-selling courses, this book will help you build an impressive portfolio of professional-quality VFX projects in Blender and bring your creative visions to life!

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 407

Veröffentlichungsjahr: 2025

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Learn Blender Simulations the Right Way

Transform your artistic vision into stunning, realistic simulations with Blender 4.0

Stephen Pearson

Learn Blender Simulations the Right Way

Second Edition

Copyright © 2025 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Portfolio Director: Rohit Rajkumar

Relationship Lead: Neha Pande

Content Engineer: Anuradha Joglekar

Program Manager: Sandip Tadge

Growth Lead: Namita Velgekar

Technical Editor: Tejas Mhasvekar

Copy Editor: Safis Editing

Proofreader: Anuradha Joglekar

Indexer: Tejal Soni

Production Designer: Ponraj Dhandapani

Marketing Owner: Nivedita Pande

First edition: November 2022

Second edition: April 2025

Production reference: 1070425

Published by Packt Publishing Ltd.Grosvenor House 11 St Paul’s SquareBirmingham B3 1RB, UK

ISBN 978-1-83620-005-5

www.packtpub.com

To my parents, who helped me start on this journey of learning 3D. And to my wife, Jamie, for her encouragement and inspiration as we both write and create together.

– Stephen Pearson

Contributors

About the author

Stephen Pearson is a 3D artist, graphic and product designer, video producer, and the founder of BlenderMadeEasy. He has worked in the 3D industry for over 11 years and has produced several best-selling courses on architectural visualization, Visual Effects (VFX) simulations, and animation. He started using Blender in 2014 as a fun hobby, but now he uses it to teach other 3D artists around the world. In his spare time, he enjoys exploring local breweries, going for a ride on his motorcycle, and playing with his two dogs.

I would like to first thank my family, friends, and loving wife for all the encouraging words and support throughout the process of writing this book. I would also like to thank all the Blender developers for making such an amazing program free and open source for anyone to try. And, of course, thank you to all the people who have watched my tutorials and supported me throughout the years.

About the reviewers

Mariselvam M is a VFX artist who works on visual effects, animation, and movie projects that demand technical precision and artistic creativity. Their passion for the field was sparked by a love for cartoons and movies, which continues to inspire their work today. Known for their expertise in Blender and Houdini, Mari is passionate about crafting visually compelling narratives In addition to their professional endeavors, Mari enjoys traveling with friends, drawing creative inspiration from new experiences.

I extend my heartfelt thanks to my parents and friends for their unwavering support.

 

Thirunavukkarasu M is an AR/VR Developer and 3D Artist with a strong focus on creating immersive experiences using Unity, Blender, and Meta Quest devices. Currently, he is working at the Logistics Sector Skill Council, developing cutting-edge AR/VR solutions to enhance training and visualization for the logistics and supply chain industry.

In his current role, he designs and implements interactive simulations and 3D assets that improve learning outcomes and operational efficiency. His expertise spans Unity development, 3D modeling, and mixed reality (MR) applications, with a proven track record of delivering projects like Caddy VR for industrial visualization and Fighter Jet Training Modules for defense preparedness. His work is driven by a commitment to innovation and a desire to push the boundaries of what’s possible in extended reality (XR).

Join our community on Discord

Join our community’s Discord space for discussions with the author and other readers: https://packt.link/learn-blender-simulations-discord-invite

Table of Contents

Preface

Part 1: Using Mantaflow for Fire, Smoke, and Fluids

1

An Introduction to Mantaflow

Technical requirements

What is Mantaflow?

Gas and liquid simulations

Gas simulations

Liquid simulations

What you need to create a simulation

Domain objects

Flow objects

Effectors

Creating your first simulation

Adding the objects

Creating the simulation

Setting up the camera

Rendering the animation

Setting the output

Summary

2

Understanding Domains, Flows, and Effectors

Technical requirements

Domains

Settings

Cache

Gas domains

Liquid domains

Diffusion

Particles

Mesh

Guides

Collections

Field Weights

Viewport Display

Render

Flow objects

Effectors

Summary

3

Creating a Realistic Campfire Simulation

Technical requirements

Creating the campfire simulation

Setting up the domain

Setting up the inflows

Adding effectors

Creating the fire materials

Creating sparks using a particle system

Creating the particle material

Adding the final details

Summary

Exercise

4

Creating a Waterfall Using Mantaflow

Technical requirements

Setting up the simulation

Adding inflow and effectors

Adding foam particles

Creating materials

Adding vector blur

Rendering animations

Summary

5

Creating a Realistic Explosion

Technical requirements

Creating the particle system

Creating the simulation

Setting up the domain

Adding the inflows

Creating the material

Creating the smoke

Creating the fire

Rendering the explosion in Cycles and EEVEE

Rendering in Cycles

Rendering in EEVEE

Summary

Part 2: Simulating Physics with Soft Bodies and Cloth

6

Getting Started with Soft Bodies

Technical requirements

Introduction to soft body simulations

Understanding collision objects

Understanding soft body settings and values

Object settings

Cache

Soft Body Goal

Edges

Self Collision

Solver

Field Weights

Interacting with multiple soft bodies

Summary

7

Creating a Soft Body Obstacle Course

Technical requirements

Creating the simulation

Adding the soft body

Adding collisions

Creating the cloth simulation

Using Soft Body Goal

Creating a glass material in EEVEE

Setting up camera tracking

Summary

8

An Introduction to Cloth Simulations

Technical requirements

What is a cloth simulation?

Understanding collision objects

Understanding cloth simulation settings and values

Physical Properties

Cache

Shape

Collisions

Property Weights

Field Weights

Summary

9

Creating a Realistic Flag

Technical requirements

Adding the objects

Creating the flag

Creating the flagpole

Creating the rope

Creating the hooks

Creating the simulation

Making the materials

Creating the flag material

Creating the hook material

Creating the flagpole material

Rendering the animation

Summary

Part 3: Diving into Rigid Bodies

10

An Introduction to Rigid Bodies

Technical requirements

What is a rigid body simulation?

Understanding the Rigid Body settings

Settings

Collisions

Dynamics

Rigid Body World

Rigid Body Object Menu

Using rigid body constraints

Constraint settings and types

Summary

11

Creating a Rigid Body Physics Course

Technical requirements

Creating the simulation

Simulating the wrecking ball

Creating the domino effect

Simulating the elevator

Animating the rigid bodies

Creating the hinges

Collapsing the cubes

Adding the camera animation

Setting up the render

Summary

Part 4: Understanding Dynamic Paint in Blender

12

An Introduction to Dynamic Paint

Technical requirements

Getting started with dynamic paint

Creating a paint simulation

Understanding the canvas

Settings

Surfaces

Cache and Output

Using brushes

Settings

Source

Velocity

Waves

Summary

13

Creating a Paintbrush Effect

Technical requirements

Animating the brush

Creating hair particles

Simulating Dynamic Paint

Adding the materials

Setting up the render

Summary

14

Creating a Raindrop Effect

Technical requirements

Setting up the scene

Creating the rain particles

Simulating the waves

Creating the water material

Setting up the render

Summary

15

Creating a Burning-Up Effect

Technical requirements

Dynamic weight painting

Creating the Cloth simulation

Using the Mask modifier

Simulating the fire

Adding the domain

Setting up Inflow

Adding burnt and fire materials

Domain material

Burning material

Summary

Index

Other Books You May Enjoy

Preface

Over the last couple of years, Blender has surged in popularity due to the 2.8 release, which completely changed the user interface. Not only are thousands of people downloading Blender every day but many big studios, such as EA Games, Infinity Ward, and Ubisoft, have also taken notice and started using it as well. Now, with the introduction of 4.2, Blender has become even more common across various studios. This open source, cross-platform software has everything a 3D creation suite should have. Modeling, rigging, animation, rendering, compositing, motion tracking, game creation, and – what this book is all about, simulating physics – are just a taste of what can be done using Blender!

Physics simulations in 3D have become standard in movies, games, and animation. Most explosions, crashes, destruction, fire, and fluid effects are all done on the computer. In this book, we will be covering the five main simulation types in Blender, which are fluid simulation (including fire, smoke, and liquid), soft bodies, cloth, rigid bodies, and dynamic paint. We will be going through each one in detail, and there will be hands-on projects for each simulation type. By the end, you should have a good grasp of every simulation in Blender and how to use them together seamlessly. It’s time for you to feel confident in creating your own Visual Effects (VFX) projects and animations!

Who this book is for

This book is for VFX artists, 3D artists, game designers, and any Blender user who wants to learn about creating physics simulations. Readers are expected to have basic knowledge of the Blender interface and how to use it.

What this book covers

Chapter 1, An Introduction to Mantaflow, begins our journey of learning Blender simulations by taking a look at Mantaflow. You will get an understanding of the basics and what it takes to create a fire, smoke, or fluid simulation.

Chapter 2, Understanding Domains, Flows, and Effectors, gets technical. It’s hard to know exactly what each setting and value does, so in this chapter, we will cover each one in an easy-to-understand way. By the end, you will have a good grasp of what every setting does in a mantaflow simulation.

Chapter 3, Creating a Realistic Campfire Simulation, puts your technical knowledge to the test by creating a realistic campfire simulation. Step by step, we will go through the entire process, and by the end, you will have created a nice, satisfying campfire scene.

Chapter 4, Creating a Waterfall Using Mantaflow, looks at the liquid side of mantaflow by creating a realistic waterfall scene. In this chapter, we will walk through the process of creating a waterfall, adding foam particles, and rendering the animation.

Chapter 5, Creating a Realistic Explosion, explores explosions, which are very fun and exciting but can be a bit tricky to create in Blender. That’s why, in this chapter, we will go through how to create a realistic explosion from start to finish, using particle systems, smoke simulations, and complex materials!

Chapter 6, Getting Started with Soft Bodies, examines soft body simulation, which allows you to deform your object in a soft and organic way. In this chapter, we will cover everything there is to know about the soft body simulation and all its settings and values.

Chapter 7, Creating a Soft Body Obstacle Course, covers creating an obstacle course for a soft body sphere to go through. We will cover collisions, cloth, soft bodies, goals, glass materials, and more. Then, we will render the animation in Eevee.

Chapter 8, AnIntroduction to Cloth Simulations, delves into cloth simulation in Blender and how to use it effectively and efficiently. We will discuss each setting and value with screenshots and images so that it’s easy to understand.

Chapter 9, Creating a Realistic Flag, looks at creating an animation using cloth simulation, and what better way than to create a flag? In this chapter, we walk you through the process of creating a realistic flag, from adding the flagpole to attaching the rope to creating a fabric material.

Chapter 10, An Introduction to Rigid Bodies, explores rigid bodies, which allow you to simulate physics while not deforming your object. In this chapter, we will discover how to use this simulation and how to work with constraints, as well as all the settings and values that come with it.

Chapter 11, Creating a Rigid Body Physics Course, covers rigid body simulation in a practical way by creating a physics-based obstacle course in Blender. We will learn how to create a domino effect, create an elevator using constraints, simulate thousands of cubes all at once, and much more in this chapter.

Chapter 12, An Introduction to Dynamic Paint, delves into dynamic paint in Blender. Dynamic paint is a way to simulate the behavior of brushes and canvases. This can be used to create colormaps, displacement, weight, and waves.

Chapter 13, Creating a Paintbrush Effect, looks at using dynamic paint in Blender to create a paintbrush effect! We will start by animating a brush following a curve, then look at creating a hair particle system, simulating dynamic paint, and creating the materials.

Chapter 14, Creating a Raindrop Effect, shows you how to create a raindrop effect using particles and dynamic paint. We will first create a nice lake scene, adding in rain particles, simulating ripples, and creating water materials!

Chapter 15, Creating a Burning-Up Effect, shows how to combine multiple simulations together to create a unique animation! We will start by using dynamic paint and a mask modifier. From there, we’ll simulate cloth flowing in the wind, and finally use the fire simulation to create the burning-up effect!

To get the most out of this book

You will need at least Blender 4.2 installed on your computer. It is, however, recommended to have the most up-to-date version of Blender, as some of the later chapters were written in 4.4.

Software/hardware covered in the book

Operating system requirements

Blender 3D

Windows, macOS, or Linux

Basic knowledge of Blender and its interface is recommended, as this will help you to follow along with the projects.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Learn-Blender-4-Simulations-the-Right-Way. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781836200055.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “Let’s begin by opening the Burning Effect Setup.blend file.”

A block of code is set as follows:

html, body, #map { height: 100%; margin: 0; padding: 0 }

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

[default] exten => s,1,Dial(Zap/1|30) exten => s,2,Voicemail(u100) exten => s,102,Voicemail(b100) exten => i,1,Voicemail(s0)

Any command-line input or output is written as follows:

$ mkdir css $ cd css

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “On Frame 1, press K and add a Location keyframe to the brush.”

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at [email protected] and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you’ve read Learn Blender Simulations the Right Way, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?

Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application. 

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

Scan the QR code or visit the link below

https://packt.link/free-ebook/9781836200055

Submit your proof of purchaseThat’s it! We’ll send your free PDF and other benefits to your email directly

Part 1: Using Mantaflow for Fire, Smoke, and Fluids

To start our journey of learning about Blender simulations, we will be taking a look at the fluid and smoke simulation system known as Mantaflow. Step by step, we will learn the basics and what it takes to create fire, smoke, and liquid simulations. From campfires to explosions to waterfalls, we will learn all there is to know about Mantaflow and how to use it in Blender.

This part has the following chapters:

Chapter 1, An Introduction to MantaflowChapter 2, Understanding Domains, Flows, and EffectorsChapter 3, Creating a Realistic Campfire SimulationChapter 4, Creating a Waterfall Using MantaflowChapter 5, Creating a Realistic Explosion

1

An Introduction to Mantaflow

Over the past five years, Blender has surged in popularity by an extraordinary margin. With the introduction of version 2.8 in July 2019 came a whole lot of new users wanting to learn what this free open source program is all about. More users are coming in every day, and in 2022, Blender was downloaded over 17 million times, plus another 1.6 million times from other sources such as Microsoft Store, Steam, and Snap!

This software includes the entire 3D workflow of creating 3D models, texturing, animation, rigging, compositing, motion tracking, game design, video editing, and, of course, the topic of this book, simulating physics! We will be covering all the simulations that Blender has to offer, starting with the liquid and smoke simulations.

Creating a liquid or smoke simulation in Blender is complicated and sometimes quite frustrating when you are just starting. From personal experience, trying to figure out how all the settings work in Blender by trial and error is hard and can take a lot of time.

If you feel overwhelmed by the hundreds of settings and values in Blender’s fluid simulator, there is no need to worry! The goal of this chapter is to ease you into working with Mantaflow and to help you get a basic understanding of what creating a simulation looks like.

If you didn’t know, Mantaflow is Blender’s default liquid and smoke simulator. In this chapter, we will discuss how it was developed, what you can create using it, and what you need to get started to create a simulation. Finally, we will create a fire simulation together. Step by step, we will go through all the settings and render out an animation so that you can upload and share it!

In this chapter, we’ll be covering the following topics:

What is Mantaflow? Gas and liquid simulations What you need to create a simulation Creating your first simulation

Technical requirements

This chapter requires that you have Blender version 4.2 or above installed. To download Blender, visit www.blender.org.

You can find the assets for this chapter in this book’s GitHub repository: https://github.com/PacktPublishing/Learn-Blender-4-Simulations-the-Right-Way/tree/main/Chapter%201.

What is Mantaflow?

Mantaflow is the framework in Blender for simulating gas and liquid. Mantaflow was introduced in Blender 2.82 and has seen many updates since then. It was first developed back in 2009 at the ETH Computer Graphics Laboratory. Now, it’s being maintained and developed by the Thuerey group at the Technical University of Munich (TUM).

In Blender version 2.81 and below, the smoke and fluid simulations were two completely different things, and they weren’t very compatible with each other. When 2.82 came out, the Blender developers removed these two simulations and introduced Mantaflow. This was a much better system because it combined both the fluid and smoke simulations into one.

To enable Mantaflow on an object, you need to head over to the Physics properties area (it will look like a circle with a dot in the middle) and select Fluid:

Figure 1.1 – Blender’s Physics properties area

Don’t get confused when you only see Fluid in Blender’s Physics panel. Fluid is just the name used for the overall simulation. Once you select it, you’ll be able to choose between Gasor Liquid.

Now that we’ve covered what Mantaflow is, let’s take a look at the simulations you can create with it 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, Fluid is used to describe the entire simulation. Inside the simulation, there are two options to choose from:

Gas: Used to create things such as smoke, fire, or airborne solidsLiquid: Used to simulate things such as water or honey

Let’s talk about each one separately so that you can understand the differences between them 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 flame thrower, campfire, steam, mist, or fog.

Figure 1.2 – Flame thrower example

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:

Figure 1.3 – 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 will cause the simulation to run slower and take longer to bake:

Figure 1.4 – 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.5 – 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. Flows 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.

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

Density and Heat: These values are within the domain object’s settings. These values control how fast the smoke will rise.Effectors: These are mesh objects that will collide with the smoke, restricting its movement.Flow: These objects affect how fast or slow the movement of the fluid will be.Force fields: These 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.6 – 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.7 – 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 to 96. 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!

What you need to create a simulation

In short, there are two things you will always need for a Mantaflow simulation, as follows:

A domain object A flow object

We will look at each in more detail, along with effectors, which are not mandatory but are still useful.

Domain objects

A domain object is the container for the entire simulation. No gas or liquid will be allowed outside this domain. When the simulation gets close to the edge, it will either collide or disappear, depending on what setting you have set.

The bigger the domain, the more resolution you will need

This will cause the simulation to bake longer. A general rule is to have the domain just big enough to fit the simulation.

The domain object is always going to be the shape of a cube. Even if the domain isn’t a cube, the simulation will treat it as one and will simulate outside the original mesh:

Figure 1.8 – Domain example

The sphere in this example is the domain and, as you can see, the fluid is going outside the mesh. It is probably best to only use a cube as the domain for any simulation. As I stated earlier, you can also see the resolution of the simulation by viewing the size of the little box in the bottom-left corner.

To assign a domain to a mesh object, have it selected, go to the Physics panel, and select Fluid | Type | Domain.

Flow objects

Flow objects are used in simulations to either add or remove fluid from the domain. It’s important to note that the flow object needs to be inside the domain to simulate properly; having it outside will do nothing.

Unlike the domain, with a flow object, you can have any shape you want but it needs to be a mesh object . This means that curves , meatballs , empties , or other objects like that will not work:

Figure 1.9 – Flow examples

We will cover flow objects in detail in Chapter 2, but I wanted to provide this example so that you can understand how they work. In the flow’s properties, you can change its Behavior. There are three options you can choose from. This will affect how the smoke/fluid is emitted into the domain:

Inflow: This will constantly add fluid to the simulation (left-hand side of Figure 1.9).Geometry: The fluid added is based on the exact amount of geometry of the mesh itself (right-hand side of Figure 1.9).Outflow: This will delete the fluid.

To assign a flow object, go to Physics | Fluid | Type | Flow.

Effectors

Effector objects can be used to collide with the liquid or smoke, restricting the movement of the simulation and creating interesting results in the process. Another way to use effectors is to set them as guide effectors. Guides basically allow you to change the velocity and movement of the simulation. They do get a little complicated so we will save that for Chapter 2. Effectors aren’t necessary to create a simulation, but they can add another level of detail and interest to your scene.

To assign an effector object, make sure you have a mesh object selected, and go to Physics Properties | Fluid | Type | Effector.

To summarize, there are two types of simulations that you can create with Mantaflow: a gas or liquid simulation. When you decide which one you want, the next step is to add all the objects you need, those being a domain and a flow object. Do you want multiple flow objects? Do you want to add any collision objects to give more interest to the simulation? There are an endless number of simulations that you can create, and it’s up to you to decide what you want to do.

In the last part of this chapter, we will be creating a fire simulation together. Step by step, we will learn exactly what it takes to create fire using Blender and Mantaflow. So, strap in, open Blender, and let’s get started!

Creating your first simulation

Now that we understand what creating a Mantaflow simulation in Blender looks like, let’s create one together. In this section, we will go through the entire process of creating a fire simulation in Blender; this process will include doing the following:

Adding the objectsCreating the simulationCreating a material for the fireSetting up the cameraRendering the animation

This may sound like a lot but don’t get overwhelmed. I will be going through every step, and together, we will create something awesome! This section is aimed at beginners, but it also assumes you have basic knowledge of Blender’s interface and how to use it.

With that out of the way, let’s get started!

Adding the objects

Let’s start by adding the objects we will need in the scene. Remember, we need a domain object and a flow object for every simulation. With the default scene open in Blender, we already have a cube that we can use for the domain object. Currently, it’s a bit small, so let’s scale it up:

To scale an object in Blender, make sure it’s selected and press S. You can now move your mouse to scale the cube, or you can type a number in. Let’s scale the cube by 2 and then press Enter. I also think it can be a bit taller, so let’s scale it along the Z axis. To do this, press S, then Z, and then type 1.5 as the value.Once you are happy with the scale of your object, you can add the flow. You can use whatever object you like, but for my simulation, I’m going to add a UV sphere. Press Shift + A, then select Mesh | UV Sphere. Scale it down to around 0.5 and place it near the bottom of the domain.

If you did all that correctly, it should look something like this:

Figure 1.10 – Domain and flow

The final step is to apply the scale to our objects. If you select the domain object and look in the Properties tab by pressing N, you will see the following scale numbers:

Figure 1.11 – Domain scale values

Before we changed the size of the domain object, these values were 1 each for X, Y, and Z. But since we scaled the domain by 2 and Z by 1.5 in step 1, it changed those values to what you see in Figure 1.11. Generally, you always want these values to be set at 1. This will make sure modifiers, textures, UV maps, and physics calculations are accurate.

To change these values to 1 and to keep the current size of our objects, we need to apply the scale. We can do this by pressing Ctrl + A or Cmd + A and selecting Scale with both the domain and flow selected. Now, those Scale values should be back at 1 and everything will work properly!

Now that we have our objects in place, it’s time to start working with the domain and flow!

Creating the simulation

Everything is in place, so the next step is to assign the cube as a domain object and change the settings. After that, we will create the flow and edit some of the values.

Setting up the domain object

Let’s start by setting up our domain object:

Select your domain and head over to the Physics Properties panel on the right-hand side (it should look like a circle with another circle inside it):

Figure 1.12 – The Physics properties panel

Once you’re there, click on Fluid, and for Type, select Domain. (Yes, there are quite a lot of settings; let’s take it one step at a time.)The first thing we should do is change the cache type. Scroll down until you see the Cache panel. We don’t need to bake in 250 frames, so let’s set the End frame property of the simulation to 150. As for Type, let’s select Modular, and check the box that says Is Resumable. This will allow us to stop the bake halfway through if we need to.

The Cache panel should look like this:

Figure 1.13 – Cache

Now, let’s set up the other domain settings. Starting at the very top, set Resolution Divisions to 128. This will give us a nice, high-quality fire:

Figure 1.14 – Resolution Divisions

CFL Number basically changes the number of simulation steps per frame. Higher values decrease the number of steps resulting in faster computation time. And, of course, lower values increase the steps, making it more accurate but slower. We don’t need a value of 2 for this simulation so let’s go with a value of 4 and this will help speed up bake times.Check the Adaptive Domain box. This will change the size of the domain based on where the fire is, which, in turn, will decrease the bake time:

Figure 1.15 – Adaptive Domain

We can leave all the default settings as-is.

In the Gas panel, open the Fire section. Reaction Speed controls the height of the flames. Higher values mean lower flames, while lower values mean taller flames. Let’s set it a bit lower to 0.5:

Figure 1.16 – Fire settings

(Optional) If you want more swirls in your fire, you can turn up the Vorticity amount in the flames to 0.6 or 0.7. Don’t set it too high or your fire will go crazy!

The domain settings are now done; the next step is the flow object!

Setting up the flow object

Follow these steps to set up yourflow object:

Select your sphere and, in the Physics Properties panel, select Fluid. As you’ve probably guessed, set Typeto Flow. As for Flow Type, change it from Smoketo Fire.Setting Flow Behavior to Geometry will make the fire disappear very quickly when we play the animation. However, we want it to constantly add fire, so let’s change it to Inflow.We can bring up Fuel to 1.2. This will make the fire a bit taller and move more quickly.In the Flow Source section, Surface Emission is currently set at 1.5. This means that the fire will emit slightly away from the mesh surface. I would rather have it closer to the mesh, so let’s set this value to 1.With all that done, we are ready to bake our simulation! Select your domain, and click the big Bake Data button at the top to start baking the simulation. Keep in mind that this might take a little bit of time, depending on how fast your computer is.

Now, all we have to do is sit back and wait for it to finish baking. Once it’s done, we can create the fire material!

Creating the material

Creating a basic fire material is pretty simple to do:

With the domain object selected, let’s jump over to the Material properties panel (it will look like a red circle):

Figure 1.17 – Material properties

The base Principled Shader is what we call a surface shader. This controls the colors, textures, and light bounces on the surface of a mesh. Since the fire is not a mesh, this won’t work, so let’s remove it. Click on Surface Principled BSDF (it will have a green dot next to it) and select Remove.What we need instead is a volume shader. These kinds of shaders are for the interior of a mesh or fire and smoke. So, let’s add one. Open the Volume panel and select Principled Volume:

Figure 1.18 – Volume shader

The first color option is for the smoke. Let’s set it to a slightly darker gray.You can also set the Density property higher if you want more dense smoke. Let’s go with a value of 8.There are many ways to create fire. The most basic way is to turn up the Blackbody intensity. You will notice that if you drag the Blackbody value up, you can only go to 1; however, if you type a number in manually, then you can go higher. The higher you set this, the brighter the fire will appear. Let’s go with a value of 4!

And that’s it! You’ve created your fire material. Now, let’s set up our camera so that we can see the fire! If you aren’t happy with the look, you can always come back later and change it.

Our fire is looking good so far! Now, we need a way to see it!

Setting up the camera

Let’s set up the camera and position it where we want:

Press 0 on your numpad to go into Camera View or go up to View | Cameras | Active Camera.To move the camera around easily, go into the Properties panel (N) section and, in the View tab, check the Camera to View checkbox. Now, you can move the camera around just like how you would move around the 3D space:

Figure 1.19 – Camera

Move the camera to where you can see the entire simulation. Then, make sure to uncheck Camera to View; otherwise, you may accidentally move the camera when you don’t mean to.As for the lighting for the scene, let’s jump over to the World settings and set Colorto black:

Figure 1.20 – World lighting

Now that our camera, lighting, and material are all done, it’s time to set up the render settings!

Rendering the animation

Now would be a good time to match the simulation to the end frame. Since we baked 150 frames, let’s set the End frame property in the Timeline to 150as well:

Figure 1.21 – Timeline example

Next, let’s choose which rendering engine to use. There are two default render engines to choose from in Blender: EEVEE and Cycles. Both have their strengths and weaknesses. For example, EEVEE will render much faster than Cycles, but the fire won’t look as good. If you have a slower computer, I recommend using EEVEE because rendering smoke/fire in Cycles is pretty GPU/CPU-intensive. To choose a rendering engine, head over to the Render properties section and click Render Engine:

Figure 1.22 – Render Engine

For my animation, I used EEVEE, but if you want to use Cycles, I will provide instructions for both!

Cycles

With the Cycles engine selected, let’s change some of the settings so that Blender will render faster and get a better result:

Open the Sampling panel and, in the Render tab, set the Max Samples number to 20.Open the Color Management tab, set View Transform to Filmic, and set Look to High Contrast. This will give the fire much more of a pop and make it not look as dull.

Now that you’ve completed the steps for rendering in Cycles, feel free to skip the EEVEE instructions and head on over to the Setting the output section!

EEVEE

In the coming chapters, we will be learning a lot more about rendering volumes in EEVEE! For now, let’s go over some basic settings to help the fire look much better. Switch over to the EEVEE render engine and let’s get started:

In the Sampling panel, set Render Samples to 16. Between 16 and 128 samples, there is not much difference, so lowering it will help speed up render time.In the Volumes tab, set Resolution to 1.1. This will make the fire have more detail and look better.Open the Color Management tab, set View Transform to Filmic, and set Look to High Contrast.

If you would like to add some glow to the fire, you can jump over to the Compositing workspace at the top. Check Use Nodes, then press Shift + A and go to Filter | Glare. Place the node between the Render Layers and Composite nodes. Feel free to customize these values to find what you like or you can copy the following ones:

Figure 1.23 – Adding Bloom

The final step in this tutorial is to set up an output for our animation.

Setting the output

Whenever you render an animation in Blender, you need to set an output folder. To do this, head over to the Output properties section and set a directory for where you want your animation to render by clicking on the little Open Folder icon on the right. After that, set up the file format of your choosing. I’m going to set mine to FFmpeg Video and Container to MPEG-4. It should look something like this once you are done:

Figure 1.24 – Output

Now, you are ready to render! Go to Render | Render Animation or press Ctrl + F12 or Cmd + F12. Once the render has finished, it will be in the output directory you set!

To view my result and download this .blend file, you can visit https://github.com/PacktPublishing/Learn-Blender-4-Simulations-the-Right-Way.

The following is a frame of my simulation:

Figure 1.25 – Final result

And there you have it! You’ve completed the first tutorial of this book. Hopefully, you made it through with ease and learned something new along the way!

Summary

If you have never touched Mantaflow simulations in Blender until today, congratulations on making it through this chapter and creating your first fire simulation!

We covered quite a few topics in this chapter, so let’s recap! First, we learned what Mantaflow is and how it was introduced to Blender. We looked at what creating a simulation is about and the two types to choose from – gas and liquid. We also covered all the objects you can add to your simulations – that is, domains, flows,and effectors.

After that, we worked together and created an awesome fire simulation. Using Mantaflow can be a bit challenging at times but, hopefully, this chapter gave you a clear understanding and a boost of confidence to go and create simulations!

I encourage you to open Blender and try to create a simulation and have fun with it! You can do something interesting such as setting a custom text object on fire and having the color of the flames be purple! Or you could do something a bit more serious such as using force fields to create a tornado effect! The things you can create with Mantaflow are almost endless!

The next chapter is all about the domains, flows, and effectors. We will look at each in detail and talk about their settings so that you understand exactly what values to change to get your desired simulation!

Join our community on Discord

Join our community’s Discord space for discussions with the author and other readers: https://packt.link/learn-blender-simulations-discord-invite

2

Understanding Domains, Flows, and Effectors

Now that we have covered the basics of Mantaflow, it’s time to get a little more advanced! In this chapter, we will be diving deep into Blender and learning all about domains, flows, and effectors – all the objects that make up a simulation.

There are hundreds of settings and values to tweak to your liking, and it can be frustrating not knowing what they are or how to use them in a practical way. The goal of this chapter is to give you a technical understanding of the liquid and fire simulation in Blender. That way, you will know exactly what all the settings and values do, without having to guess. You will always be able to come back and reference this chapter if you forget something. We will be going through each setting, and there will be a brief description of what it does in the simulation, with screenshots for easy learning!

While we briefly touched upon domain, flow, and effector objects in the previous chapter, in this chapter, we will go into much more detail and learn all the ins and outs, starting with the domain object.

In this chapter, we’ll be covering the following topics:

DomainsFlow objectsEffectors

We have a lot of things to cover in this chapter, so let’s jump right into it!

Technical requirements

This chapter requires that you have Blender version 4.2 or above installed.

To download Blender, visit www.blender.org.

Domains