How to make texture have an 'absolute' size regardless of the mesh?

Hi all!

I would like to create a material in which the size of the texture is absolute, i.e. a specific size of x by x that is not affected by the size of the mesh it will be applied to.

Here I tried to illustrate what I’m aiming for.
As you can see, the material has the same scale on both meshes (imagine that the texture is repeated all over).

So basically imagine the material with the texture to be like wrapping paper that you can use for different sized objects.

Can anyone help me with this?

What you can do in the shader is get the object bounds, and then use this to change the UV tiling. There’s an “ObjectBounds” node that’s useful for this.

You can also use triplanar projection in worldspace to do similar, however it will not ‘move’ the texture as the object moves in your world.

How would I go about using the ObjectBounds node? Where should I plug it in? I see there are no parameters or properties that I can adjust for this node, is that correct?

I’m sorry it’s just that I am really not very experienced in Unreal, so some sort of visual representation would be very helpful :slight_smile:

Look this video, this is how I make sur my texture follow the good size without having trouble with the scale of the mesh.

1 Like

This tutorial helped me out already quite a bit, but here is the problem: I have 2D texture that represents a flat image. Once I apply the material to a mesh, it only looks good when the mesh is rotated in a specific position. I also tried using the LocalAlignedTexture, but it still gives some weird results depending on how the mesh is rotated…
Do you maybe know how this can be solved?

say thanks to luos

here a way to get the good rotation and size :stuck_out_tongue:

Hmm… I don’t understand how this works, the nodes still don’t give me the desired result.

I think I may have to think of another solution, it seems this might be too complicated to achieve. Thanks anyway!


But the texture remains static.