0
$\begingroup$

enter image description here

Dear fellow Blenders,

Perhaps you can be of aid.

I would like to use only the upper quarter of an in-game texture, as shown on the left, to be used for a labyrinth, shown on the right. I would like this as a repetitive pattern.

Naturally, when I increase the size of the UV map to use the entire texture, it uses the entire texture. I only wish to let it use the upper quarter. I tried to do this the current way, but the bricks appear far too big. I should increase the size of the area covered, but in that case it uses texture I don't want used.

Does anyone know how to do this the easiest way?

Much appreciated :)

Link to the image and file: Image: https://www.dropbox.com/s/er3glnvxhperllu/Ruins.psd?dl=0 Object: https://www.dropbox.com/s/bu55gtb4io1wdq6/Labyrinthv02.blend?dl=0

Combined Blend File: https://www.dropbox.com/s/qc99rd9a41lm7pc/Labyrinthv03.blend?dl=0

$\endgroup$
4
  • $\begingroup$ There are no images packed into the file you provided. Consider using file->external data->pack all and reuploading so that people can get a better idea of your goal and problem. $\endgroup$
    – Nathan
    Aug 4 at 15:59
  • $\begingroup$ Sure, added a file which ought to combine my efforts. Please note I did not have any primary intention of publishing it on this forum so it might be messy and unsorted. One can select ruins.PSD for the proper single image (it is not the current one) but the question remains the same. $\endgroup$
    – Joep
    Aug 4 at 16:43
  • $\begingroup$ Oh maybe I didn't look at all links, I might have misunderstood what you were doing. Apologies. In any case, I'll take a look. $\endgroup$
    – Nathan
    Aug 4 at 17:04
  • $\begingroup$ No worries, it is not easy to explain such things! I want the UV map to use the upper left quarter of the image with a repetitive pattern (so it all becomes nice bricks). $\endgroup$
    – Joep
    Aug 4 at 17:38
3
$\begingroup$

The best thing to do here is to fix the texture in an image editor. Just open up the image and crop it to the part of the image you wish to use, then save a copy.

But if you want, you can use Blender's nodes with a vector wrap to limit your material to access that quadrant of your texture:

enter image description here

First, on your materials tab, you will need to enable "Use nodes" for this material. Then, I use a vector math node set to "wrap". This will repeat the UV coordinates across the range we set. Here, because I'm looking at the quadrant from UV 0.5,0 to 1.0, 0.5, I'm using those particular minimums and maximums.

I'm also changing the texture interpolation mode to "closest". 3D stuff doesn't usually sample individual pixels; it samples entire boxes of pixels. At the borders of your quadrant, that means it will be sampling bits of the texture that we don't want. By using closest texture filtering (which is, really, no texture filtering), I'm telling it not to that-- just use a single pixel of image instead. In general, not doing any texture filtering is not a good idea, and that's why just changing the image is a better solution. In this case, nearby pixels are close enough that we could use texture filtering, but if we were to use a different image, with magenta quadrants unused, we'd definitely see some pink where the texture repeats when we zoomed out. I'm talking about all of this so you (and others) understand for other times that you use this technique.

I've scaled up your UV to demonstrate the tiling. You'll notice that your quadrant doesn't actually tile very well, but hey, you can use this for something else that does tile well.

$\endgroup$
2
  • $\begingroup$ That's much appreciated. It is indeed how I would like it to look. The issue is we are trying to save on data, and limit the use of new textures. Using in game graphics saves a lot of memory use, since it is not only this image. I understand the best would be to crop the image, but this not an option unfortunately. I tried to execute your approach but failed. Perhaps you can take a look at my effort: dropbox.com/s/jaqimld5z1f49mm/Labyrinthv04.blend?dl=0 Perhaps you can see where an error was made? PS: Uploading your version would be of great help too! $\endgroup$
    – Joep
    Aug 4 at 21:02
  • $\begingroup$ @Joep You're doing it right. Look at your object: it's using only that quadrant of your texture image. Further work is about placing the UV. Note that for a game engine export, you won't get that wrap stuff-- you need to be working in the game engine shader, not with Blender materials. 4 textures in individual images consume no more memory than 1 image that combines all 4 (although 4 images means 4 materials means more draw calls.) $\endgroup$
    – Nathan
    Aug 4 at 21:34
1
$\begingroup$

One way, Alt J to Convert to quads. Unwrap menu(U)<Reset(R) Make sure all sides are rotated the right direction in the UV editor R+90. Move and scale these UVs to occupy the UV space of that particular section.

$\endgroup$

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.