Blender Physics - Creating a Splash with Mantaflow

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi welcome to this tutorial and this chapter is about creating a splash in mantaflow this is actually a remake of one of the chapter from previous tutorial called using cgi for product advertising since blender fluid and smoke system got reworked and some of you suggested and needed help with this part of manta flow like how to set up the same scene but with the new fluid and smoke system so that is what we are going to do today okay so i will only cover the fluid part if you want to see the full tutorial you can click on the link in the description or just check out the playlist section okay the rest of the tutorial can be followed even with this version and nothing has changed about that okay so here we are with the scene what we created previously manta flow as you know is the new fluid system more or less the principles are same okay you have the domain and you have a fluid source and obstacles etc and like it's a pretty simple and a similar thing to set up okay now there are a few things you can do with the new system such as add forces and uh like you can animate fluid on the spline you can add vertex you can add basically any other forces okay and uh the baking process have changed so instead of baking the entire simulation in one go you can actually first simulate only the particles and once you're sure about the simulation then you can bake the mesh part okay and also about the baking uh like it's much more flexible now you can pause it anytime you can resume it anytime and preview the simulation and it's a bit more refined but also there are a few bugs at this moment which is uh which won't stop us from doing what we are going to do today and that's okay so there is still scope of improvement but we'll talk about that in some other chapter so the basic structure is basically what we want here is uh we we need to create a splash as seen in the trailer and storyboard so the fluid source should be around here at the back of the cans okay and uh once uh driven with the velocity when the fluid hits these cans basically it will spill the drink from the left and from the center gap and from the right okay it will collide with the cans and create a nice splash okay some of it will spill on the ground and that's that's basically the structure of the scene is so what we need to do is we need to make these two cans into collision objects and we need some inflow sources over here okay let me just uh enable the overlays yeah this is better so i'll just disable the background so yeah let's go to the side view so what we need is uh some inflow sources over here and here so when they basically throw the fluid they will collide here and here and here and basically create a splash okay so it will come out from here and here and here okay some some of the particles should go in the air and yeah that's about it okay so [Music] just a moment i'll just uh delete this okay so yeah and uh now before we get into any of those details uh i just want to clarify few things about the flow source and about the velocities okay so i'm just going to go into a new file and i'll just create a cube over here and create another cube for domain okay and uh as uh you had seen in the previous chapter so basically what we need is uh we need one container which will be uh as a domain which will be domain and uh the fluid simulation will happen only for the objects which are inside these domain in this domain okay and we need one fluid source so let's click on this box okay whatever is the domain you need to always make sure the object's origin is in the center okay otherwise when you bake the mesh it will not work properly okay it will offset the mesh by the distance of on the pivot point okay so i don't know if it's supposed to work like that or if it's a bug but uh i have reported it anyways so we'll go to the physics uh properties over here and click on the fluid okay now if you uh if you notice over here previously there used to be one smoke simulation and one fluid simulation but now there is only one tab and this is for from manta flow the fluid okay and within this you have different uh domains okay you can assign whether you want it for gas which is for smoke and either for liquid okay so for this purpose we want liquid okay now you can see we can see this resolution cube over here and this represents what the resolution is basically if we want this 32 this will be much bigger pixel if we want uh 128 this will be much finer pixel okay voxel basically and uh okay for now let's keep it 32 just to speed things up and uh right now uh if you want to see the fluid you can click on the big data and cancel it anytime with escape okay and you can resume it if you want you can free it and unbake it okay but nothing will happen because we don't have a source object a source of flow okay now for that we'll go to the this cube okay let's move it up and click on the fluid again and instead of domain click on the flow okay we want the fluid to flow from this object okay and now there are there is a thing called flow behavior over here like what kind of flow is this okay when when you click on this there are three things inflow outflow and geometry inflow is like basically the fluid will inflow from this object okay like a faucet okay so fluid will keep spilling from this okay now if i set this to inflow and bake the data uh okay sorry i need to change this to liquid okay so flow type liquid and inflow now let's uh free this and make the data again now as you can see i just uh changed the viewport background so that you can see the particles more clearly so as you can see the particles are falling down and it's a continuous inflow okay you can basically make this simulation for as many as frame you want i'll just uh click on free and increase this to 1 90 frames okay because our shot is for 90 frames let's keep it for 90 frames for now [Music] let it be okay so the longer the simulation goes the heavier it's gonna get because this container will keep filling with the inflow object okay now as you can see over here [Music] now these are fluid particles okay and this is actually uh the container is actually filling up okay now if you want to have a better look at this you can click on the mesh over here and click on the big mesh now see what happens it's a very low resolution and stupid simulation at this moment but i'm just clarifying few things okay so i'm going to free up this mesh okay you can click on free and as you can see even though i uh i've removed the mesh baking the particles are still there simulation is still there so that is good thing about month of flow okay you can disable this for now and uh free the simulation as well okay now so this was inflow okay i'll just go to the world viewport so this was inflow and uh so basically you can uh if you need something like a continuous flow you can use inflow and you can also keyframe this inflow let's say if i want only 20 frames i can click over here i can uh bring my mouse over here and press i to set the key and go to frame 21 and disable the inflow and press i okay and now what will happen is uh if i bake the data the particle will flow only for 20 frames okay yeah so now let's change this to so outflow is basically uh when the fluid hits the outflow object it will uh disappear from that point okay so basically it's like a outflow like what you have in the kitchen sink okay so if you don't want uh like your fluid to fill up too much and from certain point if it's not making any sense and you want that fluid to basically exit the simulation you can use outflow okay and now uh there is one thing important that is geometry okay now the difference is uh in the inflow and geometry is i'll just free up this simulation so basically we had this object spilling fluid from here okay but the geometry what it does is it basically converts the object into fluid itself okay whatever the shape is and whatever the volume is of that object and that will work like a geometry now see what happens when i bake the data simulation is pretty fast at this moment because we are only baking it on 32 resolution which is pretty bad resolution but this is just to clarify the concepts okay so as you can see uh the particles are forming in the box formation and they are just falling over here and only particles which are filling up the dense density that much particles are emitted from this object okay and now just to have more fun with this i'm going to increase the resolution to let's say 80 okay so that you can see few things happening more interestingly so i've cancelled the simulation for that much frame press escape to cancel the simulation now you can see when the resolution is higher it's showing much better representation of the queue i'll just resume few more frames so that we can see the splash happening much more clearly all right so let's play this so that is uh basically the how the geometry works okay now i'll change this to world background so that we can see everything okay these were all inflow objects okay i mean are the flow types now there is one more thing i wanted to clarify for this tutorial purposes what these initial velocity parameters are okay because we need these velocities to make splashes okay so i'll just uh free up the simulation and make this a 60 resolution okay maybe so basically as you can see when you select the source object the flow object you have this parameter called initial velocity okay i'll explain what this means okay now the source is basically when you have any animation on the source let's say if it's moving in this direction okay that animation will be tr uh that source velocity will be translated to the splash to the fluid basically okay that is source velocity okay normal velocity is the source object i mean the fluid source will have a velocity in the direction of the normals okay and uh to explain normal i'm sure you already aware of it but these are basically normals okay and uh basically fluid will throw in all these directions okay now if i increase the normal velocity see what happens let's make it 2 okay and bake the data [Music] i'll make it five and uh free and bake the data [Music] as you can see uh these fluids have some velocity in the normal direction but these are not working in the face normals but these are working in the normals of the vertex okay as you can see it's forming the shape of uh working in the normal of the vertices okay and i'm not sure if it's a like how it's supposed to work like a normal direction you usually you would want these to work in the direction of the faces but we'll see about this in the future if it gets reworked or not so yeah if you increase the normal to 10 and let's bake the simulation again this will go even further like this okay and it will basically as you can see throwing the fluid in the normal direction velocities okay so that is normal velocity all right now okay i'll make this zero and uh free up the wake now also there are these uh different dimensions like x velocity y velocity and z velocity basically if i increase this let me just enable the this gizmo and now if i make this x direction it will go in this direction because this is the x direction and this is also one more thing i want to just uh let you know guys in previous version of the fluid system it used to take uh local coordinates in the consideration but i've reported this i don't know if it's a bug or it's supposed to work like this but basically it won't take the local rotation of the flow source in the consideration it will only work without void axis and i'm not sure if it's a good idea or not but we'll work with this for now and we'll see in the future updates okay so i'll increase the x velocity and i'll make this 32 resolution and quickly pick the data and this will throw in the particles sorry as you can see it's a too much of velocity i'll just make it one and uh big data again now this will throw in the in this direction as i said x x velocity okay you can make it 0.5 maybe and free up [Music] yeah so similarly you can give it y velocity and z velocity okay now for our tutorial purpose what we need is we need uh one source in the back of the can and we want it to throw the fluid in certain direction okay now to work around with this what we what we can do is uh if we use a cube then we'll have to figure out the world coordinates like in the perfect uh we'll have to find the perfect direction like let's say i'll just open up the file okay let's say if we have one cylinder over here okay and i want the cube to throw in this direction okay in like in diagonal direction like this then i'll have to figure out maybe i'll have to give it some x and some y velocity okay and some z velocity and then it will make our diagonal splash basically okay now sorry [Music] so basically uh if i make it 0.5 in the x and 0.5 in the y and z i'll also make 0.5 so that it goes up okay and to this i'll give it some effector and make it collision okay now free up and bake the data now as you can see it's a [Music] i'm not sure if it's visible or not but basically fluid is rising up it's colliding with the can and it's basically creating a splash okay very stupid at this moment but it's creating something okay now i'll just increase the resolution so that you can see something and all right so here yeah there you go now you have some nice looking splash okay i'll just give it some more frames all right so yeah it collides with this geometry and it creates some interesting shape over here okay so that's how you can figure out basically so basically uh you can play with these velocities and uh you can figure out with which dimension you want to give velocity in but this can take uh some time to you know hit and try and like figure out the exact direction in which you want to throw the fluid in okay now there is one more way and uh to do that what we need is okay so far uh when you are making a like when you are working with geometry it will fill the particles inside okay but what if we have a plane okay i'll just make a plane over here and uh let's see the normal direction okay i have this normal direction okay which is good now i'll make my plane over here and uh sorry i'll just create in in the back [Music] over here okay now what we if we have one plane and we make this one a flow object and make this one liquid and make this one geometry okay and uh now if you bake the data you'll see nothing is happening because this plane doesn't have a volume okay now to deal with this what you can do is go to the flow source and click on uh increase this surface emission okay i'll make this two you can also you could have also done with this uh in the cube basically when you think uh there should be some more fluid uh like you want to give it some more like basically the geometry the flow behavior if you want to give it some more emission the more fluid you can increase this so that how much the surface of the object emits the fluid okay so by default it will only emit the fluid in the geometry like uh inside this let me just uh bring one flow and geometry and i'll just uh disable this plane for now okay so by default it will only create uh the particles inside this cube liquid [Music] yeah but if you want some more particles around the surface you can use this parameter surface emission let's make this one okay three and see what happens now you'll see there is there are some more particles which are around the surface answer and it's like adding into the amount of the fluid generated okay so if you want to increase the amount of the fluid you can use this when you're working with the flow geometry basically this will also work with the inflow i think so in our case we have a plane and we don't have the volume for this plane so we can use this parameter and let's see what happens yeah as you can see the volume uh the plane is basically creating particles now and now because we are going to use the normal direction for this one let's make this one for velocity in the normal direction because we have normal in this direction and this is much more precise way to work like okay whatever the orientation is of this object it will throw the splash in that direction now if you give it four normal let's say i mean uh velocity and uh simulate this one you'll see it's uh it's spilling the water uh the splash in that direction okay and this is much more easier way okay and you can control it more precisely this way okay now i'll just make this one 80 and uh bake the data i'll just cancel only 10 frames yeah you can see it's uh throwing the splash exactly in the normal direction okay now we can increase the velocity and we can increase the z velocity if we want this to rise up a lot okay but i hope you understand the concept okay and basically we can make this one six and we can shoot this a slightly and uh bake it again [Music] yeah so now you'll see basically now this way you won't have to uh guess like uh because with the world coordinates it could be difficult like when you're when your source object has some local orientation and it could be difficult in the world coordinates like in which direction you want this to flow so you can basically create a plane and you can give it some normal velocity and throw the splash in that direction okay so yeah this is easy and uh now we'll go to our main file so now whatever we have discussed let's uh start building the simulation for this one okay i'll just make a i'll just make a cube which is going to be sorry i'll just disable the overlays or sorry bg and uh let's make a cube over here okay and this cube will be our main domain all right and i'll change this to bounce so that we can see the simulation for now all right and move this right above over here [Music] okay and let's see in the camera we don't want to see these boundaries in the camera so scale it up further something like this [Music] all right make sure the origin is in the center [Music] now as we were discussing the velocities uh [Music] for this we are going to use a plane okay but uh one thing i just want to clarify what is the difference in when you create velocity with the geometry and with the inflow okay so sorry i'll just create one plane over here and go to the edit view and look at the orientation of the normal so this looks fine all right go to the top view we want this over here okay so our camera is somewhere over here all right i mean this is on camera so [Music] we want this right behind the can over here okay now select the main domain call this excuse me domain all right and this one inflow one all right so now let's go to the physics properties and make this one fluid okay and make the flow to flow and make this geometry and make this one liquid and as we discussed we need some surface emission because this is a plane and it doesn't have a volume okay and let's go to the cube make it fluid make a domain make it liquid domain and change this to bounds so that we can see the particles okay right now it's showing particles from the previous sim which is saved in the same directory so i'm just going to click on bake again and free this up to to remove that cache okay all right so one very important thing i'll just quickly explain it and uh on the 64 resolution now when we have this plane set to geometry and if we give it some initial velocity let's say of two okay now imagine if this was uh like sand particles or something okay like let's say if this was actually a plane and there were a lot of grains on top of that okay now what happens is uh when you let's say if you have some fluid in the plate okay this is a plate and there is some liquid over here okay when you apply some velocity in this direction what will happen is the top most area will go higher but the bottom will have the less velocity okay so it will go something like this okay but if it's a inflow object like uh this inflow like a faucet that will have a constant velocity okay because it has some more fluid coming from the back and that is why the flow is constant okay and uh i'll explain this with a better example in just in a moment with the actual sim okay let's make a sim and let it bake for a few frames all right now just notice over here what is happening okay so we have particles as i uh just uh mentioned so particles on the top have more velocity but particles on the bottom have less velocity okay like uh how the actual particles work i'm not sure if this was actually designed this way or or this is a i don't know what it is but uh i think uh this is just my observation okay all right i'll just uh make this um a few more frames so that you can see more clearly okay so yeah i'm just going to increase the resolution to 100 sorry 100 don't make it thousand ever [Music] and i just want to show you what exactly i mean so as you can see these colors represent velocity okay and the particles on the top have more velocity but at the bottom have the less velocity okay and uh like they are not actually shooting and just falling on the can but they are actually falling down but uppermost particles are shooting towards the can okay but if we change this to inflow and uh now if we bake it again okay let's cancel it so as you can see the particles have constant velocity they are not falling down like whatever it was in the back they are not falling down uh this will be much more clear if i give it some more velocity so let's make it 64 and give this one more velocity like uh four okay as you can see over here like i explained so because uh this is an inflow object now this is not actually a volume and uh so it works like uh like a faucet okay i i mean the constant with the velocity is constant okay it doesn't matter which particles are on top which particles are in the bottom but they are shooting in the uh like a constant velocity okay [Music] so for this reason we are going to use this kind of flow source like inflow because we don't want the fluid to splash somewhere over here and also fall on the ground when the simulation starts but we want the fluid to emit from here jump to these cans and then fall on the floor okay otherwise our floor will be flooded okay so let's uh cancel the bake and uh i hope i'm making sense and if you have more questions you can ask i know i've been talking a lot but these are things actually like took me a while to understand and i just want to share it with you so let's go to the frame number seven and make a key on use inflow and go to the frame eight and make uh disable this inflow and mega key so we don't want we want only in the five or six frames to emit particles okay now let's make this one 80 resolution for now and bake the data okay i'll cancel the sim and see what is happening yeah let's go to the camera view so as you can see this looks much better and the particles are not falling on the ground but first they are shooting towards the can and this kind of velocity looks good so what we need is a surface emission 2 and let's play this animation whatever frames we have so right now it looks too fast okay one very important thing before we do anything else let's change the time scale to 0.3 okay we want this to be slow motion shot and also uh we'll uh increase the resolution to 100 and see what kind of uh like it looks like in the high resolution okay it's a like sometimes things can look different in the lower resolution and it can drastically change when you're in high resolution so it's a good practice to keep it to somewhat to the final resolution and uh do your view of your test okay when you are sure about things okay we need few more inflow objects like one over here one over here but first let's just uh don't make it heavy and test it with only the one of flow source so this is going to take maybe two three i'll just make it 120 resolution it's going to take me a couple of minutes like maybe five minutes or something or three minutes i'm just going to bake the data and come back all right guys so we have the simulation and it took me around three minutes or something so as you can see this is a slow motion now uh like uh because we changed the time of the simulation time scale to 0.3 and this is what it looks like much more elegant and uh right now we have only only simulated like 50 frames we can change this to 90 because our short length was 90s frames okay 90 frames so i'll just go to the camera view and see how this looks uh let's disable the gizmo and i can also get rid of curves so more or less the structure is good i mean i can see the particles coming from the center from the left and creating a nice splash okay i think the speed needs to be slightly slower and for that i can make it 0.2 but also as you've seen in the trailer there was some fluid from here from here and there were few particles shooting in the air okay so and also there was some fluid in the back side okay so we definitely need one more source okay it's one is not going to be enough so i'll just free up the bake and uh make the time scale to 0.2 okay so that's uh simulation is much slower and i'll make a copy of this inflow source with the same keys and all and uh place it over here so that it shoots the particles in this direction and some some particles in the center okay it adds up with the uh adds up with this one okay and also uh for some particles to like uh [Music] go much higher and uh add more interest in the negative area i'll make a duplicate and move it in the z direction make it very small okay and just place it somewhere over here let's go to the global access and go to the camera view place it over here let me see uh where this one is in the camera okay this needs to be somewhere over here [Music] all right [Music] yeah over here and this one should be somewhere over here [Music] all right so i'm going to do one more bake and just come back with after two three minutes [Music] uh before that i'll just uh make one more addition over here right now the particle sampling is set to 2 so as you had seen we had some particles but we can increase the number of particles i mean we can make it much more dense so that simulation will be much more um dense and when you mesh it it will be like instead of some small drops it will have some thicker fluid not like a viscosity but the gaps will be less okay i mean you can see it says particle number factor higher value results and more particles so i'll just make it three or let's make it four for now okay we are going to take a coffee break and come back okay and also yeah make sure your end of the simulation is 90 because we want 90 frames and we are going to do one uh full resolution like 140 frames bake and after that if we need we'll make a few more tweaks but right now let's bake it to the full resolution and uh 140 was the resolution i find it good for this one so let's bake it and come back i'll see you after short break the bake is done it took me around uh like less than five minutes i think four minutes or something three minutes maybe so so yeah this is what it looks like i'm just going to play the animation as you notice the number of particles are much higher i mean uh there are a lot more particles because we increase the sampling uh if i go over here these particle sampling so we bumped up the default value by two or something [Music] just a moment so yeah i think it this looks pretty interest interesting and uh i really like the splash and the speed also looks fine it's not playing real time but i'll take a preview in a moment but one thing i notice is uh the splash is not going much higher i mean there are no particles in over here or like going on top so it can be more exciting if if it had some more particles going much higher so that's what i think we need to tweak it a little more so what i'll do is uh i'll do a few tweaks and uh take a couple of uh simulation break and uh i'll share with you the final details like what the adjustments i made because uh this could take some time like uh maybe two or three times something so i just don't want to drag this tutorial a lot so so i'm just going to tweak these settings and make a few adjustments and get back with the results okay [Music] [Music] all right guys so our simulation is done and uh there were quite a few uh three or four uh iterations i worked on and uh so this is what it looks like i'm going to just play the animation [Music] so the distribution of fluid looks pretty decent i really like how the particles are like shooting from the top of the area and there is a right balance of fluid over here and they are not going way too far in the back so i had to reduce the velocity of the emitter in certain areas so i'll just go through it one by one so basically the main source have a for normal velocity and i gave it some z velocity like 0.1 so that it like goes up till here and uh for the second emitter i think it's the same parameters and also i'll just disable the overlays also i copied this small emitter which we created over here for the top simulation which shoots the particle at the top of the can and i placed the same duplicate for the first can as well so that we have these few nice drops here and there okay in the higher parts all right so this looks good and uh i think if i spend some more time i can improve a few more areas but that is not the purpose right now so when you are happy with the simulation and as you can see uh the number of particles look much higher because we increased the uh i just select the particles and over here particle sampling is set to four and you can see it's much more dense simulation and particles are much more okay so when you're happy with the simulation and you just want to bake the mesh you simply have to click over here so for this tutorial purpose i have already baked the mesh because this has already been a really long chapter so the process is very simple you just have to click over here and after that you'll have to click on the big mesh button okay and by default the particle radius value is set to two and uh if you find the fluid is looking uh very thick and uh basically i'll just enable i'll have to change this to solid if you remember our domain object we converted this to bounds so that we could see the particles but now that the meshing is done and that domain object is uh is what creating this mesh geometry okay so you have to make sure it's it's in solid mode now go back to the particle properties physics properties so if you have this default value of mesh particle radius set to two it will it will create some thicker mesh around the particles the more higher this number gets the much thicker the mesh will be so if you increase this it will maybe i just enable the overlay create a mesh like this okay i mean it will overlap some areas so if you want to create some tight meshes you'll have to decrease these values but it might ignore some uh particles like over here and here but that's okay you'll have to make a right call for yourself okay so if you want you can increase the number of particles and resolution so that it has much it have much more resolution and particles to create a mesh form and then you can play around with the particle radius parameter so yeah that's about it and uh so i'm going to render out the sequence with the same settings as original tutorial and see the results all right so our render is done i'm just going to view the animation from here so the settings are pretty much the same like the original tutorial and uh as you can see uh it's not a very high quality render i only rendered this for 40 of the resolution on the 97 90 samples but that's not the purpose over here i just wanted to show it to you guys uh like what it looks like with the render okay so there are a lot of things which we haven't discussed over here and uh like this was a very long tutorial of four chapters which we made last year and there are a lot more things which we discussed like modding the can texturing animation setting up the camera camera effects staging and also the lighting of the scene and there were a lot more creative calls which we took and it's a much more detailed tutorial so if you guys haven't seen this yet you can just have a look at from the link in the description or you can just go to the channel and click on the playlist and click on the cgi for product advertisement okay and also there are much more parameters which you can play with like uh with the with the source you can play a lot with the velocities and you can stage your scene however you want it's not that you your splash needs to look exactly the same you can it's your scene you can just play around with this and have fun with this like if you want to play with the different settings okay and also with the different fluid machine settings if you want a thicker fluid if you want to give it some viscosity you can do that from from diffusion over here okay so so i hope you find this useful and uh because the manta flow got reworked the entire tutorial some of you were not able to follow it because the settings have changed a bit but overall principles are same so if you guys still find uh yourself stuck at some situation you can find you can just ask me in the comments and if you also think that whatever we have done today there is a much easier way or a much more efficient way to do this you can also let me know that in comment so i'm looking forward to seeing uh results you guys uh what you guys make out of this and also post it on instagram and tag me with instagras mind so thank you for watching and [Music] goodbye [Music] you
Info
Channel: CrossMind Studio
Views: 64,614
Rating: undefined out of 5
Keywords: Best, Professional, Blender, 3D, Training, Eevee, Cycles, Vfx, Industry Standard, Art, Design, 3D Modeling, Texturing, PBR, Rendering, Cartoon, BlenderGuru, Introduction, Beginner, Series, Tutorial, Material, Shading, Scene, Game Design, Cinema4D, Houdini, Autodesk, UV, Mantaflow, 2.8, Motion Graphics, Dynamics, Simulation, Illustration, Sketching, Surface, Substance, Visual, Crossmind, Entertainment Industry, Behind the Scene, Learn, CGI, Concept, cinematic, Animation, mantaflow, fluid, particles, physics, dynamics, advertising, love
Id: FKm19oozgNs
Channel Id: undefined
Length: 48min 40sec (2920 seconds)
Published: Mon May 04 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.