0
$\begingroup$

Is there a way to precisely place a repeating texture on a large mesh?

I have a mesh with 8 by 16 by 1 dimensions, loop cut both horizontally and vertically, so its surface is divided equally to 1-unit squares. I also have a 64 by 64 texture, containing 16, 16 by 16 squares of varying colors. I would like to place these squares so that they are repeated and each one only covers one square on the mesh (so the texture covers the mesh evenly).

I have tried several methods, such as making a Project View unwrap from top orthographic view (theoretically, this way I get even squares on my UV) and then resize it until the squares overlap precisely. However, there is always some distortion, I cannot make them align dead on.

I know I am doing it wrong; there must be a way to do this on the dot, I just don't know how.

Can someone help me solve this problem?

This is what I have; maybe visualizing it will help understanding y problem better:

enter image description here

Update 1.: Here is the texture I am using to learn precise texture placement:

enter image description here

$\endgroup$
  • $\begingroup$ do you have any reason to cut your mesh in 8 x 16 squares? Otherwise it could be just a large square and it would make it easy to fit your texture... also, when you realign the mesh grid with the texture grid, I'm not sure why you have distortions... maybe share your file? $\endgroup$ – moonboots May 16 at 9:44
  • $\begingroup$ It is important because later I would like to replace some of the faces with different textures (basically different floor tiles). Also, I use it kind of as a guideline, to make sure my texture aligns with the grid perfectly. Yes, I update my question with the texture, but really is just a 4 by 4 square pattern. :) $\endgroup$ – Gergely Kovacs May 16 at 9:56
  • $\begingroup$ it would be better if you could share your file, with the image packed inside, because if I try myself to reproduce this kind of object I don't meet any problem $\endgroup$ – moonboots May 16 at 12:39
1
$\begingroup$

Did you look closer of your UV in image mode? The UV coordinate sometime give a small error upon manipulating (Floating-point error).

And if you want a clear edge of checker pattern, change the interpolation method from Linear(Default) to Closest as below:

Interpolation option

And for precisely assign UV, use your pivot point:

1. Unwrap your mesh

If your mesh is a clear plane with square and rectangular, a normal nuwrap can do the job, check if the UV mesh is rectangular and perpendicular in UV editor.

2. Set Pivot to 2D Cursor

Once you enter the UV editor with the mesh, you can see the UI panel on the right, there is a 2D Cursor similar to 3D Cursor, set it to (0,0) if the UV map can scale from origin.

UV editor

Or you can choose any location once upon you know how the pivot point work.

Pivot

3. Scale your UV to specified value by directly type in number (aspect ratial of your rectangular)

The number just like a virtual text input block. It is a pretty standard parser in a lot of application, even Photoshop use number pad to type the value of layer transparency. Type down the number, you can see it in the bottom of the status bar(if you didn't toggle off the bar)

This should work as below:

Result

This method only solved the general checker pattern. If you want a more complicated mesh, I would recommend using script for it.

Addition

  1. What does closest interpolation do and why is it necessary?

    Closest interpolation give you a sharp image texture, while using linear method, your checker edge will be blur out if resolution is low. Not necessary, but I will do it if I want a sharp edge(it also improve a little tiny performance, just a little).

  2. Why do we need to set the pivot point to 0.0?

    You can set the pivot point to else where, if the UV origin you want to scale is known (you can read the vertex UV value in UI Panel). But most of the time Blender put unwrap vertex in 0.0, 0.0.

  3. Am I right to change the interpolation in the node editor of my material?

    Yes, node editor is the most common and general place you can change your shader behavior. The image textures node by default use linear for scaling, just because it is a common and light weight method to deal with 2D scaling. Feel free to change it if the linear method is too coarse for your rendering (I love Lanczos BTW, but Blender didn't implement it)

$\endgroup$
  • $\begingroup$ Thanks, I will try and report back. $\endgroup$ – Gergely Kovacs May 16 at 10:38
  • $\begingroup$ @Hikariztv, I think you are on to something. I was able to do the texturing, albeit with a lot of trial and error. For example it mattered which axes I was resizing along first. If I went X first, then resizing the Y-axis resulted in distortion. I also do not understand how the numbers work. Typing in 10 after S+Y will not make my selected face 10 units/pixels height (which would be the most precise). I also do not know where to set my pivot point nor how it helps in my case. Would you mind extending your answer; so, beginners like me might understand your suggested workflow better? $\endgroup$ – Gergely Kovacs May 16 at 22:03
  • $\begingroup$ I add a little bit detail to it. If there is still any places that was unclear, please specify the part. $\endgroup$ – Hikariztw May 17 at 1:35
  • $\begingroup$ Just a little explanation of minor points. What does closest interpolation do and why is it necessary. Why do we need to set the pivot point to 0.0? also, am I right to change the interpolation in the node editor of my material? I think that is it. the rest is clear and still working perfectly. $\endgroup$ – Gergely Kovacs May 17 at 11:04
  • $\begingroup$ There could be a lot of mistake in my answer, I only use Blender for about 2 years. The answer are based on my knowledge, don't think like it is a necessary process to do your thing. There is no a correct way to modeling things, just do what you feel comfort. (edit my question for detail) $\endgroup$ – Hikariztw May 17 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.