Material for automatically switching between textures

Hi all,

I need help to create dynamic material for TV Stand. The idea of the material is quite simple, just smooth bledning between different textures with 1 sec delay.
First picture on the tv, then 1 sec delay, then smooth blend to second picture, 1 sec delay and so on.

Please, help me to create this kind of material.

Sincerely,
Dmytro

TV

Thank you!
It almost works f
2022-10-19 16-40-04.mkv (2.1 MB)
ine, but I have a problem. Please look at the video on blue texture, it oversaturated at the end of blending. Looks like the second texture is ok, both jpg, RGB, 8 bit images.

UPDATE: It only happens with image in slot A of the Lerp node.

And just one more question, how is it possible to add more than 2 textures in this sequence?

My mistake, should have said

Once you get into the realm of 3 or more images, it’s much easier to control using parameters from a material instance.

You would a timeline to move the params. Technically, yes, you probably could do it with sine waves of different lengths, but it would be more of an academic exercise.

1 Like

Thank you so much, it works perfect! it is possible to add a little pause between blending, so the user could have a look at the pictures for a while?

Sincerely,
Dmytro

Then you need to do it with a blueprint, again… :wink:

Could you please help with this final step to add pause in animation? Unfortunately my BP knowledge is not enough to do it and without pause it looks weird… can’t use it in my scene so…

You need to make a blueprint and put the TV mesh in that.

Then you can switch materials at any pace and at any time using a timeline

The material should be like this

and make a material instance from it in the content browser. This is the material that is controlled in the blueprint.

TV

Hey guys, how would you do that for 3 textures (swap 3 textures fast, think a doodle effect that is the same thing but 3 different textures)

No idea what you mean by a doodle effect but if you’re simply asking how to apply this same logic to an arbitrary number of textures, use custom hlsl with an active index parameter.

For example, for hot-swapping 4 textures:


float4 texA = TextureSampleA;
float4 texB = TextureSampleB;
float4 texC = TextureSampleC;
float4 texD = TextureSampleD;

int idx = ActiveChannelIndex;

float4 result;

if (idx < 0.5)
result = texA;
else if (idx < 1.5)
result = texB;
else if (idx < 2.5)
result = texC;
else
result = texD;

return result;
1 Like