 Howdy guys, Andy Pixel here, and in this video I wanted to walk through how to procedurally generate these grass cards for Unreal's grass system because you know, it's quite laborious making these things and When you're trying to make really efficient grass cards, you constantly have to go back and forth Tweaking the grass and changing it and that's a lot of work When you're doing it manually and so I wanted to show a way that I've come up with to do it procedurally Basically, we're going to build this scene. We're also going to be utilizing Houdini engine v2 Just for the terrain for this. It's really basic stuff, but we're going to walk through that We're also going to walk through how to set up every step so that we get these efficient grass cards And we're also going to develop the the texture for this guy, too So we're also going to do the spherical normals, right? So it lights nicely inside of the engine works both for unity and Unreal and but we're also going to make the texture as well We're going to do it all here in Houdini. No other software is used So hopefully you guys are excited to make a grass field with some efficient grass cards All right, let's get started All right, let's get started by creating our grass blade first So I'm going to create a geometry node here and we're going to dive inside and I'm going to drop down a line here really quick and I'm actually just going to keep it at a height of or length of one for now most likely just going to keep all this stuff pretty normalized because Basically, this is all based off of a meter. So there's currently three feet, which is pretty tall grass And so we'll just keep it between the that particular range And then what I want to do is I want to resample this and the reason why I'm going to use a resample node here is Because when I resample this guy, so you can see we have a bunch of new points over here I can take advantage of this curb you attribute that it produces. So it's a value of 0 to 1 right there if you ever wanted to Visualize that you can always select the node you want to visualize hit X on the keyboard You can also create the the node itself if you just want to use the tab menu, but X is the Shortcut for that and you can come into the visualizers tab here and just look up the curve you attribute and set it to a marker instead and Turn off the update visualizers and I have a zero to one value so you can just see your data All right, so then I want to go and sweep this guy and for this we are going to utilize The ribbon we don't need our own custom Curve or anything like that or profile Inside of the construction here. I'm actually going to set this to the z-axis So it's constrained to the z-axis there because it's going to be facing the camera when we actually turn this into a texture I don't really need any columns you more than welcome to put in as much Resolution as you want here, and I'm just going to reduce the width a little bit And then we're going to go and also apply some scale along curve here so I'm going to add another little knot over here and Just kind of shape this into the shape of a grass blade really I'm going to go for obviously the more stylized look here I'm also going to select all these knots here by holding down control on the keyboard and I'm going to switch us over to Beast Point so we get something a little bit more smooth there We can also kind of sculpt this a little bit better You make this just a little bit wider down here a little bit stronger You can actually overpower these guys holding down the middle mouse button on the mouse mouse over here And you can actually just increase that value It's a little bit too much for my taste there Yeah, so that'll work pretty good. All right, so now what I want to do is add some color to this So I'm just going to do a color node And I'm going to actually set this to a ramp from attribute and the attribute we're going to use is that curvy value again So it's really important to always want to always produce the attribute But just know that that is there so you can utilize it for lots of different things and then finally what I want to do here is Add on some different colors basically and so for these colors here So this gradient right here is going to be the gradient that I used to Set the base color. So I'm actually going to set this to a red and this to a black So that'll be my first gradient I'm going to create another one of these by holding down alt clicking and dragging to create a duplicate of that And then basically I want this to be the tip color. So I'm going to Make that blue. I'm just going to make this black now You can obviously keep all those in one particular note. I'm just splitting it out. So I can't control those separately All right, so we'll call this the tip color And this is our base base ramp like so so we can use this base ramp to Clamp off like the simple wind inside of unreal and also, you know tinted a little bit You can do a lot with that particular ramp and then the blue color basically is going to be that used for the tip of the the Curve so let's do something like that Now what I want to do is I want to Put these two both together together here. So let's do this with a wrangle node like so I will call this combined colors and I just need to type vector other color It's equal to points and we're going to get that from the Second input, which is the first index right there. So remember it goes zero one two three All right, and the attribute that we want is the CD Which is the color attribute and I just want to get it from that same number so that PT num And all we need to do is just add those two together. So at CD plus equals other color There we go. So now we got them all blended together perfectly. Yeah, bring this down just a little bit something like that That looks pretty good. All right, so then we're also going to need a bend node. So we get this guy set up It's for when we actually place it on the line here So let's Get this blend node or a bend node here and let's set a few things up So I actually want to change these capture settings If you select the bend node itself and then come over to the scene view and hit enter on the keyboard You can see the gizmo and that basically that's where it's going to be bending it from And so I need to change the capture direction of one and why and I'm actually just going to leave the capture length That one because remember our grass blade is all normalized here So that allows us to basically tilt it this way and so this is going to be our Z bend and Then let's make another one and we will put it on to the x-axis. So we'll call this the x-bend And we really just need to change This guide so the up vector My believe is on the z-axis now Yeah There we go So now we have control over the bend in in X Cool. All right. So with that we now have set up our grass blade That's everything we need to do. So I'm gonna call this out grass blade And what we need to focus on now is creating the placement of all these grass blades All right, let's do that in the next step Okay So now what I want to do is create a line that I can basically scatter These grass blades across so let's do that now So I'm gonna go and create a line and I'm gonna point this guy on the x-axis like so And from there, I'm going to resample this. So it's just resample this Basically, this line is going to be what controls the placement of all the grass on my grass card here All right, and so we're gonna have to set up a few attributes for this and to do that We are going to need that curvy value again Now it doesn't necessarily matter what you use for this particular value because we're gonna be scattering points onto this So really this is just to get you this curvy value All right, so let's do a point jitter now So point jitter like so and all I want to do at this guy is actually just do it on the z-axis here Let's reduce that a bit. So I want to get some kind of depth range in there By using that and then finally let's do a match size. So this is all centered up on the world axis like so beautiful, okay and Then we need to go and scatter some points. So let's scatter some points here All right, let's I'm not sure why the grass blade is actually still showing up. I have noticed that in Houdini 18 We get some weird scene view bugs. So if that ever happens that's you not want to way you just go and recreate that scene view and It'll update the window not really sure if it's my machine or if it's Houdini thing But that is the fix for that. All right, so now we're scattering some points and I don't honestly want that many grass blades there Something like that. I do want to control the density though. So let's put in an attribute remap. We can remap the Curve you value using this guy. So I'm just going to call this density So I'm going to take the curvy you attribute and Remap it into this density value, which the scatter node is actually looking for so this density Attribute right here All right, and so what we can do now is I so I want to say I want more density in the middle here And then less density on the outsides here. So it gives you an extra amount of control Yeah, so if we were to actually template our line Actually, we need to template this guy. There we go. So we're getting less density on the outsides and more in the middle And you can obviously go and change the minimax values, too If you want to stretch it back out just a little bit Like so Yeah, looks pretty good. All right. So with that done Let's go and do another point jitter here I found it just really helps kind of break things up if we just do a point jitter Just in the x-axis here, and I'm gonna use that later. So let's do a point jitter. There we go It's a point jitter All right, and then I just want this on the x-axis this time So it just helps me kind of spread it out even more. You don't really need that much Something like that. Very cool All right. So with that we can now go and copy two points Let's drop down a copy of points and I want to copy my grass blades here And I want to copy to my points that I created with the line and there we go So now we have our grass cards copy to that line. So one thing We need to do here is actually roll through each point Because I'm gonna set up a few attributes here. Let me actually select all these guys Hold down a on the keyboard and then left click and drag to organize these guys like so I Want to create some attributes that control things like the bending I also want to control my scale and I also want to control the length of our grass blades as well All right. So to do that we use this for each node here so I can roll through each point and Get the attribute from each one of those points All right. So we'll see how this all works here in just a second Cool. So let's start with the z-bend here. That'll be the most obvious one All right So what I want to do is I want to be able to bend these based off of you know, where it lies on that line Right. So if it's on this side, it should bend this way. It's on this side It should bend this way. All right. And so all we need to do is just drop down another attribute remap value here And I'm going to call this my bend remap and I want to take that Curve you value again and we are going to put it into an attribute called bend So if you have your geometry spreadsheet open over here, you can see now We have this bend attribute now if you don't you can always come up here Hit that little plus button and go to inspectors geometry spreadsheets cool so now we have this bend value and Currently, it's just going from zero to one and what I want to do is I want to have it go from zero to one to zero Actually, we actually want to go from negative one to one my bad. So I want to go from negative one To zero no bend to one to a full bend go in the other direction All right, and I'm also going to select these guys and set the interpolation. So this time I'm just right-clicking. So set interpolation B spline Cool. So now I want to use that Attribute that we created so that bend attribute. I want to use it over here in my z-bend and so Just make this even more obvious Let's drop down a null node here right below my for each begin and we'll call this point data so we're going to get The data from the single point because remember we're looping through each one of these points here And you can verify that by going to your for each end node here and going to single pass So now you can see I'm just going through each point This way I have access to each point's data or the attributes All right, so I'm going to turn that single pass off cool So we're going to get data from this particular node and so I'm going to come into this z-bend node or the bend node here for the z direction and This is where we're controlling that. Let me actually turn this guy on as the display So I want to control this particular value on a per point basis So I want all these guys moving in the same direction. So in order to do this We need to get a value And so that value is going to be point. All right, so you can see if you open up parentheses here You can get the data off of a point using the string float string float argument pattern here So the first string is the name of the node. So we do dot dot forward slash and we say point data The second argument is our point number. That's going to be zero because remember We only have a single point here. So that point number is zero It'll always be zero for every point And then the attribute we want is bend Like so and we just want the first value There we go. So now we're getting a bend value And it's super super subtle because currently if I were to left-click on this It's just going from negative one to one right now. So I need to fit this So I'm going to say fit this point value between or from Negative one to one we want to do something like let's say negative 30 to 30 Like so. Oh, and we also need to negate that Yeah And it looks like I'm getting a weird result there. Let's go back to our remapping And oh, this actually needs to be zero to one. There we go. Yeah, there we go So now you're getting that bending value Let's go back to our Benz and actually we don't I mean you can leave it on the fit You don't really need to because I already have a value that goes from negative one to one So if I just multiply this by something like oh, I don't know like 90 degrees There you go. So now you got something really cool there to control your your bending From one side to the other Very nice. All right. So the next thing That I want to do is I want to scale this guy as well. So let's do another attribute remap We're just going to keep using that curvy value. So I'm just going to call this my scale remap like so and We are again going to take that curvy value. I'm going to call this a p-scale All right, so do a little p-scale there and What I want to do is just make it pretty tall in the middle there And we can adjust all this stuff later on. I will put this from Zero to one to zero and then we can control our minute max from here Yeah, let's see. Something like that Yeah, that's gonna look cool All right, then finally I also want to control the length of each Of those particular grass cards. So we also have another control up here that controls The overall length of those guys, right? And so Let's go to attribute remap Let's drop down our attribute remap node. I'm going to call this my length remap There we go. And I want to do Curve you we'll call this length like so And again, we're just going to do that zero to one to zero curve like so And now what we need to do is we need to pump it into here All right, so we're currently going to utilize this length remap to control the values, right? So all I need to do is just come in here and do a point expression So do point and I want to get the data from our point data node And we'll get the length attribute And put in zero for the first uh index there and I'm doing the vex version here There we go Cool. So now we're controlling the the length as well So we can come back to our length remap node and I can increase The minimum Maybe decrease the maximum there even though that looked pretty cool before And there you go. So now we have a really easy way to control How our grass cards look Pretty cool stuff and we can always come back to these guys. So let's go back to this. This is the z value The z offset here. Let me actually get a better view there So that's the z value Pretty cool. So let's call this our z offset And we'll call this one our x offset This is the x So again, we should just keep this at one that way we can control Um everything from here Oh, let's get rid of this guy. Actually, you know, I want one there and zero for z. There we go Just want to focus on one axis Yeah, I think I'm liking that. All right. So next thing we need to do now is get this prepped and ready for Um our grass card because we need to render it out basically To a texture. Um, I also want to get the Unreal project set up and um Before I actually usually before I go and render these things out to textures I'll actually test the real mesh itself to see how it's looking So let's move on to the next step and get all this things going All right, so now we got all that stuff all hooked up One thing I do want to do now is I want to Create some occlusion. So I am actually going to use the uh labs occlusion node here All right. So what that's going to do is just give us a little bit more occlusion information Uh, which is usually why I put the the point generator in there for the z offset It's just so I can pick up some occlusion now. Um Might be a good idea this time to add some more columns. So if we go up to the sweep node here Add some more columns will get a better occlusion bake there. Yeah, it looks much better All right, so um, let's put that into The vertex colors there. So let's do attribute wrangle like so All right, we'll call this uh occ color And the reason why I'm doing that is because I want to add it on to what we currently have here Um, I also want to get rid of this specularity in here. I don't need that So if we hit d on the keyboard go to the material tab here Do our specular rough? Now we won't have any of that stuff. It's just so I can see things better All right, so again, we're going to do our vector other color And this one is going to be point I'm going to get it from that first input or in this case the second input, which is index one Uh, do a cd because that's the attribute we want And at pt num because we want to get it from that same point All right Now for this one, I want to say that at cd dot G is equal to other color There we go Yeah, and I might actually invert it Let's do one minus Yeah, there we go um, and now I actually I'm gonna switch that up a bit. Hold on a second here. So let's go to our tip color Let's put this one on the green channel And let's put the Other color here into the blue channel Like so and the reason why we're getting this little squiggly line here Is because currently other color is a vector and we're trying to shove it into a float value right here So let's just do a dot our There we go Yeah, much better. So now I got all of the information inside of our vertex colors here. All right, so Let's um add a normal here I'm going to add a normal the other thing we also need to do to prep this guy Is to give this more of a spherical normals currently if we're to put this into Any game engine unity or unreal It wouldn't like very well because all the normals are pointing in this direction and so What we need to do is we need to Basically Do an attribute transfer and create some spherical normal So in order to do that we need a sphere that has normals on it All right, so let's do that. Let's take a look at this guy here And I'm going to set this to polygon. I'm just going to up the resolution there Hit shift w on the keyboard to show my wire frame on shaded And now we also need point normals as well for this to work There we go All right, and then I'm just going to do an attribute transfer So let's do a transfer there you are So I'm just going to select both these guys and hook those guys up like so Now you can see we're getting spherical normals pretty cool Now I actually do want these guys pointing up mostly and so If we are actually change the scale on our Sphere here. I want something more like that Yeah, that'll work and we need to clip this guy. So we don't get any of these bottom normals here So the only sample stuff we want there we go So what we did there is we clipped off the bottom So these are the normals that we're sampling These are the the normals right here. We're sampling onto here So that will render much better inside of unreal and inside of unity All right So in order for this to show up at the correct scale for unreal, we just need to multiply this by 100 There we go, and you get it up on the keyboard to Zoom out for to frame your selection. All right, so I am going to put down a null node here and I'm going to call this high res for game All right, so with that we are now pretty much set up for everything The last thing we really need to do is plop down a Rop FBX node now I might I need to note that if you are using apprentice You have to use a Rop geometry output. All right That'll export it to obj and you'll lose all your vertex colors for these next few steps But I'm actually going to be baking all this stuff down to a texture anyways, so It'll still work. You can still export it out if you are using apprentice. All right So I'm going to save this out now to the location of my hip bow. So if I just select hip here and I'm going to create a new folder called grasses I might make a few here And I'm going to call this grass a card 001.fbx Okay, and let's hit save the disc Cool. All right. So with that, let's jump over into unreal and start getting things set up And actually before we do that, we need a terrain that we can use. All right So we'll do that in the next step and then we'll go into unreal All right, so let's focus on creating the terrain here So I'm actually going to create a new geometry node and I'm going to call this terrain I did go ahead and Call that grass card. This one is actually going to become a HDA I'm going to be using the Houdini engine version two for this particular demonstration So I'm going to call this ip grass terrain. There we go All right, let's just drop down a height field here and if you're all wanted to know the The sizes that are valid for you know unreal on the Houdini engine. You can always go to the documentation For this particular Demonstration, I'm going to be using something really small. I don't need to go crazy with it It's just really a test for grass and stuff like that But just to show you guys, let's go over here to the Houdini engine for unreal documentation If you go to landscapes, you'll find all the valid sizes So I'm going to use just a 253 by 253 here. So we'll just set that in here. So 253 And 253 I'll leave it a grid spacing of two for now Um, also It's recommended you leave it at two when you're using the Houdini engine If you are baking these out to height fields, you can put it to one or like 0.5 Or not height fields. I'm sorry height maps. All right, so let's add a little bit of noise I really don't need a ton of noise here And I'm going to expose this anyways so but I want the default to be something like I don't know one In the element size to be something like 10 I'm just making you know kind of like a Really rough. Maybe we'll do like two Go a little bit bigger a little smaller. I just want kind of Really basic noise there. Nothing crazy All right, so with that done, uh, let's go now and create our Layers, so I'm just going to do two layers for this one. I don't need to go crazy for this particular deal So I'm going to do a mass clear You can do this a couple different ways So if you use a mass clear and then set it to a value of one, uh, it'll actually add a mask You can also drop down a volume wrangle node In here, so if you go like this you can say um at Mask is equal to one Same deal, right? So whichever one you want to do Same deal All right, so with that now we have a mask. Um, I'm going to do some noise Let's just do a mask noise here Like so and we'll do a subtract And we just need to take down the element size. I just want to kind of create a really splotchy type of grass layer here And uh, let's go and blur that So I'm going to do a mass blur All right, and we'll do a remap So height field remap and inside this remap node all we need to do is just change this to mask Rather than height and then we can remap this guy. So I just want to bring that in a little bit more like so Something like that. Yeah Cool. So now we need to get these into Layers that Houdini engine can read. So let's first um Take this guy here. Well, actually, let's just um Since we only have two layers, this will actually be way easier. So I'm just going to do a copy layer here And this one's going to be a grass. So say mask goes to grass like so And I really just need the opposite of this so I can do a volume wrangle node here Like so I can say um at mask is equal to one minus mask Let's go So now we get the opposite right because we need to make sure that All of our layers inside of our unreal landscapes add up to a value of one there. So we'll just call this um dirt mask And we'll do I'm just going to copy this copy to layer node and we'll say mask goes to dirt Like so So now if you're to check out your primitives here, uh, we have height mask grass and dirt Perfect And that pretty much is all we need to do Here for this test terrain. We will have to add a Material here, but we haven't made it yet So I'm going to do unreal material There we go And there's nothing in there yet. I'm going to get it just prepped So we put it on primitives and on the height layer Cool, so let's get this now made into A digital asset. So I'm just right click on say create digital asset And we're going to name this With a namespace and a version number There we go And I'm just going to save it into wherever I have all this stuff that I'm working on Very nice All these files will be available to all the patrons All right, so let's go and get rid of these default parameters We don't need these guys here anymore Now, um, I'm probably going to want to have control over the noise So let's just promote these two guys and call it a day there for this particular hdn I'm not going to get into You know exposing it too much of the stuff. I really just want to concentrate on the The grass And for that I need a terrain. So, um Yeah, with that all set up, let's go and get it all set up inside of unreal All right, so let's get things set up here inside of unreal So I just wanted to show that I am using the new hoody tangent v2 now I need to know, um, there are still things that are broken in this So, um, I would not recommend using this in any sort of production just yet And that's really just my two cents. Um, there's a few bugs that are just kind of show stoppers for me Um, there are most of it does work. It's just you're going to run into some, you know areas where Like for instance closed curves basically shuts down and crashes the hdn engine So you can't have any tool that has a closed curve in it, which is comes up so often so That and there are still some issues with the pdg. So anyways, um, let's get our terrain set up So I'm just going to close this guy down and um, I've gone ahead. Let's go and create a new folder called this levels And we're also going to have objects We're going to have materials Like so and we're also going to have hdas At least I think just one for now All right, so let's save this. I'm going to call this my grass map And inside of our hdas, let's go find our hdas here. So let's open up the folder And let's go to where I am saving all that stuff And that is going to be in here. All right. So let's go and uh, just drag and drop this guy into here All right, and then we just need to make sure that the hdm engine Is running. So currently we are not running. So I'm just going to create a session There you go. So you'll see this hdm engine session connected So with that done, we can just drag and drop our terrain into the level and because it's a super tiny terrain It doesn't take very long to show up at all All right, so very cool. Now we have our terrain all set up Anyway, a procedural control over it. I always like to center these guys up I really don't like having those things offset when it comes to terrains Beautiful. So now we need to go and create the material for this. So let's just make a really basic material I'm not going to get into creating any sort of Crazy auto landscape thing. I'm just trying to focus on grass here. So I'm just going to call this terrain mat Or um, and then sorry I thought I was in unity there for a second All right, so let's open this guy up cool And first thing I'm going to do is just get my landscape layer blend and we're going to set up our two layers So I have two layers here And we're going to do a dirt Because these are what I named them inside of Houdini And grass and then I need two colors Like so and so for dirt I'm going to use Kind of an earthy dirt color Just desaturated a little bit more red there Yeah, there you go And then I want grass color Yeah, a little more saturation Uh, let's expose these. So let's convert it to a parameter called dirt color And we will call this Uh grass color There we go. And then we just need to hook these guys up like so And then we put that into our base Color there. Let's get all of our specular stuff set up. So I just need three parameters here This is not metallic. Um, I'm going to put the specular at 0.5 And actually put that there there we go And then our roughness will be one There you go Beautiful now in order for our grass to show up we need to utilize the grass Let's see grass output node here and then pick a Landscape sample So layer sample. So we want to sample the grass layer There we go, and that's all you need to do beautiful to apply and save And I'm going to shut this guy down here and let's make a material instance for this Awesome All right, and so if we select the landscape itself you can do this right off the bat, but I I do want this to Actually show up When I just create the hd8 itself. All right So all we really need to do for that is go and copy the reference here And then go back into houdini Right here and that's what this little guy here is for so all we need to do is say s that unreal Material now if you're using unity it would be a unity material And I'm pasting that path basically the same process is just that you would put unity in here rather than unreal And the padding stuff is Basically the same you just have to get the path from unity. All right. It'll just look different All right, so with that I'm just going to save my hd8 so you can do that up here in the breadcrumbs so save That and then we can come into our Actually, we could do it up here. Let's just right click on this and say rebuild selected And now automatically the Material gets assigned for us Beautiful. All right. So now we need to bring in our Grass card that we exported out All right. So let's do that. Let's open up our folder here And I'm going to go to my objects. I'm just going to drag and drop this guy in here And for the Information here I actually want to Go to the mesh settings and we want to replace because we have vertex colors in here. So I'm just going to import all that stuff Beautiful and now let's go and Let's actually just do this. I'm actually going to go and right click and create a new grass type And we'll call this grass 001 Now for now, I'm just going to be using the high res mesh. I know this isn't what you actually do Um, and so let's make this a little bit smaller here. We're going to turn this into a card here and just a little bit I just want to make sure that this is all looking good Yeah, we've all that stuff got that setting there And let's go now into our materials. So we need to get that Master material for the terrain here all set up So inside of our grass We need to go and assign our grass type to this guy All right, let's go back to here and just drag and drop this landscape And hit apply or save whichever one you want to do And there we go. So now we've got grass Yeah All right, so with that all set up I'm going to stop it there and we're going to move on to setting up the material for the grass itself All right, let's go and create the grass material here now and for that I'm just going to create a new material Call this the grass mass material And open this guy up here. Let's make it full screen All right. So for this guy, I'm actually going to set it to Double-sided foliage and we're going to make it two-sided And I am going to bring in that vertex color that we set up inside of Houdini And I'm going to set up a lerp here and we're going to basically lerp between two colors. So let's do that Let's create two colors here And this first one is going to be like Green I'm just going to kind of stuff these guys in here And this other one's going to be another like dirt color I'm with darker dirt. Yeah, something like that All right, let's hook these up into the A&B inputs there And if you remember our red is our main gradient. So let's um hook that up there There we go. Very cool. I'm also going to hook this up into my emissive color And then I also want to fix my normals a little bit. So let's actually before we do that Let's assign this to the model here So we can see it all in action while we're building this here So we're going to go back to our objects. Open up that grass card editor here and Let's assign the material to it So I'm just going to drag and drop this guy into there There we go. Yeah, there we go Cool. So now we have Ability to you know color using that ramp that we created But you notice that you're going to get this weird lighting issue For all these guys We also need to plug in the subsurface Let's do that as well. All right, let's hit apply Yeah You're all we're going to get this weird lighting issue basically. Um I mean they are looking cool so far but We need to fix that so I'm going to create a new up vector So if we just come into our constant here Create an up vector and we're going to use that two-sided sign node I'm just going to multiply these guys together And put that in for the normal Hit apply much better Cool. So now we're starting to get some pretty cool grasses So at this point, you know, what I usually end up doing is I'll go into my grass Let's actually come over here in our objects Open up the grass type and start playing around a lot of these values now I'm not going to pump this up too crazy just yet to for the grass density I'm really just going to play around with some of these values here To get a better idea of, you know, what I need to do before we actually render this out to a card So a couple things I want to do is, you know, rotate them We also need to fix the specularity. I don't want any of that stuff Let's go back into the material here Hey, you might want specularity for this, but I'm going to actually turn it off for this demonstration here All right, so not metallic Specular can be 0.5 And our roughness, I did it again But in the wrong one, our roughness can be one Let's hit save All right, so like I was saying, I will go in here At this point because currently you remember I'm using the high res mesh And that's not going to work for the final result I really want to get an idea before I start rendering all this stuff out to textures If this is going to work really well or not these pretty good shapes So what I can do now is I can go back to Houdini Let's say I wanted a little bit wider because I feel like it's just not wide enough, right? So if I go back to Houdini over here, we'll go back into our Grass card over here. Let's go back to our line And make it a little bit longer Like so Yeah, and let's play around with our size too. So, um, let's go to our length ramp Maybe the max length should be something like that And maybe add a couple more And here that's a little too much And really I just don't like how kind of uniform it is We should also Come in here and Right click set this to beast blind And then maybe add some more variation in here like so Let's try that out real quick. So I just hit or select the fbx node hit save the disc go back to unreal And go back to my objects and just re-import this guy Yeah, so now we're starting to get something cool. Let's close out this window Much better. We're also going to need a few more of these guys But that is looking pretty nice so far All right, so I'll let you guys mess around with that I'm going to mess around with a little bit more too, but let's move on to the next step All right, so uh after playing around with that, you know, I got it into a spot where I kind of liked it I didn't spend too much more time, but um, I did basically add more clumps and stuff like that to it and I added in the The simple wind inside of the the material I'm going to show you guys really quick what I did So yeah, I just added the simple grass wind there I just kind of messed around with the colors a little bit more too. So nothing super crazy Again, uh patrons We'll have access to all these files. Um, and if you don't feel like uh signing up the patreon, which is totally fine I'll put this up on gumroad as well So let's take a look inside of houdini now and see what I did so, um, basically Yeah, after I transformed it I just used a copy and transform node and I played around with the translate and x and The rotation and y kind of got this shape here And then I basically just re centered it up on the the grid like so And that seemed to work pretty well. So now I have a good idea of what I want to do I need to make sure that I'm not Utilizing the the super high res mesh here. So what we're going to do now is walk through the process of making the texture sheet And the actual grass cards that are a lot less low poly But also they keep the overdraw in mind as well and we're going to make it all procedural So it's easy to change and stuff like that All right, so our goal is to get something Like this that we render out and then basically Um, we have a texture that we're going to render out from this particular Uh data here. So let me show you guys how I set all this up. So Before I get started, I I did create a duplicate grass card here and um The reason why I did that is because I want to have this texture sheet and all I did was I went up into the Scatter and I changed the the global seed to something that was just different than the other one So now I have two versions Of that same grass card. All right, so if I were to actually Just show this right here So I just have two versions of the same grass card, but with a different seed value. So they're you know different All right, so um, what we need to do is we need to get this into Um, a format like this, right? So Let's take a look. It's at this guy right here um Basically, I got it down to About 183 polygons here And so I'm going to walk through the process of how I did all this here. So let's uh, let's get it done It's not that hard actually So let's drop down a geo node. I'm going to turn this one off. We'll call this cards two All right, and I'm going to go and get an object merge node And I'm going to set this transformed to none and we're going to go and get our first grass clump So grass card cool and I did put in those grass card nodes here I did put in this out option here And I think I'm actually going to do it Before the transform because we're going to do that anyways Um here in sec for our actual cards that we're using So I want to get this guy right here. And so in my object merge node Let's just do the out yeah Like so that way we're all normalized between in the unit grid here And let's make sure we do that for grass card one. This is why we make hdas So we don't have to update multiple nodes, but um, I'm not going to make an hda in this particular, um Video Just know that, you know, it's probably a good idea now that we have this grass card maker or grass clump maker I should say you can make it into an hda and just pump out tons of different types of things that you want All right, so uh, I'm going to call this clump a And this one's going to be clump b Like so And then I want to transform one of them right up Above it and you can put it anywhere You want I just want to make sure that I transform it. So let's put that on the template there You can give it enough space so we don't get any bleeding in the mid maps All right, so let's merge these two guys together I'm going to hold down alt on the keyboard just so I can drag off that there hit shift s on the keyboard to get these More curly lines there. All right. So now we have our texture sheet that we want to render out And I need to actually change this to the other one. So in this object merge node for b grass clump There we go. So now we have two different ones All right, so let's throw down a match size Uh node here and put it back into the normalized space. I'm just going to hit scale to fit And we're going to do a uniform scale. All right, cool. So if I do space for three on the keyboard To go into my front viewport, you can see now it's all normalized. So this basically is our texture space at this point, right? Like basically at this point you can make it any size you want because we're normalized between zero and one, right? So this box here represents a size of one and all axes Very handy node. All right. So with that completed, let's um Go and turn this into a real grass card at this point This is going to be the geometry that we render out. So I'm going to say out for render like so Okay, so The trick to this is to turn all of this geometry into just a single card and get rid of all this Excess geometry or polygon counts now the the node that I'm going to be using is the triangulate 2d node If I were to actually plop this in there right now, you'll see that it's It's working, but it's um Getting both these guys and it that's just because we need to separate these out into groups, right? To get the two cards and so to do that. I'm going to create some groups up here. So I'm going to drop down a group node We're going to call this a Like so and then I'm just going to duplicate it. I'm going to call this one b And all I need to do For these guys is to set this to Oops, I put that in the wrong spot Group name is a And this is b Just remove that so it selects everything And switch these guys over to point groups because you'll notice in the triangulate 2d node. It's taking in a point group All right, cool. So now if I were to just to do group a it'll do just that one, right? Perfect. So let's do number or do group b. So we get that guy Beautiful. So now we got some cool geometry to work with Let's go now and Merge these guys back together All right, so now I have these two pieces But what I need to do is I need to be able to procedurally Scatter these in some sort of circle fashion, right? And so I need to get these guys centered on the grid again And to do that I'm going to use an assemble mode here and that basically then provides let me open up my geometry spreadsheet here So this will actually put out a specific attribute called name on the primitives and we can then use a for each loop So for each named primitive here Then we can use that name attribute to loop over each one of those particular pieces of geometry each one of those cards there All right, so our goal now is to get these guys Basically sitting at the center of the world. So to do that it's really to see that match size note again like so And set that guy to minimum. So now at the end of this loop here if I turn off single pass I have them both back at the center of the grid there, which is great Okay, so while we're at it, we might as well also Provide an id for these so I'm going to drop down an attribute wrangle And this id is going to be useful when we use the variant attribute on the calculator points node So I'm going to say I at id is equal to some sort of number and that number we can actually get from this meta important node here So I'm going to call this loop data like so And then I'm just going to plug this guy into the second out or input here Or input one and I'm going to get uh the iteration number right because that moves So I'm going to actually get it from geometry one and I want the iteration Attribute and zero for the first index There we go Very cool. Awesome. So now if I look at my Point attributes here, excuse me. I have an id value now for zero and one Awesome, and that is working out perfectly for me So now All I need to do is scatter this stuff around. I also need to get rid of all this internal geometry here So let's do that. Let's uh do a group here And um, we can actually let's actually do it up here before our loop And actually before this assemble node here So to move all those guys together. I just held down the control key on the keyboard and Pick this one that moves everything below it All right, so let's call this a group node or the group name here border And I just want to select the border of this. So I'm just going to go to edges Enable include by edges and then you undo the unshared Edges and that gets me the border selection there. And then what I can you do is use a dissolve node and Get rid of everything that is not a border. So I say not or exclamation mark border Now we need to turn off or move inline points on that dissolve node And like that we got rid of everything in the middle that we kept our border One thing to note though is you're going to have leftover points. So Um Good way to get rid of those guys here is just to drop down a facet node and just say remove inline points That gets rid of anything that's within this uh tolerance distance. And so point zero zero one. Basically, it's negligible if it's there or not Beautiful. All right. So now we have both these guys Perfect. Um, the other thing we're also going to need to do is create the proper UVs for these guys Before we actually move them back to the sun of the world. All right, so after we do this right here All we need to do because we normalized it with that match Size node is just drop down a UV project node like so And by default it's going to be set up to that Um, normalized box basically. And so now I've got these guys in the perfect Space for you know, when we render this texture out, it'll actually match up perfectly Um, so you don't have to worry about moving it or adjusting the UVs or anything like that All right, so let's keep going here. We're almost there Uh, let's now Drop down a null node. Um, these are going to be my cards Like so Very nice Now I need a circle. So let's drop down a circle And I'm going to put this on the zx plane. So let's go over here. All right, you can leave it as a primitive I really just want to use this circle as a means to scatter points on So I'm just going to scatter some points on there like that and put this up to something like maybe six points Now with this, um done now that I have these points, I need normals on it. All right So I'm going to actually utilize a preset that comes with this point expression node I'm going to switch it over to normal and Use one of the presets and that's this sphere by n right there So now if I turn on my normals, you can see I have it facing outwards from the circle perfectly Now I want that normalized as well. So I'm just going to use the normalized method here All right And with that now we need a random id set to these because we have id's now set on these guys So let's do an attribute randomize over here and Set the id and so I'm going to set this to a name of id We're going to put it on the points. I'm going to use a custom discrete here And I only need to because I only have two cards. So I'm going to set zero to one here and start playing around with these weight values So you can see it moving over here when I move the slider So I want a nice spread and even distribution now You can see that it's a float value because that is a decimal place there So if I do an attribute cast I can cast this to an integer and that is required for the variant to work So I need to convert it from a float to a integer So now we can actually go and copy this to our points here So if I just take my cards Put it into the copy of the points here. You can see it's starting to work. All right We just need to turn on this piece attribute and Set the piece id attribute to id Like so and now You'll notice that this obviously isn't going to work our circles is way too big So let's just move this inwards like so which is great. Let's look imperfect It's kind of giving me a better distribution as well We let's also go and rotate these guys So they're kind of rotated a little bit like that Yeah Then you can even tighten this up a little bit more Yeah, that's pretty cool. I like it. So we should also redo our normals as well at this point because we have new geometry These normals actually look like they might work, but let's just be sure So I'm going to actually save my scene really quick here. So I don't lose any of this stuff for you guys Uh, let's go back to our grass card our original one there and uh, let's just copy all this right here And then let's go back to our cards too And we will just paste this down here And we'll just reset our normals. Yeah, there we go So that's the power of using all these nodes. You don't have to reset it up And also the power of making hdas. So you don't have to just constantly do that over and over again Like, you know, honestly, it would be a good idea just to make this into an hda So you could just select all these guys and do a shift c and uh, this is you can call this spherical Move my cursor there spherical normals There you go, right now you can just copy that around or you know, if it's an hda just use it over and over again Beautiful. All right. So that actually becomes our geometry and you can see our UVs are laid out perfectly So at this point, we just need to do a transform and um, this will be our unreal scale And scaled up to a hundred Awesome And then we just need our fbx node again and again if you're using apprentices, you'll need to be using the uh, geometry output node That guy Okay Cool. So for the fbx, you've got to get rid of that guy and then just plug this in and then um, I'm going to save this into grasses. We'll call this grass card too All right, there we go. So now we're all set up with that. Let's just hit save to disk The same I seen once again now we need to get set up for rendering. So we have this guy already set up for rendering. So um, let's close that out there and in the next step I'm going to show you guys how to get the uh, the texture out All right. So now we need to um, get our texture out for this guy So we already set up this node here. This is going to be the out for, uh, render, um, like, like so So that's what we're going to actually be, uh, rendering here So first thing's first, we need a constant material So if you just go to the material palette and drag out one of these constants, right Into the palette, then you have this material. Um, I'm going to set that to that guy And that basically makes it so it doesn't pick up any sort of lighting or anything. I just want the actual full texture there All right. And so, uh, let's go back to obj context here. So I did set up a camera Let me turn it off and show you guys how I did that. So let's do a camera here And we'll call this render cam All right, there we go Now, um, inside of this guy, I want to move this back in z one Like so and then I want to go to my view set this to orthographic and set the ortho width to one And then I want to set the resolution to something like, um 1k So now if I go to my camera using this little guy right here, so I go to render cam You can see I have it fitting perfectly inside of our 1k texture It also matches up to the geometry that we just created as well All right, so, um, let me close my previous render view there So now we're ready to render at this point. That's when you want to go to the out context So currently we're in obj, which is where you do all your geometry stuff So now I'm going to go to my out and I actually created a mantra node Um, let me delete that and let's go and create a new one here All right, so this is going to be our mantra node And I actually want to utilize my render cam that I created So let's go and get the render cam beautiful and Let's do a render. So let's open up the render view for mantra rendering And let's just hit render. It doesn't take very long at all. There's not a lot to render There we go. So now we've got our texture all set up One thing you'll notice if I go and turn on my view bar, we have no Real alpha. You do have this op id But I want the actual alpha and so I'm going to do this extra image planes You're going to come all the way to the bottom here and in extra image planes I can hit that little guy like so and then get the alpha So now if I were to look at my alpha, I have my alpha Mask here as well Cool. So let's just save this out. Now you can Go and just render it using this guy right here and setting the output picture Or you can always just right click on the the view itself the render view and say save frame And then go pick a location. So I'm just going to go into grasses And I'm going to put this guy here and call this grass Sheet 002 just to make sure that it lines up with my other Grass card and I'll save it as a png And then I just need to tell to use that new alpha plane for the alpha and hit save There you go Cool. So now We have the texture out And we are now ready to go back into unreal and get it all set up using our lower poly mesh All right, let's get all the new assets imported here. So I'm going to go to my folder Just make this a little easier. Let's just import these two guys Let's make sure that we replace our vertex colors, which is good Yep, and we've got our texture. Let's just make sure that we have yep. We have the alpha in there. It's beautiful All right, so we are set up. We have all of our vertex colors Super awesome. So let's get our grass card set up here With all that stuff So we do need the material we're going to have to update the material to be using the texture now We can't still use some of the vertex color stuff Let's put this guy into there. Awesome All right, let's save this and just minimize it for now And let's go and edit our master material. So now what I want to do is replace some of this stuff Like I said, you know, we can't actually still utilize the vertex colors You'll notice inside of Houdini over here If I were to go back to my out or my obj context and take a look at my current geometry Let's take a look at our cards Our final cards down here They still have the red at the bottom All right, so the wind should still work so we can still utilize the vertex colors for that But now we need a texture. So um I am going to just go and select my texture really quick And then inside the material editor hold down t and click and I'll get me that texture So now, um, I want to utilize the red for here And the green for the tips Yep I think I'm using the blue for occlusion That's what it was. Yeah, there we go Yeah, I think that works now. Perfect Awesome. So yeah, now we have the vertex colors driving the wind And we're also need to replace this guy So I need to actually copy this right here Totally doing this on the fly here. So pardon my Pauses while I think about stuff. All right, that should be working. Just fine now Yeah Cool. All right, let's uh, also we need to go and change the type to masked And uh, get our alpha put into our opacity mask Yeah, there we go. Well hit save Alrighty and let's check our grass card now Yeah, that looks pretty good Let's see everything's working like it should still So pretty easy shift over. I know, you know, if you are new to Houdini, that was probably quite a bit to take in there But um, I use this quite often these days to generate new cards. You can also use it with the mega scan stuff Maybe I'll do another video on that as well. Let's replace now inside of our Grass types here. Let's replace this guy. There we go Cool. Yeah You can see the performance is way better Now and we get basically the same look, you know So really cool. Um, I'm going to go and add I want to make this a little bit thicker just because it's cool Let's add one more element here And we'll do just I'm just going to use the same static mesh here. Yeah Yeah, it looks pretty good from a top down view. I could probably still work on the placement You know when you're working on these grass cards, you go through lots of just really subtle Changes to you know, try to fit most use cases This is actually working out pretty good so far. Yeah Liking it so far. Let's put up the density here now that we've got lower poly stuff Let's hit save Yeah, and there we go. So that's how we make procedural grass cards pretty cool Like I said, I might do one where I I start from a mega scans texture or atlas texture Because you can use the same process to do mega scan stuff as well All procedurally so you're not having a hand place or hand Generate the cards themselves. So Hopefully you guys like that and let me know your thoughts in the comments And thanks so much