Download

Is possible to interpolate two textures in game?

Is the setup in the picture is possible somehow? I want to switch two texture samples in my material, even instant swap is acceptable, but I can’t figure how to do this while game is running.

I think that the problem is the ‘Alpha’ collection param is a float 4 (RGBA, 4 values / vectors), and the Lerp node is outputting a single float value / vector (float 1). It’s either that, or two textures need to get connected via their RGBA pins rather than RGB to be compatible with the collection param because it’s a float 4. I think the limitation is you can only interpolate between two values (pins A and B), and based on a value (the alpha of the lerp), if they’re the same floats. The exception is if one or more are a constant, which is a float 1 or integer value, whether it’s a scalar parameter or not.

In the case of lerping from one texture to another, I’m not sure the exact goal you have. If it’s to swap between two textures in the editor, then simply create one texture sample plugged into the base color or other applicable pin, and convert into a parameter. Then create an instance of the material (right-click on the material you saved in content browser and select “Create material instance” at the top of the list), and the texture can be changed by opening the material instance…enabling the texture property…and selecting a different texture. Those textures look familiar, are they from Doom 2016?