Dynamic UV - Complicated situation

Hey everybody,

For a VJ plugin I developed,
I created a dynamic scene where I duplicate one cube BP on a grid,
creating a visual that looks like this:

I am controlling this via an outside software where I can import textures into UE, so I can create live looks like this:

The structure is dynamic, meaning the user can change the amount of boxes loaded.
So far so good.

My question is,
I want to have an option to spread the imported texture all over the structure,
so the UV map would not be the same for each cube, but rather each cube would represent a piece of it.

Meaning I’ll have to assign each BP a different part of the imported UV map, automatically calculated via the amount of cubes on the grid.

All originating from the same single cube-BP.

Is that at all doable ? any idea how?

Thank you very much in advance



I got it! almost

I got this to work using this method:

Which works almost perfectly.
The only problem is that my cube-tiles are gapped, so I need to take that into account when spreading the texture, and here I am a bit stuck.

Basically it’s some math I have no idea how to do.
Maybe some zooming within the material?

What’s the best way to approach this?

Thanks again

Hi @EladMagdasi

What about using a material with a texturecoordinates world aligned ?
Basically you dont use the normal uv of the objects, instead you use this video .
You can make a material that lerp between 2 texture
1 is uv based , and so every cube should show the same image in the same way.
1 is world align, and so depending on the position in 3D space will draw different parts of the texture.
You have to take in account the spaces too ,
but give it a look
Maybe you can create manually the textures cropping and moveing the texture correctly

Thank you for the idea!
Would that work though if the number of instances is dynamic?

If I create them manually, then the grid changes, it might not work anymore.

The method I posted before seems to work great, minus the gaps. so I figured if I can zoom into the selected UV piece, that would fix the issue, I am just not sure how.

Any number of object in any place in the map , with this material, should get the texture switfly.
Since the mateiral will take the coordinates of the object at runtime!

sorry dont know how to fix with your method XD

My texture comes from a TextureSample which won’t connect to a T2D for the WorldAligned.

I think all I’m missing is some math, to zoom on the UV piece from my current setup, but Multiply won’t do it - should have majored in math haha

Thanks anyways!