Texture Problem

Hi there,

I have a mesh, that can be scaled in any size without the geometry stretching. I do this by splitting the mesh into different parts: horizontal parts, vertical parts and corner parts. Shown in the images:


the mesh is properly unwrapped. Now the problem i’m having:
In my project i scale this frame mesh differently. To ensure that the meshs texture is not stretching i am using THREE.RepeatWrapping and map.repeat.set(x, y); that works fine aswell. My problem is that i have to provide three different textures to the mesh. One for the corners that does not stretch, one for the horizontal parts, that scales with the width of the mesh and one for the vertical parts that scales with the height of the mesh.

This is how it looks in threejs:

  1. Can i somehow use only one texture? (If i use one texture the .repeat.set(x, y) property does change for the other meshes aswell because they refer to the same file.

  2. Is my way of doing it bad and you can give me some advice how to improve it?

Thanks

Tom