Can i randomize texture sample image in Material?

Hi, it is possible what i try to show in this picture?
I want to randomize the material of a mesh, but i dont want to create many materials, if can randomize texture sample inside a material.

Through blueprints, you could make an array of the various textures. Then make a master material with a texture input parameter. The blueprint would then need to make it a material instance dynamic. From there, you could randomly pick from the array and that texture would be piped into the material.

Yes, thanks, but its not possible to do it inside a material?

That material will be very inefficient. It would sample from all textures and then just use one. It can be done by using per object random(or object position as seed).

use the construction script in blueprint for this task

If I recall correctly, this only works with instances meshes, but you could definitely use object position as a seed with some randomizing math to sort it out.

Again, this would be HIGHLY inefficient to perform within the single material. Just use my suggestion from earlier with MID+array.

Yeah thanks. I just hoped in material way. Then do with BP.

It would be nice if we could use texture arrays for this. One could probably code them in, but it would be a big project.

Were you able to randomize the materials?

If you create a texture-parameter in a material, you can randomize the material by using outside logic to set whatever texture(s) you want in those parameters. such a material only has to know about the 1 texture will ultimately be using.

if you want to randomize INSIDE the material then that material has to know about all the POSSIBLE choices you might want it to take. this is likely very expensive and extremely inefficient.

you are likely best served with the former method, make one master-material and use outside logic (blueprints for example) to make changes to the material-instance as you need them

Hello!
Do you suggest doing this (Print)and changing it manually?

Essentially, yes.

To my eyes it looks like you have material-instances in an array and you are changing between them as needed?

That should be fine. I would caution that overall, change as little as you need to. If it’s just a texture that’s changing vs a whole material, don’t swap materials, just update the texture-parameter.

See this example, the object is same material, but I want that he has variation de color