How to scale and wrap individual tiles in a texture atlas?

Hello, I have been trying to scale and wrap (tile) a specific tile in a texture atlas.

Let’s suppose my texture atlas looks like this

When I scale the first tile up or down, it should look something like this


MI_TexAtlas_2 2024-01-03 11-47-17

Which it does. I’ve been using the built-in MF named WrapFloat2 to get the job done on the first tile. But the problem with that function is that it wraps between 0 and the given end value to wrap at. So, the first tile, which starts at the UV Coord 0 tiles perfectly and scales. But when I move to tile 2 or tile 3, the wrap starts from the beginning since it is wrapping from the start. It then starts to look like this


MI_TexAtlas_2 2024-01-03 11-47-31

My current Material setup looks like this

I have gotten both parts of the material that I want in the same material working separately.
I have successfully been able to make a material with a texture atlas and have been able to pick the correct texture atlas and I have made a material that scales, tiles, and wraps perfectly but I haven’t been successful in making a material that both picks the correct atlas tile and scales it.

PLEASE HELP!!
And thanks in advance.

1 Like

Not pretty, but it works :wink:

1 Like

Thank you so much for your reply @ClockworkOcean

But I have been able to make a material that selects the individual tiles on an atlas.
What I’m trying to figure out is, how to also scale any part of the atlas and have it be tileable like this

MI_TexAtlas_2 2024-01-03 11-47-17

For example, let’s suppose I select U4 and V5, which would be the tile E3. Now, how do I scale that part and have it be tileable like in the gif above.

Any insight would be much appreciated, thanks.

1 Like

Ah, sorry, my bad… ( thinks )

1 Like

I’d say, do the wrap float first

( incomplete, but you get the idea )

( bit more complete )

1 Like

Thank you so much @ClockworkOcean
This was the solution!!

Here’s the Material with descriptions for anyone trying to replicate this in the future

Here’s the code if anyone wants to copy it from BlueprintUE
Resizable Texture Atlas Materials posted by anonymous | blueprintUE | PasteBin For Unreal Engine

2 Likes

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