Hello I’m trying to create a custom tiling function which tiles a texture more seamlessly by randomly rotating and scaling the texture, here are the functions in order:
MF_Rotate (rotates x,y around a center x, y): MF_Rotate posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4
MF_Neighbours, finds the neighbours of a UV cell (floored uv, which creates an integer x, y to use for rotation and scaling): MF_Neighbours posted by anonymous | blueprintUE | PasteBin For Unreal Engine 4
MF_TextureTiling:https://blueprintue.com/blueprint/2c5p85xs/
Here is the current final result of the function right now:
Now the current problems I’m having are the following:
- Doing fmod on the uv results in these weird light brown-green lines bordering the UV cell.
- Obviously there is no blending between each UV cell.
Now I don’t particularly care about 1, since its only noticeable at a distance, but I really need to fix 2. Now I have a heightblending function but I didn’t know how to use it, so I used the MF_Neighbours function to get the continuation of each UV cell (up, down, left, right, top-left, …), so if I’m in cell x, y, the scaling and rotation of that cell pertains(continues) to x-1, y in the left neighbour, x+1, y, in the right neighbour, etc.
IMPORTANT: SO IF YOU WERE TO LERP, SAY THE NORMAL TEXTURE SAMPLE AND THE LEFT/RIGHT TEXTURE SAMPLE WITH THE ALPHA BEING (THE R COMPONENT OF FLOORED UV MODDED BY 2, TO GET VERTICAL B&W STRIPES), YOU WOULD SEE THAT 2 UV CELLS ARE CONNECTED SEAMLESSLY, SAME HAPPENS IF YOU DO 1-X FOR THE LERP ALPHA.
As you can see two horizontally adjacent cells show tiling, because they are, since the texture is continuing to the left/right.
So using this information how would I blend between each UV cell? Using lerp is fine, I will replace it with my custom lerp function.