 Howdy guys, this is IndiePixel here and in this Houdini tutorial I am going to walk through the process of creating a tiling brick. So here you can see I have this mesh right here and it's actually utilizing some of the newer features inside of Houdini 16. So I really wanted to cover some of those things and we're also going to go through baking this guy out. So you can see here I actually have that brick material baked out and tiled there. If I come down here you can also see that the brick mesh is also tiling which is awesome. So what I wanted to do is just kind of walk through the graph here and talk about how it's constructed. So let's go through and select the grid here first and I'm going to show my properties up here. So I started with the grid here and I divided it in the rows. That way I ended up with a bunch of primitives here because I want to loop through each one of these rows here and add bricks to it. And I just centered it up on the grid. Now you don't necessarily have to do that. You could leave this anywhere you want. It could be flat too. It could be laying down on the grid as well. So not necessary there. But the rows are. So then I just reversed it so it was pointing forward and see. Again not necessary but I like to have all my stuff pointing and see like that. Alright so then from there what I did is created a for each subnetwork. That way I could loop through all the primitives. So I just did each primitive point here. So I just did that and you'll notice what that does is it slices each row up into the bricks in a random width basically. And it also offsets each of those guys. So let's go dive in here and take a look at this. Alright so it's not a huge or anything which is awesome. Alright so the first thing is I created a horizontal size. And basically that is storing. So we have here we have attribute create. Alright so I first create an attribute that stores the loop iteration. Alright and creates a random value for that. Okay so. And this is already hooked up as a HDA so we're going to jump out. So that's why I have some of these properties already hooked up. But we can still look at this. So basically the way that this works is we do a fit and then I do a random value of the current iteration that we're on. So the stamp for value is giving me the current iteration that we are on inside of this for each loop. Okay. And then basically I put that. Let's actually go into the expression editor so alt E. So we can look at it without having to keep clicking on it there. Alright so then I just that creates a random offset range in X and in Y for me. In X. Okay so let's close that. And then I have the X offset right here. And basically this is getting the size in X and dividing it by the number of bricks. Alright and I'm going to use this to allow me to cut each of those bricks. Okay so let me come down here into another for loop. Okay. And I'm going to create a random width. Now this particular value over here is actually giving me a different width. Okay so in that for loop because what I want to try to do is slice this guy up. This whole primitive depending on how many bricks I want. Okay so I'm using the iteration from the metadata here inside of this loop. Okay. And I'm getting that vert loop data and the iteration value from that. Okay. And just doing another fit and just doing a random range. Okay. And then I feed that into this all those values all those attributes I created. I feed that into this knife right here. Take a look. It's kind of a big one. And really what this expression is doing is it's just making sure that we don't actually go to the we don't end up slicing too far over so I'm trying to fit the slices within this width right here but also utilizing all those random values that I created. Alright. So then finally we just use that value inside of that knife and we get the slices. Okay. Boom. And then I just move it over a little bit. And that is the final offset in X. Like so. Alright. So then with that all set up it's pretty simple at this point. We can just go through each of these primitives here now and that's what I do in this loop. So let's go through each of these primitives here. Let me turn off the primitive numbers. And that goes and creates all the bricks for us. Alright. So if we were to jump in here it's pretty simple. I just get the current primitive that we're on. Do a transform. Now this transform is doing some randomization as well. So I'm translating it back and forth in Z. And then I'm rotating it in Z. That way you get a little bit of rotation on the brick itself. Alright. And I just centered up the pivot here. Then I extrude the brick out. Alright. Make sure to include the back. And then I polybelled it. Added some normals and then remeshed it. And remeshing is awesome because it does actually break it up and make it look kind of like a roughed up brick. Alright. So then from that we get all over bricks. And it's tiled already. I mean you can verify that by creating a copy and transform node. Alright. Awesome. So then I just center it up so that way when I go to do the baking, I can utilize the same grid over here so you can see that I have my low res grid. And if I didn't center that up, I'd still be right over here. Looks like it actually still kind of work. Let's go back. I know it wouldn't so. That's why I center it back up so that way we get a perfect tile. Make sure it's centered in Z. Which you don't necessarily have to do. I just kind of made it nice and clean that way. So then I come down here and I do a little bit of colorizing over here. Okay. So first what I want to do is just measure and I go and get the curvature. Now you can also use the game development curvature. There's the game dev calculate curvature. And I've noticed that this also has some problems in here. If I go and connect up the attribute blur here like this, then it seems to work. So then once that is up and running, I just auto calculate and then colorize visualizes color. And that starts to give me what I want. But in this case, I'm not going to use it right now. I did my own curvature. So basically I used a measure node and set it to curvature. And then I just did my own attribute blur like so. I just took in that attribute curvature because when we put a measure node down it adds the curvature attribute. So we can take a look at that in the geometry spreadsheet. So it adds the curvature attribute to all the points. And then I use an attribute blur to blur it out so it blurs out that value. Okay. And then I just colorize it and that gives me my curvature value for the bricks. Pretty cool. So then over here we have a connectivity going on. And all I'm doing is just checking to see if one brick is attached to another brick. This way I can actually randomize the colors on each brick. So I just use the connectivity node and put the brick attribute on it. And then I did a partition using that brick attribute as the rule. And then you just colorize it random. So I just say random from attribute on a color node and use that brick attribute. Okay. And that gives it random colors. And then we have the point bop here. And inside of this point bop I'm just adding the random colors and then colorizing the curvature. So if we dive into this guy, let's actually maximize this here. So all I'm doing is taking the current color. All right. And that's that curvature value. Let's come it in. I'm multiplying it. Let's see here. Oops. Keep doing that. All right. So when we go and we multiply those two guys together. If I say I'm taking the color, the randomized color, then I multiply those two and really you don't have to. It's just a, I found, I was just messing around with different effects. So I just took the X and the Y colors and multiplied them together. And then they did a fit. This just allows you to adjust some of those colors. I actually need to visualize that here. This allows you just to kind of have a levels adjustment in a way. All right. Pretty cool. So then this is the curvature right here. I'm just pulling that curvature value in using a import point node. And then I'm doing a fit. So again, I have those levels adjustments there. This allows you to really clamp it up so you can get whatever kind of effect you want. And really I just use the color mix and that allows me then to colorize it. And you can say I just exposed one of the values there and these, these two values right here. And this allows me then to tweak it from out here. And that is basically how I did that. I know kind of went through that a little bit fast, but I'll make this available on the site. All right. So then I just add some normals and I merged it all together with the grout. So let's cover the grout over here. All right. So what I'm doing is pulling in the grid that I've divided up here to transform. So it's sitting a little more forward. I did a remesh and that just so I had more points to work with. And then I did a point bop and inside of this point bop, I'm just giving it a noise just to make it kind of bumpy. All right. So I just did a turbulent noise and a displacement pretty standard stuff. But then what I did is I did an intersection analysis. Now this is a really cool node. It allows you to see and it gives you points where two services interact, intersect basically. So now I have a bunch of points where all those bricks are intersecting that grid. Super cool. Wish I would have had this years ago. Then I do a VDB from particles. And one thing to note on this is I had to make the point radius scale really small. And the voxel size is relatively small. And then I convert that to a polygon mesh. And you'll notice that you can use the ISO value to kind of squish it down also to get what you want. And then I just run that through another point bop, which also takes a curl noise and a turbulent noise. All right. So you can just hook those up and start playing with the values. And that really just gave it more of that brick grout looking type of effect. All right. So then I use a normal. And that's just to give it some normals. And then I colorized it, which I didn't do anything fancy for that. And then just merge those back together. And that gave me the perfect grout. Super awesome. I actually had some bump to it. Everything so worked out really well. And then finally I come down here and just clip all that stuff off. Now you don't have to do this, but I was just messing around with different techniques. So that's why those two guys are there. Basically you can verify the tiling of this one centerpiece here by using another copy and transform. Boom. There we go. There's some color issues. It's neat work on that, but you can always fix that in Substance Designer or Photoshop, wherever. At least the meat of the model is there. And basically I went and baked it all out and ended up with this on a plane. So that is the actual texture right there. It's not a fancy texture. It's more or less about the technique of building this graph. So that's basically what I wanted to show. So to do the high res and low res bake, all I did was took that initial grid that I created. I created some UVs for it, so I switch over to the UV Editor. Just transform. I just meet it up a little bit. It's weird. And then just put in a null node. That way I can access the low. And I created another null node for the high. And so if we go to our render in context here, I just have a games baker. You're not familiar with that in the game development tool set. There's the game baker right there. So you just hit that and it automatically throws this down for you. And all I did then is in this case just output the base color and normal map. All the others worked just fine too. But all you need to do, it's really simple to use. Set your resolution, set the path where you want the images to be saved out. And then just select the low and the high from these guys. So I just hit the little node selector deal. All right. And then just go in and find that low null node. And same for the high. Easy peasy. And when you're ready, just hit render. And it will bake it out for you. All right. So hopefully that's useful. Like I said, I'll make this available up on the website so everyone can see. Or you can use it or just dissect it. It's pretty easy to do. But it's fun to mess around with figuring out how to use, who do you need to create these tiling textures. I mean, you can even use this as a tiling model if you want. Obviously I'd have to close off the sides here. But pretty good. All right. Thanks so much, guys.