 All right, so let's finish things up for our basic terrain pipeline by getting the terrain layers generated and all the appropriate attributes hooked up. So that way when the asset link goes and cooks this inside of Unity, all the textures and splat maps and stuff like that are already hooked up for us. Okay, so let's jump back into Houdini and get it set up. Alrighty, so let's go create our final HDA or SAP level HDA. So again, we're going to need another file. No, so we need to just copy that guy. So I just held down alt and left click and dragged it off there like so. And let's go and create another subnet because this particular HDA is going to be responsible for creating all the terrain layers and assigning all the terrain attributes. So we're going to call this IP texture layers. I think or actually let's do I didn't spell that correctly. Anyways, let's do terrain layers. There we go. Cool. So let's go and right click on this and say create digital asset and we will go and set this guy up the usual way here. And then make sure we place it into our Houdini project. All right, hit accept and accept. And there we go. So there we go. We're all set up there. So we don't need to add anything just yet and hit apply and accept. And then let's go in now to this particular HDA and start working on the input data. All right, so the first thing I want to do is just create a full mask. All right, so I'm going to drop down a volume wrangle node. All right, there's a couple ways you can do it, but I'm going to do it with the volume wrangle. And I'm literally just going to say at mask is equal to one. That'll just put a mask over the whole thing. All right, so this basically is going to represent our rock layer or whatever layer you want, whichever is the lowest layer underneath all the other textures. Basically, this is think of this as like layer zero or layer one, wherever your indexing starts for your layers. Okay, so with that, let's go and do a feature. So I'm just going to add two layers to this particular terrain just to keep things nice and quick. So we don't spend too much time fussing about. Okay, so I'm just going to do like a rock layer and a dirt layer. All right, so for this particular mask by feature node, I'm going to set this up like so. I'm going to put this to full 90 so we have a way to select, you know, where all the cliffs are basically cool. So I think that's going to work just fine. And so I'm going to invert that and that's basically going to represent where all of my dirt is. Alrighty, and now what we can do is we can go and drop down a height field layer node and extract out where all of our rock is. All right, so we're going to say height field layer and I'm going to put that full mask as the base terrain. And then the terrain to layer is going to be this mask by feature. And I'm just going to work on the mask. So I'm going to get rid of that wild card there and just type in mask. So we only focus on that particular height field layer. And what I want to do is get the difference. That will give me my rock. There we go. All right, so now I have my dirt and my rock. So all we need to do now is just drop down a copy height field copy layer like so. And this allows me that to put all this mask information. All right, but this is like a this is an actual layer. If we if we hover over this layer node right here and hit the info button, you'll see that we have tons of layers already. Each one of these represents a volume height field volume. All right. And so we have tons and tons, but this mask is also a volume. And now that I'm here, we should actually get rid of a lot of those because I don't really need them coming through. So what we can do is just drop down a blast node and blast away all those like the bedrock get rid of debris. Those are all generated by the road node. So I don't need them right now at least not for this basic example. So we want to keep height and masking it rid of everything else. These other layers are useful when you start creating more advanced train layers. Okay. So in this copy layer node, I want to take all the data that's in this mask volume. All right in this mask layer here and send it to a new volume called rock. All right, so now if I hover over this guy, I hit the little info button. You can see I have a rock layer there. Cool. So I'm going to go and actually hit this little button again. We're going to call this dirt. The reason why I'm doing that is because I really just want to set up all my layers in this one node here. So you can see in the geometry spreadsheet, if you have primitives turned on, we now have dirt and rock as layers on our height field here. So what I can do is I can drop down another layer node. All right. And I'm not collision layer. We want a height field layer. So height field layer. There we go. And we'll feed that guy in there like so. And then I'm going to take the result from our mask by feature and pump that into that second input and we'll just replace. All right, we'll replace the dirt layer with the dirt layer that's coming in up here. Cool. So with that, we can now use our visualize node over here to take a look at all of our layers. All righty. And we need a height field visualize. So let's do height field. Let's do that one more time there. There we go. Height field visualize. All right. I'm going to get rid of all these guys like so. Go. We also should clear the mask and drop down a height field mask clear. There we go. Very cool. So now I can go in and select, you know, rock from these drop downs and then dirt. And that shows me all of my layers and I already know right off the bat that our dirt layer is not correct. All right. So let's take a look at what's going on around here. So that's the mask there. Oh, and what we need to do is make sure that we actually put so we need another copy layer. So I need to make sure I put this particular mask over here also into a dirt layer. So we need to say dirt. That way when we go to replace it, it can utilize the masking information that's in that dirt layer and replace it over here. Okay. Hopefully that makes sense. So now if I were to take a look at this, you can see we now have the appropriate looking masks. So if I were to colorize these a little bit more naturally, look at that. You know, I have something that resembles a rough terrain with some layers on it. Alrighty. So with that all set up, let's put this guy right here and we're going to have to go and create a couple of attributes now. So we need to do. Well, let's first do the material. So I'm going to have to do a wrangled node for this. So it needs to be a primitive wrangle because we need to assign the material to our high field. Now this is new to unity terrains and Houdini engine. We actually need to assign the material for to show up in the editor. So when you say s at underscore unity material like so it was equal to some path, some relative path inside of unity. All right. So let's go and get that set up. I'm going to go switch over here to unity. I'm going to go and art and create a new folder called material like so. And let's go and create a new material inside there. So drop down the new material. And this is going to be called my default terrain met. Now, since we are using the universal render pipeline and actually moving forward in unity 2018, you need to utilize different shaders for this. You can't just utilize the standard shader for terrains or you're going to get some weird artifacts. And so what we want to do is we want to go to the universal render pipeline because that's the render pipeline that we're using. All right. And you want to go to nature. And we want to whoops, I went and selected the wrong one there. Oh, I want to go to terrain. There we go. And let's there we go. That's what I'm looking for. Cool. So that's the particular shader that we want to use. If you're just using the 3D, you can always go to the nature, terrain and standard. All right. So because I'm using the universal render pipeline, we need that. So let's go and copy our relative path. So I'm going to right click on it and say copy path there. And then we're going to go back to Udini and we're just going to paste that into that attribute. So now you can see we have that attribute on all of our layers, which is actually not what we want. We want to only put this on our height. All right. So let's actually assign that. So it's only assigned to the height. Cool. Now we need a couple more things. All right. So I'm going to say attribute create. And I want to create the rock layer. So we're going to call this rock layer. And I'm going to turn that guy on and we're going to put this onto the rock layer itself. So we need to do that. And we need to assign this a special attribute name. So if we come over here and we come into our attributes and groups. All right. What I need to do is I need to utilize this attribute right here. And now keep in mind we need to put it onto the prim class and the type is a string. All right. So cool. So this is the attribute name that needs to be on a primitive. It needs to be of type string. And then we need to assign some local value to this or this relative some relative path to a texture inside of unity. All right. Or to a train layer inside of unity. Okay, so let's go back in unity and get that path. Okay, so we're going to have to create a couple of new assets in here. So I'm going to go and right click on the art fuller and say terrain layers like so. And inside of here we're going to go and create two new terrain layers. So I'm going to create a train layer called rock layer. And I'll just duplicate that by hitting control D on the keyboard. And we'll call this one dirt layer. So in each one of these layers, we can control all the textures for it. All right. Very cool. So I actually imported a couple of track textures here. So I have these grids. All right. So I'm just going to assign that to the dirt layer. And then I'm going to assign a texture to the rock layer with some colored grids just to give us something to look at. All right. Cool. So what we need to do is we need to copy the relative path here of that terrain layer assets and pump it into the string value here. That way the Houdini engine can read it. So all we need to do now is go and call this the dirt layer. And we need to ship this over. So it's now using the dirt layer itself. So let's select that and let's go and get our path to the dirt terrain layer. So let's copy that and go over here and just replace this. Awesome. All right. So there we go. We now have a terrain. Now one thing that needs to be noted here is we are using a very large string here. This is a 4097 terrain and by default unity clamps the splat maps down to 2048. So what we have to do is we have to split this stuff out. Okay. So I need to go and drop down a height field tile split like so. And I'm going to just set this on two and two. All right. That way because we're using a 4097 terrain each one of these splat maps basically will be 2048. All right. So we'll just call this hf1. And I'm just going to duplicate it and we're going to send the tile number to one. And we'll just do this again. We'll send this to two. We'll do that one more time for the final one. And that'll be tile three or tile four but index three. Cool. So with that done all we need to do is just merge these guys together. So I'm just going to merge them together by holding down alts on the keyboard and dragging out from one of the outputs. And that now is our merged terrain. But you can see I have four terrains that are 2048 and that will work perfectly with unity. So now I'm just going to drop down and all and do that and say out terrain textured. We'll say textured terrain or whatever you want. Cool. So now let's save this node here. And we are going to go and test it out first inside of Houdini here. So let's go and drop down another HDA processor. There we go. Cool. We'll move the cook flag down there and let's go assign our HDA here. So terrain layers. Cool. And that's that's going to be fine right there. We need to make sure we turn on our create files up inputs and the naming will be fine for now. So the defaults usually work pretty well, at least for something like this. So let's do one quick test here and I'm just going to hit shift V on the keyboard and we are going to cook just the terrain texturing portion here. Let's move that guy over there and this one shouldn't take too long. And there we go. So now we have our final textured terrain. So if I were to now go and select that work item there, I'm going to hit up a couple of times or you on the keyboard. And what we can do or what we can see here is we actually are importing that tile terrain now. And if we inspect its attributes, we have the terrain map of the terrain material on each height layer and we have all of our terrain layer assets assigned appropriately. We also have the tile index. Super cool. So that makes it all work perfectly. So with that, let's just save our node type and let's actually just do one more quick check here. I do want to make sure that I put $PDGdir right here, so PDGdir, so it picks up our working directory. All right, just make sure that this one is set as well. If you don't, then it most likely won't work. So just make sure it's pulling in the working directory. Awesome. So there we go. We now have everything good to go. Let's go and save this. And in the next lecture, we will go and test this out and cook a terrain inside of Unity. Thanks so much.