Matching Gerstner Waves From GPU with BP
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.
asked Jun 17 '17 at 06:26 AM in Blueprint Scripting
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.
Without looking in-depth, I'd guess that first thing worth checking is differences in time inputs.
answered Jun 17 '17 at 03:27 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here