Houdini 17.5 Water Simulation Basics

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this new DD 17.5 beginners tutorial on water simulation and the basics of it today we're going to be covering flip fluids and flip tanks as well as covering collision guides on objects that will interact with these fluid simulations so on the screen right now you'll see a prompt of the time stamps for what I cover when but I recommend you watch through the whole video as some parts will relate to both the sections of the tutorial okay so let's jump right into it so here we have our Houdini 17.5 seen nothing in it so far okay so first let's just simply start the scene because we're going to need something for the objects to collide with so okay first we're going to start with the flipped tanks okay instead of the flip minutes which we'll get on shortly so let's spawn in a flipped tank let's create this just click on the particle foods tab I'm the flip turn can just click enter that will make the default size and it will make it spawn in the middle of the UD be seen there we are we've got our very very basic which simulation so I just like this and play through it you'll notice all the objects in the tank which are water particles will move doesn't really look like they're doing a whole lot because they're not colliding with anything I'm not doing anything and we haven't set the display flag yet to have it so the water actually looks like water these are just all the individual little particles you'll basically work with you notice they're not very close together the closer together there are that they are and the more compact they are which will mean the betta interactions they have so more splash is bigger splashes more waves are something okay so we have our flip tank initial here so what's important about this is this allows you to control the size of the simulation also quick note which I didn't do that whenever you're working with a water simulation or any soft form of simulation really whenever you do any changes make sure you have frame 1 otherwise you saw the ball an orange before this means that Houdini Hustlas of recache all of the things you've done and I'll make it run really slow whereas if you do it frame 1 it will only have two recache frame 1 and it won't take very long so as I was mentioning with the wave tank initial yeah the flip tank initial all I do any is control of the size of the simulation so this tutorial I'm just going to leave it on the basics because I don't want it to take too long so you guys know what it's a lag you can also control sort of the grid scale of it he really not normal change the size again like I said just with the sort of size instead of dragging it I mean if you change the debt for which I have time for this and make it deeper so if you notice now so Sarah what's not making all our difference but yeah so ok we don't really touch this tab the foot tank initial like I say is mainly just for changing the signs of the water simulation what you actually want is the flipped tank fluid and the auto don that work so there we have I'll put them in little groups so we don't touch this at all these flipped on fluid int area so we just touch then we have our initial setup and then we have our two main sources of the simulation which we'll be working with so here we have essentials like in spell so let's jump in shall we so first off out of the two also quick tip if you have a lot of refocus you seen if you press space and H at the same time works both on Mac and PC it will bring your scene or I'd like to the initial sort of showing you everything in your view part so we're gonna jump right into the authored on that work so this is where most of the magic is going to happen this is where we're going to control sort of how much the simulation interacts how many parcels are in it all of us or stuff so I'm going to talk you through the important parts so the merge and the out part those a complete fine you won't need those this is just to cash out and this just merges that into here the merge will be useful later and we add a collision object in which the auto network will automatically merge it into this simulation and do it all floating so let's talk about the top let's talk about these let's tank itself so firstly let's talk about particle separation so what particle separation is is like a discuss before it's just how much space is between these particles so the lower the particle separation the more particles will be there which means a higher res simulation which will take longer but they'll also make better results so for example if I'm not playing not seven five right now if I hope this to one you know it's where are they all gone but basically that loose they can't stay in the initial box that was self anymore I just play through like they they don't throw anything so you never really want to go that high so we are not pointing at someone five before so we're gonna go to not play not fired I think this is a good number to work with for this tutorial because as you can see there's quite a few particles I but there won't be too many some of the simulation will take too long okay so now we've got a healthy amount of particles like I said you could hop it but for example let me show you what not pick not one looks like I'll have to cash out see that's insane that is a very high-rez simulation and that will be something like you sort of looking for once you know the basics and you have the hardware and software to be able to make it so all right why don't we for because we don't want to make you that high res for this example okay so yeah okay so in the flip tank all you need to know about is the particle separation yep that's all you need to know about that's all I'd like oh I'm pretty sure we can also spawn in a so I see this in the collision targets making a parent box we can also visualize the particles on last you always want to visualize mom somewhere else we can also add in a ground plane but we will manually do that later so here we are this is the next importance that this is the flips over for obviously the slip simulation what this does is all we need is the velocity scale basically that controls how much your water will react when it collides with something or something moves through it so for example the velocity scale is on one this is the default if you want more like bigger more like vibrant splashes you're gonna want to up this but the more you up it the longing a render time will be like the like the particle separation from before so it's all about finding a balance for your simulation to have a good simulation but not how insane rent deterrence so I'm gonna keep it on one for this example before I show you anything else because I want to bring an object through this to show you how it interacts and then we'll move back in okay so we're going to do that before we get on to the flip tank fluid so for this basic example I'm gonna make a sphere just hit enter to spawn in some seats there and I'm just going to drag it up here we're gonna make this animation I'm gonna make this animation two seconds long so I'm working at 25,000 seconds isn't seen better markers so I'm going to hit the keyframe button this will automatically set the key frames for translate rotate and scale so if I move to 48 the water's going to have to simulate out so we'll just give that a quick second there we are the water Sims no no it's just reacting with itself so there's nothing truly going on so I'm just gonna drag this all the way down there and as you can see the keyframe is larger looming these sheets go and click it again just to solidify that the keyframes there otherwise once you move the slider the keyframe will go away so a quick way to get back to the start is by clicking here this will skip you between the keyframes as long as you on the selected object so at the moment there's no s once I hit play the ball on the wall I just sort of don't touch or interact at all so we're gonna change that so once you've got your simple animation set up or whatever kind of animation you want you want to make this object the sphere a Collider so name it accordingly so she's going to be our water collider and it's gonna make a big splash in the water okay and then the splash in the water is going to interact and it will spill about and splash up and down within its bounding box that it's in so this way you can see is how large the bounding box for water actually is which we can change but for this tutorial we're going to leave it how it is so because of that I'm gonna make this spear a little smaller nor point five so there's more room to sort of splash around that's too far more room to splash around etc etc so once we've done that we want to make these ferries that's a Cobb jecht you can see the we click in to check and this you can see when it's done this we know it means it's a colliding objects okay so don't touch any of this then go back into your dock Network which show the magic happens and hit L on your keyboard while your mouse is hovering here to organize everything so as we notice now we have a Collider which is a sphere we name the collider and here it is so because it's being merged into the this tab with the flips over this means that it will interact accordingly with it so you can have as many colliders as you like so starts having an interaction with the water but for now we're going to keep one and I'm going to show you what it looks like so this was on nought point four I believe on the particle separation why don't we show that to make it faster we're gonna come north point on five and I'll play the simulation so you can see what happens so obviously it's not the fastest thing in the world cuz it's cash it to disk that's what the blue thing means but here we are the sphere is about to collide with the water and there we go so once that's finished going through there so all animation is done it's not a clot so you should see we got a little bit of Walker backup wants to say sphere has fully passed through the object so I'm gonna zoom in and slow down the animation for you so here we are you can see whether the sphere collides with the water you can see the water spreading and separating for the sphere gets pushed down spreads out the space and once it's down it brings up a little plop when you just drop something in the water for example like a coin now this isn't very dramatic and probably isn't usually what you want so this is where the velocity scale comes in I was talking about before so we're gonna go back to start it's like I said the velocity scale controls how much interaction actually is with the sphere in the water so for example if I go a bit extreme and of this to ten and play the simulation again we should notice that it's very different from what it was before now it comes see look at that I'll wait for it to gets 48 and then we'll discuss it sort of a water simulation didn't have enough velocity scale on it to make a big impact so with the high one you've got a big splash now sort of spreads through the whole bounding box and then makes a ripple effect like you've thrown something into a like volume of water in real life with some force and so just dropping it so that makes a more dramatic sort of splash as you can see and it looks a lot nicer than move on it just depends what kind of effect you going for and like I said it's all about finding a balance so I'm going to set our simulation to naught point naught 4 and I'll keep on 10 so she's going to make a higher res simulation that looks a bit nice and I love we just did so let's let that go to 48 again and then we're going to discuss the flipped on fluid ok so welcome back we've got 50 frames of our machines sim doubt and it's looking very nice as you can see with the large amount of particles the simulation itself looks a lot nice like I said this takes a lot longer compared to having it on a lower particle separation and I'll lower velocity scale but for me this is fine I think we moved something back but yeah for me this is fine it looks nice so we're gonna go and sort of figure out how to get this from looking like this to actual water so what you want to do now is you want to dive into the flip tank fluid the other section that we saved yeah that's the doc Network what this does is basically caches out the surface so it reads the data from the doc Network brings it into here and then displays it for us so we have two forms of cache we have a compressed cache which you only need if you're doing sort of whitewater simulation or you want to add extra simulation on top it's a very very low res version but it's just performed in blocky huge so allows you to sort of add effects on top like whitewater like foam and things which can allow you to sort of preview what it looks like but today we'll be just playing with the surface cache and the particle fluid surface so let's click into this tab it will take a minute this is the high-res version so as you can see once I've clicked on there we get a sort of mesh outline of what's happening what the water would look like once it's rendered so if you click the display flag onto the particle fluid surface here it will now display what the water actually looks like so as you can see looks it looks alright but it's a bit it's a bit chunky isn't it it's a bit so doesn't exactly look like water it's colliding with the sides here like I said before because of the bounding box but it looks a bit jagged II so there's two things we can do to change that here we again we have the particle separation tab this is just a handy little shortcut that allows us to control a particle separation from here instead of having to keep jumping back and all you have to do for this is right-click it and delete the channels and then you can put in a new with desire but we're fine with no point not four okay so we look into two separate parts here the voxel scale and the influence scale basically the voxel scale controls how detailed this simulation is going to look so the lower it is the higher res it will be but again it will increase the render times that you will go through and then we're we're gonna talk about the influence scale which will smooth off basically areas of this so it doesn't look as chunky but for more you smooth off the more simulation you lose so let's change our box on scale down shall we so we can see it looks kind of chunky so we're going to change it to naught point four and get a second to cook it and some help so as you can see already this is made a lot of difference it's the simulations a lot smoother looks a lot more detailed in the splash compared to this how chunky was before so I think not playing far is fine for this example looks nice enough let's have a mess around with D voxel scale so for example I'll show you how bad it looks on one and that's what happens if there's absolutely no voxel scaling at all so it just gets rid of it you go back to three it should look how it was so we're just going to cancel that and show you something else so if we put the voxel scaling on four then give it tap to sort of zoom out and test here you are so you see looks a lot smoother look almost like noodles now but it's a lot smoother it's interacting a sort of a smooth away my like water would the the noodles are a bit weird but you like again like I say you can go in and change that remember this is only one frame so that's probably why it looks so funky but you can go around and play where you set in so you have more particle separation so it doesn't splash like this or change your voxel scale or your influence scale or anything like that but for this this is fine so once you've got a simulation you're happy with what you want to do is go down to this one the surface cache so basically here you need to know a couple of things are important so whatever you do do not lose this file extension so I'm going to ctrl exit so I could control cut it this is what you need to cash out the file otherwise it won't work properly so let's go and find somewhere to save this I'll just put this in make a new folder on my desktop fan out so always cache and I'm gonna call this test cache call it whatever you like so you remember what it is called but make sure you pull up file extension on it that's very important so after this what you want to do is you want to save this to disk and just wait for it to cash out basically what caching it out does is once you're happy with the simulation it will simulate it all out into a cache a file cache and then you can just read that instead of having to simulate it all out over and over again so I like a lot less so basically you want to do this once you at the end of your simulation you finish with it and then you can delete all the sim out and bring this back in and then there won't be as much lag in the scene controlling it massive sort of thing so I'm gonna save this to disk and I'm only gonna do two let's just go to a hundred and twenty frames so it doesn't take ages and I will meet you back here once this is finished so okay so now that the cache is done we can click here and so display flag here and click load from disk and this will instantly cause a increase in your performance as all of the sort of render is cached out and as you can see I can just scroll through this at 120 with no problems so I'm gonna set my new frame range to 120 just to avoid going over but once this is done like I said you basically don't need any of this anymore so I'm gonna do a file save just in case just put it on the desktop I'll call it water cache doesn't really matter the name whatever works for your project and now I'm coming back continue so I'm confident that we don't need any of this anymore and you can either click into it and highlight it all and disable it like this this will mean no simulation will happen at all because it's all disabled or you could just leave them all out the safe way is probably to just disable them all that way you won't lose any of you dare and there's no real worries so we're gonna delete all this from the sphere object just so that there's no simulation on it but we still obviously want it to appear in the scene so to bring in the cash that you have just made all you have to do is type in file click here and we're gonna call this water cash so we're gonna get confused click into this and then locate your cash so mines hair this is and I saved it to my desktop click open here it is once I play it still interacts with the ball like you did on the other one it's just lacking its textures what do you notice how smooth and fast it plays because it's a catch yes it does sort of chalk a bit there but that's probably because I've not set it to a real-time playback so to do this all you have to do is go down here and click this and now it will play back in real time and as you know it's just flowing a lot more smoothly than it was before before it was just try animation as quickly as possible so you're probably asking yourself now we've got a simulation it works it looks nice but we got no textures for it that's a simple fix all you have to do is go into your material power and you can either use the basic liquid that was made before or we can have a mess around with some of the presets in Houdini so we're gonna go with just a normal principle shader and which will make it blue there you go we're going to turn the reflection down a bit that's what I owe our stands for and I think the rest of it's fine so once we've done this you can either go to your file and bring in a material here once you've dived into it and plug it in and set it as your display flag once then once you've selected a material here it will work so we've got principle shaders you know it's just blue but what I prefer to do is I just prefer to go to the top click on the render go to material and then sentence principal shader both ways work it just depends on how you're working in your scene if you keep diving into things I'm working in the sub Network sort of sayings then I would use the material way I showed you a minute ago well if like this you're working just from the outside the principal shader one works just fine so let's get it to a nice frame a splash in Charlie looks kinda nice well then I'll go into the render view I'll give you a quick rundown on how it's up some very very basic render settings just ignore that because I'm laying Houdini apprentice right now I can only go to 1280 by 720 but if you're running anything else so the actual version or apprentice yourself you can change if you're running the actual version you can change this to 1920 by 1080 or whatever you want it to look like but here we are we've got our a nice little render of our water simulation here so there's probably a more dramatic angle we could take so I'll just give you a quick rundown on how to do this okay so this angle works for me so I'm gonna go lights and cameras all you do is to make a camera where you're looking if you control click or on a Mac command click you'll make a command a camera right where you look in so I wanted to do anything and if you click lock this means whenever you move your viewport your camera will move with it and if it's unlocked once you scroll out of there the camera I'll stay right there and then if you want to get back to it you just click back camera on so this is fine I'm gonna stop a little bit of light in just for this so we'll stop an environment light and then we'll go in surrender view you don't want to know we'll go into the render view and render so now we've got a camera so we're going to set the camera to object camera one we're gonna mess run with our lighting of it so as you notice now got some shadows in it because of the environment light and it's taking a little bit longer to render so obviously the more detailed something is that includes light in before when you're in the viewport and I just click rendered that was just the basic Houdini lighting but now we've got a natural light setup we could probably delete this environment light and bring in a skylight even I think that'll be better so if we just render that out again now we have both a sunlight and the skylight we can control so that's maybe that's sort of a nice nice yellowy I think I know that will go with that a nice of orange yellow as you know yes so it changes the color itself so if we go into this one as well we sell it to ffv be sick so you can obviously set it to whatever color you like I just go in with this color because this one I know I'm colorblind so it's just a color I've used my project before this so as you can see it looks quite nice you can mess with the sunlight so you can make the intensity 10 for example it make it super overexposed or intensity zero super underexposed it's too dark so also that's like three what photo still quite overexposed so it's warm and you can mess with the exposure so you have on minuses so it still looks quite nice I still got some highlights but it's the exposures minuses and you can do the same on here there you go so the render is just really up to you have a mess around with it whatever works for you and then once you're done you happen with you render how it looks that looks quite nice to me even though we just mess around with it to render out all you do is go to out again you want this extension this dot dollar sign LS you go to images rendering pixel samples will be how high-quality your render actually is so right now which run in pixels on one three three excuse that but well run for four when you change this it will change what it looks like rendering here because this is the renderer that we're using I'll give it another go it'll take oh well it won't take a lot longer now but it's definitely gonna take longer than before looks obviously the pixel sampling is how detailed the render will be so the higher you put it the longer runners are gonna take yeah yeah let's render it now just got up you start slow it's not that fast either so it's gonna take about five minutes frame that's not bad in rendering especially from one computer so once you put it how you look in your render settings are also up you're gonna go back to images find where you want to save it we'll go back to save into my desktop and I'll go images make sure you have proper folder setup for this obviously this is just rough when we're more put in render is the name and then make sure you put in the file extension otherwise you'll get one file that doesn't work and you need all those files for the simulation click and to make sure the right camera is being used so that's camera one last one we wanted and then yep just click render and it's done so that I'll render out and at the start you'll have seen how that's looked so I'm just gonna file save this and that's the basics for just going over a flip tank now I'm gonna go cover the the we're gonna cover the limits of particle fluids so coming back to basic empty seem delete that before you know let's just make a file new scene just so we don't ruin anything still that's a moment here we go right so for this scene we are going to need Collider objects more than just the sphere we have before so support set up a basic ground plane so that will bring in a ground plane here and then it will also set up your network which we've been through before we know what the merge does static solver it's all for the ground plane so we need two more things so we're going to need an object to emit from and we're gonna want an object to collide with so we're gonna make a box and to move it up and scale it just for this example once you know how to do one form of flip fluid simulation you basically know how to do it all but I'm going to call that for some collisions in this as well so like before with the sphere we want to make this a static object and that stuff as a Collider now before we move away from this I just want to talk about actual collisions so the ground plane Collider I'll be set up all just fine you don't need to touch that but when you make actual objects you make collide as yourself they can sometimes be very buggy and not I have the collisions you think they should have for example let's go into the collisions tab of the Box object we have just made and click on the collision guide so if you change your view from the normal smooth shaded to just wireframe we can see that the blue wire frame is actually the collisions of the object now to me that doesn't like a rectangle basically colliding objects usually have their sort of parameters a little smaller they aren't exactly all they're supposed to be so for this all you need to do is mess with the division size and then offset the surface so the division size is how detailed this is going to be and just changing this can usually fix it so if we change it to not put not seven you notice now it's a lot more like a rectangle to me if we make this all a bit smaller sell out my detail now if I change this to not point not one as you notice it's now extended from being inside the square of the rectangle sorry to being outside it so that means when something falls it's will now collide with this part of the rectangle instead of what it looks like so we drop this to naught point naught 1 there you go it's looking better usually I wear with Division size naught point naught 1 there you go so it usually works um looks like this very detailed but you've got to remember the more detail you have on your collision the longer your render times are going to be because there's more to simulate there's more to collide with so that's all so when you make a collision object just comment into your doc Network click into it make sure you turn on the collision guide otherwise you can't see it for ease of access I turn on wireframe but you can't still do it from smooth shaded as you can see then basically just set your division sighs do not put not on or anything you think I'll work and then just offset your surface a little bit if you need to and it's as simple as that okay moving on to setting up the emitter let's got a small sphere and just drag it above the rectangle we sell before this is pretty simple again it's a lot similar to the flip tank food we just did all you have to do is click on the object make sure it's selected then click into your particle fluids and the emit particles lives then just hit enter and give up a moment to simulate and here we go as you can see there's already water particles in here so they will fall and collide with this box and the surface so I'm just going to organize this by pressing L I'm going to go back into my box I'm turn off the collision guide because I don't want to see that anymore it's L again so like I said before we don't need a ground plane right now we don't set up stairs the emitter we don't need to touch that that's the collider we don't want to touch that beach don't even need that my apologies so all we need again is the particle third and the dot that way so here we have a exactly the same setup as before so we'll get answers last but here it's very very similar so don't even bother touching this all this is used for is turning the activation on and off so you have you can keyframe in your animation sort of emitting particles which for this example I will do so if you right click on something and click set keyframe as one so I go but if I go to a second it's going to simulate out but it should be very simple and we turn this to zero and then click the keyframe button that's 48 and turn it back on there we are okay so now we've got a very very basic simulation setup with this turning on off like a tap the other two parts you know so you've got your particle separation again which is obviously what you want to control so I'm it's more fluid more particles and then any flips all of it you've got your collision guide so arguably the collision guide is more important in this on because you want to control how sort of good it looks colliding with the square don't you really so I'm gonna set up a little animation here so a place is not playing nor seven and have the collisions are not playing on fires and then we've got our little keyframe here so we have an on-off simulation so if I go back up to the top let's play you can see the water is emitting drop stops collides with the object splashes off and it splashes how it does because we set up the collision guide so if we just pause the animation there for a second I just reset my camera you know s here it's all colliding on top of the rectangle like we set it to if we hadn't set the rectangle up like that all of these particles would essentially just fall straight through the rectangle and that's not what you want at all is it you know there's a little simulation to turn this back on and let it continue sinning so you can make stuff like droplets with this with the turning on or off or stop emitting from a certain way like maybe leaking out of a drain or something of that sort of variety maybe make a bit of a fountain anything like that really so I'm fine with how this looks it's just an example and you know the basics now so all you need to do is swarm or recap this is the activation in the sauce surface from sphere so that's the emitter that's just to turn it on and off you've got your particle separation which controls how many particles are emitted sort of yeah well it's just how many particles are emitted so how detailed it will be then you've got your velocity scale which is how sort of details of the interactions with the water will be as we can see here if I turn this down to one for example it will not look like this at all we're about to speak it in it will load a lot faster because the obviously it's not as detailed but it should just run off yeah you see it's not as extravagant as it was before but maybe sometimes you don't want that this works nice it's a little water droplet that one okay so that's that covered once again you want to go into your particle fluid and now we want to sell how it actually looks so so this is how it's gonna look again all we need to do is click into here and control it so I'll make the voxel scale not putting on farm again they admit while hi-rez there you go I'm Orpheum that scale to before again there you go it's a lot smoother looks a lot nicer now but we're gonna put it on 3.5 this time once that's hold on you just need to cash out again which we will do so I'm just going to delete the keyframes and set its 120 again because turning 40 frames is way too many for this little example and I will rejoin you in a second or so she's cashed out remember that this is important if you're going to save stuff in the same place like I'm gonna save it to cash do not name them the same thing because you'll start to get confused so I'm going to call this splash cash and then half the extension okay so I'm gonna let that render out once your cash is finished making as you can see here we've got the whole thing again you want to just disable everything else so there's no simulations going on so we'll need the ground plane sphere in the box but this can go and then we're yet again import a file and to that to find our cash so we call this splash cash and here we are so the splash cash this is what it looks like in the end but render well the cash should I say looks quite nice it's quite over the top big splash which we're going for a very fast water admitting and splashing it's the object I'm much like before you can add in your own textures and render it to make it how you look so yeah I hope that was a helpful tutorial on the basics of water simulation in Houdini 17.5 and I hope you enjoyed thanks very much
Info
Channel: C00PLY
Views: 2,035
Rating: 4.9183674 out of 5
Keywords:
Id: UKe0aSll6NY
Channel Id: undefined
Length: 42min 31sec (2551 seconds)
Published: Wed Jan 01 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.