 Welcome back. All right, so what we're gonna do in this video is we are going to focus on the grass clump So I want to actually create grass clumps that I can go and Scatter about in a scene inside of Unity Using the Houdini engine. Okay, so I want to create that model and what we're gonna do is we're gonna create the high-res model All right, or the more High res version of this model. These are all gonna be set on cards But I want to create all the LEDs as well And I want to show you guys how to do that here inside of Houdini so that when we import the FBX Inside of Unity here. It'll set up the LEDs for us. All right, so that way, you know, just saves us a step Okay, so let's get started. I'm gonna go into the grass clump geometry note there And the first thing I want to do is drop down a circle All right, and what the circle is going to represent is the radius where our grass clump can actually You know take place I'm gonna set this to the zx plane and turn this into a polygon all right, and Let's make sure to turn on our Backface calling just so we can see here. You can see that the circle always comes in reversed When it's set on the zx plane like that, so I just dropped down a reverse node Now it's not completely necessary because the scatter will scatter on to The reverse geometry, but you know just for visualization. I like to reverse it So next up we want to drop down a remesh node here and what this remesh node is going to do is it's going to take This geometry here and actually provide us a bunch of points in the middle All right, so it's going to remesh the original mesh and the reason why I'm doing this is I want more points Because what we're going to do is we're going to take all these points We're going to find their distance from the center of the world here to create a gradient value And this gradient value is going to allow us to create variations of height Bend we can do a lot with that particular information So I want to set myself up so I have all of that And now that I'm looking at it what I want to do is I want to go and add a couple more Divisions to our circle just so we have a nice clean circle like that Now if we want more points in the remesh We just come to the remesh node here and my apologies for the icon not showing up I think I need to refresh my user preferences But this is a remesh node What we can do with it is we can change the target edge length And what this will do so you can see this slide right here What this will do is it'll make it so that each one of these edges Tries to reach this particular distance so far to make this bigger I'm going to have less points because all these edges are trying to be a value of 0.5 So if I make it smaller we're going to get more points Because all the edges are trying to be a value of 0.9 now right so that length So that's what that does All right, so with all of that particular Data what I want to do is I want to put some noise on this because You know nothing in nature is that is you know super perfect. So I want to add some noise For a grass clump just another way to add some more variation. So I'm going to drop down a point Expression node and this will allow me to create a radial Normals and the reason why I want to create radial normals is because I want to use a mountain node after this But let's focus on creating these radial normals So currently you can see all of our normals are Vertex normals and we know that because they're green lines. All right What I want to do is I want to have all these normals Pointing out from the center. Okay, so we can use that information to place our grass cards Appropriately so I'm going to switch this attribute over to normal like that And what we can do is there's a little drop down over here that says sphere for in right here So if we put that in you can see that we actually get Normals that are in a radial fashion or they're spherified And all it's doing is it's taking the current position of the point and subtracting the center and that gives us a normal All right Perfect. So that's going to work out. Well the next thing we want to do is drop down a mountain node and this will allow me to Add some noise to it and the reason why I wanted the normals Radially like this is because the mountain node is going to use the normals to displace the geometry So you can see now It displaces it perfectly on a flat plane there And that's what i'm looking for Because I want my grass clump to have a little bit more Kind of a natural field to it. So I can adjust all this stuff appropriately Like so it just gives me a better More natural shape You know one thing we could do also is we could actually put the remesh Down here and remesh it after the fact And that'll give us something a little bit more clean in terms of our points because you'll notice that if I had it up here What happens with the mountain node is we get some If we try to push this too far The points start to overlap each other All right, so by putting the remesh node down below the mountain node We clean that up Cool So now we have a lot more control there. You can change that element size I think i'm going to do something like that. It looks pretty good for now All right, so next step in this is we need to do a little bit of wrangle or vex expressions here And so what i'm going to do is i'm going to drop down a wrangle node an attribute wrangle node And the first thing I really want to do is I want to take the center Of this particular Object and I want to find the distance for each point I want to find this distance away from the center. Okay, so to do that It's pretty easy. All we need to do is we need to Find our current center of our object. All right, because I don't want to use the world center because the shape is now offset Let's go back here Because the shape is offset. So the center could actually be You know, not necessarily a world center. You could use the world center But this is a cool way to do this. I'm just going to call this variable center And what we're going to do is utilize the get bb box center Method and just pump in the geometry that is coming into The first input here. So zero All right So that gets me the center What I want to also do is I want to find the The maximum size of this particular object now. This is pretty hard because We can't just use a box necessarily for this Well, I mean you could but what I want to do is find something that's a little bit easier to Handle in terms of getting our max size here. So what I'm going to do is I'm going to actually drop down a sphere Like so and you'll notice that the sphere node actually has an input right here All right, so I'm going to pass that into there. So I'm going to take the remesh pass it into the sphere And you'll notice that we get a sphere that actually encompasses Our geometry perfectly. So now what I can do is I can find that or use that radius of that sphere Okay, as my max bounding box size And this will just help us create a more accurate gradient. Okay Cool. So let's actually turn off that template flag there. All right, so Let's do another vector variable and this is going to be our box max and I'm going to equal this to our get bb box max, but this time we're going to get the maximum from Our sphere so the input or the geometry coming into Input one there. Okay, and just for good measure. Let's make sure our sphere is set to a polygons here All right, so it just sets it to a polygon Cool. So now we have All the information that we need. All right, so we have the center and we have the box max And we know how big the sphere is and we know where the center is of our particular Grass patch right here. Okay So let's go and actually Determine a smooth gradient basically. So what I'm going to do is I'm going to say float Gradient is equal to our fit All right, and what we're going to do is we're going to fit our current position Okay with our center So the old All right, it's the center and then the old max is our box max Okay, and we want to fit that between zero and one like so Oops And this isn't actually going to work right off the bat And I wanted to set this up this way because I wanted to show you how to debug a certain vex Issues that might pop up. So you'll notice that we get this green line underneath the gradient We also have this warning over here. All right, so if I were to middle mouse click on my attribute wrangle node here What'll what'll happen is it'll give me some information about this It says that we can't cast from vector to float and that's actually good information Because what we're trying to do is we're taking a bunch of vectors. So at p is a vector center is a vector Box max is a vector, but we're trying to fit it between zero and one All right, and that obviously can't work because we can't go from a vector to a float without specifying You know some sort of conversion. So what we actually need to do is we actually need to find the distance So I need to find us. Let's call this center distance Like so and what I want to do is I want to find the distance between Our center and our box max So what's that distance between our maximum? Position and the center because then what we can do is we can actually fit that All right, because this comes out as a float we can use this information right here to fit Our current position All right between zero All right, so we can say zero And instead of box max we can use our center distance now because this is a float We want to fit that between zero and one But we need to take care of this last issue right here because our app p is also a vector So this is the distance from the the actual Center of the object as well. All right, so we need to do one more conversion. So we need to do a float and we'll say point distance like so All right, so what we're going to do is we're going to say distance If I could type there we go So distance from our center to our current point that we're working on Like that. So now we can get rid of this at p and we can say point distance. All right So that's how we take care of those issues inside of Vex here All right, and that's how we have to kind of convert things down from vectors to Float distances and then we fit it to zero one because I want a value that goes from zero to one You know as we go from the center Cool All right, so now we have a gradient. So I should actually take a look at that so we can say at cd is equal to gradient And there you go. So now we have a nice soft falloff between the center So what I really want is I want a one minus so we could do it here. We could say one minus right here All right, and that'll reverse it or we could do it up here And I'm probably going to do it up here Just so I know that my gradient value is all ready to go for me. So there we go So now we have a nice smooth falloff All right, cool. Last thing I really want to do here before I close out this particular video is I want to create an actual Value or a control for the user to control this fall off now. There's a couple ways you could do it One way we could do it is we could say float pow Or let's call power and we could just do a pow Function. All right, so we want to find the power of the gradient With some Sort of channel that the user can actually adjust so by declaring chf I'm going to automatically create a slider down here that the user can use So we're just going to call this the power So There we go and to get that to show up I just this little button right here Now if I were to let's get rid of this line here if I were to assign Our color with our power You can see that we are now adjusting the fall off Pretty cool All right, so one thing we also want to do is we want to make sure that we clamp it because if I put this down To really small values here You'll notice that we're going to get values that don't go to zero I always want, you know a normalized value So what I can do is I can say power is equal to our clamp We'll call this power here And we'll just clamp it between zero and one like so Cool It's always good. Just safe measure So the other way that we could do this We could go and say float ramp This gives the user even more control So we say float ramp and this is equal to a ch ramp and what I want to do is call this my fall off All right, and I want to pass in our gradient value Like so Now we just clamp our our ramp value instead here And we'll pass in the ramp to the color And now we need to go and create that ramp And there you go. So now we actually have a different level of control here Cool. So now you could have a little bit more Denser grass in the middle here Or you can create more of a smooth fall off All right, so just different ways to control it So what I'm going to do is close out the video there that gets us pretty set up already The next thing what we want to do is set up our scatter and get all of our normal directions in place So that way we can go and copy a bunch of Grass carts to this particular Clump mesh. Okay. Thanks so much