Quicktip: Fluid Splashes Using FLIP

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in our latest tutorial on rendering I walked you through lighting shading and rendering this cocktail glass with the splash and of course you guys asked how did you do the splash and NASA's not rendering related I thought well let's talk this through disclaimer I usually don't really work with fluid simulations so lots of the techniques you're seeing here might not be the quote-unquote proper or standard way of working with this so I'm more than happy if you guys let me know if there is a better way of doing stuff just let me know in the comments that being said let's go and walk you through setting up this fluid simulation first thing I'm gonna need is the cocktail glass itself and I provided you with the file so let's just drop down a file no there dive in there and select that file which loads up this cocktail glass which is almost real world scale I think it's a bit too big but that doesn't matter and the first thing I want to do is from this cocktail glass create a volume in here that's filled with liquid to do that let's just drop down a null here append this call this one out go up one level and drop down another geo node in which we're gonna set up the whole simulation and let's call this thing a splash dive in there as I mentioned first thing I want to do is create a volume for the liquid for that I'll just get my glass using an obj merge merging in the glass geometry in this other node here like so next I want to select only this interior area here which shall then close to create a volume to do so I'm just gonna go into the side view by hitting a space and three then go to my selection cursor selecting the points here is interesting rectangular selection maybe in selecting those points making sure to uncheck select groups or connected geometry and now I can select those points here hit delete to blast those points which will enter a group of points here to blast and I'll just copy over the original group that I had in my original setup to make sure it's perfectly the same so that's this and now I also want to blast this outside of the glass here which can be done again by using the selection cursor selecting primitives which are connected in 3d space so that allows me to just click on this group hit delete again append a second blast and end up with only this interior surface here which we're now going to close using a poly fill drill append and let's set the fill mode here to a single polygon ending in this now if I pipe this into a simulation it's gonna collide and gonna result in errors around these areas here where they might be intersection so let's scale this a bit small using a transform a pendous hitting move centroid to origin to center this geometry around the origin and then translating it back tunneling out the translates to its original position and by this making sure we are now scaling around its center point I scale it a good bit smaller to 0.85 and this is gonna be our liquid next I'll need an ice cube that I'm gonna drop in there I'm gonna create that using a simple box which I'll scale down a good bit to 0.04 and move it up to say is 0.4 and maybe rotating in a bit as well like this just some position that I liked originally now when we highlight this we can see it's got these sharp edges so let's get rid of them using a poly bevel leveling the edges a bit say around 0.005 units and we go down here increasing as a division a bit so we're getting subdivisions resulting in this very geometric but for now fine ice cube let's also create a collision volume so a Collider is in the simulation I'll have to collide the ice cube as well as the liquid with this glass here and I found it most reliable to just create a V DV from polygons piping in this glass in there and then scaling down the voxel size to 0.001 so we end up with this collision geometry off of the glass okay I think we're ready to build a simulation by dropping down a table net in here and wiring in first our liquid source here then our collision geometry with the glass here then the ice cube and finally our collision volume in here all right let's dive in there in our dotnet I want to set up three solvers on static solver for the collisions one RBD solver for the ice cube and finally a flip solver for the fluid and to execute all these three solvers and merge their results in the end we're gonna need a merge node into which all the solvers will go and all of those solvers will be affected by gravity so we can append the gravity to that merge as well now let's start with these static solver for the collision geometry and that's gonna be done by simply dropping down a static object which will wire into the merge so in my soap path what I can do is either point the solver directly to a stop it's going to be used as a collision object in our case the obj merge or with a small expression I can set this up to point to an input slot that will wire in here and I want to set it to the second input slot that's usually the input with the ID one so it started there and that's one of these expressions that I always keep handy and copy because I can never memorize it so it's this back take up input path then pointing up one level and pointing to the second input slot to the one with the ID one and then closing with a back take let's take this copy it and under collisions let's set up the collisions to use volume collisions and use a volume sample with a division method set to by size and set it to the exact same size as I did with the VDB that I created if you remember when we go up one level here is DVD B we created using this voxel size and it's being piped into the dotnet into the last input slot here one with the id3 we can set this up in our static object by going down here and setting our proxy volume to exactly this slot like so so when we highlight this year and less uncheck display geometry but display collision guide we can see we now are getting this volume as our collision source so basically what we did here is we set up volumetric collisions for the rest of our simulation if we hit play now nothing much should happen because that's just a static object and although it's being affected by gravity as it's static it won't move down and we might enable a real time toggle now for later save this and work on our RBD sim for the ice cube dropping down a rigidbody solver which will wire into the merge here and then also an RB D object which we're gonna use to create the object we're gonna simulate goes into the first slot so the soft path let's just paste this expression point it to the third input slot I think just highlight this yes that's the ice cube here and you see it's already created at the very first frame which I don't want because I want the fluid to settle a bit and after a few frames we can create the ice cube and let it drop in there so instead of having this created with this expression on the first frame let's ctrl shift click in here and manually enter the fifth frame as a creation frame let's just drop this down here and under physical let's check the parameters I think I did not change much there also let's go to collisions and bullet data because I'm gonna use a bullet solver here and let's set the geometry representation to be a box next let's go to the rigidbody saw over again drag this down here and we're gonna use bullet so let's just go over these settings I'm not sure if it changed much just let me check what I did here is I increase the number of sub steps to 16 let's save this select the output here and let this run again okay so that is definitely not working here so let's check our static object here and in the bullet data here let's set this geometry representation to be concave so this should have taken care of this concave area here being represented in our bullet solver for collisions so let's reset and resume you late and yes we can now see this ice cube being dropped in here and wiggling around of it which is fine for now okay finally let's set up the fluids the flip simulation and for that we're gonna need two notes one is the flip object and one is the flip solver and awhile that object and there and the solver into the merge immediately will be greeted by ginormous particles so the first thing we're going to do in the flip object is dial back the particle separation to zero point zero zero zero five really small let's hit escape on that because that's gonna create a rather large volume and set our sub path again using this expression here let's just copy it over to our very first slot that's the one with the ID zero so now we can zoom in and we can see a bunch of tiny particles forming as this liquid volume here let's increase the jitter scale a tiny bit so that we calls around those particles and now let's dial in our flip solver here so what I found useful through a bit of trial and error is increasing the substeps to four and four making sure the solar runs four sub steps always and also in the evolving motion tab setting the velocity transfer to swirly kernel under the hood what that does is it switches a certain part of the simulation to a newer method called a fine particles in cell which results in less noise in your simulation yielding more of that stringy viscous behavior rather than this droplet behavior that you've seen in flip for a long time which is why flip traditionally has been used more for large-scale simulations such as oceans or rivers than a small scale simulations like this as a splash however using the swirly kernel we get rid of this noisy droppy behavior resulting in a more stringy viscous behavior of our fluid one last thing before we hit simulate on this that I want to do is go up one level and on the dotnet here in the simulation tab scale the time so I want this to run a good bit slower and I had good success with a scaling factor of 0.25 that means we're running four times as slow as this would be in real time right now let's save this highlight our dope net and before we hit simulate let's go to the caching tab and increase our cache memory so it makes sure we are caching the whole simulation into round alright save this and hit play and afterward feels like an eternity we are greeted by this a really nice splash going up and a bit outwards sides and I'm kind of liking it so let's roll with it and mesh it and for that I only want those points in here not the collision geometry not the ice cube geometry and to get those I'll just go to the object merge tab and instead of merging everything I just want to merge the flip object one that's how I call this object resulting in those points here now to turn this into a surface I could either build a small tree using MIDI bees or I could use the built-in particle fluid surface which on the hood does the same thing so it's wireless in here and make sure we dial in the particle separation as in our simulation so let's just in the flip object copy this by right-clicking on it going to copy parameter and going back to our particle fluid surface right-clicking on this particle simulation and pasting as a relative reference so when you click on this it 8 takes forever to calculate and B has now the same value as our simulation so let's have at the particle fluid surface here which already looks kind of nice and which you can dial in to your liking to get your desired look let's just drag this down a bit and in my case I went to the filtering tab and checked dilate as well as smooth and in here I increased the smoothing iterations to 4 and as a final step as this is a highly reflective mesh I just added normals which I said to be point normals and then using a natural ER I smoothed out not only the position but also the normals just one iteration and that is how I build the fluid splash for the rendering tutorial again I by no means claim to be an expert in flip simulations so if you guys have any hints on improving this workflow or even speeding it up making it quicker I'd be highly intrigued to get to know your techniques so let me know in the comments and if you want to get hints on how to shade light and render this you might want to head over to our patreon and support us and to everyone already supporting us a huge thanks to you without you we wouldn't be able to do what we do with a very special thank you going out to parasol island gear box to do Quebec encore VFX important-looking pirates Chrissa there and rific an adult thanks so much guys and with that as always its Cheers and goodbye
Info
Channel: Entagma
Views: 34,861
Rating: 4.9513812 out of 5
Keywords:
Id: _6SQPc961ZE
Channel Id: undefined
Length: 11min 15sec (675 seconds)
Published: Fri Apr 17 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.