Topic was automatically imported from the old Question2Answer platform.
Asked By
stalker2106
I have a basic mask shader that I use to mask part of my sprite.
I wanted to make the texture repeating to make a larger sprite, but the mask is applied to all the repeated instances of the textures, instead of the global sprite.
You can tile the texture using shaders instead of using texture region.
Lets say you want the texture to tile 4x4, you just multiply the uv’s by 4 the use fract on the uv’s and you have tilling texture. I mean this way:
vec2 uv = fract(uv * 4);
Use the modified uvs with the colour and the original uvs with the mask and it should give you the effect you are after.
You can replace the 4 with a vec2 that fits your needs.