How to Break the Repetition of Tiling Texture in Unreal?

Greetings Unreal community, I wish everyone a delightful day.

I have a question about my personal project and hope to receive support from everyone. I am working on simulating a medieval village with numerous houses. I’ve extensively utilized tiling techniques for my buildings. I am aware that there are several ways to help break the repetition of tiling textures:

Option 1: I can use Decals in Unreal.
Option 2: I can use a different UV set in my model to incorporate textures like dirt, leaks, alongside my main UV utilizing Tiling texture.
Option 3: I can use Vertex Painting in Unreal (it seems like this may not be applicable when using Nanite?)

I would like to gain a deeper understanding of the pros and cons of each method and the performance they bring to the environment.

Thank you, everyone! ^^

Hey there @Starcarft! Welcome to the community!

Option 1: Decals can be quite expensive performance wise for games if you use massive amounts of them. Though they have some features that could be useful since they can move as well as do some custom depth tricks. Best used for details instead of breaking up tons of tiling.

Option 2: This is what I recommend when handling terrain and other large scale tiling textures as this is much cheaper than decals, and if you’re particularly skilled with materials you can gain some efficiency by the extra maps inside of a single texture by splitting them into their own channels and handling the colors in shader.

Option 3: Vertex painting is actually supported for nanite assets, though only partially. (Read more here)Depending on how you would be applying this, it could be significantly more effort. I don’t have much data on it as I’ve only manually vertex painted very rarely.

1 Like

This is an oft-covered topic, with many solutions.

Usually, one can at least brute-force their way out of this by using multiple texture samples, rotated, scaled, etc independently and then blended back to a final, aggregate map. More or less expensive in how you do it, look at the Texture Bombing node for an example.

Generally, you are better-served (efficiency-wise) with UV manipulation. This can help cut down on the overhead of multiple (or at least more) texture-samples but it’s also more complex-math (it’s like a trebuchet!). Good examples of what can be done are here: Unreal 4 UV Tricks — tharle VFX

He’s also got a video: https://www.youtube.com/watch?v=yj7-h_X_eu4

Rodrigo Villani is another good source: https://www.youtube.com/watch?v=MaDhhyrFbrM

There is also more advanced stuff like using temporal-sampling: Randomized tiling function, eliminate repeating patterns in your textures!

3 Likes

Fantastic, this is exactly what I was looking for, thank you so much. So, it seems that the majority of UV-related operations within the Shader are likely more cost-effective compared to other methods.

I think I will apply the second method more, but will combine methods 1 and 3 for practice and learning purposes ^^.

I’m not sure if Nanite is widely adopted in games at the moment. In my project, I still use low-poly models (few triangles) to contain information baked from high-poly ones, so it seems like I won’t be using Nanite.Is Nanite applied for anything else besides directly incorporating high-poly models into games with high mesh density?

Finally, does Vertex Painting incur a significant performance cost? Is it widely used in games?

Once again, thank you very much.

Thank you very much,

Working with UV in the Shader is definitely something I will be interested in in the near future! Thanks for all your insights. I will definitely check out your helpful links. <3

Nanite doesn’t offer any benefits for lower poly geometry, and actually loses some features static and instanced static geometry offers (for now until they are fully implemented into Nanite that is). If you use the Nanite visualizer and check your scenes with nanite geometry, you may realize it’s not changing the geometry at all, this means it’s already under it’s threshold.

Don’t let my comment about decals dissuade you, as they are only really as heavy as their complexity like any other material really. Decals are definitely necessary in most games in some shape or form, just can’t go too overboard.

Vertex painting isn’t as much performance heavy as implementation is a bit more work and the UV manipulation is just better in most ways.

1 Like

I like it for foliage. It’s a mesh-shader, much of what is typically done on the CPU insofar as sorting/culling can be offloaded to the GPU. Nanite t does well with crowded scenes, actually better to some degree as I understand it. Things like grasses, trees, big rocks that ultimately occupy the majority of your screen real-estate will benefit from being proc’d on the nanite pass.

Insofar as any vertex-coloring, there’s always the cost of the math you do with it in the shader, but for overhead, vertex-colors are always there; they are as intrinsic a part of a mesh as the vertices themselves. You choose to read them if you want to.

And yes, it’s a viable place to pack/carry data in a mesh, they are widely used in gaming. Vs a texture you could store the bendyness of a plant in one of the vertex colors. 3dStudio Max bakes in all kinds of deformation information into vertex-colors.

There is also stuff like this: Vertex Color Materials | Unreal Engine Documentation

Or this: Baking out vertex animation in editor with AnimToTexture | Community tutorial

In the end, the vertex-color is a 4vec that lives along with the vertex. It can be used to store that amount of information. How you choose to interpret it is up to you. Think of it like a freely-carried texture, but only at the resolution of the vertices. For nanite, they even recommend using the vertex-coloring for capturing AO since the density of the mesh can be so dense, you can save on a few textures, or use the slots for something else.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.