Repeat one sprite over the entire surface of the plane

I need repeat one sprite over the entire surface of the plane, like on this image:
Untitledqqqqqqqqqqqqqqqqqqq

But my example is not working properly:

What could be my mistake?

Hey there, I just set the texture to use wrapping mode and played with uScale and vScale to get it looking more like the target image (new code at lines 18-22).

PS and you could remove the subMeshes and multi material like below unless you need them for something else. :slight_smile:

7 Likes

And if, when creating a plane, turn on backUVs and frontUVs

so that only a piece of the sprite is duplicated, is that possible?

Yep it is but IDK what part of the texture you’re trying to repeat though? :thinking:

For example i have a texture:

I want to take only a rhombus from it, as in the case of sprites:

But do not stretch it to the entire plane, but duplicate it in full size over the entire width of the plane.
Is this possible with textures?

Hmm the texture changed but still the same problem that IDK what part of the texture you want to repeat and how many times? With that info/screenshot of the desired outcome I could make a quick example to show how to do it but otherwise IDK how to help… :slight_smile:

From this textures:

Imgur

duplication of a fragment on a plane:

eeeerrrttyuuuuuuuuiiiiiitest

As per @Blake comment and always relevant answers:

  1. Yes, you can indeed repeat a texture and with a limited number on the U and/or V axis.
  2. However, when you say “without stretching it”, that simply means you have to calculate the size of your UV mesh and divide it through the number of repeats and size of your texture. This division needs to match the size/ratio of your repeated texture and – if not – :
    2a) Either you can request to stretch it to match the full size - - or - -
    2b) The difference (remaining parts between the size of your repeated texture and your mesh/UV size) will remain ‘untextured’.
    Hope this makes it a bit clearer and meanwhile, have a great day :sunglasses:

Edit: Here’s a rough example for the values you’ll want to play with

Although there are other (more complex) solutions. There (nearly) always are :smiley:

1 Like

Heya, so this morning I made a little material plugin to try to make this kind of tiling easier to do. :slight_smile: And then played with these new tiling settings a bit: start, end and tiles. They’re set at line 25 like below:

mat.uvTiling.start.x = 0.52;
mat.uvTiling.end.x = 0.7;
mat.uvTiling.tiles.x = 5.5;

mat.uvTiling.start.y = 0;
mat.uvTiling.end.y = 0.29;
mat.uvTiling.tiles.y = 1;

So for v it’s using the top 29% of the texture and tiling once. For u it uses approximately the third fourth of the texture and tiles 5 and a half times. It looks better when the tile is seamless so I chose start and end values where the texture is white (ie the same color).

But note the formula for the uv tiling still needs more testing and fine tuning (ie I just made it up as I went along), but so far it seems to work ok and gives us more settings to play with. :slight_smile:

4 Likes