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.
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 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!