 Tiling textures are a staple of game art but when it's done badly it can really ruin the sense of immersion in a game. You're a good game artist though and you want to make sure your tiling textures don't actually look like hot garbage. Well then my friend, you have come to the right place. I'm Shane, this is Game Dev Academy and in this week's class I'll give you four pro techniques for breaking up the tiling in your textures. You can stack each of these techniques up to make it so that your textures don't even look tiled at all so make sure you stick around to the end of the video to get the full effect. If your textures look really tiled the first thing you should do is make sure that the texture is actually seamless. This means that the colors at the edges of the texture will match up when it's repeated in both the X and Y direction. In this example here you can see that the seams are very noticeable and that's because I've purposefully chosen a texture that I know isn't seamless. Here it is on Google Image Search in all of its unseemless glory. Let's swap this out for a seamless texture then to show the difference it can make. I'm going to go to Megascans as I know that all of their textures are seamless. I'll search for a wild grass material that I like the look of and then download it. Next I'll need to import the textures into a real engine and then I'll create a new material for the wild grass. I'll just add the base color and normal textures and then also add a constant for the roughness and that's all I need to do. This material is identical to the one I created with the texture that isn't seamless so let's see what a difference using good seamless textures makes and as you can see this already looks way better than the original. Now we'll add some micro variation to our material to break up the tiling even more. The first thing I want to do for this is to add the ability to tile the texture by differing amounts so to do that I'll add in a texture coordinate node and multiply it by a scalar parameter which I will call micro tiling. I'll set the default value of this to 0.5 as I think this gives a better result by default. Next I'll add in the ability to add a tint to the color with a vector parameter which I'll call micro tint and then multiply that by the texture for the base color. I just need to make sure I set the default color of this to white by default which means it won't change the color unless I change this value. Now I'll stick all of this into a comment and then copy and paste everything down here. I'll change the name in the comment to micro color variation then I'll replace the scalar parameter and call the new one micro variation tiling. I should also have changed the default value of this parameter to 0.5 but I forgot to do this when I was recording the video. Now I need to change the name of the vector parameter to micro variation tint and then I'll take the green channel of the grass texture to multiply this by. Now I can change the value of the micro variation tint to a pale yellow color. Now I have a micro color and micro color variation I need a pleasing way to blend between them. For this I'll create a new texture sample and the texture I'm going to use is called t underscore macro variation which is available in the Unreal Engine starter content. I want to have control over how this texture tiles so I'll create another texture coordinate node and multiply this by a scalar which I will call micro variation alpha tiling and I'll set the default value of this to 0.01. Now for the blend I will create a linear interpolate node and then I can plug in the red channel of the result of the micro variation blend to drive the transition between the two variations. Then I'll set the result of our micro color to a and the result of our micro color variation to b and then finally take the result of the lerp and plug it into our base color. Now I'll save it and check out the result. Once it's applied you can see that the tiling is broken up by the difference between the two variations and that I can also use the material instance to change the color of the tints to keep the transition from being too jarring. So this looks better again and this is even before I remember to go back and set the default tiling value for the micro variation. Now I'll break up the tiling even further by adding some noise to the material in the form of darker patches of the grass. I'll go back into the material and then create another texture sample using the t underscore macro variation by copying and pasting the one I already have. Next I'll put it in a texture coordinate node and multiply it by a constant which I'll set to a value of 0.005. Then I'll make a copy of all that and set the value of the constant on this one to 0.0015. To just control the brightness of these textures I'll take the red channel of each and add 0.5 to it and then I'll multiply the results together. Then I'll stick it all into a comment named macro variation noise. Now I'll just give myself control over the contrast of the noise by creating a scalar parameter called noise contrast. I'll set the default value to 0.5 and then put this into the A input of a lurp. I'll leave B set to 1 and then I'll take the result of our macro variation noise and plug it into the alpha of the lurp. Now I can add a quick comment neaten things up a little and then multiply the result of our macro variation noise by everything we already had going into the base color. Now I can take a look at the result and compare it to our previous work. Straight away you can see the difference but I'll just match the tint colors to the previous material to get a better comparison and then you can see the effect that the macro variation noise is having more clearly if it changes the value of the noise contrast parameter. At this stage it's almost impossible to tell that this material is made up of the same tiling texture. Even with all the variation we've added to the material so far the textures can still look tiled on large environments when you're viewing them in the distance. I've created a nice long strip of landscape to illustrate that here. To solve this issue we'll make it so that the tiling of the material can be changed when it's further away from the camera. I'll go back into my material for one final time and then select the micro color, micro color variation and micro variation blend groups and put them into a comment which I'll call near. Then I'll select everything in that comment and copy and paste them below the originals. Then I'll rename this comment to far. Now I replace and rename the parameters of everything in the far group. So I'll call this far tiling and this one far variation tiling. It's also at this stage that I realized that I had forgotten to set the default value of the micro variation tiling so I corrected that now and then I set the far tiling to 0.05 and the far variation tiling to 0.05. Next I went to the micro variation blend in the far comment, replaced the scalar parameter and named it far variation alpha tiling and set the default value of this to 0.001. I also changed the name of the tint to far tint and far variation tint. Next I created a lurp and connected everything for the far part of the material up to it. Now I just need a way to show the near textures up close, the far textures far away and to blend between them smoothly. To do that I'll create a pixel depth node and then from that I'll create a subtract node. Into B of the subtract I'll create a scalar, call it far distance and set the default value to 5,000. Now I'll come out of the subtract and create a divide. I'll create a scalar to go into B of the divide, call it far fade amount and then set this value to 7,500. Now I'll take the result of the divide and create a clamp, leaving the values at 0 and 1 to make sure that I get black and white values which I can use to drive a lurp. I'll stick this into a comment and just to show you what this does I'll plug it straight into the base color and then apply the material to the other landscape over here. As you can see close to the camera the color is black, further away it's white and there is a smooth gradient fading between the two colors. Black will be where we have our near textures and white will be our far textures. Let's set it up. So back in the material I'll put everything back as it was and then create a new lurp. Then I'll take the result of the lurp from the near group and plug this into A and take the result of the lurp from the far group and plug this into B. And lastly I'll take the result of the create gradient far from camera group and plug this into the alpha. I'll then take the result of the lurp and put this into the B input of the multiplier which adds a noise. And that's everything I need to do. So I'll save the material create an instance and then apply it to the second landscape. Next I'll just match up the colors for the tint to get a better comparison. And then using the material instance I can change the values for the far distance and the far fade amount parameters to get a result that looks like this. And that is everything I have to teach you for today. I hope you found all of this useful and if you have be an absolute G and give that thumbs up button a thorough spanking. If you want to get more from Game Dev Academy then please subscribe and also consider supporting my work on Patreon. The link for this can be found in the description below the video. For my next video I am considering creating a dev log for a PS1 style horror game that I've started making in the small amount of free time that I get. Let me know if you want to see that video in the comments. Thanks so much for watching and I'll see you next time.