Simulating a Splashdown in Houdini - Escape Studios Free Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this tutorial from escape studios today we are going to be learning how to recreate the effect of a ship breaching through the surface of water and crashing down creating a big splash like you might see in the movie miss Peregrine's Home for peculiar children so we're going to be doing this in Houdini and you can see I really roughly animated a ship breaching and then splashing down I'm not an animator but this will do the job and I've also animated a camera just to kind of give a bit more a better perspective on what's going on okay so what we're going to be doing is I'm going to be running through a really kind of basic flip simulation and so we're going to be looking at generating the collision geometry for this ship and also generating secondary simulation elements foam and spray to get the kind of best result we possibly can so first of all we need to look at just building the flip simulation so if we look at our shelf and go over to our ocean tools and then sorry particle fluids we're going to create a flip tank so this is going to be the kind of source of our main flip simulation so I'm just going to drop a flipped tank in this going to create a couple of nodes at the object level so we've got our fluid tank initial fluid tank fluid fluid tank interior for now we can turn off our flute interior we don't need that and also obviously we've got our dock Network which being created automatically and this is where all the computations for solving the fluid gonna happen so first of all let's look at our fluid tank initial and at the moment we can see that this is much much too small just before I start resizing things are going to hop into my top Network and change the particle separation on my flip tank to 3 and so particle separation is literally that it's the distance between each particle and obviously the higher value that is the less particles you're going to have in your simulation and so while we're setting things up if we put this at a kind of higher value we're going to get a much quicker feedback just so that I can see the the size of the flip tank so let's hide the fluid for a second hop into our fluid tank initial and this is where we are going to set the the size of our flipped tank so if I just make this a tiny bit bigger so you can see here our particle separation is linked to our auto Network the value that we just said the water level is exactly that how high the water is and so the first thing I'm going to do is just move this onto the grid it just makes things easier for resizing and I you can use this with well any kind of primitive you create are normally whenever I create a box or a sphere I'll just drop this expression in to move it up to the base of the grid so co-channel size Y which is this value just multiply it by 1/2 so now you can see it's the base of our tank is sitting on the grid and now I want to make this slightly bigger so let's say 250 by 150 by 250 again okay let's just okay and now we need to increase the water level to actually start seeing our particles so let's set this to maybe just trying to see what my camera is I might actually just change the color of my background - great Oh No light maybe it just so I can see my camera okay so let's put this it may be 10 or tor just so that camera is kind of sitting on the water as if it's from the perspective of someone in the water looking up at the ship okay so this is I guess the the kind of size that we want for for our flipped tank obviously let me play through because I haven't got my top Network or the fluid import visible we're not seeing any motion in the the particles so let's look there's our ship and our camera again perfect so what we need to look at now is our flew tank fluid I'm going to run through some of these nodes so from here we can see that our fluid tank is being imported and this is a dot IO dot import output node and all this node is doing is is bringing in data from our dot simulation and to sort context and so we can see it all our particles here this fluid compress node is relatively new in Houdini and the way that a flipped simulation works is it's a combination between volume calculations and particles and so when the so the fluid is calculated by volumes and then once the density of that volume drops below a certain point the simulation for that area turns into a particle simulation and this can speed up well it has sped up kind of fluid simulations because particles can take a very very long time to simulate and so it's kind of balancing between the two and this fluid compress node essentially compresses the data that you might need to store so it's only storing the necessary information for you to be able to render a good simulation so this there's actually a really good video I think side effects about fluid compression and kind of workflows optimizing your flip simulations on their website but anyway so let's hop back up to object level and go into our doppler k-- and so this is where in daps you have the flip tank obviously the flip solver these this is well that the actual calculations for the simulation going to happen so this flip object it's bringing in in the initial data the values that we set previously so from our fluid tank initial is bringing in the data it's bringing in the particle field and we have our particle separation here particle radius scale and grid scale so this is bringing in on our kind of initial data and then the solver is calculating and it's going to calculate collisions it's also going to calculate interactions with other particles and this is where you can set your overall simulation information a parameter sorry and so we need to have this object or boats ship collide with these particles and if I played this through now when the ship moves through the water there's there's not going to be any interaction between it because although this flip object is dynamic we haven't yet made this ship a dynamic object and so we need to tell Houdini that this ship needs to be included in the calculations as well it's just going straight through because this object is animated we don't need to we want to give the positional information from the animation instead of actually having forces act upon this ship so things like gravity and other forces you can add because obviously gravity is affecting our fluid but this has already been animated so we just want the ship to affect other objects so instead of making this a kind of dynamic object we're going to make it a static object and now if we hop back into our ship we can see this has been created dot path and it's a string which is looking at or referencing our our dot network one thing I always like to do is just drop in null nodes to give a bit of organization let's call this out jobs okay so if we go back into our dope network you'll see that the l2 layout the ship has been brought in this is what was being referenced in that attribute create this node and it's also brought in a static solder again if we were to press play you wouldn't get a collision here because at the moment this node is referencing our and our ship geometry only on the first frame and so we need to tell Houdini that we don't just want to reference the position of this on the first frame we want to reference it every frame is deforming it's it's animated so we check use deforming geometry so now if I do a quick flip book I'm just going to actually change the particle separation to two just to give us a better interaction and I'm just going to do a quick flip book so that we can see the kind of first run at our collision so I'm going to pause the video and I'm going to run a flip book okay so flip books being created so if I press play you can see we're starting to get collisions now but we're not getting very good interaction between the particles themselves and the geometry you can see particles are actually kind of going straight through the geometry and this is down to the how the our geometry is being created in dops so how it's being kind of interpreted to collide with the particles so if we go over to our ship and I'm going to turn off display geometry for a moment cuz I just want to look at the collision geometry that is being created for our ship at the moment so the kind of base collision geometry that Houdini will create I'm just going to create a new camera so that I can redo flip books from the same prospective okay so back into our network and just turn off display geometry and now if I go to odd collisions tab you can see here this is where the collision geometry for our objects is created so at the moment we're using the Ray intersects mode an RBD tab we've got and it's being divided 30 times so if I turn on our collision guide here you can see how our geometry is being interpreted interpreted so it's being divided 30 times and that's why we're actually if I turn on display geometry again we're not getting a + wireframe we're not getting a good kind of interpretation of our actual jory you can see so because it hasn't been divided enough if I put this up to see 90 we're getting better but you can see these thinner areas of the geometry is still not really being resolved and you know for this to be really kind of high quality in these areas you're not getting at all we would need to work this uniform divisions up much much higher is just going to slow down our simulation I mean even a hundred and twenty we're still not getting these areas for thinner areas so we need to think of another way of generating collision geometry so that we can resolve these kind of thinner areas and one way to do that is generate a collision volume for the ship so let's hop into our I'm just going to hide the fluid for a moment let's go into our ship geometry and another thing I need to do because we're calculating the velocity of the interaction between this geometry in the flip particles if we look at our geometry spreadsheet and I press play at the moment we have P attribute for each point we have its position in space so px py PZ but we're not calculating the velocity of these points so the change between each frame that's because this is not a dynamic object it's object which has been animated so Houdini there's an easy way to do that in a teeny and that's just to create a trail salt and I'm going to put that above my out dots and the trails up will allow you to compute velocity of the each point so I'm just going to put the results hard to compute lossy now you can see we've got V X V Y V Z and this is going to show the change in velocity sorry the the velocity based on each changing frame so now if I look at collisions again so I hop back to my chem 1a turn on my top Network and I'll do another flip book to see what differences has made okay so now if we look at our result with velocity being computed you can see you get a lot more splash the velocity from the ship is being added to the particles and you're getting the water kind of being thrown up so if we look at same way you two if we compare to without velocity being computed you can see you're getting more splash and more activity around the base of the ship then before okay so we're still however getting though not getting the thin areas resolved on the ship so what we're going to do is we're going to create a collision volume for the ship so first of all I'm going to drop a poly cap in and all this is going to do is fill any holes in my geometry and it makes it much quicker to complete to calculate the volumes so triangulate caps of some of it turn that on and okay and now we are going to create a V V V from polygons VD b VD B's are really kind of quick to compute in terms of well in relation to other volumes and if we look at our video polygons you can see it's an estimation of the surface of the geometry and if I didn't have my poly cap node turned on then you might not notice a big difference sometimes you might have small holes and it's not actually going to resolve your the shapes of your geometry as well so we'll keep that turned on and you can see when I turned it on there's some extra Vauxhall's being added around here so anyway we just want to onam turn of wireframe and hide other objects just so that I'm looking at this shape then it's sorry just the VDB and although we've got generally quite a good estimation it's still not as good as I would warn kind of these areas here railings again these thin areas are not being resolved quite as well as I have lied so what we're going to do is drop this voxel size down to maybe point not eight see how that looks okay it's better still not quite this gear just viewed one but one way we can solve that is to increase the amount of our interior band boxes okay so this is good enough I think work because the objects moving quite fast you're not going to notice these kind of these areas not being is kind of hot resolutions you might have hoped because these take up a lot of memory less than traditional volumes but still quite a lot of memory and so I want to write out this this volume sequence so that we can then source the volume in our dope network so I'm going to drop in a raw output driver rendered frame range Joe I am going to call its side on a hip so at the name of our Houdini file geo and I'm going to create another subnet sub directory again dollar OS and dollar OS relates to it just references the name of the node so this I'm going to call Rob underscore collision little bit and then I'm just going to save this to this I'm going to pause the video save it to disk and then I'll come back when this is all been saved up okay so that is all saved and you can see I brought it in here I've just dropped in another file node and referenced the sequence of files we've just written out and so now I'm going to drop in another null and I'm going to set call this out vvv okay so now we've got our I'm just going to set the display flag on this to the geometry now we have our collision geometry set up and we can concentrate on the fluid okay so now I'm going to show you how to use that volume we've just created two by the static object we have an r dot network to calculate collisions so at the moment we're using our Ray intersect mode and all that's doing is it's dividing our geometry up 30 times or 120 times in two to a kind of volume which is going to then collide with the fluid but as we saw before this values got to be huge before you can resolve thinner areas the geometry and that's just going to slow down our simulation so instead of using Ray intersects we're going to use volume sample and down here in our proxy volume channel I'm just going to look at the ship geometry and the out V DB and I'm going to export the relative path and now let's just pump the uniform divisions up to about 90 okay so this is correct it's looking at the VD b we just created so now let's do a quick flip book just to see how our shapes being resolved now and see if we are getting a better collision with a fluid than before so I'm just going to pause now and generate this flipbook okay so what I did is actually turned off the particle visibility on the flip tank and I turn on the collision guide just so that we can see how the shape is being represented and you can start to see these thinner areas colliding with the particles it's still not very good because we haven't actually looked at our flips over settings yet and also because the particle separation might not be low enough to get good collisions with thinner areas and these thin areas might be kind of passing through the space between the particles so let's now we have our collision geometry set up stop that that's the first frame now we want to look at the settings for our flip simulation so if we look at our flip tank we can see a particle separation there this is where I turned off the visibility of the particles and turned on the visibility of collisions and there's other guides I'm not going to go through all of them but they can help to kind of debug what's going on in your simulation so these guides these tabs relate to the corresponding guides at the moment we have a visualization on the particles if I have a look we have a visualization of the speed of the particles from this blue to white and so as you can see areas which are colliding with our ship are turning from it was ramped between these values okay so if we look in the physical properties of our flip tank downspout forward friction Daiya friction temperature density I'm going to leave them as is but the viscosity I'm going to add a very small amount and so this is just going to help to give a tiny tiny bit more stickiness to the water not enough to kind of be noticeable obviously a very high amount would turn the liquid in something like honey but this is just going to add a very very subtle amount of viscosity to the fluid so it's not kind of behaving like a complete gas okay and we can leave everything else now this this is not the only place you have to turn on viscosity you also have to turn it on and off flip solder but I'm going to look through each of the different parameters we have here so time scale leave that one just to be kind of physically accurate now we have our min minimum sub steps and maximum sub steps and obviously this is the amount of how many times per frame calculations being performed so I am just going to boost that to two and the max to three this CFL condition basically what it is is how likely the lower this value is how likely it is that the map the maximum sub steps are going to be used so if we look at the tooltip says factor used automatic term and what size sub step the scene requires so the lower this is the more likely that this value is going to be or more towards this values going to be use so just can drop that down to nor point nine I'm going leave the particle efficiency FL as is so now let's look at our particle motion and as I said the star power flip simulation fluid implicit particles stands for is a combination between particle simulation of volume simulation so we can control how our particles behave in the simulation and also how the volumes behave so at the moment before we had you could see the particles was going straight through the geometry partially because our John collision geometry wasn't kind of high enough resolution to resolve the thin areas but also because upon collision we weren't actually doing anything with the particles so I'm going to set this to move out size collision so this is saying now because we have our V DV or volume we're using the calculation of whether the particle is inside the volume or outside each voxel and it's going to try and move that particle outside of the voxel if it detects that it's inside the volume and also I'm just going to click kill a moveable particles and so behavior we don't need an idea or age attribute and also I'm going to turn off reseeding and what reseeding does is it attempts to kind of add more particles as particles are killed or move outside the bounds of the flip tank so that it keeps the kind of same amount of particles overall so as Possible's diet we'll try and add them in but sometimes this can mean you get popping as part of new particles are created so I'm just gonna leave that on off sorry I'm also going to leave separation off I'm going to turn on droplets and basically what droplets are is when the particle will when the volume drops below a certain density obviously it turns into a particle simulation but the particles can still tend to kind of clump together and so what droplets are they give a bit more of a kind of spray effect so once the particles have dropped below a certain kind of density then we're going to tell them to turn into droplets which will then behave more like droplets more like kind of spray and so I'm going to turn the minimum density and so this is the minimum density of the particles before which their turn into a droplet and I'm going to leave the maximum at one and now we're going to leave the behavior to blend with fluid and all that means is that when it rejoins the fluid it's just going to be blended or we could have it killed when they turn into a droplet or killed when they blend back in with the fluid but so it's going to leave it with blend and we can leave the velocity blend it's no point to okay so the next tab is vorticity and this is basically the kind of chaos of the the particles and this can be used to calculate white water the more kind of swirly an area is then the higher this attribute is going to be so we'll add vorticity but we'll leave these parameters as they are and I'm not going to add a rest attribute we don't need it so now let's look at our volume tab volume ocean tab so at the moment we have our velocity transfer splashy kernel these are literally they do what they say if you want a kind of splashy simulation use this kernel if you want the more swirly one you use that I'll just leave it on splashy the full scale we're going to leave two one and the velocity smoothing to nor point one at the defaults okay so these this velocity scale obviously if you want bigger splashes you can increase this value but you need to be a bit careful because the higher it is the more unrealistic it might look so which you can leave this at one because we're calculating our velocity on the geometry and we are going to turn on stick on collision because we want the particles to stick to the hull of the ship as it breaches out of the water so it's going to attempt to kind of match the particle to the to the face within to the face of the geometry within a certain distance this max distance and this is kind of gives you a bit more artistic control over the look of the water I'm going to turn the normal scale and this is just kind of how much the particle is going to try and match the normal of the face that it's sticking to okay so before I mentioned that we not only needed to have our viscosity turn on in the flipped tank but also in the flip solver so I'm going to turn that on here so now we should have a viscosity attribute here you can see and it's a scalar value so density we don't need divergence and this solver we can leave as they are I'll just talk about the solver quickly Bax girl this is quite important when you have things interacting within the scene because certain things are by well our sorry are bi-directional within Houdini say you wanted the velocity of the fluid to affect the to effect a rigid body object you can adjust this feedback scale so the higher this value then the more influence the fluid is going to have on other dynamic objects in the scene and you can also use OpenCL to to speed up your simulation which is good but when you first turn it on obviously every time first frame is going to have to load everything into your onto your GPU so it first can slow things down but is good here in certain circumstances so now let's have a look at how our simulation is looking so I'm just going to pause the video and I'm going to do a quick flip bug okay so you can see this is the flip book I've just generated you're getting much better collisions and those particles that are not moving outside the collision is just being killed and you're getting this kind of sticking to the surface which is nice and you can play with those settings and till you get the kind of look that you want this is good for me for now so I'll just stop this and you can see there you've got pretty good collision so now once you're happy with how your simulations looking the next stage would be to cache the simulation out and so this is where our fluid or fluid tank fluid network comes into play we have our fluid compressed node here and you have different parameters for how you are going to compress the data I'm not going to go through all of them there's as I said earlier there's a really good video on the buy side effects about a flip workflows but anyway we'll look at the particle fluid surface node all this is doing is gently is generating a surface from our compressed cash but we actually want to write out the data from our compressed cash here so that we can then use those volumes because if we look you have the volumes and the particles we want to use those to calculate our Whitewater so I'm going to drop in a raw output driver I'm going to rename this raw underscore lip base and then again hit dollar hit geo and then dollar OS and then full slash and I want to render the frame range so now let's save this a disk and come back when this is also okay so the flip simulation has been written now I've dropped in a geometry node at the object level and then I just referenced the compressed cache that we wrote out and what I'm going to do maybe you can see that we have just volumes and so we want to drop in a particle fluid surface mode so that we can read the data from the compressed cache and output particles so we can see the simulation so if we click on our fluid surface and then I'm going to turn this from surface of polygon soup into just particles and there you can see now we've got our particles back it doesn't look the same because we're not actually visualizing the velocity before we were visualizing speed so you just need to set the ramp visualization to be to velocity um okay so this node you can look at different things like particle flew compressed fluid and all that's going to do is fill in the gap gaps between each particle and so gives it more of a kind of full appearance and now but I just want the particles because we're gonna creep we're gonna create a surface from this now so we've got a just under three million points and obviously on the first frame before any compressions happened because we're the flu is getting compressed we're losing some of that some of the particles underneath the surface because we just don't need them once this is a bit meshed you you don't need to see the particles which are kind of below that level anyway so we want to surface create a surface from this and we're going to use VD beads again so firstly create VD be from particle fluid and nor point three five and now this might take a while to compute so if we look at this you can now see from our particles we have VD B's and so from this we are going to convert the VD b s to polygons so we going to drop in a convert VD b node and we want to select two problems so now if we look at the wireframe you can see we've got polygons instead of just PDP's we get these kind of artifacts here and that's because obviously is the surface is being created from individual points and so we can just drop a VDP smooth to try and even out some of these artifacts and that looks a lot better so that's without the smoothing and this is with okay so now we are going to look at how you could do a whitewater setup so ideally you would write out this this sequence and so you would write out your flip mesh to disk and then you would use the volumes from your initial flip simulation to calculate the whitewater so I'm going to show you how to do that now first thing we need to do for whitewater is to just select a whitewater node sorry the whitewater shelf tool it's going to say select fluid for generating whitewater so if we hop back into our dock Network I'm going to click flip tank and hover over the viewport press ENTER and now this is going to hear a few nodes of at the object level whitewater import similar to how a flip town was created will import sim and source so at the moment our whitewater sauce is referencing the fluid in our top Network we don't want to do that we want to reference the compressed cache we written out so if we look for our file this is the compressed cashing off flip base and so now instead of referencing the top Network is just going to reference it from this and so from here you can control the Whitewater generation based on the attributes of the initial base flip simulation so we have our white water source here and this is going to control basically because essentially the white water is just a particle simulation and then it's being written out there and if we volumes out just outputs the volumes that are being merged in from our cache so let's go back up to the object level and look at the other two you know they've been created so we have our sim and our import import again is just does a couple of pro post processes so this is where we can affect the white water solar notice that it's a different top network to the flip simulation so we have our object here our emitter which is just referencing the source and then yet the solver and this is where we would write out our simulation from so if we look at our white water solver you can see we have foam spray and bubbles and then the solver at the end here which is just referencing other channels this is where you affect the particle simulation so we have like a minimum lifespan so how long the bubble err the the white water particles are going to live once they've been emit the minimum time they will live and a maximum and obviously variance and also spray spray is similar to white water sorry to foam but it behaves more like a spray so it's going to have much more kind of volume sorry not volume is going to have more appearance of greater velocity to it and their bubbles and bubbles is what creates our foam and so let's have a look and we will so on our white water we're going to just change the maximum lifespan to 10 okay and I'm going to turn off spray and write out our foam with the bubbles so from here if we go up to object level go back into our import and then we have this attribute wrangle and this is basically just controlling the P scale of each particle and also the velocity is just timesing it by one so we want to write out the simulation after this point so let's drop in a rock output driver again and this is going to be called foam so we'll change the name of the node to rock on the school phone cue dollar OS and we'll render out the frame range and so I would do this with the foam I would simulate the foam on its own and then I would write that out and then I'd hop back into the solver and I would turn off the phone and I would enable spray and I turn off bubbles and I'd write them out separately this partially is wool because you can then splitting up each element is good because if something gets lost or whatever you don't need to re simulate the whole thing you can just recently late the part that it's corrupted or or lost or whatever and you can only have things on disk which is absolutely necessary and you can then render each element separately so you would write out the the Whitewater elements separately so I that was a quick introduction to flip simulations and just generally how you could get started on doing your own kind of basic flip simulations and a lot of the look of fluids is you know it's how you have a lot of artistic control over the look of the fluids and so playing with these parameters obviously that would take far too long to go through all of them there's so much to flip simulations to go through in an hour but hopefully this is giving you an idea of a basic workflow generating flip simulation cashing that out to disk the caching surface or the mesh out to disk and generating good collision geometry and then also from your base particle simulation generating whitewater secondary elements so I hope you've enjoyed this tutorial and thanks for joining me you
Info
Channel: Escape Studios
Views: 75,806
Rating: undefined out of 5
Keywords: Escape Studios, Escape, studios, VFX, Visual Effects, CGI, Autodesk, Foundry, Tutorials, I want to learn, tutorial, rendering, dynamics, animation, beginner, simple, basic, expert, character, festival, workshop, renderman, compositing, particles, learning, study, guide, free, motion graphics, design, houdini, simulation, effects
Id: GBKHHOpTYuI
Channel Id: undefined
Length: 53min 43sec (3223 seconds)
Published: Wed Oct 19 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.