Oi! everyone, it's Wiki here, and in this
tutorial, we're looking into FLIP fluid simulations with particular attention to 2 shelf
tools FLIP fluid from object and emit particle fluid. I split the tutorial into three parts to
make the navigation easier: part 1 explains what FLIP fluids are and how the networks work; part 2
looks into setting up colliders including static, animated, and deforming objects; part 3 shows
how to add additional forces to the simulation, such as, POP Wind or POP velocity. Before starting
this tutorial, I'd recommend watching my other videos on how to set up your scene for simulations
and understanding liquids for dynamic simulations. They will give you a further understanding
of the topic and also make this tutorial much easier for you. But without further ado let's
start! Please keep in mind that I'm using the technical desktop and I've already prepared my
scene for the simulation so I'm ready to start. But before we create anything let's have a look
at the shelf tools that we have here in Houdini. So the first tab is called particle fluids and
we can find a lot of useful shelf tools here, they are all basic FLIP fluid simulations
plus some tools for adding parameters, forces, and effects, such as viscosity, suction
force, or white water. Today we'll be looking at FLIP fluid from object and emit particle fluid.
The second tab is called viscous fluids and this is very similar to the previous one with the only
difference that these shelf tools give us some additional parameters. So some parameters are
already set up for us, such as for example temperature for lava from objects. So you could
use these tools and then add parameters yourself and switch them on but instead of doing that
you can just use these shelf tools which are already set up. And the third step is oceans,
but part of these are not FLIP fluid simulations! Some of these are just deforming planes that
can be used to fake large oceans or large surfaces with liquids. It's far more efficient
and also it's a clever way of faking huge oceans and only simulating a small part of the scene.
We also have colliders, of course, that we'll use today to add collisions to our FLIP fluid
simulations. The tool we're going to use first is the FLIP fluid from object and when you hover
over you will see that it creates a FLIP fluid object from SOP geometry. This means we need
a SOP geometry first, so the surface operator, and it's nothing else than just simple
geometry. So let's create it. Let's go to the TAB menu and type "geometry". Okay. And
let's zoom in and rename this one to "Pig_geo". I'll now dive in and in here, you might
have guessed, I want to create a pig head. Okay, so test geometry / pig head. Let's
drop down this node and as you can see pig head is quite detailed but for simulations, we do
not need that much detail so what I will do is change the difficulty to easy and this
will get rid of the shader and also reduce the detail on the geometry itself. All right,
so now I want to create a transform node. Let's display it select it and I will zoom
out because I want to move the pig head up. So you can switch on show handles and now
you'll be able to do that manually in the viewport or you can use these values, so for example type
6 in here to move the pig head up. All right, let's drop down the last node in
our network, this will be Null. Make sure to display it and we'll rename
this one to OUT_pig. Okay, so now we have our three nodes the pig head, the transform
node, and the out null which is displayed. Let's go back to the object level now and we're
going to use this node, this shelf tool, for the very first time. So what I want to do is click on
the gray background to deselect everything, I do not want to have anything selected in my network,
now I'll click on the FLIP fluid from object and it will give me some tips on what I should do
next. So it says "select object to convert into a FLIP fluid" so this will be our pig head. I
select it in the viewport "and press enter to accept selection" so I press enter with my cursor
still in the viewport. After a while, you will see that the pig head disappeared and now we have
a lot of dots here which are the particles. So it's similar to the representation of liquids in
physics. So you can see here that the tool turned our geometry into a cluster of particles so it is
mainly a particle simulation with some aspects of grid volumetric solver. So we can use these two
aspects to combine both particles, so for example fluid liquids and volume, so for example white
water which you can use for foam or splashes. Let's go to the object level now and let's have a
look at the new nodes we have here. I will press "H" to home all to see all the networks. Okay,
and let's place them in order so the first one is pig geos - this is our source, this is the pig
geometry created and you can see that it's hidden so we can display it if we want to see it. But
we want to see the particles so this one is not displayed. Then, we have particle fluid interior.
Okay, so this is our pig geofluid interior let's dive inside and you'll see that nothing important
really is happening here for us. There's nothing we can change so we just have a simple object
merge node and you can see it merges pig geo fluid render with this merge node. So we're
not going to change anything here yet. Let's go back to the object level and we can even
hide it if we want to. Okay, the next node is the green one which is called AutoDopNetwork, so the
dynamic operator network. Let's dive inside and you'll see that in here we have a lot of
nodes new nodes and everything that we do with the simulation, so whether it's adding
forces or adjusting colliders, will be most likely in here. So let's go from the top, the
first thing we have here is called FLIP object, and let me just scroll up to see the options. So
in here, we can change the quality of our liquid. So we have the first thing called particle
separation and the particle separation is the distance between the particles. And if I increase
that distance you will see that we will fit fewer particles inside the geometry. If I
decrease that distance you will be able to see that we have a lot of particles. So we managed
to put more particles inside the pig head geometry which means we also have more detail. So you
need to adjust this value for your simulation. For tests, we usually use quite high values, so
maybe 0.07 so this is low enough so high quality enough to see what's happening with the liquid
but then it will not take ages to simulate. Okay, and then, once you have your simulation
ready, you can decrease that value to increase the quality and cache it, and render it out. The
next thing we have here is the grid scale and as I already mentioned FLIP simulations consist of two:
so particles and grid solver, so you can see here that we have the particle separation and the
grid scale. And the grid scale is multiplied by particle separation to determine the final quality
of our simulation. And the best way to visualize that is to scroll down, go to guides, okay,
then switch on collision, switch off particles, okay. I'll just zoom out and now when I
play it, you'll see this huge box here okay. So what we want to do is visualize it as grid,
so let's go to the tab called collision over here and switch on use plane, and now when I play the
simulation, you will see that we have this plane with that number of boxes and this is our quality also the quality of the simulation. So now if
i scroll up and change the grid scale to one, now I need to go back to the
very beginning and play it again, now you will see that we have a higher number
of boxes so it's higher quality. So sometimes for colliders you'll see it later we'll have to
adjust the grid scale and the particle separation okay but enough about it for now we'll come back
to it later so let's go back to our collider switch off use plane go to visualizations and we
want to switch on particles switch off collision okay let's see if it looks like particles
brilliant so now when we play our simulation we can see that the particles go down
as they should and then after some time they disappear here we go so you can see that here
when they exit this box they disappear this is the bounding box so this is the area within which our
simulation is solved everything outside this box is not calculated it is a very uh clever
efficient way of creating simulations so we can just ignore everything that is outside
and only focus on the simulation itself so we can adjust this box um in several ways first
of all again in the same note i just scrolled up we can switch on something called closed
boundaries and now when i play the simulation instead of disappearing our particles actually
collide with the bounding box however we need to wait quite a long time for the particles to
reach this side of the bounding box so let's adjust the size of of this bounding box to do
that let's select flip solver so click inside on this brain icon so do not oops didn't want
to do that just click once do not display just click click once to see the uh parameters and flip
solver is the solver the brain of our simulation everything is solved calculated in here without
it the simulation wouldn't work okay and in here we can when you select it we can see
that we are able to adjust the boundary box so the bounding box changed color to
red and now we can click on these walls drag them to adjust it if you cannot do it
make sure you have show handles displayed selected adjusting the bounding box is very
important it allows you to work more efficiently it makes your simulation more efficient so now
let's see what happens when i play it okay so again it interacts with the ground the particles
interact with the ground and also with the walls if i go back to our first node flip object
let's select it you can see that next to close boundaries we have x y and z okay and what do
these mean uh well we can open one of these walls by switching off uh one of these axes so if we
want to switch off for example the right wall so let's have a look at our axis this will be
x plus so the positive x so if i just untick it now you'll see that the liquid will interact
with all the walls apart from this one over here in our flip object we can also adjust physical
properties of our liquid so let's go to the physical tab scroll down and here you can see we
have several physical properties such as bounds friction temperature density viscosity that
we can change for our flip fluid some of these however will not work straight away such as
viscosity we would need to switch it on separately but i'll do another tutorial on that let's now
go to the next note so we already discussed flip fluid from object we discussed flip solver now we
have just merge because we might need to have more things plugged in here then we have our forces
for example gravity and we can adjust the gravity force by adjusting these three values so at
the moment it's very realistic because it's minus 9.8 and so on but i can reduce it and now
you can see that the gravity force is much lower okay i can also reverse gravity so for
example 9 or even changes direction once we're done and we want to go back to the
default value right click on words as force and just click revert to default and finally our
last node is the output so we can save here our simulation as dot sim to disk and then import
it in another software or houdini as well all right so this is our auto dop network let's now
go back to the object level and let's see what last group we have here and this is the network
that is used for final uh processing of our simulation of our geometry of everything that is
happening in the scene so this group creates our scene ready for rendering so we have some import
fluid compress cache nodes where we can cache our simulation to make the rendering faster but
we also have something called particle fluid uh surface so let me just display it and now
you can see that the particles are meshed so before we had points we had particles now
we have an actual mesh that looks more or less like liquid like what we will see in the render
okay so this is how the flip fluid works it first creates the particles and then in the final
step it meshes them so that we can see the actual surface of their liquid let's now make sure that
the display flag the blue flag is on this node over here dub import and the purple flag is on
the render and let's go back to our object level one more thing that i didn't show you
in autumn network so let's dive in is something called time scale so in our flip
solver we have a lot of different options we can adjust quality here we can change
how the particles behave and how the whole liquid behaves we can add more parameters here
such as viscosity uh density and so on and so forth but the one that we can use now is called
time scale and time scale allows us to control how fast or slow the simulation is happening so we
can slow down the simulation to create slow motion or speed it up you can use that for example
for large simulations if you want to create waterfall it will seem to move much
slower than for example tap water so if i decrease that value to for example half
and play it now we'll have half of the initial original speed of our simulation
so it will appear much slower okay if i increase that value however it
will be three times quicker than the original all right and again let's right click on the
time scale and revert to defaults and we can save our scene control s okay so now let's have
a look at our second tool which is called a met particle fluid and for this one when you hover
over you will see that it emits fluid into a flip simulation and again it will need a geometry that
the particles will be emitted from so let's go back to the object level again and next to our peg
geometry i'll drop down another geometry network this time i'll rename this one to emitter geo let's dive inside and in here i just want to
create a simple sphere so for simulations emitter and the quality of the emitter the shape of
the emitter also is very important because uh the whole simulation will take the shape of the
material this is our initial state so instead of using a simple sphere we'll add some more noise to
it first of all let's change the primitive type to polygon mesh because that's what we need for the
simulation and now we'll drop down a mountain node make sure to display it and now i can increase
uh the height and the element size so i can just distort our geometry slightly and i can
see that the quality of the geometry is a bit too low so i'll go back to the sphere
and increase the number of rows and columns go back to the mountain node okay that's a bit
better alright so this is our emitter so now i want a transform node so that i can move it
up display it again you can use either the values or you can move it using the handles and
i'll put it on top of the pickhead and move it well i don't want to rotate it so i'll just use
the values i'll move it slightly to the right to the left just for now and now i want to create no
just to finish my network display the null rename it to out emitter all right so the sphere the
mountain node the transform and the emitter null let's go back to the object level and now
again i deselect everything click on the gray background and now click on emit particle fluid
so the first step is to select object to emit fluid from so this is our emitter geometry so
let's select it in here and press enter and now the second step is select a fluid object to emit
into if any so we have another fluid simulation so we can combine these two simulations by selecting
our second simulation and you'll see that when i select it in viewport when i select it here it
will take me straight to the flip object okay so i selected in the viewport and press enter again and
now you'll see what happens in our autodop network so we have our initial original pickhead so fluid
object but we also have something called source surface from emitter geometry and this is or the
original name of the node volume source this node uses the information from our geometry and then
uses it to emit particles from it and you can even see it here that the sub path leads
to our object emitter geometry out surface okay but we did not create anything like
outsurface so let's see what happened here let's click on this icon here so that we can
jump to our network and we are definitely in the emitter geometry network we have our sphere
the mountain node the transform and the null but now we have several other nodes in here so let me
zoom in so that we can see the sphere and now you can see that the sphere is made out of boxes these
boxes are called voxels so these are 3d pixels so our sphere our emitter is now turned to volume so
these voxels if i switch on display create surface and in here we have something called voxel size
so this is similar to particle separation the lower the voxel size the more quality we have here
the more details we will see however you can see that it's green which means we cannot change this
value it's linked to somewhere else or is keyframe so let me just expand that and
click on where it says voxel size to see its path okay so you can see that it
multiplies something in autodub network and something else in autodub network so these two
are multiplied so the first is particle separation and the second thing is grid scale so again
you can see that flip fluid combines particles and volumes so the voxel size is determined so the
quality of the emitter is determined by these two values particle separation and grid scale which
we can adjust in our autodop network so right here in our flip object so particle separation and
grid scale all right let me go back to our emitter so this will change automatically when you change
either particle separation or grid scale but you can also adjust this value manually if you want
to you just right click on where it says voxel and delete channels and now you're able to adjust
this value manually and you will see that when i increase this value we have less voxels
so lower quality if i decrease this value will have more voxels so smoother emitter more
quality but let me just revert that to defaults actually undo that so that we
have our link in here brilliant and remember to change the display flag back to
out surface and let's go back to the object level again okay now i want to hide the emitter geometry
so that i can see the particles and zoom out and play the simulation to see what happens okay
so why can we not see anything happening here well this is because of our bounding box so
let's go back to the auto dop network select the flip solver and now you can see that the bounding
box is tiny so we added another simulation here we need to expand our bounding box okay so
let's expand it and now let's play the sim again so now you can see what the main difference
between these two these two shelf tools is the first one turns our geometry into flip
fluid so we do not add any more particles to our simulation over time whereas the second
tool emit particle fluid emits particles on each and every frame so we'll be adding more
particles to our simulation so to be fat these two are very similar the only difference is that
this one emits something this one just creates something on the very first frame and then doesn't
add any more particles to the simulation and when i place the simulation you can also see that these
two liquids are in the same bounding box and they also interact so it's a nice easy way of combining
several simulations flip simulations so flip fluid from object and emit particle fluid so if you
want to adjust the physical properties of this emitting liquid simulation you also do it in flip
fluid object however if you make any changes here it will apply it to both simulations so if you
want to have two simulations for example mixing liquids with different viscosity or density you
will need to use something called multiple solver so it's a slightly different thing but that's a
topic for another tutorial okay guys so that's it in part one now i invite you to watch part
two which is adding colliders see you soon