Repeating texture problem

Hi,

I’m stuck on a texture problem and thought I’d post and see if someone can help me out.

I’m using blueprints and contruction script to setup a mesh and have a texture repeated on it. The mesh is effectively a plane.

I can change the scale of the mesh via the contruction script in the Y direction and I’ve set up an instanced material with 2 scalar paramaters so I can change the U and V tiling.

So if I scale the mesh to 10 in the y direction then the texture is repeated 10 times in the y direction and all is fine.


However this only works if I have a texture file per mesh. I have a number of meshes that share the same texture file . So when I try the above the texture moves around showing textures that should not appear on this mesh but the textues from other meshes.

Is there a way around this so only the correct uv coordinates are repeated or will I need to have a seperate texture for each mesh I want to scale and have texture repeat.

Hopefully that is understandable.

Thanks

Jawilba

im not a blueprint guy, but you can make an instance of a material instance in blueprints for each mesh you are using it with.

no clue on how to achieve it, but i know its possible as ive seen it being made quite often. not posting this as an answer since I am sure someone with bp knowledge can explain better :slight_smile:

I’ve had no luck trying to get this to work. I put the same question up in the forum and was advised each mesh needs it’s own texture. So guess it may not be possible to get the reult I want. Looks like lots of re texturing for me.

lemme forward this to someone who knows their blueprints, because it is possible.

You should generate a dynamic material instance for every mesh with its scale passed as parameters.
But looking at your screens, if this is just a horizontal plane, why don’t you use world position instead of texture coordinate?

I’ve tried using the suggestions but still can’t get this to work. I’m not that familiar with working with instanced and dynamic materials in UE4 so your help is appreciated.

I don’t have access to the original project right now but have made a quick example to see if it clears up what I want to do.

alt text

I have a single texture for all my meshes. In this case 3 meshes use the texture. 1 mesh has uv’s to use the red, 1 mesh has uv’s to use the green and the last mesh uses the blue.

If I scale the 3rd mesh by 4 in the Y direction I want the blue part of the texture to repeat 4 times like the blue example shown in the image above but what is happening is I get bits of the green and red texture also.

Any further assistance or examples you could show would be great.