Houdini Paint Splash Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone today I'm gonna walk through setting up a sim like the one we see here doing that inside of Houdini and making this I used all standard now to use the standard flip solver with a few tweaked parameters and a couple of other just standard op notes I'm also gonna show you a way to build velocity fields from curves giving you more control over the look in the shape of your splashes there's a lot of information to cover with with this setup so let's hop inside and get going so the first thing I want to go over is how to build a tool for controlling the shape and the direction of this flash and as with most things in Houdini there's a lot of ways to do it and there's not not really a wrong way it's whatever way you feel like fits your needs the best so I chose this way because I feel like using curves and you're gonna see here I have a geometry node called velocity fields and I'm gonna build some curves inside here I feel like having the ability to look at a curve and say my particle is gonna start down here and it's gonna travel up this curve that's exactly what I want and then it also gives me some flexibility to just manipulate those points manually as well as using noise to give some definition and shape to those curves so let's let me start the process of explaining how this is gonna work with a single just a single line so I'm actually gonna drop down a line soft I'm gonna resample it alright and now so actually while I'm in here I'm gonna just give this a little bit of a shape I just did that with a soft fall off there so something that's common in Houdini is is if you want a something to follow a curve like this you can you can define these directions at these intervals by using a normal and right now I don't have any normals on on these points one nice way to get a couple things for free is to use a polyframe in and I'll explain what what we're getting for free here again like I said as soon as I put this down it's it is gonna calculate normals that's what this thing does it calculates normals based on based on these options so now what I this this isn't really doing what I want and it doesn't matter because I'm not gonna I'm not gonna use the normals that this creates directly what I'm interested in is this tangent which is you know this is your normal if your tangent would come up at a 90 degree angle to it perpendicular to it so I'm gonna rename my tangent to normal and already that's really really close to actually this is exactly what I needed by default I think this is at two edge and you can see that's that's also pretty close to what we need it it's approximating that but what I want is it's like this normal as it comes around the curve I want it to point directly at its neighbor and you just said that the first edge and that's what you get so we've established just with this one node we've established our are normal from our tangent we just label this no more from tangent and that's good but that's not our velocity that's just a normal so we need to convert this normal to a velocity and if you look as you look close these normals are pointing they're actually pointing from the in the top down and we need to point these from the bottom up because we want our particles to flow from the bottom up so the easiest way for me to do this is just with a with the Wrangell oh it's just one line of X it's not hard and I'm gonna call this velocity from normal and this is really simple Beck's you can do this in a in a vow if you're more familiar with that but I find if I know exactly what I'm after doing in of X is a little bit quicker so I'm just gonna type the @ symbol for defining an attribute and this is gonna be at V which is our velocity equals it would think that it would just be the at our normal at n but we actually want this to be the inverse of that so we just put a negative in front because we want our velocity as I said to travel the opposite way that these normals are facing so now I should be able to see and it's not it's not showing me these trails but we can visualize this easily by clicking on that information and then also clicking on this little V attribute so now we can see that by by clicking on this it makes a visualizer let's let's actually edit this we just don't want it to be quite so long okay so now our velocity is pointing at each of these points I think that's good but let me actually double-check this just to make sure that I'm still getting actually using that two-edged even though the normals Samed with first edge of the normals we're pointing right at one another but I think because those are going the opposite way what we see is this is you know if your particles coming up here it's gonna travel right off this way it's not gonna get that second point but I think if we use two edge that that actually calculates that a little bit closer and maybe as we resample this a little bit more we'll get something it's even closer to what we're after all right so that's half of it that that that is the half that will give us that defines directionality now I also want something that is gonna define I guess forces it maybe may not actually be the proper way to talk about it but that's this no I'm gonna say it I want the longer my curves are I want the particles to go harder you know to move faster so the way that I found to do that is pretty simple is just using a measure saw and this measure stop operates on primitives you'll see let me turn off the points here this is gonna operate on primitives and we can calculate all kinds of different measurements from that now the way to find the length of a primitive is with the perimeter so what that's gonna do is export an attribute name called perimeter I'll show you that in the spreadsheet again this is a primitive attribute so perimeter equals one and we got that because our length equals one now if we go to go up higher than that two point eight let's see two point eight eight so basically all we're doing is we're getting this length attribute but again I actually don't know what to call this perimeter I do want to call it length just because it's makes more sense to me and now what we want to do is we want to use that length as a multiplier for our velocity which is easy enough but as you as we just talked about this is not a point attribute our velocity is as a point attribute and right now our length is a primitive attribute so we just need to promote that after we promote and we're gonna change this from let's let me grab my link that tribute like that in in our original class is primitive and our new classes point and as soon as we did that you can see we have our length here okay so now that we've got our length all we need to do is hop back into our wrangle that we created and add a multiply by the length okay and that's this is the attribute length not the not the VEX function link but that we're using the @ sign so now we have our velocity that is being multiplied by the length now if we let me see and you can see all let me let me just pin this and you'll see it so right now our velocity is going and why and and that's because you know we don't have there's really not any variation in a direction but just for the sake of showing this all I'll do this so our this is equals one right now because the length is one and also that direction is one but as I change this length now our velocity is also changing okay and just one other way just to drive this home is I'll make a second copy and I'll make one super tall and and also move it over and then I'm gonna I'm just gonna merge these two together and pump that in there okay so now I have two primitives and one has a velocity of one and you'll see the other is 2.5 which is the taller one at 0.5 okay so now this is this is good this is I'm gonna enable this like the reason I'm doing this I'm gonna pull this into our sin in just a second I just want to have something to something to show I don't want that to be too far off there we go all right so this is good this is our velocity from our curves I'm going to go ahead and save my file just in case anything bad happens but that this isn't what the this is not what our our dots in our flips in is gonna expect what it expects is velocity I'm sorry what it expects is a velocity volume or at least and how we're going to use it as it expects it velocity volume so we need to create a V DV from let's see from these particles as we're just going to do this at a point level so VT be from particles plug that in and here's what we good you can see these this is way way way too big I set this way down and then this just skate this is just our point scale more or less okay so that's that's probably good for these this demo purpose and this isn't also what this is done this is just given us a distance VDB that's called surface and you can again you can see that there we go so that's just given us one one volume primitive called surface and what we need is our velocity so if we add we can add volumes or add primitive volumes to this from our point attributes we add velocity look now we've got one called V and we can rename this to Belle which is what that's gonna be what adopts sort of expects and this is also going to be a displacement velocity okay so this this defines the vector type of the volume and it is a velocity volume okay it's now gonna drop down and all and say out velocity but I do want to visualize this just so it doesn't look like this still just looks like two curves one thing we can do is use a volume slice okay the volume slice and that will give us and change the plane good this will just show us a 2d representation of our volume which is is useful to make sure that it's working but we you know we kind of already knew it was working what this will do is it also shows you the density of your VD beatgrid everyone go a little bit smaller than that yeah and the other really useful thing is to I'm just gonna drop down a grid and I want to do I want to show you volume I don't show you the the paths that these are going to take but there's another sock called volume trail and what this does is it will take a velocity volume and it will I'm going to scatter some points on this grid she's gonna make this create a lot smaller as well and I don't yeah so it'll take points and it will create paths that the points are going to travel based on of based on a velocity volume and that's exactly what we're inning and this this may not feel too useful when you've got such a simple shape as these couple of curbs but as you as we build this up as we build a whole field of these curves this is going to be pretty useful to see and and just to troubleshoot to make sure that's working all right so now we're gonna hop into we're gonna bring this this velocity volume and adopts and push our sim around with it for the sake of time I already have the bulk of this this this simulation set up this is what I created from the render that we saw the head of the video I've made a duplicate of it and I've just deleted a few things that we're gonna rebuild here all this all these nodes are pretty much stock their default there's nothing custom here yet I have changed some parameters and I'll walk through those after we make sure that we're getting the velocity volume working now to bring that velocity in we need a volume source and by default this is set to initialize the smoke we're not doing that we are bringing in velocity and we do that by selecting the pump option our input is a Saab so we just need to point to our velocity output which is in velocity fields out velocity and we don't really need to pay attention to this first this scale our treat or not we're not dealing with the density we are bringing in a vector attribute velocity so in some sand you know when we created that out of curbs the VDB we created we changed the name of that V DV primitive to Vale so we need to specify that here so source volumes bail and the target field and dot's is also though and the operation that we're doing we're saying hey whatever the velocity is in the sim add the velocity from this source to it lastly a lot of times when we're sourcing in particles for for our flip sims we plug those into our sourcing tab now don't don't get fooled by this if you plug it in there that's not going to work we're actually not sourcing particles into the same we're sourcing velocity into the sim and that comes into the volume velocity input now you can you can put a merge and merge both of these in there I just put this in line it doesn't really matter and let's quickly hit actually I want to scale this up on the scale it's about five and let's see if if our particles move among those curbs that we had and sure enough look at that one thing I want to do is I want to visualize my particles not value but speed and there we go so that is working as we expected and you can even see that so there's my shorter curve I don't remember if that one is the curvy one or not let me just take a look yep so my shorter curve is the is the one that's I need to highlight that honk and there we go so you can see that you can see how these particles start to approach that curve but they don't really follow the curve so much because they're getting forced this way and then actually our surface tension in our viscosity are just sucking those up in there sorry for the the banging outside my neighbors are working on something so let's let's hop back into our dotnet and we'll explain some of these explain some of the settings that I have why is this getting an error this is saying that we need a field that's not president that's just because at first there was no field called pump right and that's because we didn't define that we're just worried about velocity and so we just deleted that in that that's still working just fine no couple things this is looking cool this is exactly what we're telling it to do but this as this is set up right now this is just gonna continue to push particles throughout the entirety of the sin because the activation of of our velocity is set to one which is always and that is not what we want what we want to do is we want this to emit for a few frames and then to stop so I'm gonna do that you can keeping that from one to zero if you'd like I'm just gonna set this to say that the simulation frame dollar SF when that is less than five be on and when it's over five be off so when this when this expression evaluates to true that's gonna equal one and when it evaluates to false it's going to be zero so now this is gonna sort of add velocity for five frames and then now it's going to turn off and these are going to fall back down they're going to fall down when their energy is run out at least that's really going see let me actually turn this down even less just to and these are just values that that you you can play with the values to get the look that you want but we can confirm that this is definitely working we have two curves and our particles are going the direction of the curve and are the longer the curve the harder that particles are pushing so we've set it up and it's working well and we're not going to stop there we're gonna we're gonna sort of rather than just have a couple curves we're gonna have a field of curves that are gonna define our splash effect shortly I just want to confirm this is working I want to talk through these some of these dock nodes so yeah this this is this is exactly what we're looking for we have again not to beat a dead horse we've got this following up the direction of a curve we're getting these cool droplets that are forming the the further we get into our sim and it's looking a little bit viscous which is kind of a paint look that I'm going after I'll show you I'll talk through briefly what's going on in the sim my flip object is you know if you've seen some of my other tits tutorials I generally will continuously emit particles into the sim and that's not what I'm doing this time right right now I'm just saying hey go but whatever's plugged into the first the first input of this doc net which is these particles here just use those as the fluid and so that's set by particle field and then you you can either point to it point to the stop or you can just use this OP input path expression and that's gonna take those incoming particles convert those into flip fluid and then do the simulation inside the flip solver a few things that I have changed I like to always add an ID attribute I've slowed this down a little bit rather than this time scale default still one which is real-time I've chosen to slow that down some by just cutting that in half and the particle motion tab I am using reseeding you'll so it'll become more evident why I'm doing this when we add more more velocity in here it's it's just gonna add it's gonna force a lot of particles into some of the thinner areas and this this default value is 1.5 that's one one easy way to cram a lot of detail in there with at the expense of it not being physically accurate anymore is that really over crank this surface sampling I I had a set to 20 so Alou there and then in the receding tab I also intend it to to interpolate a couple other attributes I D color viscosity and also this this attribute ramp that I created that I'm really not going to go into in this tutorial but I'm using this for shading and if you're interested in and how I use that you can I use this to achieve that that gradation that's going on across the across the render that I had I don't have that render up so I use that that ramp attribute to to control these colors and with a redshift ramping at render time so I can I'll explain that within the and comment that out and put that in the the file that I upload to come Road so that's why that's in the recede tab really not much else has changed within the particle motion volume motion I've enabled a viscosity viscosity by attribute I set that attribute again because this is a particle field I set that viscosity attribute with a popper angle I set that here but I plug it into the particle velocity tab let's set that to ten just at this guy's T equals ten and then I have a pop drag to kind of add a little bit of a resistance to these as they're going up and then the surface tension and this you know you can set your surface tension within the solver I tend to do it with a micro solver you can just type surface tension and that brings that up the default value is point one I've cranked that to one I believe to try to force these droplets together a little bit faster than they would form at the default value and for the for the solver that's really all I've changed I've just added this surface tension added some viscosity and that's really it so let's let's hop back over now and I'll I'll build a little bit more complicated velocity field and I'm not again just for the sake of time I am gonna talk through this not build it fresh again I'll have a little have a better version of this in my project file that I put on gum Road I plan on having a way to paint a paint on a surface so if you want like this is great so this is driven by noise just in this vibe that I've separated the the different dimensions of the of our position I'm XYZ values and I'm adding noise to the Y value and so you this but what happens if you say actually want this section over here to be a lot higher and you don't want to if you don't want to play with the noise settings out I'll add in a node where you can just paint a white value on here and it'll and it will make those go up you can also add deformers to this you can twist these around if you want you can grab the same way that we did with with these curbs over here you can you can make selections and scale those up twist them around whatever you want to do these are these are just primitives and you can deform them however you would like and when you pump pump on through here you'll see you get your velocity field the same way that we did with the curves now what I might need to do is make those points a little bit larger and I probably need to I'm gonna add one final resample before I before it goes into it's the calculation for the velocity and want to just visualize my points and let's go let's just get double the amount of points there so that when we create our velocity volume here that's just those are going to be a little bit closer together I still think that particle scale may be a bit too big in essence I just don't want a lot of gaps in here and I don't want this to be too too coarse now I've changed that to three and that's a little bit better wrong way all right that that should work for us now let's hop back into our top net and see what you know this is going to give us now I may pause depending on how fast this goes I may pause just so no wasting a bunch of time all right so I went ahead and cashed out this sim and just playing this back and it's looking really good so I'll hop back into the dotnet and show you the last so just the last little thing that I changed so I have it cashed out and this is trying to resend everything and I don't really need that so I'm just gonna hit escape here and I'll show you so the only thing I changed was this over surface over sampling on the reseeding tab I had that cranked up to 20 I pulled it back down a little bit and I really don't think I changed anything else actually I upped the surface tension just a bit and that's really it this is the this is the result we get my turn simulation off and really happy with it I think it's you know it's it's approaching what what I wanted to do I'm really interested in these little sections that that stay that sort of stay together and then get pulled in I think that's really nice and again is I'm not going to go over too much of the my meshing and render setup if you're interested in that you can always grab the grab the file off-camera but I do want to show you real quick why I've got this gradient happening that gradient is generated by this it's by this color but but what's going on underneath the color the is this is a color value but it's being generated by this ramp attribute and the reason I want to do that as in in redshift I want to use a redshift ramp to generate these kinds of colors push this through the sim so that that gets carried out through the through the scent it's not just static and it's also that's being interpreted by the reseed and and the reason I do this in redshift is when you try to start messing with these color attributes at a soft level redshift really tends to bog down I've gotten a few crashes from it but when you do it at your shader level and I can said it wasn't going to get into it I can show you real fast when you do this at your shader level these are the final colors from our render it doesn't bog down at all and it happens the updates are really really fast and I just I just tend to like that better and I'll go ahead and do a quick render of this just to show you what the final render looks like let me make sure that I've got only that activated this is my this is my cash Sam from the render that's on Vimeo and YouTube this is what we built today really really similar this it's almost the exact same setup let me come down here to my mission and flag my material this is my redshift material only flag that for for rendering then hop back over to my out context and open this in a render view let's see what we've got you let's look and it's looking really nice let me um go up a few more frames so we get something it's fuller frame to render and we're getting these these nice droplets that are forming they're breaking off and are really in a really nice way one more frame you can see how how quick this renders month my machine is decent it's at 210 a TTI's and it's it's really cranking through this I think probably my camera isn't positioned so great let me walk my camera and come on in a little bit there you have it I've got I've got some subsurface scattering going on - to give this liquid a little bit nicer look and that's that's pretty much it so you've got a you've got a system to define these curves when we pull that up we've got a this velocity field that is defining our curves we hunt back in just two yes I'm sorry we have a we have a bunch of curves that are defining our velocity of the sim so this sort of hilly pattern is giving us you can see where you can see where this this fluid is just following that pretty closely especially initially and then when it gets when we stop him when we stop sourcing that velocity end of the scene that's when the that's when the surface tension really takes over and that's basically it so I hope you enjoyed I hope you enjoyed this I hope you found it useful again if you want to grab this file with well I will I'll extend the functionality of this a little bit before I post it to Gumroad so you can so you can paint some areas of influence to have greater influence you can also as we talked talked about you could you can merge all this together and have individual curves you can place those where you want that's my larger curve so you can place these curves wherever you want and just pipe this directly into here and any curve that you put in the disk to this system is gonna affect your velocity so I you know I think this is a great way of art directing some sims because inevitably if you're doing this for a client or even figured for yourself you get something going that's maybe halfway there even better than halfway there but you like you know what this would be perfect if it just shot up really hard over here and so now you can do that or if you don't want to merge these in and you just want to make selections like you absolutely can just grab this do an edit change this from surfaced radius and you can pull up hills as much as you want you know you know or you can or if you say that you know what this is working but this one's too high let's move that down or you know what I want to add some twists to it you can and I and all this will carry through your sim so again I hope you see the value and taking the time to build this out rather than just throw some stock forces in there and I hope you also see the value and just using the tools that are available in the the standard tools that are available and who do you need to get some really nice looking some really nice looking some splashes alright so that's it so thanks again for watching if you found this useful or if you want more information check me out at what I found dotnet you'll find all of the all the social links there you can follow me on YouTube Vimeo Twitter wherever you like I hope you enjoyed it thanks so much for watching alright so I wanted to hop right back in and just say after after recording this after playing with my setup for a little bit longer I kept thinking what wouldn't it be nice if if I was able to read time this and I wouldn't have to rely on a reseeding to get some of those some of the details and some of the to get some of that thin sheeting wouldn't it be nice to not have to reseed is there a better way to do that so after spending a day or so poking around online digging through forums I found some really helpful advice from some Houdini users who were a lot further along than I am I just wanted to share the results really quickly so what we can see here is a lot fewer particles I am able to retime this this edit and send us this fast this is using the the game a game dev tool set every time that every times your animation via this nice ramp here's the here's the sim and what this is using is using some custom surface tension and a custom hole filling setup now I didn't come up with either of these either of these tools I did modify them to work in conjunction with one another in a way that I that it really worked for my setup that that let me keep some of these nice details up here and have that drop break off the whole feeling by default you never let anything break up so what I'm gonna do is I'm gonna record another video in the next week or so about how to how to extend the setup that you just saw with some help from users on forums who are posting tools that that they're creating and just basically I'm just gonna do a walk through either a video or a write-up on how to find help when you need it and how to apply that in a smart way that works for your own setup and that'll give you some more flexibility so all that to say and I'll show you the render that I that I created with my new setup all that to say you get happy with something don't don't stop there there's always ways to push your push your ideas further and there are so many helpful people online to learn from so in my next video that's what we're going to talk through is how to extend the setup that we have I'm using the same the same velocity system that we built but how to extend it with with the help of resources that you find online alright thanks again
Info
Channel: What I Found
Views: 19,198
Rating: 4.9674797 out of 5
Keywords: houdini, sidefx, 3d, tutorial, motion graphics, mograph, cg, cgi, vfx, sim, simulation, paint, velocity, art directed
Id: aSmNuuprvi8
Channel Id: undefined
Length: 36min 8sec (2168 seconds)
Published: Sat Jun 13 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.