# Randomized tiling function, eliminate repeating patterns in your textures!

**URL:** <https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519>\
**Category:** Asset Creation\
**Tags:** unreal-engine\
**Created:** [April 5, 2019, 1:13am UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519 "2019-04-05T01:13:49Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![witch-dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/witch-dev/32/465106_2.png) [@witch-dev](https://forums.unrealengine.com/u/witch-dev)\
**Post date:** [October 19, 2019, 10:16pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/21 "2019-10-19T22:16:00Z")

</div>

> [@LucianoJacomeli](#):
>
> How we do this debug view in the final image?

That wasn’t possible in the version on GitHub, I’ve updated it with a new version that makes this possible, just toggle “showDebugColors” in the material.  
I’ve also updated the way tiles get rotated if “rotateTiles” is turned on, now each tile gets a random rotation (before it was fake rotations which were basically just mirroring the texture coordinates on different axis and it was always the same for each kind, so all green tiles used to be rotated 180 degrees for example).  
I also wanted to try using this with virtual textures, but the current implementation of virtual textures is not yet suitable for landscapes which is my main use case for this material.

---

<div class="post-metadata">

**Author:** ![LucianoJacomeli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LucianoJacomeli](https://forums.unrealengine.com/u/LucianoJacomeli)\
**Post date:** [October 22, 2019, 6:03pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/22 "2019-10-22T18:03:14Z")

</div>

> [@witch-dev](#):
>
> That wasn’t possible in the version on GitHub, I’ve updated it with a new version that makes this possible, just toggle “showDebugColors” in the material.  
> I’ve also updated the way tiles get rotated if “rotateTiles” is turned on, now each tile gets a random rotation (before it was fake rotations which were basically just mirroring the texture coordinates on different axis and it was always the same for each kind, so all green tiles used to be rotated 180 degrees for example).  
> I also wanted to try using this with virtual textures, but the current implementation of virtual textures is not yet suitable for landscapes which is my main use case for this material.

Thanks for reply, i’ve downloaded and open you updated in 4.23? Some things not open in my 4.22.3 version. I check the files and all they exist in the project but only 7 is in editor. I will download the 4.23.1 to verify.

 ![Sem-título.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/9/994d9b3ff753b147b0ec9ac8f4f4a655a6fe0bf5.jpeg)

---

<div class="post-metadata">

**Author:** ![witch-dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/witch-dev/32/465106_2.png) [@witch-dev](https://forums.unrealengine.com/u/witch-dev)\
**Post date:** [October 22, 2019, 6:53pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/23 "2019-10-22T18:53:22Z")

</div>

Ah yes, I’m on 4.23 currently (built from source). I didn’t realize that this could cause such issues. I hope you can open it and migrate it over to an older version if necessary. I’ll make sure for future updates to pay more attention to that and update the readme file appropriately.

---

<div class="post-metadata">

**Author:** ![OptimisticMonkey](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/optimisticmonkey/32/906571_2.png) [@OptimisticMonkey](https://forums.unrealengine.com/u/OptimisticMonkey)\
**Post date:** [October 22, 2019, 7:13pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/24 "2019-10-22T19:13:57Z")

</div>

How does this compare to the built-in texture\_bombing node?

[https://forums.unrealengine.com/development-discussion/rendering/85140-texture-bombing](https://forums.unrealengine.com/development-discussion/rendering/85140-texture-bombing)  
[https://developer.download.nvidia.com/books/HTML/gpugems/gpugems\_ch20.html](https://developer.download.nvidia.com/books/HTML/gpugems/gpugems_ch20.html)

---

<div class="post-metadata">

**Author:** ![witch-dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/witch-dev/32/465106_2.png) [@witch-dev](https://forums.unrealengine.com/u/witch-dev)\
**Post date:** [October 22, 2019, 8:38pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/25 "2019-10-22T20:38:20Z")

</div>

> [@OptimisticMonkey](#):
>
> How does this compare to the built-in texture\_bombing node?

My material is much cheaper, as far as I can tell, even a single texture\_bombing node in a material connected to only the base color output has already more instructions and texture lookups than my full material.

---

<div class="post-metadata">

**Author:** ![Miguel1900](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/miguel1900/32/1010694_2.png) [@Miguel1900](https://forums.unrealengine.com/u/Miguel1900)\
**Post date:** [October 23, 2019, 1:26pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/26 "2019-10-23T13:26:21Z")

</div>

Hi @**[witch-dev](https://forums.unrealengine.com/member/1691248-witch-dev)** ,

Great material, thanks!

As feedback, it would be very interesting to have an option (static switch param) to use separate maps as normal, heightmap, base color, etc, instead of unified ones. Yesterday I (fastly) tried to add that options and to share it here, but I didn’t found an easy way to do it and didn’t get a perfect result, as I hadn’t time to analize the whole logic of the material.

---

<div class="post-metadata">

**Author:** ![witch-dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/witch-dev/32/465106_2.png) [@witch-dev](https://forums.unrealengine.com/u/witch-dev)\
**Post date:** [October 24, 2019, 3:16pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/27 "2019-10-24T15:16:14Z")

</div>

> [@Miguel1900](#):
>
> Hi @**[witch-dev](https://forums.unrealengine.com/member/1691248-witch-dev)** ,
> 
> Great material, thanks!
> 
> As feedback, it would be very interesting to have an option (static switch param) to use separate maps as normal, heightmap, base color, etc, instead of unified ones. Yesterday I (fastly) tried to add that options and to share it here, but I didn’t found an easy way to do it and didn’t get a perfect result, as I hadn’t time to analize the whole logic of the material.

I understand that many might like that, but outside of prototyping purposes using it like that won’t be very useful as each separate map would add three more texture fetches and that would quickly become very expensive.  
But I have now added a new material that uses TAA for blending without a heightmap, so the transitions are just linear gradients. It still looks surprisingly good and with this adding another texture sampler will only add a single texture fetch. (for reference the height blending based material has with my two textures has 230 instructions and 6 texture samples, the TAA based material has 237 instructions and 3 texture samples (one of those is for temporal blending)). The new material can’t be used with tessellation though.

Comparison screenshot left side is the old height based method, right is the new material. (The two ground planes are touching and I can’t really tell anymore where one material starts and the other ends.)

 ![witchdevTAAvsHeight.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/a/ca53e70f908617e48a714f7920b7766a2e0d4f08.jpeg)

---

<div class="post-metadata">

**Author:** ![LucianoJacomeli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LucianoJacomeli](https://forums.unrealengine.com/u/LucianoJacomeli)\
**Post date:** [November 6, 2019, 1:50am UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/28 "2019-11-06T01:50:24Z")

</div>

@witch-dev , hi i don’t know how to use Github so i’ve downloaded as .ZIP your project anyway… i put back in github [GitHub - LucianoJacomeli/RandomTiledRHAO](https://github.com/LucianoJacomeli/RandomTiledRHAO) in my version i add the RHAO version, my packed textures is: albedo, normal, mask = Roughness, Height, AO. Please test and check if is correct i think i’ve destroyed some parts, because my colors look strange. I only not understand why we need to put the mask texture weightmap in all texture.

---

<div class="post-metadata">

**Author:** ![witch-dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/witch-dev/32/465106_2.png) [@witch-dev](https://forums.unrealengine.com/u/witch-dev)\
**Post date:** [November 6, 2019, 10:46am UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/29 "2019-11-06T10:46:52Z")

</div>

It looks fine to me, the colors look strange possibly because the skylights intensity was fairly high. You only messed up the output for the debug colors (you had the switch on your RHAO output and it should have been on your albedo), then I changed the normal map to use the normal map sampling mode. You aren’t using a channel packed one, so you can just use Unreals standard that means the offsets around the rotation aren’t needed and the function at the end which reconstructs the blue channel isn’t needed either.  
I’ve made a pull request to your GitHub project, it should merge without any issues.  
Weight map works such that it multiplies the masks from the tiles with the height values from your textures and then calculates a weight for each of the 3 texture samples such that the total adds up to 1. With this weight, you can now multiply the 3 texture samples and add them together to get your final values.  
In the next revision of this I’ll make sure to include a version with a seperate normal map, but for anyone looking to use it with a standard normal map your version with my fixes should be a good starting point now.

---

<div class="post-metadata">

**Author:** ![LucianoJacomeli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LucianoJacomeli](https://forums.unrealengine.com/u/LucianoJacomeli)\
**Post date:** [November 12, 2019, 1:53am UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/30 "2019-11-12T01:53:55Z")

</div>

Material it is working alone, but why is so hard to use it in a landscape material? i don’t know what it’s causing D3DCompile Exception.

@witch-dev Do you already try to use it in some landscape material?

---

<div class="post-metadata">

**Author:** ![witch-dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/witch-dev/32/465106_2.png) [@witch-dev](https://forums.unrealengine.com/u/witch-dev)\
**Post date:** [November 12, 2019, 3:49pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/31 "2019-11-12T15:49:01Z")

</div>

@LucianoJacomeli I’m using an older version of the material in a project and I’ve just thrown together a landscape material with the temporal version and it’s working fine for me. I can update the project later this week with an example of it in a landscape material with a few layers.

---

<div class="post-metadata">

**Author:** ![LucianoJacomeli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LucianoJacomeli](https://forums.unrealengine.com/u/LucianoJacomeli)\
**Post date:** [November 12, 2019, 10:24pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/32 "2019-11-12T22:24:15Z")

</div>

@witch-dev This will be amazing! i have a lot of landscape material, but with my version of RHAO it’s what i use since i use Quixel Megascans Textures and now is FREE for UE4 Developers.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_be468f95](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_be468f95](https://forums.unrealengine.com/u/anonymous_user_be468f95)\
**Post date:** [November 26, 2019, 2:37pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/33 "2019-11-26T14:37:15Z")

</div>

I’d like to use this in a landscape too i’m migrating from Unity and this feature looks amazing specially if used in layers. i’ve tried to use but show a compile exception in Material.

---

<div class="post-metadata">

**Author:** ![witch-dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/witch-dev/32/465106_2.png) [@witch-dev](https://forums.unrealengine.com/u/witch-dev)\
**Post date:** [November 29, 2019, 10:18pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/34 "2019-11-29T22:18:18Z")

</div>

@LucianoJacomeli Still going to work on this, I just didn’t find the time for it yet (also I’ve been wanting to wait for 4.24 because it finally makes array textures available).  
@anonymous_user_917e6b1f The material might be a bit complex if you are just starting with unreal, I’ll try to have a more complete (and flexible) example available soon.

---

<div class="post-metadata">

**Author:** ![Zothie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zothie](https://forums.unrealengine.com/u/Zothie)\
**Post date:** [December 2, 2019, 12:55am UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/35 "2019-12-02T00:55:50Z")

</div>

Same “D3DCompiler exception” for me when i try to do WorldAlignedBlend for more than 1 material with such function. Im not really experienced in ue4 materials to solve it by myself but its still a very cool function that helped me a lot. And anyway, i would be very appreciated if anyone helps me with that error. Here is my blend func if needed

 ![image.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/8/585e66386d419abadad5b46ad11912caedac998a.png)

---

<div class="post-metadata">

**Author:** ![witch-dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/witch-dev/32/465106_2.png) [@witch-dev](https://forums.unrealengine.com/u/witch-dev)\
**Post date:** [December 3, 2019, 3:05pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/36 "2019-12-03T15:05:47Z")

</div>

> [@Zothie](#):
>
> Same “D3DCompiler exception” for me when i try to do WorldAlignedBlend for more than 1 material with such function. Im not really experienced in ue4 materials to solve it by myself but its still a very cool function that helped me a lot. And anyway, i would be very appreciated if anyone helps me with that error.

It’s a bit difficult to figure out what is going on from your screenshot. I haven’t used the WorldAlignedBlend node before, If you can upload an example with the error somewhere I can take a look at it.

I’ve started working on my landscape master material, though it’s going to take a bit longer. The material is going to be fairly complex because I’m mixing temporal, tri-planar and height based blending techniques to achieve the best compromise between quality and performance (Also I’m looking forward to having array textures supported in the engine). I’ve also taken a look at Quixel Bridge and am now developing the landscape material with textures exported from there. I’ll document the correct export settings so that your textures from there will be compatible with the material (I won’t be able to upload my project with Megascan texture due to the license.)

 ![witch201912031.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/e/8/e89553764ca1cc553a044ecc77ebf5f74614737c.jpeg)

This random grass texture I’ve downloaded from Megascans provides also a very good example of how effective my basic tiling function is:

 ![witch20191203.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/0/0/00893a0c9e104e7f16e6aba529c99337810160b9.jpeg)

---

<div class="post-metadata">

**Author:** ![Zothie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zothie](https://forums.unrealengine.com/u/Zothie)\
**Post date:** [December 3, 2019, 5:38pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/37 "2019-12-03T17:38:25Z")

</div>

@witch-dev @anonymous_user_917e6b1f @LucianoJacomeli doesnt megascans are free for ue4 users now? I thought its ok to share assets with anyone but its illegal for anyone to use them in their projects… But anyway, ive reproduced this issue here at 4.23 [https://drive.google.com/file/d/1jjp…vnkMVqLYx/view](https://drive.google.com/file/d/1jjpx-52St07O1yVcD2vdCCuvnkMVqLYx/view)

And also ive just solved the problem. At least a bit.  
First, when i was searching for the problem, ive tried to pin the material to the end output first and it was ok. But when i pinned it to the blending function and then to the output - it ended up with error. So i thought the problem was in blend function or somewhere there.  
Secondly, it can work with blending function, but it works only if material is outside any function as in the example project ive made. Cant say what the problem but i guess its something inside the engine.  
But, thanks to you, ive come to try to reproduce the issue and accidientally solved it. Hope it will help anyone else who comes there with that thing. All setups that work\doesnt work is in the project link above.

---

<div class="post-metadata">

**Author:** ![witch-dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/witch-dev/32/465106_2.png) [@witch-dev](https://forums.unrealengine.com/u/witch-dev)\
**Post date:** [December 3, 2019, 6:50pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/38 "2019-12-03T18:50:36Z")

</div>

@Zothie Weird error, I have really no idea why it would fail there when used inside a function, glad you have found a workaround. Here is the full error message for future reference:

```auto

LogShaderCompilers: Warning: 1 Shader compiler errors compiling TestMat for platform PCD3D_SM5:
LogShaderCompilers: Warning: C:/Development/UnrealSource/UnrealEngine/Engine/Shaders/Private/ShadowDepthPixelShader.usf(): Shader TShadowDepthPSPixelShadowDepth_OnePassPointLighttrue, Permutation 0, VF FLocalVertexFactory:
    D3DCompile exception
LogShaderCompilers: Warning: Failed to compile Material /Engine/Transient.TestMat for platform PCD3D_SM5, Default Material will be used in game.

```

Regarding the Megascan materials as far as I understand it, the license allows using it in any game made with unreal engine. But we are not allowed to share the textures, I’ll just ask whether having textures in a public project as \*.uasset is okay or not.

---

<div class="post-metadata">

**Author:** ![LucianoJacomeli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LucianoJacomeli](https://forums.unrealengine.com/u/LucianoJacomeli)\
**Post date:** [December 4, 2019, 10:20pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/39 "2019-12-04T22:20:41Z")

</div>

@witch-dev amazing images, with Quixel Mixer do a texture with grass & dirt and with your function randomizing everything, tomorrow will occour a livestream about the new open world tools for UE4, lets see if they will say something about “array texture”, i hope it transform the UE4 like Frostbite in support for multiples landscape layers.

---

<div class="post-metadata">

**Author:** ![witch-dev](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/witch-dev/32/465106_2.png) [@witch-dev](https://forums.unrealengine.com/u/witch-dev)\
**Post date:** [December 5, 2019, 6:26pm UTC](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519/40 "2019-12-05T18:26:46Z")

</div>

It’s time to tune it down again. Currently, I have 12 top and 12 lower layers with one layer that regulates how much the lower layer shows through, the lower layers also get more visible the steeper the terrain is. All layers are tri-planar projected (I’m using temporal blending, so having all layers tri-planar is the same cost as having one layer tri-planar) and blended with texture height information, my main issue right now is that I can’t have two sets of weight blended layers (top and bottom layers should be weighted separately). It’s now time to optimize the shader and probably throw out a few layers as 24 seems a bit excessive.

 ![witch201912052.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/1/210d670a8dd8b60f845d5871423296a932eddae7.jpeg)  
 ![witch201912055.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/6/56ae2bfdcf69efd5940aacf5d9340a645c138c17.jpeg)  
 ![witch201912056.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/3X/2/7/273bf5f0551c231e638bc966200b602d1ddb2904.jpeg) The textures are straight from Quixel Bridge, I didn’t adjust them and just chose them pretty much at random. (Which led to most of them being Iceland stone/rock textures)

[Previous page](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519.md?page=1)

[Next page](https://forums.unrealengine.com/t/randomized-tiling-function-eliminate-repeating-patterns-in-your-textures/124519.md?page=3)
