Differents texture scales on a cube

Hello,

I have been searching the solution for hours but I couldn’t find a working one, so here’s my problem :

I create my level using Unity’s cubes, but the textures are messed up because Unity fit the texture and I do not want that, so I searched everywhere to fix this but couldn’t find, see the image to see what I mean :

[30122-sans+titre.jpg|30122]

What I want is that face “A” has the same texture scaling as face “B”, same goes for face “D” to have the same texture scaling as face “C”.

Notes :

  • There is only 2 materials used (floor/wall) which scaling and tiling are not edited, they are diffuse.
  • Like I said, those are Unity’s cube, they aren’t planes/models or anything else.

So what I can do to fix the problem and get the result I want ?

Thanks

Shepard

You’re seeing texture stretching/distortion as a result of the fact that all of the cubes have the same UV mapping, but different sizes. If you’re not aware, a 3D model’s UV map specifies the relationship between its geometry and its texture.

There are a few ways you can fix this.

First, you could use a modeling program to create more geometry with proper UVs. Maybe a bit tedious, though.

Second, you could use various materials with tweaked scale. This option is probably the simplest, especially if you’re not sure what all this is about.

Third, you could use a custom shader that fixes the problem automatically. This option is probably difficult if you haven’t mucked around with shaders, before.

I tried the second solution, what I have done is that I edited a wall’s Mesh Renderer to have 2 materials instead of 1. I made a copy of the material and change it’s properties to have the desired scaling, but the problem is that both materials are applied to all faces. Is there a way to apply a material to a set of faces only instead of the whole cube ?