Is there any other way to make a random interval texture switching using only material?

Hello, in unreal engine is it possible to change a mesh textures in a randomize interval without using a blueprint?
Limited only with material, I tried this for mine but I want to know is there any other way to do it.
Thank you for your time.

Hey there @Asuka1231! Depending on the level of randomness you’d need, you could pass a Time node through a Sine and some Noise function and get some pseudo randomness based on time. To give a better recommendation, may I ask what is the full use case?

1 Like

Thank you for your reply @SupportiveEntity, I am using this material for a tv screen, I want it to be bale to change it at a random intervals and I have around 20 screens and I did not want them to change at the same time but still at random intervals.

By the way how to do this "Time node through a Sine and some Noise function” ?
I understand connecting the Time node through Sine but I did not get the Noise function.

Thank you for your time

i you have 20 textures to switch it might be better to do that in blueprint, loading them from soft refs. otherwise your material will load to memory everything at once and will be sampler heavy spaghetti on top of that.

1 Like

Thank you for your reply and for the time @Langyizhuangshi,
what if I just want to switch between 3 textures only? but I want it to be randomized time between 20 seconds to 40 seconds is it possible?

to give you some ideas:

there is ‘time’ node which you can multiply by a float to slow it down or make it go faster. for texture ‘switching’ you can use lerp node, which takes input in 0-1 range. how do you transform incrementing time into a 0-1 range? ‘sin’ makes it pingpong from -1 to 1 in a smooth way, ‘saturate’ clips it to 0-1 range and noise texture can be used to generate that random value for which there is no dedicated node

2 Likes

Thank you for your time and reply,

I try using this and it worked, thank you very much @laggyluk.
Looks like I need to learn more about nodes.

1 Like