Step 1.
Before we start creating our Materials we want to consider texture tiling – yes it’s a thing and it happens – often. That’s why great minds have spent a lot of time coming up with ways to combat it. We can learn from those minds and preemptively tackle it right from the start.
Let’s create a few material functions that can be used to add variation to our textures in a number of ways and give the Material Instance the ability to change their masks and scales for each different layer.
I’ve added them as copy/paste blueprintUI scripts so you can either create them yourself and paste the code into those, or there is a link to a project at the bottom of this tutorial you can download with all the Landscape materials and functions included.
Before creating the functions, there is a common method used by many of them to get a non-repeating mask value over a long distance. Epic created a system (used in their Starter Content) called Macro Texture Variation which scales 3 sets of UVs, reading the pixels from a common mask at those 3 places and calculating a mask value from them.
Here is a material function that does this. This function is slightly different in that rather than multiply the values out it just adds all 3 together – it just makes it more versatile for other uses such as mixing textures. The Blotch Material Function calculates a lighter/darker combo with the results with a parameter to adjust the blend.
The types of de-tiling we are going to use are:
Scene 1: The Swizzle
The Swizzle de-tiling method takes a single channel mask and passes through either the original UV positions for the landscape textures or a set of UVs that are rotated by 90 degrees. It also takes care of rotating the Normal map which is as simple as exchanging the UV to VU. The swizzle still gives some tiling at a distance so it’s good to combine this method with one of the distant methods.
Scene 2: The Blotch
The Blotch de-tiling is the simplest type and works close up and far away. It works by applying a mask to the Diffuse to lighten or darken it slightly, producing variation at the masks scale. This technique is used by a number of materials in the Epic Starter Content (called Macro Texture Variation).
Scene 3: The Puddle
This is very similar to the Blotch de-tiling, but instead of lightening/darkening the pixels it adds puddles.
Scene 4: The Zoom
This method is used when the texture is being rendered further away from the camera, it basically just shrinks the UV coordinates to make it appear larger – when combined with the Swizzle, it can hide the tiling at a distance.
Scene 5: The Mix
This type is very similar to the Blotch but instead of changing the brightness of the diffuse textures it combines two sets of textures through a Mask. This takes twice the memory but provides the best results.
The Mix DeTiler can be expanded upon with more source textures added, interpolating between them all with masks – this can be very effective at creating a varied landscape without needing to do much painting.
Scene 6: The Scramble
The last type I’ll mention here is a method that breaks up your texture into smaller sections and rotates/scales those sections into a tiled version of the texture.
There are tools built into both Substance Designer and Quixel Mixer to do this – and rdTexTools can do this well too. (See the “Using rdMasks” tutorial here and “Removing Patterns from Tiled Textures” tutorial here).
You can use a CameraDepthFade to Lerp between your original set of textures and the rotated/scaled ones created by one of these applications. We won’t go into this method for the tutorial but if you’re interested, you can find more information in the “Using rdMasks” tutorial and by searching “Substance Smart Auto Tile” or “Quixel Mixer Remove Tiling”.
It’s also possible to have a shader do the work of rotating/scaling the texture/s in real-time (similar to the swizzle and zoom DeTilers here). Some landscape materials mix up to 4 or 5 different textures into the base texture doing this. It does take a lot of Texture Samplers and Shader Instructions to do this though.
Scene 7: None
We also create a DeTile function that just passes through the original textures for when we don’t want to use any type of DeTiling.
Combinations of DeTilers
Below are three more Material Functions which are combinations of the above. The first is a combination of the Swizzle and the Puddle, the second is a combination of the Zoom and the Puddle and the third is a combination of Mix and Puddle. It’s easy enough to create any combinations you want by copying/pasting the relevant parts of the blueprint.
The example project, and my blueprintUE account (https://blueprintue.com/profile/recourse/) has more examples of combined de-tilers.