 All right, so let's continue our grass blade texture here And what I want to do is I want to turn this into a actual pixel texture. All right? Currently it's all just 3d geometry All right And so what I'm going to do is use a technique that I watched on Lester Banks's website from Fabricio and it basically goes through how to make your own texture type of generator using cops and stuff like that So I highly recommend you check that out. All right, cool And so we're going to set up that same thing. Okay, and so what I want to do is turn off our grid there What I want to do is I want to Basically create a volume All right, and this volume is going to represent what they call planes inside of Houdini At the end right and it is a volume basically at the start here. All right, and so this first volume I want to basically store color information All right, so that's gonna be our color and this is gonna be a type of vector and I want it to be a two-dimensional vector. All right, and you'll notice if I were to actually turn this on All right, and let's actually template our grid. I need this volume to be the same size as our grid so I need to go here and Get the size of the grid so we can do it in a couple ways. You can use BB Vox or you can just Sample the size of the grid itself, which makes it easy so we can say grid one And we can get the size X like so. There we go All right, and we also need that for our Y direction as well And that didn't seem to do anything for me Let's get rid of that there Interesting. I didn't want to update Let's do by size And that's odd. That should totally have worked. It's just not updating for me So we reason but what I'm going to do is go through and set up all these properties here. And so I want the size to be 1024 by 1024 and That is our division sizes there there we go All right, so this is what I wanted to do. I want to do non-square 1024 For our texture as well. So X and Y is 1024 by 1024. It's like that okay, so with that I'm going to just turn off the z-axis there and All right, and so it doesn't seem to be wanting to update for me, which is unfortunate But that those are the the setup so you can see now if I were to actually Give this some value. It will actually Show up as white. So currently I just have the color set to zero zero zero. All right So what I want to do is also give this a name. So this is going to be called C for color and What I want to do is there we go. See it's having a problem updating. I don't understand Okay, yeah, the next one I want to do is alpha So we want an alpha for this as well And we basically want those same setup But the alpha is going to be a scalar because it just goes from zero to one, right? So I'm going to name this a and Then what I want is a gradient value. We can use this gradient value for some texture work All right, I'm just going to call that G for now Well, what we can do now with all those different Volumes or planes is just merge them all together. Okay? very cool and What we're going to do is we're going to basically raycast into the geometry now to do this what I need to do is I need to Drop down an object merge node and we're going to say we're going to get our blades All right, and Let's go and do that. So I don't need to transform it. It will just be From our blades, so we should set up a null node for ourselves. Make it easy like so. We'll say out blade sheet like so Cool. So now in our object merge node over here What we can do is go look for out blade sheet and now we've got our blade sheet right there Okay, so to do the ray casting it's actually quite simple, but it does require that we use some vex So I'm going to feed the the volume into and we need a volume wrangle for this So volume wrangle, so I'm going to feed that into the volume wrangle the all the volumes here And then I'm going to get the geometry and put that into the second input or input of an idea one Okay, and so what we want to do is I want to do a ray cast and to do this I first want to declare a couple of variables. So I'm going to declare a vector and We're going to call this out hit and then I'm going to make another vector called out UVW And I want out UVW like so. All right and What I want to do is I want to basically say Int hit is equal to intersect like so And we want to intersect with the geometry coming in from the first or the second input, which is ID one, okay? And we want to take the at current position that inside of our volume. All right, because we're basically going to go through each You know pixel if you will and do a scan we're going to ray cast into this So that's that at p value And we want to do a ray cast direction. So in this case, I'm going to do the z axis. I'm going to do a negative 100 Okay, and we want to output that into the out hit So that's the current position and then we want to Store the UV hit as well. All right. So with that That will output for us negative one or the primitive that we hit remember just The primitive not any point or anything like that. We have to do some other work to actually get the hit point okay, and so the next step in all this is to Check to say if Hit is greater than or equal to one or zero excuse me Because if it's negative one, we didn't hit anything if this function right here returns a negative one That means we didn't hit anything and so nothing's going to run. Okay? But now we can say if we did get a value So if it's equal to zero or greater because remember if it does hit something This is going to be the current primitive number that we hit All right, then what we want to do is we want to say at C All right, because remember C is this volume appear and that's how we access the volume say at C is equal to point and Then provide it some sort of point, but we we need to actually find the prim Point or the point on the primitive. Okay, so this is going to be called our hit point. So hit point Let's just keep it short We'll call this a prim point like so and if you ever want to find the help for these things Just put your cursor, you know right in the middle of the name that function name and hit f1 on the keyboard And this will actually launch the help for that specific Function that you're working with which is very convenient. You're not having to like search through the API or anything like that All right, and so once this is loaded, we'll go through and talk about the different features So the print point is going to give us a point from the hit primitive Okay, so we want to find a print point from geometry one because that's what we're sampling And we're going to get the prim num which is stored in this hit value. Okay, so we just hit and The vertex will just be zero like so Cool. So with that information we now have a hit point. Okay, so I can say point We want to get from one We want to get the point from the one and we want to get the color value coming in All right, and we want to use the hit point like so and we need to make sure we name that correctly. There we go All right So we don't actually see anything oddly enough and the first couple things that we actually need to do is we need To actually go up back to our grass blade over here and into our color node Like so because currently we're putting the color onto the point. We actually need to put it onto the primitive itself Which means we actually need to promote the gradient value or we could always go and Let's go back into our grass texture sheet. All right. So when we get the grass blade We can also just do an attribute promote. So we can say attribute promote like so Cool and we want to get everything so we're gonna promote The point. Oh, I actually got the attribute randomized. I didn't want to do that So attribute promote. There we go So the original class is point which is right We want to send it to the primitives and the original name is color. So now we've got that on the actual primitive cool Very cool. Okay. So that is gonna work out nicely for us All right. So now if we go here You can see that we still don't see any particular value All right. So one thing we could do is we say at a is equal to one let's say There we go. So now we're starting to get the alpha where it hits cool and then we can say at G is equal to point One and we're looking for that gradient attribute that we put on there. We'll feed in the hit point to sample from Alright, so With that we should be good to go You know, we actually do want to put the color back on. We don't want that. So let's just toggle this off And you can see that this thing is trying to display the alpha value and it's just displaying white but if we put down a volume visualization node it'll allow us to go and Look at these particular variables. All right. So we have C Dot Star which stands for all the color information. Now, we're not really getting anything and One of the reasons why is because the the mesh itself is Literally sitting right inside these planes Or the the volume planes and so we need to just move it back a little bit in Z All right, so it can actually fire the raycast. We're just barely getting it And so I just want to set this back like negative one like so Now that's getting more of the actual shape that we want. All right And let's take a look at the color and the color for some reason is still not hitting appropriately and That is odd because this should be working. So maybe if we declare it properly, there we go So it just wanted to know the value. So we should just put the actual value Decorations in front. So v stands for vector f stands for float and v stands for and this is not actually a vector This is an F. There we go Let's just make sure our gradient was set to scale are cool. All right So now if I were to go and look at my gradient value, you can see we're getting the gradient value as well But you notice that it's actually pretty stepped and that's just because of the resolution of our grass blade So let's change that and we set this back to our C dot star which stands for all the channels So let's turn this off too. We don't need that and Basically what we want to do is we want to subdivide it. So but I also want to keep the shape I don't want to you know shrink the shape anymore. So I'm going to create some creases for this All right. So what we need to do is find all the borders And so let's drop down a group node And we'll call this borders There we go like so and I want to get all the unshared edges And we'll set this to edges or not vertices. We'll set it to edges. There we go So we get the borders and Set that in we'll send that into our crease because the subdivide node now will subdivide using those There we go and we'll feed the creases into the second input. There we go. So now we've got a Way to make more resolution on each one of these blades of grasses Okay Cool. So let's go and feed that in instead Move this up. Just organize it and Let's go take a look at our volume visualization now. There we go. So now we have a smoother gradient for our particular grass blades Super cool. Okay. So with that Let's just do another null and let's call this out Recast like so There we go. So now we have all over a plane. So in the next lecture What we're going to do is talk about how we get this into an actual like targa format or PNG All right, so we can actually use it in our game All right, so thanks so much