Probably simple World UV coordinates issue - can anyone help?

Hello,

I am currently modifying the engine ocean water material, and I have a little problem generating correct world space UVs that I was hoping someone might be able to help me solve.

To outline what I’m trying to do - I have a black and white mask with a slight falloff that defines the shape of my island. I want to kill the world position offset of the ocean material to 0 where it meets the shore. My thought process here would be, that I need to create some world space UV coordinates for the texture based on the masked RG components of Absolute World Position, and then create a multiplier for those coordinates that corresponds to the difference in size of the ocean actor, and the landscape of the island.

So I thought, what if I get the Object Bounds of the Ocean Actor, and then take the world unit length of one side of the landscape (both are and will always be square in my usage), divide one by the other, and then this should give me a relative value connecting the scales of the two objects, that I can use to determine what the proper scaling of my generated world space coordinates for the mask should be.

However, I am having a hard time making this work, something about the way I am doing these calculations is not producing the result I want. However I know the principle of what I’m doing is sound because if I just divide the world space co-ordinates by some completely arbitrary number, I can see the exact end result I want in the ocean’s world position offset, obviously just with completely incorrect UV tiling.

I’ve posted a screenshot of the relevant section of the graph below - is anyone able to point out what I’m doing wrong/stupid, and what I ought to be doing instead to get the correct result here?

(The number on the top of the divide is my landscape resolution of 15,301 units, multiplied by 100 to give me what I think should be a value in centimeters/Unreal units.)

Many thanks to anyone who can assist!

Imgur

Solved this by doing the following, combined with a texture offset to the corners in Substance rather than positioned centrally. Dirty but if it works, I’m happy.

Imgur