Fluid Simulations for Beginners 💦 (Blender Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this beginner tutorial I will show you how to create fluid simulations in blender so in this video I'll cover all the basics of how to create fluid simulations and we'll be creating this animation right here and we're even going to be doing the lighting and the rendering and the materials at the end of the video after we create the fluid simulation and if you're looking for a specific part of the video then you can use the timestamps in the video description to find all the parts in this video and if you enjoy these tutorials and you'd like to help support me and this channel then I will have links in the description to my gumroad store and my patreon page where you can get 3D models and assets tutorial files artwork project files procedural materials and other blender content on my gumroad and patreon and you can also get the finished project files of this tutorial on my gumroad and patreon as well I'll have all the links in the description and some great ways to help support the channel here on YouTube is by checking out the YouTube memberships by clicking down there on the join button and you can also use the super thanks feature here on YouTube to send me a little tip if you enjoy this video now during the video if you'd like to see the buttons that I'm pressing that my screencast keys will be right down here in the corner so you can see what buttons I'm pressing so I'm going to start by selecting everything with the a key and then I will hit X and let's click on delete so I'm now going to press shift a I'll go here to mesh and I'm going to add a new Cube so I'm going to use this Cube to model kind of like a basic sync object and then we're going to be animating the fluid simulation going into the sync Now the default primitive objects in blender are a little bit higher than an average human when modeling to the real life scale and blender so this cube is actually pretty big so I'm going to hit s to scale and I'm going to type in 0.6 and then enter just so it's a bit smaller then I'm going to scale this down on the z-axis and I'll just type in 0.3 and then hit enter then I'm going to hit the Tab Key to go into edit mode and I'm going to click here to go to the face select and I'll just select this face and I'll hit the I key to inset the face and I'm just going to scale that down to about there and then I'll hit the e key to extrude and I'm going to extrude this down just to about there and then I want to model kind of like a gutter or a trough object which is going to direct the fluid down into the sink so I'm going to select this face here I'll press one on the numpad to go to front view and I'm going to press shift d to duplicate and I'm going to bring it up here and I'm going to zoom out so that I can see the grids here in blender so you can see in the background there's these grids and I want to scale this object up on the x-axis and I'm going to scale it so it's about two and a half grids long then I'll press 7 on the numpad to go to top view and I'm going to scale this object and I'll scale it on the y-axis and I'm going to scale it down so it's about half a grid wide then I'll press one on the numpad to go back to front view and I'm going to zoom in a bit and I'll hit the e key just to extrude the face up and I'll just extrude it to about there so it has some thickness so I now want to add some Loop cut so I'm going to go here to the side and I'll press Ctrl R and I'm going to scroll my mouse wheel out so there are two Loop cuts and then I can left click and then right click so they stay in the center then I'm going to scale these and I will scale them on the y-axis and I will scale them out just like that and I'll scale it out so that the size of the square is about even then I'm going to click right here to go to the face select and I'll select this face and I'll hold down the shift key and select this face and I'm going to extrude these faces up so hit e to extrude and I'm just going to bring it up to about there and that way it'll help to direct the water down the gutter and then with my mouse hovered over this object I will press the L key and that's going to select the link vertices and I think I want to scale this whole object down on the x-axis so it's a little bit less long and then if I press 1 on the numpad for front view I'm going to rotate this object and kind of just point it down here so then we can have the fluid falling down and then going down the gutter and then into the sink so I can now hit the Tab Key to go back to object mode then I'm going to press shift a and I'm going to go here to mesh and just add a plane and I'm going to bring this plane down on the z-axis so it's right down there and then I will just scale This Plane up really big and this is just going to be like a ground object kind of in the background so I now want to add an object which the fluid is going to come out of so I'll press shift a and I'm going to go here to mesh and I'm going to use an icosphere but you really could use whatever object you want I just like using an icosphere I think that's kind of cool so I'm just going to add an icosphere and then I'm going to scale this object way down because it is pretty big so after I hit s to scale I'm going to type .08 and then hit enter so that way it is quite a bit smaller and then if I go to front view I'm just going to bring this object up here and just stick it up here and this is where the fluid is going to come out of so the fluid simulation is going to come out from this object and then this object here is going to act as a collision so the fluid will collide with this object but we still need one more object and that object is going to be a domain of where the fluid simulation is going to be because the blender scene is of course really big and so we need to tell the fluid simulation where we want it to simulate and that object is also going to become the fluid simulation so I'll press shift a I'm going to go here to mesh and we're going to add a cube now the fluid simulation is going to be inside this Cube so you just need to make this object as big as you want the fluid simulation to be so I'm going to go to front view and I'm going to bring the object up and I'm also going to hold down the Z button and go to wireframe and I'm going to scale this object on the x-axis and make it a bit longer and I'm going to bring it over here and then I can also scale it down a bit so I just want to make the cube as big as I need for the fluid simulation and you especially want to make sure that this object the object that the fluid is coming out of is going to be inside this big Cube and then of course this object is going to interact with the fluid so we want it to be inside the cube as well so what I'm now going to do is just click and drag to box select all these objects and I'll just press Ctrl a and I'm going to apply the scale because we did scale these objects so now this is now the object's new default size and then of course we should save the blender file so I'm just going to click here on file and I'll click on save as and I'll just save the blender file to my computer so then as you're working on the project you can press Ctrl s and that is going to save the blender file so we now want to add the fluid physics to these different objects so I'm going to hold down the Z button and I'll go back to solid View and for now I'm just going to move my view inside the cube so I'm first going to start by selecting the cube object and to add the fluid physics we need to click right over here on the physics properties on the side panel and then right here we need to click on fluid and then I want to click on this object right here this is where the fluid is going to come out of let's click on fluid as well to add a fluid simulation to this object and then let's also click on this object here and this is going to interact with the fluid and you can actually have multiple objects which will interact with the fluid for now I'm just going to have one object but if you have multiple objects you can add fluid to those objects as well so select this object here and let's click on fluid to add fluid physics now when you add fluid physics you can see that there is a type that we need to choose and if you click here on the drop down you can see there are three types there's the domain there's the flow and there is the effector so what I'm first going to do is select the cube object and then here on the type I want to choose domain because this is going to be the domain so it's where the fluid is going to send emulate now if you click on the icosphere here this object is where I want the fluid to come out of so right here on the type I want to change this to flow so flow is going to bring the fluid out of this object and then let's click on this last object here and then on the type here this one I want to change to effector and this effector is going to make the fluid objects collide with this object now if you hit the space bar to play the animation or just click on the play button right here you can see it's not adding fluid and it basically just looks like there's some smoke here and that is because on default the fluid simulation is actually set to smoke so what you want to do is click on the icosphere or just select the object that the fluid is coming out of and right here on the flow type we want to click on this and we want to change it to liquid instead and then you want to select the cube object and go right here to the settings and on the domain type we also want to change this to liquid so I can now click on this button here to bring the timeline back to the starting and then you can either hit the space bar or click on the play button now you can see nothing is still happening and that's because this object is a little too small so if the flow object is too small then there's not going to be any fluid simulation so I just need to scale this object up a little bit so now if I go back to the starting of the timeline and play the animation you can see there are some particles which are coming out of the flow object now I don't just want to simulate particles I actually want to be able to see the mesh fluid so to fix this we're going to click on the box object and we're going to scroll down here on the side settings and we want to check mark the mesh button so just check mark that mesh so I can now go back to the starting and I can play this and you can see that when I play this the box is turning into this fluid object right here however the box is still there it's just invisible so you can't see it but if the fluid reaches the end like here it reaches the bottom it's going to stop where the Box ends now this object isn't really adding more fluid it's just adding one little blob of water and the water is just kind of falling down on the ground and this is because on default this fluid simulation is set to turn the geometry into fluid so if I like made this object really big then I can go back here to the starting and I can play this you can see now there's like a really big drop of water or if I make this icosphere much smaller it's just going to use the geometry to create the fluid so if you're wanting to turn an object's geometry into fluid then you can do it this way but I instead want this to act like a faucet and so I want it to emit water out so to fix this we need to change the flow Behavior so if you click on the icosphere you can go over here to the settings and you can see the flow behavior is set to Geometry on default but then there's also inflow and outflow so the inflow is going to act like a faucet and it's going to shoot water out of the object if you change it to outflow that's going to kind of act like a sponge and it's going to suck up any water so we want to change the flow Behavior to inflow and now if I go back to the starting of the animation and play the animation you can see it's just going to add more and more water now you may have also noticed that during the simulation the water was going through through the object like right here you can see the fluid is going through the object and so to fix that we need to make the fluid simulation higher quality so what you can do is just select the fluid and then right here on the resolution divisions you can turn this up to make the fluid higher quality so I'm going to turn the resolution divisions up to 70 and then I can go back to the starting here and I can play the timeline and now it's going to interact much better with those objects so now you can see it's actually going over the little lip here now when you turn the resolution divisions up you can see the fluid simulation does look a bit higher quality but it also is much slower and right up here in the corner you can see there's this red text and this is showing you the frames per second so you can see the frames per second right now should be playing at 24 frames per second but it's quite slow because it's trying to bake the simulation in real time and if I pause the simulation you can see the fluid simulation is still quite Blobby so I'm going to turn the resolution divisions all the way up to 100 and that'll make it look a bit nicer so then I need to go back to the starting of the animation and I can play this again and you can see it's even slower but the animation is looking much nicer now you can see it is quite slow in the viewport and when I try to move this around it's very slow so in order to see this much smoother we can bake the simulation and then we can play it back instead of trying to play it here in real time so to bake the simulation you can select the fluid object and then you can scroll right down here and you want to open up the cache settings now right here there's going to be a cache location and this is where blender is going to save the cache data so it's going to save the data of the bake simulation so if you want to move the cache data somewhere else on your computer then you can click on this file icon here and then you can locate somewhere on your computer where you want to save the simulation data I'm just going to leave it at the default though because it'll save it in the same folder where I have this blender file saved now you can also choose a start frame and an end frame and I'm going to have this simulation 200 frames long here on the end frame on the timeline I'm just going to change this to 200 and then here on on the end frame I will change this to 200 as well now on default the type here is set to replay and so this is going to bake it when you play the animation in the viewport so right now it's baking the simulation but it is going very slowly and it is kind of laggy because it's trying to bake it while it's playing it so if you want to change this right here on the type you can click on this and you can change it to all instead and now that I've changed the type to all there's this bake all button so I can click on the bake all button and you can see it's going to go through here and it's going to bake the simulation and if for some reason I want the fluid to stop baking I can hit the Escape key and that is going to cancel the bake so now I can play this and you can see it's going to be much faster and I can actually scrub the timeline here and you can see It'll be very fast now since I've baked the simulation you can see all the settings here I've turned gray so what I need to do is click on the free all button and that way I'll be able to control all the settings again so I can change all the settings of the simulation so I just let this bake all the way through and I can now press the space bar to play the animation we can actually see the animation going all the way through so you can see there's lots of fluid coming here out of this object and it is starting to fill up the whole sink and then even at the end here it starts to flow over the sink now when I'm creating a fluid simulation I like to bake the simulation then I like to go back and change some of the settings and then re-bake to see if it looks any better and so because I'm constantly re-baking the simulation I always want to be able to see this button right here but if I click on another object like let's say I click on the icosphere and then I want to move it over now I have to click back on this object here and then I have to scroll all the way down to get back to the bake setting so what I like to do is pin the settings so the setting is always here so to do this what I'm first going to do is Click right here and I'm just going to drag up when the Crosshair appears and then let go and that'll close the outliner so I have a bit more space then I'm just going to click down and drag down here and that is going to split the window so now we have another properties panel so now what I'm going to do is make sure I select the fluid object and I'm going to scroll all all the way up to the top and I'm going to click on this button right here this little pin button and this is going to pin these settings so now even if I select a different object you can see the settings go away right here because we are selecting different objects but it's still going to keep all the settings of the domain object so now what I can do is I can drag this up here to make it really small and then I can scroll down and I'm going to scroll all the way down to the cache settings this way I now have this button and so I can click on different objects but then whenever I want to bake the simulation I can just click on free all and then I can click on bake all and it's going to rebake the simulation so that's just something that I like to do so that I can very quickly rebake the simulation without having to scroll down on all the different settings so I'm going to click on free all so that we have all the settings back again now if you want to change the speed of the simulation if you select the domain object there's this time scale right here and this is going to change the speed of the animation so just for now if I scroll right up here to the type I'm going to change this back to replay just so that it'll rebake every time I play the viewport so I'm going to drag this back here and I can play the simulation you can see the speed of the fluid however if I want to make this slower if I want to make it look maybe like a slow motion animation I can change this time scale so I could change this to maybe like a 0.3 and then I can go back here to the starting and I can play the animation again and so now it looks much more like a slow motion video or if I want to make this much faster here on the time scale I could maybe change this to like a 2 and I can play the animation again and you can see it's going to be quite a bit faster I will just leave the time scale at 1 because that looks the best for real time so you can see the fluid is colliding with the sync object but what if I want to have an object in here which is going to push the fluid around well to do that I can press shift a I can go here to mesh and I can add a new Cube then I'm going to hit the Tab Key to go into edit mode and I'm going to scale this cuboid down and I'm also going to scale it down on the x-axis that is much thinner and then I'll go back to object mode so to make the fluid interact with this object I need to click on the cube right here and then I need to click on fluid and then just like we did with the sync object here I need to click on the type and I need to change this to effector so now I can go back to the starting and I can play the fluid simulation and when it gets to this Cube object you can see it's going to interact with the cube and so it is now going around the cube and so it's just flowing around that Cube so then what I could do is actually animate this Cube so what I can do is just move the timeline maybe down to about here so I'm going to go maybe to frame 60 and what I can do is I can bring the cube back and I'll bring it back on the x-axis then I want to add a keyframe here so I'm going to hit the I key and then I'm just going to click on location so I can now move along the timeline and I'm going to go to maybe frame 100. I can now press G to grab and I'm going to bring this over on the x-axis and I just want to bring it right over here then I want to add another keyframe so I'm going to hit the I key again and then I'm going to click on location so I now want to bake the simulation so it's a bit higher quality so I'm going to select the fluid object and then right here on the resolution I'm going to make this a little bit higher so I'm going to set this to like 120 and then right here on the cache setting you can click on the type here and you can change it to all and I'll just click on this to bake the simulation and now that the fluid has finished simulating if I press the spacebar to play the animation you can see as this object animates it's going to push the water around so this is how you can make an object move through the fluid and push the fluid around I'm just going to select the cube though and I'll press X and let's click on delete and then again if you want the fluid simulation to rebake every time you play the timeline then here on the cache type you can click on all and you can change it back to replay instead now you can see as I'm playing the animation it's just continuing to add more and more water so if you want to control the amount of fluid there's a few ways to change that so one thing that you can do is just change the size of the flow object so if I select the icosphere I could make it really big and this is going to be quite a bit more water because the flow object is much bigger or if I wanted to be less fluid I can make this much smaller and then I can play this and you can see there's just a little bit of water but just remember that if you make the flow object too small it may not emit any water so you need to make sure it's big enough that some water will actually come out now another way to control the amount of fluid is by animating when the water is going to come out of the flow object so if you select the icosphere you can see that there is this use flow button so if I turn the use flow off now if I try to play this there isn't going to be any fluid so I can animate this use flow and when it is check marked it's going to add fluid but then if I animate it and turn it off it's going to stop emitting fluid so what I can do is go to frame 10 and I want to turn the use flow off then to add a keyframe to this object you can either click on the Little Dot here to add a keyframe or you can hover your mouse over the value and you can press the I key to add a keyframe and you can see the option has turned yellow and that's telling us that it's added a keyframe and also right here on the timeline we have this little yellow diamond and that is telling us that it's added a keyframe so I can now move one frame over by just hitting the arrow key to move forward one frame and then I want to turn the use flow on so I can click on the check mark here to turn it on and then again you can either click on this button right here to add a keyframe or you can hover your mouse over the value and press the I key and that is going to add a keyframe so now the fluid has been turned on so I now want to go to frame 40 and then I want to click on the use flow to turn it off and then again with my mouse hovered over this value I'll press the I key to add another keyframe so now if I go back to the starting and play the animation you can see it doesn't start to add fluid until frame 10 and then once it gets to frame 40 it's going to stop adding fluid so it's like the faucet is turning on and then the faucet is turning off and so that's how you can animate when you want the flow object to add fluid now if you select the ecosphere object I already talked about how the flow Behavior can be set to inflow if you want to act like a faucet and shoot out water however however I also want to show you how to use the outflow so the outflow is basically going to act like a sponge or a drain and it's going to suck up any of the water so any of the fluid which touches an outflow object is going to disappear so I'm going to bring the timeline back to the starting and then I'm going to press shift a I'm going to go here to mesh and I'm just going to add another icosphere and I'm going to scale the ecosphere down and I'm going to stick it here on the bottom of this gutter so now with this object selected I'm going to add a fluid physics and then here on the type I want to change this to flow and then again right here on the flow type we don't want it to be smoke we want to change it to liquid instead so then we have this flow Behavior but I'm going to change this to outflow so now this is at the outflow I can go back to the starting here and right up here on the settings you can see I have the bait type set to replay so if I press the spacebar to play the animation it's going to bake it in the viewport so now you can see when the water hits this object it just disappears if I hold down the Z button and go into wireframe you can see the water is disappearing when it hits this object because it is an outflow but I will just hit X and then click on delete because I don't want to have an outflow object so I now want to go over some more ways on how you can control your fluid simulations and specifically I'm going to be going over the field weights so if you select your fluid object you can scroll right down here on the settings and if I close these tabs you can see that there is a field weights right here and I can open this up and there's going to be a bunch of different forces so for instance there's like gravity then there's this all here and this is for all of the physics but then there's also a bunch of other ones here like force and Vortex and there's also wind and some other settings and so if I turn these off then the fluid won't be affected by these values so for instance I'm going to just turn the gravity off so here on the gravity I could just turn this to zero and I can now go back to the starting and then I can press the space bar to play and you can see the water is just sitting there so because I've turned the gravity off the fluid is just kind of sitting there and there's no gravity to pull it down or if you wanted very little gravity like maybe you wanted moon gravity or Mars gravity you could just turn the gravity to a very small number and now the gravity is going to affect it but it's going to be much slower and then to show you this taking a bit more of an effect I'm going to really quickly animate the icosphere so I'm just going to move to frame 15 and then I'm going to hit the I key and I'm going to insert a location value on the icosphere and then I can go to maybe just like frame 60 and I can move the icosphere over I'm just going to like stick it over here and then I can press the I key again and I'm going to insert another location so now we have two keyframes there so if I go back to the starting and play this now you can definitely see that gravity taking effect so it still is falling by the gravity but it's kind of moving over here to the side because the gravity is much less strong now there's also a bunch of other field weights and right now none of these field weights are in the 3D scene because we haven't added any force fields but we could for instance add a force and then that force will affect the water so how you add a force is you press shift a and then you can go right down here to force field and there's going to be a bunch of different force field objects that you can add so just for an example I'm going to add this one here this force and then I'm going to move this force over by just hitting the G key to move this around and this force is basically going to push things away from it so if I just like stick this right here I can then go back to the starting of the animation and I can play the animation and you can see the water is now being pushed away so you can see the water is going here to the very end of the simulation Cube and it's just being pushed over there on the side and I could change the strength of this Force so for instance here on the strength if you select this object here on the strength I could just turn this to like a 0.1 and then I could go back to the starting and I could play this again so this time it just has a very small effect and so it is kind of moving over here but it is much more subtle and I'm actually going to select the fluid object again and I'm going to scroll way down here and I'm going to turn the gravity back to one just so that it has full gravity and then this time it has full gravity and so the force field is still affecting it you can see it is moving a little bit but not that much and then of course if you wanted the force field to have of less of an effect on the fluid than right down here on the field weights you could just turn the force down so I could just turn this Force way down and it's basically not having any effect over the fluid now what's also really cool about these values is you could animate these values so what I'm going to do is select the force and then I want to make this much stronger so I'm going to turn it back to a strength of one then I'm going to click on the fluid object and I'm going to scroll way down here and go to the force so I'm going to start by turning this all the way up to one and then I can click right here to go back to the starting and I can press the space bar to play this and we'll just let it simulate and I actually want the force to be even stronger so if I go back to the four settings I'm going to turn the strength up really high to like a five so I can go back here to the starting and I can play this and you can see the force is very strong so what I'm going to do is let this play Maybe to just about here so maybe about frame 25 so I can now click back on the fluid object and I'm going to scroll down here and I can add a keyframe on this Force value so I can press the I key with my mouse hovered over the force value and that is going to inset a keyframe and the other way you could do this is you could just select the force and you could also add a keyframe here on the strength value I'm going to click back here on the fluid and so I've added a keyframe now I'm going to use my arrow key to move over by one frame and then I want to click on the force value and I'm going to turn that to zero and then again with my mouse hovered over the value I can press the I key to insert a keyframe and now that I've let this simulate I can just jump back to the starting and it's going to be much more smooth so you can really see that effect so the fluid gets splashed over to the side and then it just kind of falls down so I can just select the force field and I will hit X and let's click on delete now I can also press shift a I can go down here to force field and there's many different force fields you could try out but another cool one is the wind so the wind is going to just shoot in One Direction so I could rotate this wind over I could rotate it over to this side and then with the wind selected I could turn up the string so I'm going to turn the strength up quite a bit and then I can go back here to the starting and I can play the simulation again so the wind is going to act similar to the force but you can see because it is wind it's going to add a lot of ripples to the fluid and so because wind is very noisy it's going to add all of this noise to the fluid and you could also rotate the wind and you could animate the wind strength just like the force so I could animate it up all the food is being pushed up to the top and then I could maybe rotate it down now it's going to push the fluid down I'm just going to select the wind object and then I will delete it and then there's one more cool force that I want to show you so I can press shift a and I can go down here to force field and I can add the vortex The Vortex is basically acting sort of like a black hole and it's going to rotate the fluid and suck it into the center but then before I simulate this I'm going to turn the gravity off so I'm going to select the cube and let's go right down here and here on the gravity I can turn this all the way to zero alright so I've let this simulate so you can see what it's doing is it's rotating the fluid around and it's kind of sucking it into the very center it's not very strong I could turn up the strength if I want to but you can see it's rotating it around and kind of sucking it into the very center of the vortex so I'm just going to select the vortex and hit X and then click on delete so using force fields is a really great way to control your fluid simulations now another way to control your fluid is you can tell the fluid to shoot out in a certain direction so what I'm going to do is select the icosphere and I have this keyframe here which is going to move the icosphere over so I'm just going to select the keyframe here in the timeline and I can hit X and then delete keyframes and I can also click on this keyframe here at frame 15 and I'll hit X and then I can click on delete keyframes now if I select the fluid object I'm going to go right down here and also here on this Force I don't want the keyframe here so I'm going to right click on the force and then I'm going to click on clear keyframe so it doesn't have any keyframes and also here on the gravity I'll turn the gravity back to one so I'm now going to show you how you can shoot the water out in a certain direction so I'm going to select the icosphere here because the icosphere is the flow object so it's going to shoot the water out so on the icosphere settings there is this initial velocity and so you can use this to control the direction of the flow so if you check mark it then you'll be able to control these values and so there's an X Y and Z value so with the icosphere selected I'm going to bring this down on the z-axis just bring it down so it is kind of down here lower in the simulation so let's say that I want the fluid simulation to shoot up and over to the side so we need to bring it up on the z-axis and we also need to bring it over on the x-axis so what I can do is turn this initial X to 1 and then I also want to bring it up on the z-axis just a little bit so on the Z I will turn this to just like 0.5 and you may need to play around with these values depending on the size of the simulation but I can go back here to the starting and I can press the space bar and just let this simulate and you can see it's moving over so it's kind of shooting it over like a hose but it's not very strong so what I'm going to do on the Z here is maybe turn this up to like three and also on the X I'll maybe just turn that to like a two so now I can play this again and now you can see it's shooting up like a hose and so now I'll just click on this button here to go back to the starting we can watch that much faster and if I wanted to move it over on the y-axis I could also change the Y so I might just turn the y-axis to two and then again I can go back to the starting and I can play this and now it's going to shoot out on the y-axis by two and if for some reason it's going the opposite direction like right here you can see the y-axis is moving it back but let's say that I want to move it forward instead instead of changing the Y to 2 I could change it instead to negative two so I can go back here to the starting and then I can play this and you can see it's going in the opposite direction alright so we've now covered many different topics like controlling when the fluid is shooting out also controlling the direction of the fluid as well as using other objects as collisions and using gravity and force fields to control the fluid but another important setting that I want to show you is how to change the thickness of the fluid because right now we've pretty much just been simulating water but let's say you want to simulate something like honey or molasses or some other thick fluid well to do this we need to change the viscosity of the fluid so to change the viscosity settings you want to select the fluid and then I want to scroll down here on the settings and we want to check mark this viscosity so turn on the viscosity and there's going to be one single value right here so if you make the viscosity strength higher the fluid is going to be more thick so if I turn the strength value all the way up to like one I can go back here and I can let this simulate and actually real quick before I show you this I am going to select the icosphere again and I just want to bring the icosphere up and then with the icosphere selected I also want to turn off the initial velocity because I don't want to use that setting right now so I have the viscosity set to 1 and you can see this is extremely thick so the consistency is almost like some very thick dough or maybe some whipping cream or some toothpaste and so this is very thick so if I wanted the consistency to be something more like molasses or honey I can on the viscosity settings turn the strength way down to maybe just like a 0.1 so here's the viscosity turned to point one and you can see it still is pretty thick so I'm actually going to make it even less thick so I'm going to turn the strength to just like a .03 and then what I'm also going to do is animate the icosphere moving back and forth so I'm going to click on this button here which is going to turn on the auto key and I can move the icosphere then I'm going to move over on the timeline I can move the icosphere over and then I can move again on the timeline and I'm going to move the icosphere over so I've set the viscosity to .02 and you can see that this fluid simulation now has the consistency of Honey or molasses so the viscosity is a really great setting to play around with to change the thickness of the fluid now I am creating a water simulation so I'm just going to turn the viscosity off so that we're not using any thickness and it's just going to simulate like water so now that I've shown you the basics of fluid simulations I'm going to be setting up the final scene for the final simul relation so what I'm going to do is select the icosphere object and you can see we've added some different keyframes here so I'm just going to press the a key to select all the keyframes in the timeline and I'll hit X and let's click on delete keyframes and then I want to go here to front view and I'm going to hold down the Z button and go into wireframe and I want to move the icosphere up here and I'm also going to make it a little bit smaller and this way the fluid simulation can come down then I can go down the gutter and then go here into the sink now if you select the Box object or select the fluid I want to make sure that the viscosity is turned off so if you scroll down here just make sure that you have the viscosity turned off because I'm doing a fluid simulation so I don't really want any thickness and also here on the field weights I want to make sure the gravity is turned to one so if I select the sphere object I now want to animate the use flow because I want the fluid to come out for a certain amount of time but then I want the fluid to stop so I'm going to go to frame 34 because frame 0 to 34 I want it to be emitting fluid so I'm going to click on the use float to turn it on then I want to add a keyframe on the use flow so with my mouse hovered over the use flow I can press the I key that's going to insert a keyframe or you can also click on the Little Dot right there to add a keyframe so I'm now going to use my arrow keys to go over one frame to frame 35 and I'm now going to click on the use flow to turn it off and then click here or press the I key so now it's been animated to turn off so it's going to start to add fluid and then the fluid will turn off so I'm now going to be baking the final higher resolution fluid simulation and so if you select the Box object or select the fluid if you go here to the resolution divisions you can turn this up higher if you want the simulation to be higher quality although the higher quality it is the longer it will take to bake so in the final animation that I showed you at the beginning of this video I actually turned the resolution divisions to 400 but that took a very long time to bake I think it took at least a couple of hours just to make 200 frames so on the resolution divisions here I'm just going to turn this to 200 and I find that 200 still looks pretty high quality but the baking speed is going to be much faster so I think 200 is a good balance between baking pretty quickly but also looking pretty nice but you could turn this up to 400 if you want to and then it would be even higher quality or if it's taking way too long you could turn it down I'm gonna go with 200 and then if I scroll down here we want to go to the cache settings and I'm going to open this up and here I have the start frame set to one and the end frame set to 200 and also here on the timeline the start and the end is set to 1 and 200. so then before you bake this make sure you press Ctrl s or click on file and click on Save and make sure you save the blender file just in case it crashes now right here on the bake type I want to change this to all and this way we're going to have the bake all button so I can just click on bake and I can start to bake this and I'll come back when it is finished alright so the simulation has finished so I'll just press the space bar to play the animation and we can watch the final simulation now is looking very cool so if you want to end the video now and set up the lighting and the materials and do the rendering all yourself you can totally do that but if you'd like to watch the rest of the video I'm now going to show you how to set up some basic lighting and some basic materials and then we'll render the animation and then we'll compile the frames together in blender's video editor to get the finished animation so what I'm going to start by doing is selecting the fluid and I'm going to use the object context menu to shade it smooth and so now the water is much more smooth and that looks quite a bit better now I'm also going to select the sync object and then I'm going to click right over here to go to the modifier properties and I'm going to click here on ADD modifier and I'm going to add the bevel modifier just so that the edges are a little bit beveled and then I'm going to turn the amount down and I'm going to hold down the shift key and drag the amount and I'm going to make it a very small amount just so that there's a little bevel there on the edge and then I can also turn the segments up so I'll turn the segments up to like a three and then also using the object context menu I can shade this object smooth so now the objects have a tiny little bevel and that looks a bit more realistic so I'm now going to add a camera and do a very basic camera animation so I can press shift a and I'm going to go here and add a camera and then you can just move to wherever you want the camera to be and then you can press Ctrl alt numpad 0 and control alt notepad 0 is going to bring the camera to where you are and then if you click up here you can select the camera and you can press G to grab and move the camera around you can also hit G to grab and then you can double tap the Z key and that's going to bring the camera in and out so I'm just gonna go right here to the starting of the animation by bringing this back to the starting and I'm actually going to go to frame one and then I can move the camera around maybe bring the camera back a bit you can also double tap the r key and that's going to enable the trackball rotation and then you can rotate the camera around so I'm just going to bring it to about there maybe zoom in a little bit closer here so I can kind of see the water falling so I now want to add a keyframe here so what I can actually do is just click on this button here and that's going to try on the auto Keen then I can just press the G key and then click to place the camera there and you can see it's automatically added a keyframe so I'm now going to press the spacebar to play and we're just going to watch this play through and when the water is going in here I want to move it down so I'm going to hit G to grab bring this down and then double tap the r key and rotate this over and I can also bring it in a little bit so I can now go back here and then play this and you can see the camera is moving slightly although I do think I want the movement to be a bit more subtle so what I'm going to do is just select the key from here and I can press G to grab and I can move it over so that the camera will move a little bit slower and then I'm going to go here to the very end so frame 200 and I can bring the camera over and just bring it in a little bit just so that you can get a bit of a closer view of the fluid so I can now go back and play this and just watch the animation so I'm just going to do a very basic camera animation nothing fancy just kind of having the camera moving into the fluid so I now want to light the scene but real quick before I light this scene I'm going to go here to the render properties and here on the render engine I am using Cycles Render so Cycles Render is a ray traced render engine and so it's going to look much more realistic and I am going for realism so I'm going to be using Cycles now you could definitely use the EV rendering engine if you want to and the EV engine does render much faster but it doesn't look nearly as realistic so I'm going to be using cycles for the animation now while we're over here on the render properties to make the lighting look a bit nicer we can open up the color management Tab and I'm going to use the view transform of filmic and then here on the look I'm going to set this to very high contrast and this is going to really make the image pop because it's going to make the colors more contrasty and saturated so now to add the lighting I can click right over here on the world properties and I'm going to be adding in an hdri from polyhaven.com so it's a free hdri and I'll have the link in the description so right here on the default world I'm going to click on the yellow dot here and then I'm going to choose environment texture and then I can click on open and open of an hdri so here's the hgri that I'm going to be using so this is the Birchwood 1K hdri from polyhaven.com again I'll have a link in the description if you'd like to download the same hdri that I'm using and again I downloaded the 1K HDR version so I'm going to click on this and then I will click on open image and then I can hold down the Z button and I can go into the rendered view just to preview this in the rendered mode now I only want the rendered preview to render what the camera can see so in the camera view I can press Ctrl B and I can drag a box around the camera and then let go and this way it'll only render what's in the camera and it'll speed up the viewport preview and then also I can click right here on the overlays and I'm going to turn off the floor and I'm also going to turn off the X and Y just so that I can't see it and then also if you want to hide the simulation particles you can select the fluid simulation and you can click right over here on the modifier properties and you can see that there's a liquid particle system so I'm going to click on this button right here just to hide it from the viewport and that way we can't see those particles and then also to add some nice bright light to the scene I'm going to press shift a and I'm going to go here to light and I'm going to add a sunlight and I'm going to bring the sunlight kind of up here and then I'm going to rotate it over and I actually just realized that we still have the auto key on so it's adding keyframes and every time I move an object so I'm going to click on this button here to turn the auto key off and then if I press the a key to select this keyframe here I can press X and I will click on delete keyframes so I'm just going to rotate the light around so you can double tap the r key to enable the trackball rotation and I'm just going to rotate the light around I want to make it kind of at an angle so something like that and then if you click right over here to go to the object data properties here on the strength I want to turn this up to five so it's quite a bit brighter and then here on the color I'm going to make this a very slight yellow color so it looks like sunlight now the image looks very blown out but that's because all the materials are fully white so once we add materials which we're going to do now it'll look much darker so let's now do the materials so I'm first is going to select the background object and let's click here on the material properties and I'm going to click on the new button to add a new material and I can just call this background and then this material is going to be very simple I'm going to keep everything at the default except the base color here I'm just going to turn to fully black and that's all I'm going to do for the background so I'm now going to click on the sync object and I'm going to click right over here to go to the shading workspace so that I can create a very basic procedural material so in the shading workspace I have the 3D viewport right over here and I'm going to hold down the Z button and go into the rendered mode and then have the Shader editor right over here let's click on new to add a new material and I can just call this sync so this material is also going to be pretty simple I'm just going to take the base color here and I'm going to turn this to kind of like a light blue color I think that looks pretty nice but then I thought it would be kind of nice to add a tiny little bit of variation in the roughness so real quick I'm going to create a very simple procedural setup so I'll press shift a I'm going to go here to the search and I'm going to search for a noise texture let's drop this here and then I want to put the factor of the noise texture into the roughness so it'll control the amount of roughness then I can also press shift a I'm going to go to the search and I'm going to search for the texture coordinate node so let's just click on this and drop this here and I want to use the object coordinates so let's put the object into the vector because the object coordinates will place the texture on the object more evenly and then I want to change some of the noise texture settings so I'm going to turn the scale to an 8.7 then I'll turn the detail all the way to the max of 15 and also the roughness here I'm going to turn this to a 0.66 so it is kind of hard to see but if I go right over here to the side kind of look at this on the side of the material you can see there is just a slight variation in the roughness but I do want to make it slightly more contrasty so I'm going to press shift a and I'm going to go here to the search and I will search for the color ramp and let's put the color ramp between the noise texture and the principled Shader now if I drag the black Tab out that's going to make it more contrasty so now you can see it looks much more reflective but then to make it a little bit more rough I'm going to click on the black color and I can just turn this up so it's kind of like a dark gray so just something like that so now you can see there's just a little bit of variation in the roughness and that just makes the material look a bit more interesting so we can now do the material for the water so I'm just going to select the water object and then I can click on new here to add a new material and I can just rename this to water so this material is also going to be very simple here on the base color I'm going to make this fully white and then to make it so you can see through the water I'm going to turn the transmission all the way up to one and then you can see it is a bit rough so what I just want to do is take the roughness and turn that to zero and that way it is now super reflective like water now depending on the type of fluid you'll want to change the ior value and Define the correct ior value I highly recommend checking out this website 8 the pixel and poly ior list I'll have a link in the description if you'd like to check out this website and ior stands for index of refraction and the creators of this website basically created a key code and you can locate to whichever material you're creating and you can find the ior value of that certain material so right here on the top of this page you can click here on the w and then that's going to go all the way down here to the w Materials and you can see there are some different water materials and I'm going to be using the water at 20 degrees Celsius and 20 degrees Celsius is 68 degrees in Fahrenheit so that is a good temperature for water at room temperature and you can see right here the value is 1.333 so back here in blender on this water material on the ior I'm going to change this to 1.333 and so now that looks a bit more accurate and it looks a bit more like water but if you want to you can also drag the ior value around just a little bit to change how the water looks if you like something else that looks a little bit better but I'm going to go with 0.333 for water at room temperature now if I zoom in closely to the water you can see there are some areas where the water is very dark and so to fix this I want to add some more light pads so what I'm going to do is Click right here on the render properties and then I want to scroll down here and I'm going to open up the light paths and what I want to do is just turn the total light bounces up and so I found that a total light bounces of 8 looks much better so now especially right here if you kind of look at this water you can see isn't quite as dark you're able to see through it a bit better and then also if you want to you can click on the sphere object and I'm going to use the object context menu and shade this object smooth and then also right here on the materials you can click on this and I'm going to add the water material just because I think that would be nice to give it the same water material now because this is an animation to make it look a bit more realistic I'm going to go here to the render properties and I'm going to check mark the emotion blur so this will just add a little little bit of blur to the water which is moving very fast and it'll look quite a bit more realistic now if you open up the sampling tab I'm going to go with 100 samples because I think 100 samples will be great so I'm going to now click back here on the layout and then I just want to render out one image so I will now press Ctrl s just to save the blender file again and then you can click here on render and you can click on a render image and we're just going to render one single image and once the image is finished rendering I'm going to add a denoise in the compositor to denoise the image and get rid of some of that grain so I'm going to click right over here to go to the compositing workspace and I can click on use nodes here and this will give us a render layers and a composite so I'm going to press shift a I'm going to go here to the search and I will search for a denoise node and I'm just going to drop the D noise here and then here on the accurate I'm just going to change it to fast so it goes faster I can also press shift a and I'm going to search for a viewer node and I just want to plug the image from the denoise up to the viewer node as well as the composite and you can now see the denoised image in the background so I now want to render out the entire animation to frames and then I'm going to be using blender's Video Editor to Video Edit the frames together so what I'm going to do is click here on the output properties and I'm going to scroll down and here in the file format just to make the file size a little bit smaller I'm going to click on PNG and I'm going to change it to jpeg instead and then here on the quality I'm going to turn this up to 100. now I need to set an output for all the frames so I'm going to click here on the file icon and then here in the folder with my other files I can click on the plus here to add a new folder and I can just call this frames then I can go inside this folder and I can then click on the accept button so this way when I render the animation it'll render out all the frames to that folder so I'm just going to press Ctrl s again to save the file and then I can click here on render and I can click on render animation to render all of the frames and the animation has finished rendering so I'll just press Ctrl s again to save the blender file and I'm now going to open up a new blender file and we're going to use blender's video editor to compile the frames together but of course if you use some other video editing program you can totally use that instead so I'm going to click here on file and then I'm going to click on new and I'm going to go down here and click on video editing so then right down here in the sequencer I will press shift a and we're going to click here on image slash sequence then you just want to locate to the folder on your computer where you saved all the images and if you click right up here on this little arrow I want to click on name and that way it's going to sort it correctly so it starts out as one and it goes all the way down to frame 200 so you can press the a key to select all the images and then you can click on ADD image strip and then right over here on the resolution settings and also the frame rate you want to make sure that this is the same as the blender file which you rendered the animation and the default frame rate in blender is 24 frames per second so it should have been set to 24. however I rendered this at 2K resolution the default in blender is 1920x1080 but I rendered it at Double all the resolution so what you can do is just select the strip and then you can click here on strip and you can click on set render size and that way it'll set the correct render size for the frames so I can press the space bar and I can just watch the animation and you can see that motion blur really helps to make it much more realistic if I zoom in here and especially look at the water when it's moving very fast it looks kind of blurry and that's really helping to make the animation look more realistic so I definitely like turning on the motion blur but there is one more thing that we can do to make the animation much more realistic and much more believable and that is to add in some sound effects so I'm going to be using two free water splash sound effects from a website called freesound.org and I'll have a link in the description to both of the free sound effects so this first sound effect here is this water splash and thank you to the creator of this sound effect and you can see it's been licensed under Creative Commons zero and then the other sound effect again on freesound.org this one is the splash nine and again I'll have a link in the description if you'd like to download it and thank you to the Creator who made this sound effect and they licensed it here under creative common zero so you can just create a free account on freesound.org and then you can download the sound effects if you'd like to or of course just grab any water sound effects that you might have so back in blender what you can do is just click and drag and you can drop the sound effects from your file browser once you've downloaded them and I'm just going to drag both of these sound effects in and then if you click on the sound effects you can click on display waveform and I'm going to do that for this one here and that way we can see the sound effects a little bit better and then you can just click and drag to move the strips around or you can select the strip and press the G key to move the strips around and then you can just play through the animation and you can move the sound effects around and sync it up to the water so this first sound effect here the splash9 I'm going to sync this up so that it makes the splash sound right as the water falls and then this other sound effect here this is a bunch of little water splashes so you can move the timeline and then you can press the K button to cut the strips so you can just play the timeline and listen to the sound effects and then just press the K button to cut the strips just go along here keep on cutting up the strips into the little sections and then if there's any places right here where there isn't any sound effect you can select that part of the strip and you can press X to delete then you can just select each sound and you can move it around and move it over to the water and then you can just sync it up so it sounds correct and after playing around with the sound effects this is what I've come up with so I like how this sounds I have a few big splashes here and then I have some little trickling of water at the very end so now we can just render this out to a final video file so to set the end frame you can click right here on the end in the corner and you can just type in 200 or just set it to whatever your end frame was and then we can go over the render settings so I'm going to scroll right down here and right here on the output we need to set an output to save the video file so you can click on this file icon and I'm just going to save this in the folder with my other files and you can click on the accept button and then right here on the file format I'm going to use the ffmpeg video and then if you open up the encoding right here I want the container to be set to mpeg4 I'm I'm going to use the video Codec of 8.264 also the output quality all set to medium quality and the encoding speed all set to good and then here on the audio codec I like to use the AAC so those are the settings that I like to use then if you want to you can save this video editing file by just clicking on file and clicking on save as and then to render this video you can click Karen render and then click on render animation and there is the finished animation and this is going to wrap it up for this tutorial on blender fluid simulations for beginners so I hope you found this tutorial helpful I hope you learned a lot and thank you for watching and if you enjoy these tutorials and you'd like to help support me and this channel I will have links in the description to my gumroad store and my patreon page and I really do appreciate your support and you can also get access to the finished tutorial files for this tutorial on my gumroad and my patreon links are in the description and if you'd like to learn how to create some other simulations in blender then I'll have some links in the description to some other simulation tutorials that I I've created and you can also check out my blender beginner fundamentals tutorial playlist with the link in the description if you'd like to learn more fundamentals of blender but I hope you enjoyed this tutorial and thank you for watching foreign
Info
Channel: Ryan King Art
Views: 140,946
Rating: undefined out of 5
Keywords: Ryan King Art, Blender Tutorial, Blender, Ryan King, Tutorial, water, fluid, simulation, fluid simulation, blender tutorial, sim, physics, water simulation, blender water, liquid, blender liquid, liquid simulation, beginner tutorial, fluid simulation for beginners, blender beginner tutorial
Id: A93O4COVPyw
Channel Id: undefined
Length: 54min 2sec (3242 seconds)
Published: Sun Apr 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.