Blender 3D: Fluids: Example
Blender 3D: Fluids: Example
If you have any comments or suggestions for this tutorial or future tutorials, please visit the forum at
http://www.forum.darkscarab.com
For this tutorial I will have the worded directions along with the exact keystrokes it takes to get
the step done. If you are fluent enough with Blender you may not have to look at the keystrokes
line. Each step within the keystrokes line will be highlighted like this: Example. Arrows will
indicate that you should be following a menu path.
If you have kept the default scene that Blender automatically sets up than you will want to delete the
default cube. For this tutorial we want to start out in the top view.
-- X --> Vertices ; 7
Next thing to do is subdivide our plane. You can click subdivide four times, or you can hit 'W', click
'subdivide multi', and submit '15'. 15 is the number of cuts, or lines you see on the plane going in either
direction. This will essentially make a 16x16 grid on our plane.
1
Now it is time to make the stairway down into our subway. You will want to go into Face Select Mode
and select the faces that are shown in the image below.
With those selected faces you will want to extrude them by 2.5.
2
-- E; Click Region; 2.5
This will serve as the walls of our subway station. I am not going to have the ditches for the tracks, or
the place for the trains to come in, we will not be focusing in this. You may add more details as you please. I
will be focusing on the stairs. I guess mine will be more like a bomb shelter.
Now I have selected the next batch of faces to make the stairs.
With those selected faces you will want to extrude them by 2.5.
This will serve as the walls of our subway station. I am not going to have the ditches for the tracks, or
the place for the trains to come in, we will not be focusing in this. You may add more details as you please. I
will be focusing on the stairs. I guess mine will be more like a bomb shelter.
Now I have selected the next batch of faces to make the stairs.
3
This next bit is going to be a bit tedious, just to warn you. With those selected parts extrude the region
by .2
This is our first step. I think you can see where this is going. Now you will want to deselect the first row
of steps and extrude the remaining faces by the same amount as before.
The red rectangle depicts the three faces you should have deselected before extruding a second time.
The image on the right shows what your first two steps should look like.
4
Do this process two more times.
Now we are at the corner. I just deselected the 3x3 area and extruded again. Hopefully yours looks like
this.
Now you can do the rest of the steps the exact same way all the way until the end. You can see what
mine looks like below.
5
Great! Now the stairs are done. The only thing left to do is move the light for rendering reasons in the
fluid section.
Go into 'Object Mode', select the lamp, and hit 'N' for the transform properties. Change the 'Loc X' and
'Loc Y' values to '0.00' and the 'Loc Z' value to '5.00'
-- Go to Object Mode, Select the Lamp, N, and change the settings as shown in the image below.
Assuming you plan to continue to the fluids part of the tutorial, you will need to go into object mode and
double the size of our subway. This is so the camera will fit into our scene a little bit better.
6
SECTION 2 - SIMULATING THE FLOOD
All right! Now we can get to the good stuff, the fluids. For this scene I want to flood the subway that
you (the camera) are in. This is similar to my Trapped animation. So we will have a Domain and an Inflow and
an Outflow along with the subway station we just modeled acting as an obstacle.
Go to top view and and add a cube. Since we want to flood the subway we have just made we want the
domain to be right on the edges of it. So skew the cube by a rate of 10.
If you move out of top view you may notice that there is a ton of wasted space underneath our subway.
This is bad. The more wasted space in your domain or the bigger your domain is the longer it is going to take to
bake your fluids.
Make sure you are in 'Face Select Mode' and select the bottom of the cube. As you can see, the dead
space is half (!) of the total cubes size. So, grab the bottom of the cube you just selected and move it along the Z
axis by 10.
Now that we have the domain in the position we want we can add the inflow. Go to the top view, and
add a cylinder. I left it at the default settings. While we are in the top view, grab the cylinder and move it by '7'
on the Y-axis and by '8' on the X-axis.
7
-- 7; Add --> Mesh --> Cylinder; Click OK.
-- G; Y; 7; G; X; 8
Now we need to make sure the inflow is at the right height. Go to the front view and move the cylinder
up by 8.
-- 1, G, Z, 8
Next we will add the outflow. Get into object mode, top view, and I added a cube. Move it vertically
upwards by 1, and put it under the camera by moving it along the X axis by '7' and along the Y-axis by '-7'.
-- G; Y; -7; G; X; 7
-- G; Z; 1
Go back to 'Object mode' if you haven't already and select our domain, the big rectangular shape
surrounding our subway. Once that is selected, go to the 'Physics Tab' and in the fluid simulation area hit
'enable'. A bunch of buttons will appear with one of them being domain. Select it.
-- F7; Physics Buttons; Select the cube surrounding the subway; Click Enable; Click Domain
8
Now select the cylinder and do the same thing except instead of 'Domain' , you want to click 'Inflow'.
Next select the small cube under the camera and in the corner and make that an outflow.
Now all that needs to be done is the adjustment of some settings. Select our inflow again and change the
inflow velocity on the Z axis to '-.5'.
Select the domain and hit BAKE. Now you may have noticed two problems.
1. The water is very gooey.
2. The water goes over the top of our subway edges.
Here is how I plan to fix these problems. Select the Subway and go into edit mode. Grab the faces that
line the stairs and raise them higher by about 2.
9
As for the gooeyness, we need to change the end time of our simulation. I am going to assume your
animation is running for 250 frames, 25 frames a second. This is the default. That means our simulation should
be for 10 seconds. If you click the Std button in the domain settings you can see the simulation end time. Right
now it is set at .30. This means that over our 250 frame, 10 second animation the fluid moves as it would in .3
seconds. I guess it would only make sense to change this setting to 10. But I won't.
Why? It will take ages to bake. But that is just me and my computer. I suggest you test it out if you do
not know how well your computer works with baking. I will just set mine to 5.
Now you can bake it and see what happens. As you probably noticed, our subway has filled up with
water to a certain point until the outflow is covered and keeps the water level from rising. The bigger the
outflow you have the more fluid it will suck in.
As you can see if you render a frame of this the water is really blocky. The easiest remedy is to Set
Smooth to the domain. (This is under the 'Editing' button or hit 'F9') You can see the difference below.
10
If you want to actually raise the resolution of the fluids you would have to go into the same place that
has the end time and directly above it you can see the resolution settings. The default is 50. So if you decide you
want a higher resolution raise 50 to a higher number. But watch out, the amount of time it takes to bake fluids
grows exponentially larger as you raise the resolution. This is another place to test out how high of a setting
your computer can handle.
Now you can add materials for the walls and add more details to this gray subway flood. Get as detailed
as you want.
----------------------------------------------------------------------------------
For more tutorials, go to http://www.darkscarab.com/tutorials.html
If you have any comments or suggestions for this tutorial or future tutorials, please visit the forum at
http://www.forum.darkscarab.com
11