# How can I prevent texture stretching while scaling a mesh?

**URL:** <https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058>\
**Category:** Asset Creation\
**Tags:** unreal-engine, scaling, question\
**Created:** [November 28, 2014, 4:49am UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058 "2014-11-28T04:49:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pianoman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pianoman](https://forums.unrealengine.com/u/pianoman)\
**Post date:** [November 28, 2014, 4:49am UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/1 "2014-11-28T04:49:54Z")

</div>

Hi all. I would love to be able to create brick and tile walls by taking a wall mesh and non-uniformly scaling it to a desired length and height while preserving the proportions of the brick or tile textures. I’ve tried using world aligned textures, and as long as the walls line up with the world axes, it works great. But as soon as I rotate a mesh, the texture retains its world alignment and swims out of line with the mesh. I played around with the LocalAlignedTexture node, but it doesn’t seem to do anything. How do you use LocalAlignedTexture properly? Or can you somehow rotate the world aligned texture to match the local space of a mesh? Any help would be greatly appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_2ed5b4c7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_2ed5b4c7](https://forums.unrealengine.com/u/anonymous_user_2ed5b4c7)\
**Post date:** [November 28, 2014, 4:44pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/2 "2014-11-28T16:44:46Z")

</div>

Hi!

**First method**

Issue - need scale with integer 2, 3, 4… not 2.1 or 3.24, because tiling between scalable and not scalable meshes is broken.

 ![22399-tile11.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/8/1/a81b01120e3e336a435340bb06590b7dd1f2884a.png)

 ![22400-tile12.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/1/a/81afaa5f97ca6bd63aa5f394225f06a91afd2d09.jpeg)

**Second method**

You can scale with any coefficients, but needed adjust selected parameters for new texture.

 ![22421-tile21.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/b/a5b0f236a3b3e80642c61edcf9ba886ece675c5c.png)

 ![22422-tile22.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/e/6/5e63d3a51af756507a43a88fd4a1ea5bbc4a49c5.jpeg)

---

<div class="post-metadata">

**Author:** ![Neilz0r](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Neilz0r](https://forums.unrealengine.com/u/Neilz0r)\
**Post date:** [February 18, 2015, 6:46am UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/3 "2015-02-18T06:46:16Z")

</div>

This seems very awesome. Bookmarking this page for sure!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_590cb5931](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_590cb5931](https://forums.unrealengine.com/u/anonymous_user_590cb5931)\
**Post date:** [June 19, 2015, 9:43am UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/4 "2015-06-19T09:43:58Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![Araklaj](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Araklaj](https://forums.unrealengine.com/u/Araklaj)\
**Post date:** [November 28, 2015, 9:50pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/5 "2015-11-28T21:50:13Z")

</div>

Thanks for the guide! What do youplug the bump offset group into?

---

<div class="post-metadata">

**Author:** ![justreal](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/justreal/32/926586_2.png) [@justreal](https://forums.unrealengine.com/u/justreal)\
**Post date:** [December 3, 2015, 12:46pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/6 "2015-12-03T12:46:43Z")

</div>

Thanks for the solution but is that method still the same or any improvements? Because I’m working with modular parts right now and most of time I have to scale corner parts down (without integer numbers) to not blend with other rooms floor. So I don’t want to get busy to adjust every single deformed part. It has to be done in much effective way otherwise working with modular parts is being useless.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_eaca42a0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_eaca42a0](https://forums.unrealengine.com/u/anonymous_user_eaca42a0)\
**Post date:** [January 25, 2016, 2:12pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/7 "2016-01-25T14:12:48Z")

</div>

Is this the solution you are looking for?

I think my way it is a little easier dealing with modular building.

---

<div class="post-metadata">

**Author:** ![skeleton60](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@skeleton60](https://forums.unrealengine.com/u/skeleton60)\
**Post date:** [February 23, 2016, 7:24pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/8 "2016-02-23T19:24:04Z")

</div>

how did you that Maximvm?

---

<div class="post-metadata">

**Author:** ![Derzo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Derzo](https://forums.unrealengine.com/u/Derzo)\
**Post date:** [March 9, 2016, 5:52pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/9 "2016-03-09T17:52:52Z")

</div>

First one is working correctly, but I need to scale my object in 3d, it only works in 2 directions now. Help, I’m not good at shaders 🙂

---

<div class="post-metadata">

**Author:** ![Narg](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/narg/32/870597_2.png) [@Narg](https://forums.unrealengine.com/u/Narg)\
**Post date:** [March 29, 2016, 2:46pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/10 "2016-03-29T14:46:54Z")

</div>

Thank you sooo much for this, u saved me A LOT of time !!!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3fd16379](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3fd16379](https://forums.unrealengine.com/u/anonymous_user_3fd16379)\
**Post date:** [May 12, 2016, 10:15pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/11 "2016-05-12T22:15:23Z")

</div>

These methods work perfectly for height adjustments, but still stretches with width adjustments. ☹

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3fd16379](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3fd16379](https://forums.unrealengine.com/u/anonymous_user_3fd16379)\
**Post date:** [May 12, 2016, 10:23pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/12 "2016-05-12T22:23:32Z")

</div>

Now that you’ve shown exactly what it is I’ve been looking for. Care to write up a tutorial or video of exactly step-by-step how it was done?

The video was quite fast. I could tell a blueprint was used to accomplish the task, but I’m sure the only ones able to pick up on exactly what was happening are those who are well experienced. It looked like you were using a child too and not a parent, but I haven’t gotten into doing those quite yet. A step-by-step for a noob would be wonderful.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_eaca42a0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_eaca42a0](https://forums.unrealengine.com/u/anonymous_user_eaca42a0)\
**Post date:** [May 13, 2016, 9:38am UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/13 "2016-05-13T09:38:54Z")

</div>

Sure, I was not sure this was interesting. I posted long time ago and I didn’t received much reply about my question.  
Anyway today I may be able to upload a new video where I show exactly to do it from scratch since I will have to redo a new project!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_dcd9d04a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_dcd9d04a](https://forums.unrealengine.com/u/anonymous_user_dcd9d04a)\
**Post date:** [June 14, 2016, 12:53pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/14 "2016-06-14T12:53:51Z")

</div>

[PTV Unreal Engine 4 Material Tutorial 5 (UV Mapping) - YouTube](https://www.youtube.com/watch?v=YcoHWSxFEko) try this , shows scaling a 3D rock without texture being affected

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_aa01b470](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_aa01b470](https://forums.unrealengine.com/u/anonymous_user_aa01b470)\
**Post date:** [May 24, 2017, 4:59pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/15 "2017-05-24T16:59:46Z")

</div>

thank u so much was looking for that exact video for the past couple of hours.

---

<div class="post-metadata">

**Author:** ![weberl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@weberl](https://forums.unrealengine.com/u/weberl)\
**Post date:** [October 18, 2018, 6:32pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/16 "2018-10-18T18:32:55Z")

</div>

Argh. Video is removed.

---

<div class="post-metadata">

**Author:** ![Moenz81](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Moenz81](https://forums.unrealengine.com/u/Moenz81)\
**Post date:** [February 17, 2019, 11:38am UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/17 "2019-02-17T11:38:27Z")

</div>

The only solution that I can do right now is to split the material into three. First one to handle x-y plane, second one to handle x-z plane and the last to handle y-z plane.

This works well for box shape which has 6 faces. Each material to be assigned to two corresponding faces.  
It works perfectly for scaling and rotating.

There must be a more elegant implementation than this. 🙂

 ![268832-nonscalingmaterialsetting.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/2/3/a23f8e6bee17b429d03a6716f93ddab6e3690163.png)

 ![268833-nonscalingmaterialtest.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/5/775db13ab17c3f3c796decbd0add0116b22219e0.png)

---

<div class="post-metadata">

**Author:** ![tertiushand](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tertiushand](https://forums.unrealengine.com/u/tertiushand)\
**Post date:** [March 9, 2022, 12:50pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/18 "2022-03-09T12:50:02Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/7/7/377d70559e29c43775145e0891c8ca9a55f0e3dc.png)

Thanks! I was able to use your code to add this feature to my Master Material.

I use the Static X, Y, Z parameters to identify which coordinates to use. I created the toggle at the bottom to turn the feature on and off.

Also, I noticed the constants were just duplicates of the coordinates, so I was able to eliminate the static constants by plugging in the scale where the constants were.

Thought I’d share.

---

<div class="post-metadata">

**Author:** ![Def0rp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Def0rp](https://forums.unrealengine.com/u/Def0rp)\
**Post date:** [April 12, 2022, 4:11pm UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/19 "2022-04-12T16:11:12Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/1/3/213a7e856b785b19cdc6c6ebfec03b8d6c72a167.png)

Something like on the screenshot is better to use for simple cube-ish geometry. No switches and single sampler.

---

<div class="post-metadata">

**Author:** ![GameFireNat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GameFireNat](https://forums.unrealengine.com/u/GameFireNat)\
**Post date:** [April 18, 2022, 5:34am UTC](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058/20 "2022-04-18T05:34:36Z")

</div>

I’ve tried following this screenshot, however the texture doesn’t quite seem to tile the way I’d expect it to.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/3/4/634adeb4c23a6845e7b0936e073f9d59b6eaad7a.jpeg)  
This is how it looks with a Static Mesh cube at scale 1,1,1  
When I scale it up along the Y axis, this is how it looks:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/8/9c8cffee77b17598ad5d95e8a955e080ccc42116.jpeg)  
It also behaves weirdly on the sides:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/b/d9bccbc24b06baa4ca9b2a529a49d05840a33ea1.jpeg)  
The top and bottom of the cube tile exactly as expected.

This is how it looks, when scaling the cube up on the X axis:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/7/ce7091b026e0ccfc6434e13e7c12dddae0d88f36.jpeg)  
Now the left and right sides of the cube tile properly alongside the top and bottom, but the front and back faces don’t.

Finally, when scaling the cube up on the Z axis, the front and back faces tile properly alongside the top and bottom, but the left and right faces don’t.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/3/5/a359acfba5f879076afa11b9bf2a77c88c794a36.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/2/5/025e9433a8588713c117e4d75ff0e3d216cb6c8f.jpeg)

Did I just set up the Material BP incorrectly?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/8/c/18c720e5154201f86a4be0871604c8b18cfe29ae.png)  
(Spreading the nodes out, so it’s easier to see what connects to what)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/a/2ea7873f161894850a1618a06c56a32f6c3af86f.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/e/2/7e22a97cbb51f2a4627b2c8860e19224b49c2237.png)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/d/8/4d87e6150d9db07031de8e8abbdc640d3329b0f2.png)

[Next page](https://forums.unrealengine.com/t/how-can-i-prevent-texture-stretching-while-scaling-a-mesh/300058.md?page=2)
