Combine tiled and untiled parts in material (texture)

I have model with 2 material slots.

  • 1 slot tiled texture
  • 2 slot untiled texture

I want to optimize drawcalls for mobile, so i want use one material, combining tiled and untiled parts. And assign this material to slot 1 and slot 2. So material behavior must be “tile part of texture tex.png in 1 slot“ and “not tile part of texture tex.png in 2 slot“. OR maybe this case can be solved with one material and one slot?
Is it possible or not?
Sample of tex.png is below

You basically want to create a texture atlas of the two textures inside of the material and then add in the needed offset for uv maps.

If you want to just save it offline, you can merge the materials via the merge actor function to get an output of a merged material.

Here is a video explaining the process

It’s an external video on youtube not affiliated with epic games.

If you want to do this at runtime it’s more complex, it would require c++

You would need access to each node of the materials nodes (Base color, Metalic, Specular etc) and do this combine for each part of the material.

Thanks for the reply, but it’s not exactly what i needed.

  • I can make texture atlas, and point different parts of master texture in mat instances
  • i can use different UVs channels in one material
  • i can merge materials

My question how to tile PART of the texture, but leave other part untiled. See picture below.
I want small picture tile along side polygons (not losing quality), but big picture remain untiled.

  • keeping topology
  • one material
  • one material slot
  • one mesh

The combine actor tool will do this for you. Just put the tile-able texture on one actor and the un-tiled material on another and it will create a new material that has both the repeated texture and single texture combined.

Here is the result of a merge. Tiled tiles and single fire texture, mixed into one texture generated by the engine:

Unfortunately custom parameters are cooked into the material so you would have to regenerate the combined material if you wish to change the tile value.

It basically creates an atlas and does the correct calculations for the texture coordinates so the tiling occurs where needed.

I repeat your method, and one material with one texture appeared.
BUT
In my example i tile small picture 5 times. In real, i need tile 40-50 times.

So, the quality of small picture in resulting texture drops a lot (squashed). I searched for some method, without losing quality.

In other words, i can do “merged texture” in photoshop, without UE. Main reason tile with original quality (maybe some material nodes)

You need to set the lod to 0 and choose to merge materials (not on by default)

Single mesh with multiple mats:

Left mesh after merging materials:

Unreal generates an atlas like this for the merged variant:

It’s not perfect as it physically repeats the texture inside of the atlas, but to get the atlas you want you probably need c++ at that point.

Edit:
Have a look at this thread regarding tile-able atlases

Using this type of tile-able atlas along with vertex colors to define the material lerp you can get this

This gives

vertex color for mesh

1 texture only for the mesh

The x and y of the vector next to the texture coordinates dictates the amount of repeats in X and Y of the tileable texture.

1 Like

Exactly what i needed! (How on earth human being can construct this setup )))) ). Thanks a lot. Below my test. (I use 1,2,4 squares for main (untiled) texture, and square 3 for tiled texture ). Thanks to forum and community.

upd.
Modified version with masked tiled part

1 Like