Author Topic: Hiding tiles in designer and painter (and in engine)  (Read 1547 times)

Hey everyone, I'm currently trying to figure out how to reduce visible tiling in both Designer and Painter for video game assets, I want to do a deep-dive into the subject and am hoping you could give me some advice on how best to deal with it.

I've read some other threads that suggest tiling an be minimized by overlaying another, texture (that's larger and has fewer or no tiles) over top the tiling texture to "break it up" this seems to work decently well, and maybe I'm just being too picky, but often the original tiles can still be discerned, and they appear splotchy and discontinuous, as they did without the overlay. with this technique I'd like to know:
1: how can I best minimize the tiling? lowering contrast and finding a good random seed seem to helps, what else can I do?
2: how can I apply this in engine (unreal or unity) effectively? I would only want to do this in engine for things like terrain or large buildings that necessitate tiling due to texture size constraints, for smaller assets like character or props that have unique uvs that don't require tiles I would just do it in painter. In the terrain case, how do I have two textures that tile / scale at different rates? Do I blend the two layers as separate textures (maybe based on viewing distance?) use decals? some other technique?

Also, I'd love to learn how to make substances in designer that avoid the issue entirely by implementing a "scale" or "zoom" parameter like the the Perlin noise and some other noises have built into them.
for assets like in the attached image, I just want to reduce the scale of the noise cleanly, no tiling is required by the uvs/mat, as each point on the plane has a unique uv position - its just the scaling that off, so if I were able to implement the scale feature into my noises I could avoid tiling entirely (in this case, but this wouldn't be useful for terrain, as it naturally will require tiling).
I've seen it suggested that fxMap node could be used for this, or perhaps the the tile sampler if I expose the tile amount and other params. I already have some ideas about how to make this work, But, I'd love to get advice or be pointed towards a resource or tutorial that goes really in depth on the topic before I start experimenting, as I'm quite new to designer still.

So to summarize:  I want to make game assets that don't have visible tiling in them,
-I'd like to learn how best to reduce tiling on textures I make in painter when the texture I'm using doesn't have a scale parameter like the Perlin noise, but I need to change its scale, employing techniques in painter to minimize the tiling effect.
-I'd also like to learn how to create my own noise in designer that has this parameter, though unless I can make a graph that effectively does this for existing textures I will still need to learn how to solve the previous point as I don't think it's viable for me to make everything from scratch.

Sorry for the long post, I greatly appreciate any help, and sorry if I've missed something obvious to the veteran users.

-Nolan Grant

This is an interesting question, in general, and one that doesn't really have a single answer. I think this is a perfect example of where the "artist" part of "Texture artist" comes in... You can make a very technically excellent and accurate material, but you need an artistic eye to find parameters and settings that hide the limitations of the medium and 'sell' the image. For single-image tiling it's often just a matter of choosing the right random seeds, trying out different combinations until they look balanced. With the right distrobution of lights, darks, detail, and resting area, an image can be tiled without a casual viewer ever noticing. Or, those very same functions, with some subtly different choices, can distract even the most immersed viewer. There's no formula for this, though.

There were some technical questions in your post, too, though. The first was how to use textures in large assets like Terrain in a way that hides the inevitable repetition... The best answer for terrain, I think, is one that's already very well-supported in Unity and Unreal, and that's splat-maps. Making a good splat mapped terrain is a whole other skill, and there are some clever tools to asist as well, but the basic idea is that the terrain has several textures loaded into it (I usually use four, but more or less can work), and an additional map indicates through it's colors which of the textures to sample at any given point.
If the final map (the splat map) is varied enough, and matches the shape of the terrain well, the repetition of the terrain textures (depicting things like grass, bare dirt, gravel, rock, etc) is hidden. Before one texture can fully repeat it's already changing into another type.
It's a time consuming process, though, and in many cases, even professional studios get lazy with areas that won't get much traffic... my favorite example is half-way up the far side of the big mountain in Grand Theft Auto V. The otherwise impressive splatting done on the rest of the terrain starts to lose its momentum, and suddenly the repeating patterns are very visible.

You mentioned decals. Decals can be very useful, since they represent something we'd expect to see anyway... variation. Patches of plant life, cracks in a road, roads in an otherwise natural setting, lichen... Plastic bags seems like a popular one. All these sorts of things can be placed around a texture in a way that looks natural, and also simply covers up the parts that would have repeated too much.

I've tried using a combination of big textures and detailed textures. I haven't really had good results. The assets usually seem boring from far away, and sort of bumpy up close. I had better luck with a range of differently sized pieces that could be repeated... I'm thinking here of a large boulder I once had to make. I tried having the macro-features, including AO, cracks, and weathering, handled with a custom, uv-fitted texture, and a plain rock texture that could repeat to make it seem high-res when standing next to it. What worked better is having small rock shapes make up the human-heighted part, with medium sized assets above that (which would never be seen too closely since they were up in the air) and one large piece on top to show the shape (which could be very low-res compared to the ground-level assets)

Finally, your question about SD-specific zooming. Perlin noise is a good example for this question, not just because it's a feature you enjoy, but because it works in a unique way that may give you some ideas of how to handle scaling in your own substances.
It can be thought of best as an algorithm, rather than a texture, I think. You may have read this elsewhere, but perlin noise is the result of several layers of 2d noise at different levels of blurriness. In this case, because SD has features like FXMap (which can generate tiled images very powerfully), the 2d noise can be thought of as a field of randomly placed white blobs on a black background. Combine this with another field of randomly placed blobs, but this time smaller, and more of them, and combine this again... and you get something like perlin noise.
The scaling trick is now quite simple... if you're comfortable with Substance Designer function graphs with variables, that is. If you set the size of the blobs to be an inverse of the number, you have a generator that can fill the screen with just enough blobs no matter how many you decide to put. And the more you add, the smaller they are.... Make their position be somewhat tile-like (also controlled by the inverse of the number of blobs...), and adding more blobs will look like the current ones are shrinking and more are being revealed. The fact that all SD functions repeat in X and Y by default means that this will always automatically tile.

This can get complicated, as you'll see by opening up Perlin Noise Zoom, going to Edit FX Map, and clicking on the function icon for Branch Offset. All that math controls the position of the blobs. But (somewhat) simpler solutions could be found, too. And I've found once I start in on creating a function like that, I can take one step at a time without any trouble until I look back and see a big mess like that and wonder how I ever figured out how it all worked...

One final note. Any good algorithm, if it works one place, it can work on anything else that runs commands, given enough time and memory. In this case, texturing through algorithms like this using nothing but shaders can be possible, where you'd have a non-repeating asset that could go on for miles, if you liked. I had a lot of fun with these sorts of textures when I was learning how to use Pov-Ray to create images... Although I prefer this more modern work-flow.

I hope you found this interesting. I know it's a long reply... But, of course, sometimes a complex subject like this needs a long reply.

Thanks for your reply Cory, an in depth response like this is exactly what I was hoping to get!

I just learnt of the existence of splat mapping shortly after my original post but I think I have some misconceptions about it still, some of which I think you've already cleared up;
In most of the examples I've seen online, splats were used to blend between two very different mats (eg a green grass transitioning to a grey gravel) but I imagine that this is just for illustration and typically splats are also used for variations of similar textures (like multiple variations of grass). If so, I may have overlooked the usefulness of this technique. 

you said "Before one texture can fully repeat it's already changing into another type."
To me, this sounds like something for which passable results could be achieved through automation, I'm not sure if this is already a feature in some terrain add-ons, but surely I could write some code that uses noise to vary the opacity of the splat layers. If I had 4 grass variations and I ensured my noise would always transition the texture before it repeats then I would technically not have any seams, though hand painting them would probably look better.
again, not sure if someones already done this or if I'm still thinking about splats wrong, but would love to hear more about his topic.

there's also some interesting considerations to make with regards to smoothly blending the regions that I need to consider that I hadn't, for instance, if there's a rock in the texture right where the alpha between two textures is 50%, then the rock will probably look off if it has 50% its height/normal/color info but is half grass, so I need to make some sort of mask for those details, or put such objects as decals, or employ some other method to make those transitions clean, would also love too learn more about this.

you also said "I've tried using a combination of big textures and detailed textures. I haven't really had good results"
I'm a little unclear on this, it seams to me there are several ways to vary texture scales, maybe I'm missing some,
1: having a single fitted uv texture for an object that doesn't tile (eg characters skin), then having either a tiling detail mask/map or multiple uv sets of detail maps (eg the characters pores and subtle details) that appear up close. Since the base texture never tiles, these detail map(s) only exist to add detail up close.
2: having a large object (like a concrete bunker) that uses a tiling texture up close, but fades to a larger, more uniform texture with distance to avoid the appearance of tiling. this might just be the same principle as #1, but I feel there's a distinction here. I think this is what you were talking about when you said "didn't get very good results... boring from far away, and sort of bumpy up close" I'm interested in this method, but I definitely see that limitation - though for something like a sandy dune I think it's acceptable, since I'd expect much more uniformity from a distance and granularity up close. Another obstacle is handling the blend between the two without making the transition, which is probably an art in itself with balancing the transition starting and ending distance as well as creating the two textures so that details don't appear and disappear, I'm sure simply reducing the contrast and variance in the macro texture will not be enough.
3: I think this is what you used for the boulder, but I may be mistaken; using textures that scale at different rates: so for example a house that has an 16x repeating 4k brick texture on the sides where the player will see them, and an 8x repeating 4k texture on the roof that is less-seen. Then I imagine blending and decals are used to break up the texture more if needed.

I'm not sure if this is all the general methods (plus splat mapping mentioned before) or if there are even more I'm missing, also I've definitely made some assumptions and mistakes, and am not sure if I interpreted everything you said correctly, let me know.

as for designer, I'll definitely take a shot at creating some new mats with a zoom feature, as well as see what I can do about tiling existing textures, likely using the methods mentioned.

I also thought it's funny that you mentioned your favourite example in grand theft auto, since I also have a favourite example: the the volcanic rocks in the demon ruins in dark souls.

Thanks again, I really appreciated your reply and would be happy to hear more about any of these topics from you

You mention here the difficulty in using two different terrain types in a system like this... And I think you're right, the tutorials and examples use very visually different assets because it's easy to see to a person who is trying to learn how the system works. In practice, though, sometimes you really Would want to blend two different terrain types, and it can be a challenge. Usually the colors are interpolated, by default... color 1 * value 1, + color 2 * value 2 (with splat maps being set up specifically so that all channels added together makes 1). And this can look muddy and unrealistic.

One solution people have found is to have custom shaders that use height-based blending. Height detail can easily be included in the alpha map of either the basecolor or the normal map, and that can be used, with influence from the splat, of course, to chose which type shows. This way you can have features like sand that gets in the cracks of stone or gravel at the edges, and it looks like the one type is simply submerged into the other type.

My favorite post about this can be found here: (I like it because it very clearly illustrates the math involved)

Thanks again Cory, looks like an interesting read, I'll have to dig into it and test it out tomorrow