Blender: Keep Material Image from Stretching

By Forrest Smith - Drempd.com

I found it odd that the default behavior for a material that uses an image in blender stretches, instead of tiles. So for instance, if I have two cubes with one of them twice as large as the other, and I apply a material which uses an image of bricks, the larger block will have bricks that are larger than the other. Of course we want the bricks to be the same size, so I need the image to tile itself as opposed to stretch.

You can see the issue in this screenshot below. This is two cubes sitting next to each other — because the cube on the right is twice as large as the cube on the left, it stretches that material texture so all of the bricks are twice the size:

It took quite a bit of searching and it takes a little bit of work (I was hoping for just a checkbox for “tiled” or “stretched”, which of course doesn’t exist).

Step 1: Be sure to “Apply Transformations” to all objects that you want to have the material (select each object, hit ctrl+a, and then click on “All Transformations”)

Step 2: Go into the shading view

Step 3: Set the nodes just like this
(To add these boxes, go into the “add” menu and search for the various nodes you need to add, in this case, you’ll need to add “Mapping” and “Texture Coordinate” (assuming you’ve already added the image). Then make sure the nodes are connected in the same way as below. A few key things:
1. Make sure that image node, that the second dropdown is set to “box”.
2. Make sure you’ve selected an object with the eyedropper tool at the bottom of the “Texture Coordinate” node. I guess blender uses this element to size all of the materials off of. Update (10/1/22) — If you “Apply Transformations”, you should be able to leave the object unselected.

Once everything was set up as above (Nothing was working until I used that eye-dropper tool to select a box Update (10/1/22) — should work if you “Apply Transformations”), I could get this result, which is exactly what I wanted:


Update – 10/1/2022

I’ve updated the text above to reflect my latest experiments with this. I think instead of having to select an object to base the scale off of, as I mention in my last paragraph above, I think you can (and probably should) not select a reference object. I think why this was needed for me in the above example is that I wasn’t “Applying Transformations” to the objects. Blender was just using each object’s scale to scale the texture, and since I was scaling the larger box up by twice, the texture mapping scaled as well. Selecting the box set the scale of both objects to be the same, but the better way to ensure that the scales are the same is to “Apply Transformations”, which brings the larger box’s scale back down to one. If you apply transformations (select each object, hit ctrl+a, and then click on “All Transformations”), it seems to work properly with all of the above nodes set up as shown, but without selecting the ‘Object’.