Download

Auto texture scaling parameter

I have been digging through the starter content and have not found yet any examples of smart materials that can adjust to the scaling of an object. I remember a tutorial in udk but can’t find that either where he created a rock material that would scale when the object is scaled to eliminate stretching. I have purchased the grey boxing kit, and it has an example i tried to implement it with my own textures but i still get stretching. Was wondering if any other examples of this exist or of any one has knowledge on the texture nodes i need to use. Here is a example of what i want to be able to set up with my custom materials,

Thanks All!

Take a look at this thread: https://answers.unrealengine.com/questions/67015/tiling-texture-scale-based-on-actor-scale.html :slight_smile:
In my foilage pack you can see an example how it works: https://forums.unrealengine.com/showthread.php?59812-Free-Foliage-Starter-Kit (the bark material)

Fighter5347 the super moderator to the rescue! Thanks so much for taking the time to respond and all the help you provide the ue4 community!

No problem, I’m always here to help :wink:

You can do this many different ways.
Here is another method I whipped up real quick. It takes a few other things into account (such as axis specific scale).

DynUV_TypeA.jpg

Custom Node “DynamicRes”: The Output Type Needs To Be (Float2)


float a = ((oRadius/Resolution)*xIn);
float b = ((oRadius/Resolution)*yIn);
float aC = ((oRadius/Resolution)*xIn*0.5);
float bC = ((oRadius/Resolution)*yIn*-0.5);
float aCa = (a+aC);
float bCb = (b+bC);

return float2(aCa,bCb);

-Jeremy-