Overlap textures with different sizes

Hi there!

I’m trying to figure out the best way to accomplish something like this:
I have a background image that can be partially overlapped by another image. Each image have its own UVs - and the idea was to have multiple UVs for the top image, or just being able to translate it in the X axis.

I was able to achieve this concept on blender, but I’m having a hard time trying to mimic it in Unreal.

It seems like Unreal extends my top image, even if the Sampler Source is set to Clamp.


Do you have any idea of how to make this work? I guess my approach is probably wrong in Unreal, but I don’t know how can I solve without the need of having a mask to drive the Alpha Channel of the Lerp.

Thank you!

Hi!

Unfortunately, you can’t do the same trick inside Unreal. But you can make a similar one.

Here is my setup :

I have a custom mesh with two different UV Channels

UV 0

UV 1

Here, I offset my UVs by a parameter and ceil it to fill the UV Tile with a value of 1. Then, if it’s not equal to 1, it will return 0; if it’s equal, it will return 1. This will create the mask to lerp between your textures A and B. (As if you add more offset, the ceil will return 2, then 3, etc.)

I think there is a simpler way to achieve this mask, though. However, this is the first idea that came to mind