Houdini Tutorial: Flip Fracture

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
my folks today I want to share kind of a fun little effect that I've been working on and this is giving a way to kind of emulate fracturing within a flipped simulation and this gives kind of like a GUI or sort of destruction workflow and it's basically just applying the regular destruction workflow you would use maybe in our VDS but emulating that in flip using viscosity instead so let's go ahead and get started I'll just drop down a geometry node here and we'll just call this flip fracture we'll dive inside and the first thing we're gonna do is just set up a very sort of basic pressuring workflow so let's do something simple let's just grab ourselves a box one by one by one is just fine I'm gonna move this drop transform for it I'm gonna move this up maybe somewhere a little bit higher and the idea is we're gonna drop this down onto something so very basic workflow there and of course we're going to want to fracture this so I'm gonna do an ISO offset I want to get sort of points within this so not just on the surface of it so if i scattered I would get points just on the surface I want points throughout this thing so I'm just gonna make a fog volume here I'll just bump up those divisions so this is just giving me a density representation and we'll just throw that into a scatter I'm not gonna want a thousand pieces the sort of density and resolution of a flip semi would need to get all those individual chunks that's gonna be just way too high so I'm gonna drop this way down let's drop this to something like I don't know maybe maybe twenty four pieces well maybe maybe thirty there we go that should be fine so with those pieces in place let's just drop Bora no fracture and here we are set up with our sort of very standard very normal sort of fracturing workflow and I can pass this at our PD and drop it in shatter it but that's not what we're gonna do today so each of these has a name that's perfect that's what I want and we've got sort of all where are we here all 30 of our pieces they're great now the next thing I get to do ultimately what I want is these to be particles so I don't want these pieces and I don't mean that I want to assemble them into points I mean that I want to sort of turn these into clumps of particles so let's just take our whole thing here and do a points from volume and right away we're gonna get our first sort of parameter here so let's just drop ourselves a parameter null I'll give that its own sort of shape in color here and then let's go ahead and add some parameters here and the first one we're gonna want is just going to be our particle separation so I'll call this piece up and particle separation there we go okay so this is gonna govern kind of the scale of our simulation here and I'm gonna choose something kind of intermediate something like point O three should be pretty good and I'll just go ahead and copy that go into my points from volume and replace this with paste relative references so that's gonna give us 37,000 points so that's like nothing at all that will simulate nice and quickly we should be able to actually see what we're doing here obviously if I was gonna do a real simulation I would want to be up by at least a factor of 10 maybe a factor of a hundred but for our purposes let's just start with this nice nice little set of particles so what we want to do is figure out for each of these particles which of these pieces is it inside and also how deep inside that piece it is to get that information what we're gonna want is a volume representation but we can't just drop so we could do say a B DB from polygons here but if we just do this on our fractured volume here we're just gonna get one box we don't have pieces anymore we don't have any idea of where each of those individual chunks was so we can't do this with the whole geometry here we're gonna want to do this inside of a loop so let's go ahead and drop a for each aimed primitive loop because what we have here is our primitives are the ones that have the name so this should be set up by default it's using primitives it's using the name attribute and it's gonna loop both of those so this should loop over 30 elements here perfect and what we want to do is for each of those generate a VDB now this is gonna give us a sign distance field here the voxel size is way too high I'm gonna drop this nice and low get ourselves some good detail here we're only gonna do this once so I'm gonna just look really crank this up give ourselves some some really nice detail certainly higher than we have for our point separation so that should be fine and what we're gonna get here and we can talk about this a little bit more in a minute is what's called a surface density function and what this actually stores is for each of the voxels that it stores information on them it's telling you how close is it to the surface of the piece that it's representing so if we have this chunk here each of the values in the SDF is actually saying how far away am i from this surface so what we see here is kind of a representation of where the zeros are where those zero voxels are but really the whole volume within these band widths is sort of storing how far am i from the surface so if we want to know for each point how deep is it in this piece we actually want to sort of toggle this checkbox here and this is saying instead of using these banned voxels which is saying basically three voxels outside of the shape and three voxels inside store your distances and everything else will just be sort of constant we want to actually fill right down to the middle one so that means the entire interior is gonna have values that we're gonna be able to reference okay so that's great if we were to pass this straight through we would just do that for each piece it's gonna take it a quick second but not very long now you can see that we have all these individual volumes and if we look under the primitives here you can see that we have thirty so zero through two twenty nine thirty individual volumes here and that is what we want we want to be able to sort of keep these volumes separate unfortunately they each have exactly the same name and that's not gonna be super useful for us so we want to actually keep track of the names of these things so that we can reference them individually and to do that fortunately name is just a primitive attribute here and we can just go ahead and drop a primitive Wrangell and just rename them so I can do that I'm gonna put this parameter angle here it's reading the whole thing let me just go to our last piece so this thing is named surface here what I really want is to give it a new name that is basically the name of the piece that's coming through and that's pretty easy we can just pipe this in here and we can just say that's it name equals prim from geometry geometry straight one because it's the second input here I want the name of that piece and just for print zero because all I'm getting is a single primitive so now we've got piece 29 on this last piece and if we go through all of them now our volumes our name with the same as the piece names that they came from okay so with this in mind or with this sort of available what we want to do is figure out for each of these points here which volume is it inside and how deep inside that volume is it so we can drop an attribute rankle here we know we're gonna want these points to process those and oreganata want to sort of evaluate these volumes if we were doing this for a single point or sorry for a single volume this would just be a matter of a simple sort of volume sample and typically that would be sort of surface since we have some you know we know how many but in principle it's procedural we have some number of volumes here we need to do things a little bit differently and what we're gonna do instead of just referencing a single volume we're actually gonna check every volume and we're gonna sort of keep track of which one has the minimum value so which one has the smallest value because when you go inside of a volume you're getting negative values outside are positive so we want to find the smallest negative value and whichever volume that comes from that's the volume that that's the piece that we're interested in so to do that we need to start then we need to figure out how many primitives are we dealing with so let's just say numb fall and we can just do in primitives and this is just asking how many primitives are in this this second stream here and that's going to be 30 you can see that here we have 30 permits one primitive for each volume now we're just gonna loop over those I'm step out for int let's call it V for volume volume equals zero be less than ball B plus plus we're gonna want to sample those volumes now we know that these volumes are coming in and they're numbered there named piece 0 through 2 piece 29 so however many volumes there are there's that many sort of piece that number so we have these indices V so we can just reconstruct that name and so let's just say string ball name we're gonna use s printf and this is going to be piece percent D which is a placeholder for an integer and then C so this is the name of the volume that we're gonna be looking up here now the let's call it depth maybe now the depth inside this volume we can get with volume the sample we're gonna go from geometry straight to our sorry 1 which is input 2 and we're going to look at all name and we want to check the position at that point so this is gonna tell us for each sort of volume what's the depth inside of that volume now what we really want to do is keep track of the best of these values so let's go here and define a couple more variables let's say float min depth and let's just set this to some really high value so we know that it's gonna have to sort of go lower and we're also gonna keep track of the primitive that it came from so let's go and we'll just call this index and we'll start it as negative 1 so now what we want to do is say yeah the depth we just measured from this volume is less than arm in depth and let's update those two values we'll same in depth now equals this depth so that's our new best value and our index is just B in fact let me go ahead and instead of this I'm gonna use a straight go straight piece and we'll just start with none and if we do find it then we'll just set it instead of Divi we'll set up the ball name so now we'll just have the piece name I think that's gonna be more useful okay so now once we've gone through this whole thing whatever comes out at the end as being them in depth of the piece well that's sort of the piece is gonna be the closest volume because it's gonna be the one that has the minimum depth then depth is going to be the minimum depth that we were able to find so we can just set those those attributes so we're going to go at depth equals depth and specify a string name equals piece so now if we look at our point geometry we'll see we have names and they should range from 29 down to zero and we have these depth values and they range from a little basically zero all the way down to negative 0.18 and if we were to just visualize this so we could drop a color here and we can just do a random form attribute and throw down name you'll see we've been basically our nice fractured pieces here and if we were to just look at our foreign eye fracture these should line up quite nicely so there we go so we were covered for each of these which piece it's from and to understand what we're getting from depth and actually to help us to sort of pick some values we're gonna need later I'm actually gonna set up a slightly different visualizer here I'm just gonna drop down a grid and let's put it in X Y and we're gonna make it the same size as the box so it should be one by one and it should be at five so one by one up at five and let's give this lots of resolution and what I'm gonna do is I'm just going to pipe this through here instead and if we were to just visualize these pieces this is backwards now here we go we just visualize the pieces we get sort of that same information but what I actually want to visualize is our surface distance or our depth rather so let's get a ramp from attribute I'm gonna put depth in here by default this is zero to one that's not what we want because we already saw if we look in these points we're going from basically zero down to negative point sort of so if I throw those values in here now you can see what we're getting and this is basically what the surface density function is doing is it's giving us these values that range from zero at the surface and they get smaller and smaller as they get towards the middle so these are sort of maximum values in the interiors here now to skip forward a little bit what we're going to want to do the flip simulation is we want to have basically these seams so the regions between the phases that are between our chunks these should be fluid with low viscosity so it should be like really easy to deform it should sort of flow around a lot and as we get towards the interior we want to increase our viscosity so we want it to be thick and stiff on the interior here so we want to figure out some mapping and we want to figure out okay where do we want to start our sort of maximum viscosity and where do we want this sort of boundary and edge to be our minimum viscosity here so let's go back to our parameters and just make a couple of new parameters for that we're gonna want to values for our min depth and this is gonna be basically the boundary for our lowest viscosity and we're gonna want our next step and this will be the boundary for our maximum viscosity somewhere on the interior here and I'm just gonna go ahead and actually make these two Astro variables right now which are going to be I'm in viscosity so that's gonna be the lowest viscosity we use and Max viscosity I'll be the highest one that we use so I'm just gonna apply that I'm gonna ignore viscosity for now but let's just sort of dial in some of these depth values so let me just copy this we're just gonna throw it right into here I'm going to paste my minimum here and I will do the same here and just call it max now just to get a little bit more sort of fine grained here let me just turn this and do a little bit of like a black body type the visualization like yellow there and I really want to emphasize that sort of upper boundary so I'm gonna actually change that color entirely so now if we start to dial in here so if we go to those same values we had before there we go and you're seeing that we really don't hit that maximum very much so I'm gonna pull this down a bit and I'm starting to like that that's giving me these chunks in the middle here we want a bit lower it sort of expands a bit farther out but what we want to make sure actually is that we have a little ther amount at the lowest fix viscosity and we're gonna talk about that a little bit more later but we really want to make sure that this band of the lowest value is relatively thick so I'm gonna sort of dial this in a bit and that I think is giving me some nice sort of chunky lines here I might actually even go a little bit farther just because I know these values work nicely I'm gonna pull this back a little bit and this may seem like a lot on the middle we're losing a lot of our chunks but you'll actually see that it works reasonably well and of course you can kind of dial in different values here but I think I'm actually gonna go with this so you can see now we've got these nice thick bands that are gonna be separating our individual chunks and then we've got a little bit of a ramp that's gonna be moving from our minimum viscosity up to our maximum and then in here is gonna be sort of our maximum viscosity for like the internal really stiff parts of each chunk okay so now that we've got those parameters kind of locked down let's actually convert them into viscosities so let's drop another attribute for angle here and all I want to do is basically remap steps into those values there so let's say let's set a default viscosity so this is going to be the minimum so basically if we don't do anything else let's just say that our viscosity should be the minimum value so we're gonna want to grab that from our parameters sorry minimum viscosity let's just copy that parameter I'm going to do the funny little trick and paste it into here so that it doesn't overwrite and this is a float so we can just copy that text there so our minimum viscosity so our default viscosity is going to be that minimum and we're gonna say is the depth of this particle bless that the minimum depth we're interested in and I know that we call that min depth so we can just throw that in here so if our depth is less than that minimum so that means it it should be a different value than our minimum viscosity we're just going to fit our viscosity using depth and we're gonna fit it from our minimum to our maximum depth so let's just go Minda and next step and we're going to fit it to our main viscosity to our max viscosity so we'll grab these parameters then viscosity up to max disgusting and I'll just put closed and now what we'll find is I've done something wrong because I should not have zero so of course I should have zeros because we didn't set these parameters here we go so for a minimum we could you 0 0 is a valid viscosity that's basically like water so it's gonna flow really fluid smoothly I want something a little higher even for my minimum I'm gonna go up to 4 and for my maximum I'm gonna go right up to a million and that may seem like a really high value but if you play around with viscosity a lot you'll see that if you want it even remotely stiff you need to be getting up into the sort of ten thousand a hundred thousand if you want it to be quite stiff you need at least a million and since we only have these tiny chunks and they're gonna be subjected to a lot of sort of shearing forces and slippage even at a million you'll see we're gonna get a fair amount of deformation of these clumps so a million is just fine if we start to go much higher than this sometimes the solver is gonna choke a little bit it'll still run but it's gonna give you an error because basically it's viscosity salt isn't going to converge you're gonna have just wildly different variables it's gonna ask for more sub steps or something like that this and my experience is gonna work okay so this right here is our flip source and we're pretty much ready to get into our solver here so I'm just gonna drop this down flip source and just so we can see something what we're solving let's just throw I'll just get some color on here let's do maybe a random name coloring so we can just color back pieces and why not let's just add a little ups I don't want that I want another color no um let's just add an extra bit of color for our are sort of boundaries so let's say if depth is greater than negative zero point out two so this isn't quite the boundary we're using but in that case let's just set that maybe to black this should give us no ah okay there we go just make sure to specify that that's a point group by default it sort of thinks of it as being I guess a primitive group by default and so we just want to make sure that that's that's gonna be a point group now one last thing this is actually reminding me of what you can see here on the bottom and on the top and actually if we go over to this grid visualizer again we've got this band on the outside that's gonna be all low viscosity and that makes sense because we're basically taking depth and sort of the outer surface of our of our bore no fracture here is going to be kind of the surface it's gonna be zero for each of our pieces and you know that's that's okay but it basically means we've got all of our pieces and they're kind of enmeshed in this big block of low viscosity what I really want is actually for the outer pieces to come right to the edge and sort of be fully dense fully viscous right at the edge and to only have this low viscosity kind of for the interior seams so to do that I'm just gonna go right back here before the fracture and I'm gonna drop another transform and I'm still gonna scatter on the original size geometry so our fractured pieces are gonna be identical all I'm gonna do by scaling is basically make it so that these sort of outer pieces are a little bit bigger they're all gonna extend farther and that means when we generate the volumes because we're still only gonna be generated our points on the inner one as well when we check our volumes they're all gonna be sort of really far into the inside so let's just drop a transform in here I'm just gonna not let that update on this transform we're gonna do a scale but this thing is sort of above the origin here so if I just drop the scale now it's gonna kind of move from where it was so we want to make sure to move our pivot and we're just gonna move our pivot to the centroid of the geometry that we're passing into this transform so we'll just use dollar c XC ey and c easy so that means that our transform is going to be relative to the middle of this object so now we could just sort of bump this up make it a whole lot bigger and we have the same fractures but what we're doing is we're basically just sort of giving these outer pieces we're making them much much bigger so now if we just go through and look at this little visualizer there we go now our outer pieces are coming right to the edge here and our sort of seams in the middle are sort of intervening sort of black low viscosity stuff is really just it's not coming to the edges it's not giving us that whole boundary it's just going on the inside between each of these pieces and that's more of what I want so if I go back to our flip source there we go now our pieces are coming right to the edge we only have this sort of these seams in between they're great okay so this is what we're gonna pass into flip and just before we do that I'm gonna give this something to collide against I know if we just drop it on the ground it's not gonna be quite as interesting so let's just make something some small simple thing for this to collide against and I'm just gonna use a little box here let's just get a small box and we'll move it sort of up somewhere sitting about there maybe I'll make it a bit lower let's try two point five there we go sort of halfway down it's gonna run into this little box and that'll just give it something to collide against so let's just drop a null I can call this collision Geo and then I'm going to do another B TV from polygons I'm gonna go ahead and grab our particle separation just use that for the resolution and I'll drop another null and just call this collision volume so in general for flip sims it's good to use volumes for your collisions actually volumes tend to be nice for a lot of your collisions for pyro for flip so you know for a box it was gonna work pretty well regardless but we might as well just go ahead and and use that volume so let's dive into Dobbs we'll drop a top Network and jump inside and we're gonna need a few things we're gonna need a static object that'll be a Collider we're gonna need to merge that with the rest of what's going on we're gonna want some gravity otherwise it won't do anything oops that's added the merge we're gonna want a flip solver and of course a flip object object there we go and we're actually not gonna add anything else to this so this is a really nice simple network here so we'll start with our Collider let's just grab what we can sort of look at so that'll be our geometry it's not deforming so we don't have to worry about any of that we do want to change these collisions so we're going to use volume collisions and our mode is going to be a volume sample and if we scroll down here we have our proxy volume and this is we're gonna bring where we're going to bring in that collision volume we made so that'll give us our Collider here if we visualize that you can see we've got our nice little collider volume so that all looks good now we want to set up our flip object and we're gonna want to change this particle scale so let's just go back to our parameters again grab this dive back inside update that great and then of course this is just its default geometry here so let's go down into our initial data our input type is going to be a particle field because we basically generated all the particles we want and the path to that field is just this flip source that we made so whoo ring that in here you'll see it disappears there because it should be up here we're gonna take care of this wonky viewport stuff in a second but first I just want to do a couple more things here I'm gonna go ahead and change this particle visualization I don't like the sprites I just like to see my particles and I actually don't even want to visualize speed or anything I don't need that I'm just gonna keep the color that I piped in originally so I'm going to turn this visualization off just look at the particles and that's basically what I want to see the last thing I'll do in here is actually turn on closed boundaries and the only one we're really gonna use is sort of the negative Y one and we're gonna use this as a ground so instead of a ground plane we're just going to use our volume limits and that just gives us some free collision so closed boundaries just means that the simulation will collide with the boundaries if they're open then when the simulation hits the boundary the particles just disappear there they're killed they're removed from the elation when it's closed they collide with the simulation so we're gonna use our negative why us as our ground so let's come over to the flip solver let's just deal with that volume first so we'll go to volume limits here they're at the volume ocean tab and this box size I don't really care about the X and the Lizzy there yeah it's never gonna hit those limits anyway and we don't really want to colliding with walls in sort of the horizontal directions we really just care about Y and again we don't even care about how tall that is it's gonna resize its field it's not gonna try to calculate this whole volume so what we really just need to do is bring up the floor so if we move this up by half of its height that means the bottom of our box here is gonna be sitting on the ground and that will give us a ground plane now part of why the viewport is weird is because essentially we're interacting with this volume so instead of grabbing this our flip simulation we're grabbing the whole volume we can get rid of that by just turning off this visualize limits now I can grab my flip sum and it will actually behave nicely so I'll just turn that off now that we have that set up pretty much the only other thing we need to do here is go to viscosity enable it and enable it by attribute so if you just enable it then you can go over to your flip object and under physical you can set up as Kosti value here we want it to change across these different pieces so we want viscosity by attribute we're gonna keep mixes copy this basically just says we're not gonna sort of remember what the viscosity was in the last frame we're just gonna update our grid every time keep viscosity scale is one and the last thing we want is to actually turn on slip-on collision if we don't have this on then basically this stuff because it's such high viscosity it's gonna stick to everything and it's gonna do some kind of funny things on this surface too but it's basically just gonna climb up and not really move around much so I'm even gonna bump up this slip scale a bit just to make sure that it can it can really move around relatively freely now I do want to take just a moment to talk about what viscosity is doing here I hope you understand in particular why we want these relatively thick bands in between these chunks so you'll notice our viscosity information is under a volume motion so this is a volume property if you don't know much about flip and I don't want to claim to be an expert here but basically what flip is doing is it's trading back and forth between a particle representation and a grid representation or a voxel of volume representation and this is handy for particular types of Sol's like pressure that aren't really very easy to solve at the particle scale but make a lot more sense on the voxel scale you have individuals sort of finite discrete compartments and you can really solve things like pressure projection in a grid format that you can't do easily on a particle format so every step through this solver what happens is all these particle values if they have individual values of their position their velocity their viscosity their density all of that gets projected onto a grid a bunch of solvers operate on the grid and then that information is copied back on to the particles and they're allowed to sort of it back to the move and it recedes if there isn't enough density and so on and so forth viscosity is being calculated on the grid it's a volume property this isn't really a particle property this is a volume property it's stored on the particles but it's solved on the grid and this is important because if we look at our flip object our default grid scale here this is saying how coarse is the grid representation relative to the particles that our representation the grid is by default a fair bit coarser and that speeds things up that makes RAM cheaper that makes all these sort of volume solvers faster and so it's kind of nice to keep this high a lot of people will bring it down to make things sort of better it'll make the solver essentially more accurate and more precise but it'll be faster if you leave this up and what that means is that when we're copying things over if we just have a really thin vant band of low viscosity and it's surrounded by really really high viscosity on either side when we translate that to this coarser grid we're basically just gonna lose the low viscosity and what viscosity is fundamentally doing is saying keep track of the relative positions of the geometry of the particles of the fluid and don't let it change very much it's basically resisting deformation so if you have really high viscosity surrounding a tiny band of low viscosity the low viscosity is just gonna lose everything is going to be treated the whole grid is going to update essentially as though it's all high viscosity so we need to have a relatively thick band here and this is also why I do the little ramp from the low viscosity to the high viscosity we want to make sure there's enough representation coming in from the low viscosity that it actually gets solved at that sort of that grid step so let's take a look at what we've got we can just go ahead and start this running and we can see that this is working pretty nicely actually so I'll just stop that for a second so you can see down here we've had this whole piece fall off entirely you can see these other chunks they're kind of splitting apart at the seams it's all sort of hitting and coming apart but it's still sort of sticky and gooey and we're getting this nice kind of fluid sort of mess coming through here so if we bring this back out here I'm gonna go ahead and on the object just used our flip star basically what I'm saying is give me the flip object not this static object so we're gonna get rid of that Collider I know you can't see it in here anyway but if I sort of skip back here now you can see the collider is gone if I grab everything we get the collider as well so I just want my flip information and that's just gonna be my particles here and you know you could you could play around with a bunch of these values you could change things a little bit but for current purposes I think this is looking pretty good and you know of course I cheated I already have these values dialed in before we started but you know this is looking pretty good to me but of course you can change this as you like so we've got all these nice pieces coming apart we've got this good spreading here but we've also got our individual chunks are really obviously staying together so with this in mind let's talk a little bit about shading how you might approach that in this and I'm not gonna dive too much into sort of our-our mantra' shaders and our settings there but I do want to talk about this a little bit because there's some aspects of fluid shading that can be a little bit tricky so if we go ahead and drop down a particle fluid surface this is obviously gonna be very coarse to begin with so let's just go up and grab again our particle separation put that in here it's gonna take a little bit longer but still not very long so we get this surface here and this is alright we can do a couple things to tweak this in my experience I like to actually bring my influence scale up a little bit sometimes even up to sort of four that's just sort of how close is it looking for things that'll smooth things out a little bit I also like to turn this limit refinement what's the limit refinement iterations to zero which basically says it's not doing any refinement and that doesn't sound good but the reason is the refinement is part of why you get sort of popping with your flip meshes so when you have sort of rapidly changing the flip and you get sort of weird sort of jitters and popping some of that is because each individual time it generates the mesh it does this refinement step and that ends up introducing sort of different artifacts so it's not quite as smooth when you don't have refinement on but you do get I find a slightly more stable mesh from frame to frame other things if you especially if you do limit refinement you can go to filtering and maybe turn on some of these smooth I like the laplacian one that will again smooth out some of those details a bit and you're also potentially if you're rendering at mantra surface polygon soup is good if you're rendering anywhere else you probably want this to be surface polygons so you might as well just toggle that so this is looking all right one more thing I'm gonna do it makes it a little bit more expensive it'll be more geometry heavy um you can see right now this adaptivity that's at point zero zero five by default which is still relatively low but what this is saying is sort of how different can the polygon sizes be so if I really crank this up you can see it's gonna try to find regions that it can Pat out with much larger polygons we're gonna get much lighter geometry this way the problem with that is that if we try to put you v's on here some of them are gonna be really widely spaced some of them are gonna be really sort of finely spaced I like to keep this relatively low and even all the way down at zero potentially this just gives me a nice even sampling of points here it means my UVs are gonna be nice and easy evenly sampled now when it comes to this particular simulation there's actually a lot of properties we can potentially work with so if we just think in particle terms for a minute each of these particles has a lot of different values or a lot of different variables one of them we can maybe think about is where is it in the original geometry in the initial geometry so is it a surface point or is it an interior point for the entire hole initial box so that's one piece of information we might want it's a darker on the outside lighter on the inside there's a lot of things we could do there so we can try to get some of that information in here um we know it's individual piece numbers so we could give sort of different values like we have here in this very sort of basic visualization we could give different shader properties to the pieces versus sort of the the sticky stuff in the middle here we also know the depth within the pieces so maybe we want to shade sort of like too dark or something give give a ramp for outside of pieces to inside at pieces instead of the entire box those are properties we have but no matter how much we do of that we do and we're still we're gonna get some sort of nice effects if we start to put some of that through here we're still stuck with the fact that this is gonna look kind of bland our basic sort of particle fluid surface is always going to be relatively smooth relatively planned unless you've like really cranked up your your particle resolution and that's gonna be a really expensive simulation I don't have a supercomputer to run this on if you do awesome but this sort of surface is always going to end up a little bit bland and one of the most obvious ways to fix this is to put something like a bump map or displacement on it but for that we need movies we need some way to get a smoothly a nice set of views on here and the first way you might think about this as well let's just Nuvi our original positions and then we can just sort of transfer those and propagate them all through so let's go ahead and take a look at what that would look like I'm gonna go ahead and do that really early on and I'm gonna do one extra thing here as well I'm gonna get that distance from the surface and so let's just do a BTB from polygons again I'll make it sort of a nice and high resolution and we're just gonna do a very simple volume sample here and I'm gonna call this something like let's just say main depth surface happy and so this is just gonna give us a value right at the beginning how deep within this overall box is it so not how deep within each piece but how deep within the entire bounding geometry the other thing I'm gonna do here and maybe I'll just do let's just call this rest info the other thing I'll do in this node is just say be at I'm gonna call this any pause for initial position is our current position so this is a no UV but we can use it to map UV and in general it's easier to sort of propagate your your rest position which has sort of maximal information and later make your UV mapping then to map your UV at the beginning because if you change your mind well there's nothing you can do about it later but if you have the positions you can always reconstruct and remap your movies so let's just pass that information through and now if we jump inside of our dotnet on our flip solver by default and I recommend it for this because we're gonna have these like sticky tendrils coming out um you're gonna want to have receding on and in fact especially for viscous simulations a lot of folks will recommend bumping up these values potentially quite a lot like up to four eight sixteen really changed this bandwidth even up to two three four this will give you lots and lots of extra particles it can give you really nice looks especially when you have thin tendrils I'm not gonna do that right now because it does slow things down but if you're doing like a final sim I would probably recommend boosting these at least a little bit and that'll get you lots of extra particles but what reseeding is doing is Saylor is asking where do I not have enough particles lets out a new one and when we add a new one well where does it now use where do its values come from by default it can just take the nearest particle that's what it'll give you for sort of most attributes but we can also specify some attributes we want it to interpolate and what we mean by that is it'll just look at nearby particles and it'll try to find like a weighted average of those particles for those values so we just made our main depth and our any pose so our rest position so let's put those into the interpolate and that'll just give us a slightly smoother sampling of those values so I'll go any pose and main depth so if we pipe those through now our receded particles will have those sort of averaged and I'm just gonna sort of come over here and make it just look at some oh boy what did I just drop okay let's just drop say a collar let's just look at our particles here so if we run this through let's just let it drop a little bit so it starts to come apart now we have some new values that we can work with so we could use main depth so we could do a really simple ramp for example so we could ramp from main depth and this ranges from I don't know what this ranges from presumably zero to I did something foolish here you'll remember for our pieces we ticked on this fill interior because we want our depth to basically make it all the way to the middle I forgot to do that here that means our minimum depth is just gonna be three interior bands time this voxel size so our minimum depth is negative 0.03 I want to fill this interior so let's just go back here run this forward again okay and now if we look at our main depth that ranges down to negative 0.5 so if we put that in here now we're getting kind of a nice effect whereas it sort of reprimand so that's kind of fun so that's the sort of thing we can look at but we were talking about UVs so let's take a look at this any pose valuable if we go into our particle fluid surface here what we can do when we create the surface is transfer attributes from the particles so let's transfer our initial position and I'm gonna drop out or tissa T and we don't need that for anything at this point so if I've done that I now have my initial positions here and what I'm gonna do with those is something really kind of basic here but good enough for present purposes I'm gonna say my U V is going to be my any pose and if we do this I'm gonna do I'm gonna kind of fake UV just so we can look at things in the viewport here so you'll you'll see why I'm doing this in a minute instead of just doing like a UV quick shade or something I'm going to do it on a sort of particle by part by point basis just so that we don't have to go into rendering over and over again but basically bear with me for a minute here let's just specify a file name make that a stream channel create that so that'll put that down here what we can then do is go into our parameters select that file name we made and set our type you know string is fine it's true but we have these nice things like files here which is what we actually want and I want an image so let's grab an image here apply accept and then I'm gonna go ahead and just pick something from maybe Houdini's own sort of images so let's just go to Houdini pick a texture everybody's got this and maybe I'll grab bricks so now what we can do is we say the color of our point we're gonna use color map and this will basically look up file and we pass it a UV and it just finds the color there so if I do this you can see our you've either mapped on this side they're they're really blurry because we don't have a lot of points here but we've got our keys on this side I don't like this very much if I'm just being really sort of cheap and boring with my UVs what I'll do is just say my first two you v's let's just add my second UV because we're not actually going to read from sorry at the third UV we're not going to read from our Zed so basically I want to say depending on where I am in depth let's offset these first ones and this just gives us like a diagonal mapping of the texture along the other faces but it means that everywhere in depth we have a UV value and because we're dealing with particles and they're spread out in depth and we've mapped them from the rest position we kind of need you v's everywhere in depth so I find this is sort of a straightforward way of doing that now if we move forward here you'll see pretty quickly and let me let's just move our simulation forward a bit farther okay so if we get to say this point and we generate our surface and we put our textures on here you can see it's become kind of just already a distorted mess like this looks bad we can maybe try to improve this if we threw down like a subdivide we can get a few more points on here we can operate point density and that fixes a little bit but still this is kind of a mess so if we're just going on the basis for our original you v's very quickly it's gonna turn into a bit of a nightmare and if you're trying to use this for bump mapping or displacements it's it's just not gonna look very good it's gonna start to get way too distorted so the fundamental thing that we're fighting against when we are trying to UV fluid simulations is this distortion is the fact that the original rest position a particle to particles that are nearby can end up really far apart and so they used to have closed by UV haze but by later on they have really distant you.these and it just makes the whole thing turn into a bit of a chaotic mess so if that approach doesn't work well what can we do instead well you'll notice on this particle fluid in our surface node we have these two defaults rest and rest too and you may have always wondered what are those doing there I don't even see them in my attributes here and the reason is you have to enable those but these two rests positions are actually sort of positions and they define or they let us do what we call a dual rest projection so for things first let's head on inside to adopts and let's enable this so let's go back at the beginning here I don't want to be in there because it's slower okay so let's just go back inside and you'll see on our particles here way at the end we have rest and we can just say addressed attribute and by default it's going to do dual rest attributes so what do arrests is basically doing is it's gonna keep track of two versions of a points arrest position and these aren't the original rest positions and said they get updated to regular interval intervals so this frame is between reset is sort of how long how many frames do you go before you reset these rest positions and the reason we have two of them is because we reset them in a staggered way so rest position one will update a fifty rest position two will update halfway through it'll update a twenty five and so what we're doing is we're basically getting new rest positions regularly throughout the simulation and the reason we do this is because as I was saying before nearby points at the beginning might end up really far apart but if we reset their rest positions then if they're close together then they're close together if they're far apart they're far apart so we're basically trying to sort of get rid of every 50 frames or so we're getting rid of that kind of distortion and we're just reprojected our UVs now the problem with this and the reason we need two of these and the reason they're offset is because if we just went to 50 and then reset our UVs we would have this big dramatic popping in what we looked at as soon as we hit frame 50 we're suddenly resetting where all of our rest positions are we're gonna reset our UVs it's gonna look awful it's gonna be very very obvious what we do instead is we have these offsets so rest one updates of 50 rest two updates at 25 when rest one is updating we only show UV is based on reps two when rest two is updating we only show you these based on rest want in between we blend between the two so what we're doing is we're constantly basically resetting one UV in the background while we're using the other and then we blend gradually towards the new one while we reset the other one and then we blend gradually towards it while we reset and we keep resetting basically while being a masked by the other rest position what this means is that our UVs are constantly sort of smooth they're constantly sort of nearby they're limited in their distortion because we only have 50 frames worth of motion before they're ending up sort of drifted apart and there's food constantly blending in between each other now this still isn't gonna work that well for really dramatic textures so if we use those bricks for example it's got a lot of high contrast edges you're gonna see the blend but if you're doing something like nice high frequency noise like bump mapping this is actually gonna work pretty well now I'm going to go ahead and actually drop this value down a little bit so we can see it more easily this is something you kind of need to dial in based on the speed of your simulation the scale of your simulation of the textures you're using but I'm just gonna drop this down so we can actually take a look so let's just drop that to 30 so now if we run this for a little bit okay so we've gone through here and the first thing you'll notice we look at our geometry we now have rest and rest too so these variables now exist the next thing you'll notice so I went up to sort of 30 hour sorry 60 frames so our reset was in periods of 30 so we basically had sort of two to two resets worth these particles I don't think I put IDs on them so for reseeding we're gonna see some other changes here but if we look at our rest positions you can see that as we move our initial rest is not changing until we hit 30 and then actually it's waiting till about 32 for some reason but basically it's not changing until around 30 then we're getting an update here but you'll see that this one rest too doesn't change when that one updates and so now this one is static until we hit probably about 45 and now rest two updates well rest one stays the same so as we move through basically every 15 frames one or the other of them is going to sort of update and they're gonna toggle back and forth so what we want to do is basically blend between these resting positions on the basis of where we are in these frames now in theory there supposed to be a detail attribute that tells us the ratio between these rest scales I've never found it it doesn't seem to exist as far as I can tell so we're gonna have to compute that ourselves but that's no big deal because we know what our sort of spacing is so we can just generate our own rest blend here so let's go ahead and do that first and drop an attribute wrangle we're gonna start and we're gonna do this on particles but then we'll transfer it over to our particle fluid surface it's just we don't have to wait for this to keep updating so let's do this on particles and in fact I'll go ahead and grab this color that we had so there we go we can map our bricks onto here and of course it doesn't look like anything because we've gone all the way forward to sort of frame 50 but if we come up here you can sort of roughly see this brick information okay so let's take a look at these rest positions we want a rest ratio and this is basically going to be defining where are we between rest 1 and rest 2 and we want this to sort of smoothly vary from 0 to 1 to 0 to 1 to 0 to 1 in a regular period and so the best kind of function to use for that is going to be a nice periodic function our options of course are a sine and cosine sine starts at 0 cosine starts at 1 I am going to use cosine and the reason is we want it to be at sort of the peak of one of its things when we start so if we're using coasts it's gonna give us a value between negative 1 and 1 we want to play between 0 & 1 so let's just say fit coasts and we haven't put anything in there yet but it's gonna go from negative 1 to 1 we'll remap that from 0 to 1 okay so what goes in here well we want to know where our frame is in these sort of 30 frame intervals so we want something like frame over 30 that's gonna give us sort of where are we in our 30 frame intervals this isn't going to be quite enough though because Coast expects radians so let's just multiply this by 2 times I so if we throw this through we'll get a rest ratio and this ratio where are we here you'll see at the beginning it's gonna be basically 1 once we hit 30 and you'll remember 30 is basically where our first rest is being upset so at this point we want to be using rest to predominantly and so sure enough our rest ratio is nice and high here as we get towards 45 our restoration goes to zero and this is where we're updating 2 so we want to be using one so this is perfect so when we're updating to our rest ratio is zero so that's gonna be towards rest 1 and when we're updating oops I'm going to simulate a little bit more there we go when we're updating rest position 1 our rest ratio is up near what so we're gonna be updating we're gonna be sort of using predominantly 2 so we're gonna use this rest ratio to blend between our two rest positions now there's two ways you might think about doing this I'll start with the wrong one because it was the first one that I thought I was supposed to do and it took me of it to sort of sort out what I was doing wrong so we'll say you v1 is going to be just rest and you v2 is going to be rest too and I'll do that same sort of funny movie mapping I did here so let's just do that for both of these these and then what we can do is say our overall UV is going to be a linear interpolation between UV 1 and UV 2 based on rest ratio now what we can do is use this UV to do our color lookup here so let me just even make this attribute we can go down here and just bring that in instead so if we do this we should be getting a kind of blending between our two UVs but you'll see that this does not look particularly good and we can kind of highlight this if we go over and look at our particle fluid surface instead so let's just pipe this through so now if we look around 28 and then get to 30 we're seeing kind of this weird flickering it's almost worse than it was before so this is definitely not smoothly interpolating the way that we want and the reason is we don't actually want to be interpolating the UVs what we want to do is use each UV to look up our texture and then interpolate those textures so what I'm gonna do here instead is say UV one let's just turn these into attributes you do two and then down here what I'll do is I'm gonna look up color from my first UV and I'm gonna look up a color for my second UV and I'm going to interpolate those colors to using again that rest ratio value you know if we do this we're gonna probably need to get this subdivide back in here to make it look like anything so let me just throw that back in here you've got some more points on there if we do this you can start to see it's still pretty just disoriented here we're right in the middle of the two though and you can see that we have this kind of overlay to the parents here so we have sort of one high contrast value or sort of two sort of low contrast textures and if I go to sort of just around 30 it's a lot more sort of high contrast we just have the one value and if I go up to sort of just after 60 again it's gonna be that that same amount what we're doing is we're sort of transitioning between these two textures but you can see that right here even way up at 60 we have a lot more sort of regularity and how this stuff is distributed it's still pretty sort of fine-grained down in these areas it's still getting broken up quite a lot because this is a pretty disrupted simulation but you can see we actually have a lot of fairly clean you've ease in here so even later on we're still getting this and this isn't gonna sort of playback smoothly because it has to do all of its meshing him things but if you were to watch this you would see that it basically transitions fairly smoothly every 30 frames from one sort of view set to the other and it blends back and forth between the two now this brick texture is pretty high contrast so you're still gonna notice a little bit of that fade it's not quite as bad as a popping but you will still notice the fading here but if this was something like a sort of rough bump map if we used instead of say our brick space color maybe we use our dirt maybe our dirt roughness for example this is already a fairly broken up texture you're never really going to notice those transitions so in this way you're always going to get some nice smoothly changing and flowing with your geometry information coming through here now the last thing you might want to do to get this looking even better here right now what we're doing when we do this attribute transfer here is we're basically sort of checking nearby points and this attribute greatest radius here is actually in sort of voxels I believe multi-armed particle separations are there so not the voxels themselves but the particle separation so this is a relatively small value and so what it's doing is it's only looking at points within I guess it's gonna be a bit basically 0.06 of the particle on the surface so it's gonna generate this surface and then it's just gonna sort of bring its particle or its attributes in so ve rest rest - and any post it's gonna bring these attributes in just from those nearby points and it's only gonna check ten of them so right now some of the break-up that we're still getting down here is coming through because this just is not enough and in general when you're doing especially for this sort of rest blending but honestly I find for almost any attribute I'm trying to bring back to my to my fluid surface you really want to bump up these values a lot so I'm gonna take this one probably up even to eight so I'm gonna look like a lot of particles nearby I've so got subdivide here I'm just gonna start with this so I'm gonna look at a lot of the nearby particles and I'm gonna sample just tons of them I'm gonna bump this just way up I also maybe want some of my other properties on here so I want my main depth and my depth there we go let's get everything going through there so if we resample all of that stuff subdivide on here just take it a second now when we do our mapping it should be a little bit smoother and you might be able to see that yeah I think you can even see that down in these areas here compared to what it was before I wonder if I can do a side-by-side easily not very it's it's gonna sort of lose track of what the previous frame was if I try to do a side-by-side but hopefully you can see that this actually kind of smoothed it out a lot of these properties here and if you ramp this up even more we can even go to let me just I'm gonna switch out to manual so I can update a couple things let's even sort of bump this up quite a lot this is probably more than I normally would but just to show hopefully once it's updated here you can see even in these areas down here where it was pretty messed up we're starting to get some nice continuous lines here so if you really crank up some of this smoothing in particular for the attribute transfer then you really start to get all those major benefits from this sort of dual UV blend here and even if we went back to say those high contrast bricks we had before let me just pull that in again even see we're actually getting some really nice sort of texturing down here so a lot of that breakup we were seeing before it was really just coming through from not sampling widely enough and not smoothing enough so if you really do smooth out your UVs you can actually get quite nice mapping of these fluids and again this is going on throughout the simulation so if I come back to say some earlier frame here pretty much no matter where I go it's gonna be moving smoothly through here but it's gonna be updated so here you can see how it's blending between the two so you can see the overlay but this overlay is gonna be blending smoothly so if we didn't have these really high contrast lines you probably wouldn't notice that much at all so this has a pretty nice look now obviously if you're actually shading this if you were really rendering this you don't want to be storing this information on the points so you don't want to be just like computing your point colors and passing out into the shader and calling it a day because I mean first of all we have to do the subdivide step which gets expensive and we're going from an already pretty I mean that's not super heavy only sort of a hundred thousand points once we subdivide we're up to one and a half million points though so we're really taking kind of a modest geometry and turning it into a relatively heavy one and so if we start with a heavy geometry this is just going to be way too many points so we don't want to do that stuff but you can see we need it if we're gonna try to do that point coloring at all but what the shader is gonna do is it's just gonna look if we go back to our wire shaded here and just take those colors off its gonna look at you views on these vertices and that's it's gonna interpolate the colors in the middle on its own so what I'm showing here isn't how you should do it you want to set this up in the shader you basically want to look up your texture using each of these two UVs and then interpolate inside the shader from those two texture calls I don't really want to get into the mantra' shaders and how to set that up I usually render in redshift so it's a little bit easier to do material blending there so I don't want to turn this into a shader tutorial so basically if you were actually gonna render this what you need to do with this dual rest is inside your shader you need to look up your texture twice once for each UV and then you need to blend it using this rest ratio so I would just go from this step I would do a quick transfer and I would hope that's not what I want I would do a quick to actually promote and I would just take my UV 1 and UV 2 and I would transfer those from points to vertices and so this would be the geometry I would pass out to my shader and you can see on each vertices we have UV 1 + UV 2 and you could even I suppose we should probably transfer our rest what do we call it rest rest blend rest ratio rest ratio you can transfer it out as well and so now in the shader you can basically look up for each vertex you can do your 2 different texture reads and blend those based on your rest ratio and that's how you would get your final shader there you know the last thing I'd like to do is actually just show one quick variant on on this setup that can give you a similar look but some extra sort of features extra properties that you might prefer so let me just go back to our particle view here if we're dealing with our sort of particles here I guess yeah this is their depth the visualization again as you watch this through these pieces sort of come apart they glom together they really sort of still stick a lot and this can be a really kind of interesting lock in if this is what you're going for then this can work really nicely for certain effects but potentially you want sort of some of the fluid aspects but you still want the actual destruction simulation to be more like a regular rigidbody simulation so the other version I'm going to show you really quickly and it's actually in many ways a lot easier than this one is just a way to have it a little bit more controlled and so instead of doing everything inside of flipped what we're gonna do is we're gonna basically gonna make a driving simulation using a regular rigidbody simulation and we're just gonna drive flip using that and so we'll get kind of a different effect but sort of a similar type of effect so let's just quickly look at how we would do that what I'm gonna do I'm gonna go back to frame 1 here come back out to my objects and we're gonna view a whole lot of the same stuff here so I'm just gonna go ahead and go to manual whenever you're copying something large it's good to set your update to manual you don't it'll get really sort of confused if you try to do it otherwise so I'm just gonna copy and paste this whole thing and let's call this flip fracture RBD and we're gonna dive inside and we're gonna sort of change some of these steps here I'm gonna keep this same collision but I don't need actually no I'm gonna keep this and I'm going to go ahead and what we really want to do now is take this geometry here and let's see okay yeah we want to do this in a couple different ways okay so I'm going to take this morning fracture I want to use these same scatter points but I don't want to use this scaled version cuz you'll remember the reason we scaled this was just to get the pieces copied over on these points here so I don't want the scaled version for my simulation I want to bring in that regular one so let's just start with this fractured geometry I'll go back to auto update I don't know why it's still trying to go through everything oh yes I do okay let's just turn this off so it's not trying to show that the background and just working this sum so here's our fractured geometry and we're just going to do a very standard sort of workflow for a rigid body simulation and in fact for this I'm not even gonna glue it together I'm just gonna let it fall I'm not even gonna do any constraints I just want to show you the workflow so let's just quickly assemble this we're gonna create pack geometry it's already got names so we don't need to do that so here we go we've got our points and they've got their names that's all good I'll drop a null here and call this our B D G oh yeah there we go so now let's draw a dot Network and we're just gonna do a very basic RVD sim I'm going to put a ground plane I'm going to grab a static object emerge gravity we're gonna want our rigidbody solver and an RVD packed object let's just wire all this together static gravity like to solve our through there and our packet object through here ground plates fine static object is just going to be that collision Geo we had we don't really want to use the volume version will use this geometry what you can do though under collisions by default it's going to use a convex hull but this is a box so we can actually just use a box that'll give it a very nice clean geometry so you can see it's just a perfect box there so we'll do that for there and then we'll just bring in our geometry that's this and if we go ahead and run this simplest simulation in the world there we go falls apart so what we're gonna do is we're gonna use this destruction to drive our flip simulation so let's take a look at that what we're gonna want to do now is basically take all of this initial information from these points it's gonna take it a second to go through this volume update so here we have all of our points and they each have an Associated piece because we already set that up we didn't actually use it very much except for visualization last time in this version we're gonna need this information quite a lot so we have these names we have the depth within the piece and we have their sort of initial position and overall main jobs but really we just care about the name and the depth here and what we're gonna do before we made one whole flute flip simulation and we basically said these guys are viscous and these guys are not viscous now what we want to do is say these guys in the interior they're gonna be following our rigid body simulation they're gonna be copying the information from this simulation and then the stuff in between is just gonna sort of follow along so we're gonna have basically on updated fluid in here that's just gonna follow a normal sort of fluid simulation ways and then the stuff in the middle we're actually gonna update using this our video sim data so to do that we're gonna go ahead and come into here here we've got our we're calculating our minimum depth and pieces so that's fine we want to keep that but then instead of setting viscosity what we're gonna do instead here and we can just recycle most of this I'm gonna say if the depth is less than that minimum depth and in fact I think that's probably not even quite what I want I think I want it to be probably somewhere in the middle here so let's say our transition depth maybe we'll even go right down to the maximum depth so we're just going to keep these blue parts so everything else is gonna follow along just the blue parts we're gonna have actually launched to the RVD so we're gonna go if it's less than our max depth so if our depth is less than max 10 let's just give this some attribute let's say I act following equals 1 and this is just going to tell us that this particular point should be following along to something else and we're gonna pass that extra data the other thing I'm going to want then I'll just throw it into this wrangle as well once we start receding we're gonna start getting new points but we're gonna be updating this geometry based on its initial points so I actually want to give these sort of uniquely identifying attributes so let's just do that here and let's just say I at and I'll just say F ID for your flip ID doesn't really matter it's just gonna be meeting up so here we're just sort of storing the particle number and it's exactly the same at the moment for these particles but once we start reseeding and losing particles these numbers won't necessarily line up so this is gonna be a way to make sure that we're checking our sort of our follow geometry in the right way okay so we can pipe the same information in here into flip but what we want to do now is have some geometry to sort of follow we want it to update and the way we can do that is by grabbing our simulation data from top so we're going to do a dot import and we're gonna grab from that Network and we're gonna grab that RVD object and what we want is just to create points to represent objects and we can use this along with transform pieces and so normally we think about transform pieces as basically saying well we're just gonna take we're gonna take like geometry like high-resolution geometry and replace that with our low resolution sim geometry but we can really put anything here it could be just about anything we want and it just needs to have this matching attribute here so what we can do is take these points and basically say first of all let's split out yeah let's split out the ones that are following so we want a point group and we want to delete non-selected it's not recognizing oh of course because it's not a group that I made that's fine so we just want that following equals zero so let's delete those one so this will just give me these chunks that should be following my individual pieces so these are the interiors of all of those chunks before and this is maybe these are actually smaller than I wanted now that I take a look at this let's see if we did Minda so now that's that's a lot more and we're still gonna have quite a few pieces on the interior here so maybe I'll use this instead so we're gonna use in-depth for this so these are the pieces that are actually going to be following and what we now want to do is basically transform these by these template points now I believe if we just piped this straight in it's probably not gonna work quite right because the name is on the points here and I think it expects it on the primitives oh actually no no it works just fine there we go so you can see now we just have our points and they're following that simulation and so what we can do now is we can take these transformed points and each of these has its original ID and that means we can take the stream within our simulation and it can look up these transform parts and say this is where I should be this is where I should be on these points so let's just draw the doll here we're gonna call this match positions and finally let's just dive into our table that our fluid simulation table that it's trying to solve let me go back to zero there we go and I'm just gonna cut off these okay so if we drop into here now what we're gonna want to do what's it angry about yes though the reason we you have to do is basically say that we don't want viscosity by attribute anymore because we're not giving him an attribute anymore so that's what it was complaining about there instead we're just gonna set that right on this physical towel and I do want a relatively high viscosity if you make it really low basically you're just gonna have following points and the rest is just gonna fall down if we give it a nice high viscosity then it's still gonna stick it's all gonna sort of long together and pull apart in a nice way so now all we have to do is basically feed in those position updates and we can do that with a really simple just a popper angle that's all we need to do so I'm gonna pipe that it to here I'm gonna go to its inputs I'm going to take the first input is myself and the second input is going to be a stop and we're just gonna point that second input to match positions so now if we look at the Wrangell what will say and we can even set a group here this group will this be following follow away following equals 1 so we're just gonna look at the points that are supposed to be following and what we're gonna do is we're gonna find the matching point from that two geometry so we'll go int let's call it match point we'll find after about we're looking at John through stream one so our second input we're looking at a point attribute and that attribute is f ID and we want to match it to our current F ID so basically we're just gonna find the matching point in our sort of transformed stream here for each of our points in the actual simulation stream so once we found that point we're just gonna grab its position so that point 1p match BT and I'm gonna grab its velocity as well point the match booty because you'll see when these points get transformed here they're actually getting velocities not on frame 1 but if I go to frame 2 you can see they have these velocities being copied over so these points aren't just getting positions they're actually getting velocity transforms as well so if I take that information in here I can basically just update this particle and that is basically all that we have to do here so now if we run this what you'll see initially it's just falling because this is basically on the same time scale nothing has really changed here you are seeing a little bit sort of it's kind of it's kind of sucking in a little bit here although not too much and I think a lot of this is receding is what we're seeing here so you see as they start to come down once they fracture now you see these pieces actually pulling apart and you can see that they're dragging some of this other fluid behind them now a lot of the reason they're dragging this colored fluid is because they're actually doing some receding but these receded particles aren't sort of keeping those same point match attributes and the color is also getting sort of interpolated here but you can see as we fall apart those internal fluids are actually sort of drawing apart these individual tendrils here so this gives kind of an interesting look now what I don't like is it still seems to be falling a little bit too quickly and a little bit too much and you can see that there's some of these pieces here that aren't getting sort of anything being stuck to them some of this is because we just don't really have enough particle resolution here so that's one thing we can try to update the other reason and sort of the major reason though is that at a natural speed these individual RVD pieces over here in our RV DSM they're just moving too quickly so if we're expecting our points to catch up with this and not just sort of move with it but actually sort of drag along their neighbors we really need to slow this down quite a lot so the way that this works best in my experience here what you could do is retain this and then just really I am pure your sub steps on your flip simulation but I figure if you're good to do all the extra calculation on those sub steps you might as well just have it available to look at as well you might as well just slow the whole thing down as long as you've got the cache space it's sort of hey why not store a nice slow-mo version and you can speed it up if you need to as opposed to just storing out sort of a subset version so instead of upping the sub steps here what I'm going to do is just slow down my base simulation so we can go to simulation here and we can just use scale time so let's go to say a quarter time so we watch this now we get a nice slow simulation here and it fractures much more slowly these pieces are moving apart at a much more sort of slow pace so if I use this and we go back to our flips then it's going to take it a second to run through here now we see right away that we don't actually want the forces that we're putting on here that's sort of a mistake on my part I think these forces on gravity here are basically and this this is why you maybe you would consider substa what we can fix it on our own these forces on gravity here are basically four times as strong as the ones on here and that's because these ones are updating based on this really slow simulation and these ones are updating in sort of normal time as we might call it so we could scale the time on this simulation as well I'll show you that in this case our forces should be sort of lined up and now you can see it's not pulling apart the same way so now who look we're getting a lot more of these nice tendrils we're basically getting all of these pieces are being connected here we have this little one that lost sort of what it was attached to but almost everything else is getting these nice wispy tendrils sort of pulling them together here if we go back into our settings here and just take a look quickly at our reseeding I've bumped this a little bit I'm gonna bump it a little bit more and this is basically gonna give me sort of a lot of extra particles as they start to pull apart that's gonna help to maintain some of those wispy bits I'm also gonna go ahead and I'm gonna pull this back down I'm gonna pull my minimum depth I'm gonna maybe push that down to 0.08 that's not changing anything here but if we look at sort of this visualization now we should be getting like lots and lots of the stuff in the middle and I actually want a lot more of that kind of interior material I think that's gonna help that so those are two things I'm gonna do I had one other thing I wanted to do which was actually just to boost our resolution a little bit I'm gonna drop that to 0.02 4 so that's gonna be a initial count of 70,000 points I've kind of doubled the points at the outset so if you take all that together and maybe even boost our viscosity a little I'm kind of just tweaking these values here now if we run this yeah so this this is starting to look really good to me I'm liking this so if we see this we hit and we kind of pull apart but we have these nice sort of wisps that are almost showing us like motion trails so this gives us the same original dynamics as a normal RVD sim but we know we have this nice sort of fluid kind of gooey set of motion trails here and you can see our colluded object is still kind of pulling it all apart there but we're getting this nice flow and this nice sort of interesting sort of branching structure here and of course all of our same workflows that we were sort of showing before still apply here so we still have our sort of distance based blend here that's coming through just fine so you can see those sort of interior parts are having that sort of cooler set of colors or we can do kind of ru vieng which obviously doesn't look like much but you can see even here we have these nice sort of fairly regular bands and if we sort of drop back into our particle fluid surface lot update we get this nice sort of branching structure and if we pipe this through give it a second to do its subdivision if we bring that through and put those UVs on there you can see we get this really nice you being even for this sort of relatively more complicated structure here so this is really just a very similar version but it gives you a little bit more control if you want your simulation to have a lot more of the feel of a normal rigid body simulation a lot more of the sort of Bounce and really sort of fragmentation but you still want comments on some of this sort of gooey fluid stuff going on this is a good way to do it you can basically just have your interior pieces being matched to your RVD sim and then have the exterior pieces just sort of follow along based on getting sort of dragged and pulled using those viscosity properties you so I hope this has been interesting I hope you've learned at least a couple of things here I know I didn't go too into depth into the shader but hopefully this sort of idea of having these two separate movies and basically just look up the texture twice interpolate between those values based on your rest ratio hopefully you can sort of sort out how to get that into your shaders for yourself and otherwise I think these are kind of fun effects they're obviously not like everyday things you would use normally but I think there are certain scenarios where you maybe want like a stylized explosion you want to have some of these tendrils something a little bit more sci-fi a little bit more organic and especially for the entire leaflet based simulation I think if you had some sort of like organic structure or destruction workflows going on if you had say like a creature sim and you've had them being sort of blown up or otherwise destroyed you could really get some of that goopy kind of innards feel from that relatively cheaply you don't really have to do very much in there the other benefit to the entirely flipped workflow if we just go back there let me just go back to frame 1 so it doesn't try to update all the way to 81 if we take a look again at this entirely flip fractured workflow one of the things that's interesting that's interesting about this approach is that you don't need to use sort of nice shapes so your interior geometry obviously I just used like a Voronoi fracture here so these are just nice convex hulls are defining my individual pieces you don't have to worry about convex shapes in this particular simulation you don't have to worry about creating nice collision geometry these can be anything you like it's a lot more like a soft body simulation it's just gonna solve all these interior forces and pressures on its own so you could have if you went back to your original box here you could have a big long looping cable it could even sort of go in and out on itself and you could have all of that be your single viscous object and have that sort of splat and come out as its own shape there so there's a lot you can do with this type of a setup and I hope that you found this informative and I hope you're able to sort of find something interesting to do with the yourselves as always please do let me know if you enjoyed this tutorial I like reading you guys's comments it's good to know that people are getting something useful out of this and please do let me know if you've got other ideas for tutorials if you got suggestions or other tips or if you happen to you some of these were clothes I would love to see it in here about it thank you very much and goodbye
Info
Channel: Diffuse FX
Views: 19,090
Rating: 4.9894457 out of 5
Keywords: houdini, vfx, tutorial, FLIP, DOPs, RBD
Id: 0QwYEWObxbY
Channel Id: undefined
Length: 88min 20sec (5300 seconds)
Published: Mon Feb 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.