Keeping this short since its failed to post twice now.
Trying to fake bouyancy with my Gerstner Waves. Generating world displacement with tesselation in the material and trying to match the waves using a blueprint to sample the Z at world position of a point to compare height to wave. I am getting weird results though feeding the same inputs, namely the range of movement is correct but the speed at which its moving is completely out of sync with the waves coming from the GPU. Attempting to do this without render targets and just do a couple discreet samples of position instead of flushing and rebuilding a buffer every tick and across pretty vast areas.
Attached are the BP function and the Material Function.
I have done both internal time and fed the material game time on tick via dynamic material instancing so they should be on the same clock (or offset very slightly deppending on gpu vs blueprint execution)
Turns out that when running the gerstner function in the real world you need to divide the Wavelength by 2*Pi and then its perfectly in sync. Then to get the correct point for my box im doing two samples of the gerstner function, once to find the offset of where the box’s coodinate was moved to in the function, then subtracting that from the box’s position and sampling again. Its not quite right but it looks better. Need to figure out the math to find a point in the wave vs double sampling which is a hack. But this specific question is solved.
Very old thread, I know - but just another important thing to consider: in the material function, sine and cosine have a Period parameter that is set to 1 by default. To match up with Blueprint, this should be set to 2PI.