[Scaling materials] How to automate scale texture while scaling mesh

Hello, i need one help with scaling of texture when i scale mesh. When i scale mesh, then my texture is broken, when i add texture coordinate and set tilling same as scale, its okey, but how can i do this automatically when i scale object then value of Y and Z output go into texture coord and scale this material automatically? Thanks :slight_smile:

This works: http://prntscr.com/b4kw8d
But i need when i scale object again, then i need to change values for UTiling and VTiling automatically from mesh scale values. :slight_smile: Thanks for help again :).

As for uniform scaling you could give this a shot - http://i.imgur.com/iTyofOs.jpg

ObjectRadius controls the texture size. (the last multiply goes into the UV of your texture). There is a way to also scale on U and V however I can’t find it in the project I’m working on at the moment, if I find it I’ll drop it here as well. :stuck_out_tongue_winking_eye:

1 Like

okey thanks :slight_smile:

There’s a ObjectScale material function that does just that. It warns that it is incompatible with pixel shaders so place it in a customized UVs input to do the calculation in a vertex shader like this:

Thanks for reply but i have one question, why i dont have Customized UV0 in graph? http://prntscr.com/b5250s thanks

EDIT: I got it, its in material section “number of customized…”

It works perfektly :slight_smile: Thanks :slight_smile:

Because your number of customized UVs is set to zero. (the default) This is an option that is hidden away in the details panel for your material, raise it to one and the input should appear.

and last question, its any fast fix for this? http://prntscr.com/b52925

You could use world space texturing instead, like so:

yea it works, thanks, and last question for this topic, when i have for example minecraft texture image with sware textures, then when i do tilling with coord 1/16 & 1/16, then i get first texture, but how to get second, third, or texture on pos 2/4. http://prntscr.com/b5f300


Hi Arnage, I just followed your guide and it’s worked! Thanks for your help
But can i able to do this for all axis (x,y,z) ? i’m very new with UE4 (I tried to + scale xyz direct to Multiply B but its warning error)

1 Like