Houdini Beginner Tutorial: Sandmonster | Part 1 | ERAVFX

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello welcome to this houdini beginner tutorial series where we're going to be recreating this sand monster effect this is an effect that i've used in many of my videos and have been highly requested to make a tutorial on and if you want to see more tutorials of my future work please make sure to like and subscribe so let's just get into it all right so to get started you of course want to download houdini and you can do this from this website and just make sure you get the one for your operating system and speaking of operating systems in this tutorial i'm going to be using windows so some of the hotkeys might be a little bit different for uh if you have a mac the main difference would probably be that when i say control you're probably gonna have to use command but other than that this tutorial should work for everyone cool and once you have it downloaded and open your software we're going to first make sure we set the scene up correctly and you do this by going into this file menu and then new project and in here you'll kind of it'll set up a project automatically for you with a bunch of folders for you to place in your caches and renders and all that by default it goes to this dollar home variable which is a windows variable where it'll store your files on your disk and i'm fine with this one you can you could place it somewhere else if you want but i'm just going to keep the default and then we can set the project name up here i'm just going to call it tutorial sand monster and i'm also going to just ctrl a control c to copy it because this will still it won't save the file or just create the folders but if you hit ctrl shift s you'll take you to let's see here you can see all my projects and if i sort by last modified this first one will be the one we just created the folder with all these folders inside and i'm just gonna go ahead and paste the the name of this folder so i can save it and if you do control open you can see now we have saved a hip variable or a hip file inside of this folder where we're gonna be working on our project all right so to get started creating our effect we're gonna place down a grid and you do this by going into this network right there hitting tab and then you can type whatever you want and in here you can see you can you have access to a bunch of different notes but we're gonna just place down a geometry node because we want to add some geometry into our scene so place so just hit tab search for geo and put down the geometry node and i'm just going to call this work area as i'm just going to be doing all my work inside here and once it's placed down you just double click on it to go inside and inside here you can see if you press tab you have access to a bunch of other nodes and these are going to be inside here we're basically going to do all of our work to create the effect and i'm just going to start by placing down a grid node which is basically just a ground for our effect and it kind of gives us a reference point and in order to navigate the viewport you left click to kind of rotate around the object then wherever you hold the cursor it's where you're going to be kind of rotating around so if i hold it up here it's going to be rotating around there if you hold it down here it's rotating around this point and if you hit middle mouse button you can pan and navigate the viewport that way and right clicking and like moving your mouse will zoom in you can do it either up or down or sideways and this is all working out because i'm in the camera mode for the viewport which is located right down here this button sometimes you you can go into selection mode by clicking this button and you can see then that all your controls are now working as you'd expect if you want to rotate around or navigate your viewport you can fix this by clicking alt or holding down alt and then you have access to all the same controls as you would if you were in this navigation mode as you can see when you hold alt it kind of selects this mode i like however to just not have to use alt and by pressing escape it'll go into this mode and then you have access to all the same controls again and this is generally how i like to work okay now let's actually get started making our effects and the first thing we need is obviously some geometry or a person running that we're going to be emitting the sand from and i'm not going to be creating a model and animating it and all that uh there's no reason to do that when that's already accessible online lots of places and we're gonna be using a website called mixamo for our animation this is actually a website by adobe and they have a lot of useful character animations and characters themselves here and i use this a lot for my videos to find animations and let's first select the character we want to use as a base and i like this character right here it's it's this alien soldier it's just got a nice shape and kind of has a nice outline that for the for the emission so you can select him by just clicking on him and once he's selected you want to head over to the animations tab and search for whatever animation you would like and i'm just going to go for a simple walk animation and there's a bunch of different options here i like this one right down here and you should be able to find the same one and it's working we're going to make a big character maybe like like 15 20 meters tall and to get the proper sense of scale i'm gonna slow it down a lot so you can do that by dragging this overdrive button slider it down a lot and maybe to around three or i'm gonna put it to five and i'm also gonna set the total frames as long as possible by dragging this to minus 50 and 150 which gives us something like this and i'm happy with this so i'm going to go ahead and download this and i'm going to set the frames per second to 24 which is generally what's used for film and just makes it look a bit more cinematic and once the rest is all fine and i'm just going to hit download so my animation is now downloaded and i want to put this into my project folder so i'm going to go ahead and open my project which for me using the dollar home variable is found under this pc documents houdini projects and then the name we gave it and i'm just going to take my download here and just drag it right in here i'm just going to keep it here with the hip file and if i go back into the houdini scene we use a note called agent to bring it in this basically just imports the fbx that we downloaded i'm going to put my display flag so if you click on this right side it makes you can see it makes it blue here this is just to visualize that particular node so i'm going to put it on the new node we just created and you can see it's erroring because i haven't given it anything yet but we can change that by changing this input to fbx and then clicking on this file selector and if i click the dollar hit variable it's gonna go into where i place my character and we're just gonna double click on this file to open it and as you can see it imports this in just a t post and it's not moving but in order to get the animation applied we go to this current clip and on the drop down there should be a miximo.com just named there and as you can see we now have our character animation and it's only like about 90 frames and then it starts looping again and we might make it longer after depending on how long we want the clip and the animation to be but that's how you import the animation okay so we have our animation imported and i'm going to start off by hitting this button right here because if you see if i turn it off you can kind of see that it just plays as fast as it can which is more than 24 frames per second which we don't want but if you hit it it's going to lock itself to 24 frames per second and that's obviously what we want to be working in and you can click this button to verify that your frame range or your animation is set to 24 fps now now that i have that done we're going to scale up our animation like i said earlier and we do this by just hitting tab again and putting down a transform node and in order to apply anything to the geometry we have we have to hook up these nodes and that's done using these lines and if you just click on this little button under the node and connect it to the transport node you can see nothing happens but if you select it and then mess around with for example the scale of the transform you can see that the scale of our character is moving and i think for my other sand monster i've been using around a scale that's about five times bigger than a normal human so if i set this uniform scale to five we should get a pretty big person as you can see these are increments of five for each of these grids so this is 10 meters uh for his flip span which is he's probably around like 50 meters tall now uh which is really big and which is what we want for this okay so our character animation is all good to go now and the next step is to convert this into some usable geometry because while it looks fine in the viewport if you look down here you shouldn't actually you probably won't see this if you press d to go into your display first of all you can change your background color to something else here it's probably light by default but you can change it to dark hair like i have it and if you go into i believe visualize sorry guides i like to have this geometry information always on because then i can see my primitive and my point number down in the corner and it says one right now which doesn't make sense because there's a lot of geometry making up this character but in order to actually see it you can put down a convert node and visualize that which will give you all the primitives and points which is actually making up this character and if you press if you hold down here and press smooth shade the smooth wire shaded you can kind of see the outline of this geometry you can also do this by just pressing shift w and each of these is one primitive and every single connection point is one point and the reason we're doing this is so we can actually do something with this geometry uh like for example scatter a bunch of points onto this so if you put down the scatter node you'll see how your geometry just turns into a bunch of different points and this is kind of that underlying principle for the whole effect i'm just scattering a bunch of points onto the surface of the geometry on every frame and then just letting them fall but there's a few things we want to change here the first one being this relaxed iteration if we turn this off you can see they kind of look a bit more randomized and that's because this what this does it kind of just tries to average out their position just to make them a bit more even but this makes this becomes really heavy when you have a lot of points so if we set this to maybe a hundred thousand points instead of one thousand i'm also going to set the display of the points to pixels by just right clicking this uh box here makes it easier to see it and if i turn it off you can see it's pretty quick it's almost three time i can just generate these 100 thousand points on every single frame but if i set the relaxed iterations to the default of 10 you can see it every frame takes a long time to generate and we don't really care about evening them out when we're generating a lot of them so instead of keeping this off uh it's totally fine for our sake okay so let's actually try to make a simulation out of this now and i'll do this by i'm gonna set it to just a thousand points back to the default uh because with every single frame is gonna get a thousand points and it's gonna add up really quickly and i'm gonna put down a pop net if you already have this line selected when you put down your node it's going to just connect it automatically which is handy so if you search for pop you're going to find the pop network node and this is going to be a simulation operator which works a bit differently than these other geometry nodes we've been doing so far this one you can actually jump into and you'll find this network generated for you which is where we're going to be doing our simulation and i'm just going to start by deleting this merge node you don't need it it doesn't do anything and i'm going to set this pop source where we're sourcing in our geometry or our particles i'm going to set it to all points instead of the default which is scatter onto surfaces because we're giving it points and not a surface and we can just actually just hit play and you can actually see it trail off it's kind of a cool effect because what it's doing is every single frame it's generating those points and it's sourcing them into the simulation and then just keeping them around and it's not being told to do anything else than just keep them there which is why we get this kind of a trail effect but if we want to add say gravity to this to make a drop you can just add a gravity force and put this under the pop solver and if you hit play now you'll see it start dropping which again it's the almost the effect itself there's just a lot of fine tuning we have to do to make this actually look good but this is the basic effect already made all right so the next step now is obviously adding some sort of collision for this because now as you can see it'll just fall forever that we want it to collide with our ground so i'm just going to put down a ground plane for it to collide with and the way of sourcing in collisions inside of adapt network is you want to actually use a merge node as you can see on the merge it has this relationship which is set to collider relationship which means that the left input of this merge node will affect the right input as you can see here so if we plug this in and then use this arrow to put this left input or put the ground pin to the left input we'll add this as a collision object into our simulation so if i go back to the start now you can see this orange that means that it's a cache but it's out of date there's been a change and if you just go back to the start of the simulation by hitting this first frame uh you'll see our ground plane appears and if we play now our sand or our particles are colliding but they're also bouncing and has some weird behavior but we'll fix that and fixing that is actually pretty simple there's bounds and friction and other parameters that we can set for the simulation and i like doing this on the pop object itself you can do it on the collision object too but we're just we just have one collision so doing it here makes sense and sand doesn't really bounce some but they can have a little bit of movement so i'm going to put it to 0.1 and if we just refresh this simulation again uh our sand is no longer bouncing uh it looks a little bit boring but we're going to add movement to it and it'll look a bit more natural uh once it's all finished but at least it's not bouncing anymore maybe we can set the point to might look yeah actually let's go back to point one we don't want any bonds at all for this okay so the base of our simulation is now set up and we can now go back into our object area to tweak some things to make this a little bit better the first thing i'm gonna do is change how this scatter works as you can see there's the global see it here which just randomizes the position of the scatter and this is useful for us because if we randomize it on every single frame um we'll get less of a trailer look as you can see here you can kind of see all the particles trail which we don't want we want this to be random and we don't want to kind of see a pattern in here and the way to do this is on this global seed we're going to set a variable i'm going to set dollar t which stands for dollar time which counts the frames in seconds and as you can see i'm on frame 25 now and it started at 1 so 25 minus 1 is 24 and the dollar t is set to 1 and then it just generates the same numbers for all the in-between frames as well basically what it means is that every frame will now have a different global seed value uh and all the particles are going to be in random spots on every frame and if we run the simulation now you're going to see that we no longer see that trailing pattern we saw before at least not as much you might see a little bit for every frame but we can fix that too but the main problem is now sold and this looks already better okay let's start refining the shapes of the simulation right now it all just drops straight down but it's a lot more interesting if there's a little bit of wind or some turbulence affecting the particles as they drop to give them some shape and we can do this with a note called pop wind so put down a pop wind and we're gonna put this one in between the source and the solver because this input is post solving you could also put it here in the pre-solve but it'll basically just do this before the gravity and the collision and by default it won't do too much it'll kind of just slow down the particles because it's it's adding air resistance to the to the simulation as you can see here an air resistance of 0.1 which is a lot more than we want in this case um if i set it to 0 it's basically just not doing anything i'm gonna set it to 0.1 so that will be a bit of air resistance but not too much it'll still look natural because we need a little bit of air resistance in order to apply our force um and point one will be enough for our case and let's just set the amplitude of this noise so this all the parameters down here is making the noise or the turbulence field which is basically just a random wind that's blowing and let's just try one and see what it gives us it can't really see much and when that happens i generally just like to set it really high let's say 10 so we can see if there's anything happening at all and yeah now you can see it's working the particles are just going all over the place which obviously we don't want either we can maybe try a value of three which gives us a bit more natural look but it's still a little bit hard to see um there's this swirl size which we can also change what this does is it basically just changes how big our noise field is or like the the different sizes i can show it by setting this back to 10 and then setting this to 5. as you can see now these are a lot bigger shapes uh which makes a more sense for our big simulation uh this it looks kind of cool like this compared to when it's set to one and these shapes are just a lot smaller and just all over the place so i'm gonna set this to maybe like four we can test it a 10 to see the pattern looks like a nice pattern and then set this back to let's set it to four for the amplitude as well and it's not super noticeable but there's definitely some movement in here now you can see like the head here you can see kind of fling off there uh it just looks cooler and generates a lot more natural shape when it hits the floor it also moves around on the floor which we don't necessarily want it could be a cool effect maybe we'll keep it actually it could be nice um but anyway so this is just how you add some detail into your simulation so usually i'd make the grain or the the particles just stop as they hit the ground and you can do this by going into your pop solver on the collision behavior click add hit attribute and setting it to stop which will just make them stop as they collide but i actually think it's kind of cool what they're doing so i'm just going to hit ctrl set to go back and [Music] just having them kind of slide on the floor it looks kind of neat so if you have a camera here you can kind of see them start branching out on the sides and everything and yeah let's let's just keep this effect for this tutorial i think it'll be cool and we basically have it set up ready to go now i don't think there's too much more we can do uh to the simulation we could one thing we could do to get rid of these is we can add a sub step where it'll right now it's simulating on every single frame but we can make it simulate on like two times per frame by setting this min substeps to two this will take twice as long but it'll will get some uh some more details in between the frames but for our sake i think it's fine we're not going to really see that much difference and it'll just take longer for us so let's just keep it at one and set up the caching for the simulation actually one thing we'll do before we cache the simulation is fixing what happens when this animation starts looping as you can see it runs through the whole animation cycle and then it kind of resets back to the start uh which is kind of a neat effect but we don't really want that in our case um something we can do is kind of loop it so that it just keeps going forever but i think what we'll do which might be cool is just have it stop right there and then just kind of see it all drop down to the ground but we don't want it starting again so what we can do is just switch off the the simulation right on this frame here on frame 89 is the last one we want to keep so go into your pop source go into your attribute or into the birth and you want to click alt and then left click on this and that'll make it green which basically just sets the keyframe and a keyframe will just animate this this parameter because what this parameter does is it just tells the the simulation or the solver if we're going to be sourcing in the particles or not and set the one it will be sourcing set to zero it will not be sourcing so if we go to frame 90 uh obviously we didn't want this in here now so we're going to set this to zero and again alt left click so if we go between the frames just using arrow keys you can see uh you can still see it there but if you keep playing there won't be anything sourcing you can turn off the the the blue visualizer here by just hitting this check mark on the guide and if we now go through the simulation you'll see that on frame 90 it stops emitting and this should lead to a pretty cool effect uh when we have a lot more particles as well a little bit colder because we'll add a lot more particles to this simulation for our for our cache because then we'll just let it run and we'll just save it to our disk which leads me to caching which is exactly what i said by just saving all of these geometry files or the the points onto our disk so we didn't have to constantly run the simulation and we can also just boost the amount of particles and just do it once and then we can just return to the same cache so we don't have to when we're rendering and doing other things to the simulation or doing stuff after the simulation we won't have to constantly re-sim because you can see every time i i sim it now it takes maybe a few seconds but when we add a lot more particles this can take minutes hours and at the most even bass when you're making really big effects um so let's get to caching uh we're gonna go ahead and jump out you can press u to go up one level or just click here to go up one level um if you visualize this note you can see our geometry but we also see our ground plane which we don't want to bring out we just want to bring in the particles and this object is kind of telling this uh telling us what we were bringing out of the simulation and star will just bring everything star is just a variable that's used to bring out everything we see inside but we just want to bring out this pop object which is containing our particles themselves so i'm just going to double click here ctrl c to copy it and then paste that in here which will just bring out our particles and not the the grid so now we have this and we can one thing we want to do before saving this is we actually want to put down something called a rest position um we're going to put this in front of the before the simulation and what it will do it'll store are the position of each point as they're created uh it'll sort this position but it'll keep remember that position even when it moves through space um and this is very useful because we want to add some noise we want to add some color to this but we don't want to call it change depending on where it is in space we wanted to change depending on where it was when it was created that we wanted to keep like stay constant so this is just a useful note for that it'll make more sense when we actually add the color and the next step to prepare this for exporting is to delete some attributes we don't want attributes if your middle mouse you can kind of see that there's a bunch of 17 point attributes a lot of these are not useful for us but every time every point attribute we have will be stored on the disk and it'll just take up space that we don't want to take up and it'll just be slower to load then it's just useless to keep them so what we can do is put down an attribute delete node which will allow us to delete all these different attributes um and instead of telling them what we want to delete i'd rather just tell the this node what to keep and you can do that by using the same star variable if i do this you can see they're all gone now there's nothing here just the position one which is impossible to delete you can't delete the position of the point but if you use this take here which is which you can make on windows by pressing shift 6 and then i can for example write id and now you'll see that it will keep the id attribute so it'll keep position of course and then it'll remove everything but id and we can do we can set some other attributes here that we want to keep for later which i'll show you later like why we're keeping this but for now you just want to do we want to keep h and we want to keep the rest position we made and also v which is velocity and you can visualize it with this one it kind of just shows which direction all of our points are going in uh which is used to like motion blur the image later on again i'll explain this in the rendering phase but for now just make sure to keep all these and then we can just delete the attributes on all the other on the vertex primitive and detail we just delete them all we don't need them we just need these point ones um and with this we're ready to save it to the disk using a file cache so again the file cache all it does is it just saves this geometry onto our hard drive or our ssd whatever you might have and we can do this by just hitting the save to this button i'm just gonna actually before i do that let's let's set up some names and stuff and like choose where these these files actually end up as you can see by default it goes into hip geo and then it sets the name here and this is a fine place to put it it goes into all the folders we created before and into the geometry folder which makes sense and then this right here is setting up the name uh i'm just gonna remove it and kind of recreate it so for our name i'm just gonna put dollar os dollar os is basically just this name it's the name of the node so it's whatever name we give it here it's gonna be this uh it's gonna be this variable so if you middle mouse on it you can actually see where it ends up or what it's called and it goes into our path the whole path for our houdini project and then the final one is called file cache which is the name of this which is our dollar os variable i can call this cash sand party calls and i'm just gonna do v1 as version one now if i middle mouse on it again you can see the cache itself is called cache send particles underscore v1 it'll you can't put spaces here it'll automatically use underscores and that's just because spaces sometimes messes up how files are read and they can error out so it just automatically generates the the underscores uh now to further set up this we want to add a dollar f variable so i'm just going to do dot dollar f dot and what this does it it sets a variable for every frame so this will be frame 40 38 27 again middle mouse and let's go look at it and there it is so it's 27 because we're on frame 27 and the reason we're doing this is we need to actually save a file for every single frame here we can't just save one big file we want to save a single file for every frame because it's changing every frame and this will do that it'll set up the news properly for that and lastly we want to set the extension which is what type of file it is and houdini has a file like a native file name just called bgo and then dot sc that will be that's the basic i think and if you control middle mouse you can actually go back to default yeah just to make sure that's what it's called and with this we should be able to actually save the disks and i'm just going to do this it shouldn't actually be too long i haven't added too many more particles um it brings up this window where you can see your job and it kind of goes to completion i'm just going to interrupt it because we don't need to go all the way there and actually right now it's actually still loading from the cache or from the from the simulation but if we hit this load to from disk button even if i disconnect it here you can see we're loading in the files and if i go here and turn off the sequence you can see all of our different files every single frame has one file now which are all about three megabytes each which is not that bad and if you click the show sequence as one entry our whole cache is about 300 megabytes which is i mean it's it's going to add up if we add a lot more particles we're going to get a few big gigabytes uh of the file here uh or in file size which is fine for our case but yeah this is how you set up a cache now let's just further prepare the scene for rendering and caching the final version and the first thing i'm going to do is just change the frame range because right now you can see it just keeps on going and it will cache all the way but we don't need it to last this long so i'm going to set it to around frame 130 it's a good place to end it i think and you can do that by just changing this to 130 um and now this one will automatically just go to the last frame in our range so it'll only catch 130 frames which is good we're also going to turn on this initialized simulation ops what this will do is just ensure that the simulation is kind of starting fresh when it when you simulate it it won't it won't use an old cache and mess up because what we could what could happen is we changed it to use a lot more points but it still has an old cache in there that's using less points and it'll cache that instead of our new one so that just ensures that everything will be nice and fresh when we hit save the disk and i'm also going to put this missing frame to node geometry instead of reporting an error that's just in case we have one frame where we don't have any geometry instead of us giving an error like if i go beyond here it wouldn't normally give us an error but i just like having this in no geometry so that when we render it won't like cancel the render it'll just keep going with nothing there which is what we want and now i think this node is all set up and let's just do a category maybe do four times as many particles so on this force total count i'm gonna do times four um which will give us four thousand particles per frame and let's see what happens when we save this to disk all right so the cache is done and as you can see we have a lot more particles now um it looks a lot nicer and there's a lot more details and you can see the points here in the corner it's already up at 300 000 points at the final it's at 356 000 points but still it was really fast at least on my computer it really depends on what kind of computer you have on how fast this will take and how much you're able to kind of store on your computer uh but this should work on most computers uh and i think this is what i'm gonna use for now to work with it um later on i'm gonna do like a lot higher one where we have millions of particles but for rendering and shading and stuff it's it's better to do that on the lower amount where you can do it pretty quickly um and then just boost the amount later on so it just makes for quicker iterations and it's just easier to work with as you'll see uh so let's use this cache um when we start to prepare this for lighting and rendering which we'll do in part two of this tutorial series [Music]
Info
Channel: Eravfx
Views: 14,527
Rating: 5 out of 5
Keywords: Hudini, Hodini, Eric, Whodini, Tutoral, Totorial, Bygenner, Beginer, Erikvfx, Eravf, Eravfx
Id: ZCn5fsOQKJU
Channel Id: undefined
Length: 32min 40sec (1960 seconds)
Published: Tue Jun 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.