Home > Enterprise >  How can i repeat a texture at its original scale on my cube in unity
How can i repeat a texture at its original scale on my cube in unity

Time:10-24

So as you see in the picture, i made a texture repeat on a rectangle(its size is 40,10,60) but it repeat the same amount of time on every face,so depending of the size of the face the texture is stretched. In the picture you see that on the top face the texture repeat correctly and keep its original size but on the other faces it is streched. Is there a way to repeat the texture without changing its size ? Thank you for your responses.

enter image description here

*** Edit #1

The x and y Tiling values need to proportional to the scale of the plane or it will stretch.

CodePudding user response:

If the size of the mesh being textured is static, you can change its UVs in a 3d program. You could even change the UVs via script.

Another option would be to look into worldspace (triplanar) shaders. These texture based on world position rather than the vertices local position.

If you are using Shader Graph, look at the triplanar node. https://docs.unity3d.com/Packages/[email protected]/manual/Triplanar-Node.html

  • Related