Repeat UV texture without repeating tiles in editor

I’m developing a voxel game and have begun working on a greedy-mesh algorithm to decrease the number of vertices used in each chunk mesh. Since fewer vertices exist, now the UVs are being stretched.
Since varying portions of the chunk mesh have different levels of UV-stretching, I can’t simply have the tile texture repeat x-amount of times across the board. From what I’ve read, my only solution to this is to create the shader myself.


Here’s essentially what I want the end product to result in:

In addition, the texture map has over 10,000 unique texture tiles on it. In some way, I have to tell the shader to use its given UV coordinates, and then repeat the said texture based on- I imagine world space?

I hope someone will be able to help me out! Let me know if any other information is needed. Thank you!


From what I’ve read, 2D texture arrays seem to be a possible solution because that would allow for singular textures to individually repeat. Though, an issue with it is its limit of 2048 textures/‘slices’ per array. The texture image above is 10,000 tiles… Still hoping to find a better solution!

You could use world or local coordinates, like you say. Local if the blocks move or scale.

After several months of development, 2D texture arrays were the way to go! Though they have memory limits, I had the textures distribute across multiple submeshes to allow for it.