Buoyancy using shaders

hello!
I’m currently working on a buoyancy system and I’m using shadergraph (just noise applied to a plane)to manipulate and deform my water from what I’ve seen it is very difficult to get (in my case) the height of waves (I’m using a floater system for my buoyancy so I only need the height of waves in the position of my floater).

I’ve looked into other vertex manipulation solutions, but I’ve found them to be too performance intensive.
I’ve also looked into recreating the math from the shader inside a script but I’ve failed at that front
is there (and if there is what way) a way to get the height of the waves?

additionally, does anyone know how to recreate the math from a shader inside a script and then get the height of waves under a position (I’m just using gradient noise and offsetting it and then applying it to a plane)?

Thanks for any help or advice!

You could definitely recreate the same math in the script, but there’s no definitive ‘how to’. Just make sure that both functions are mathematically identical.
Alternatively, you could render your waves to a texture, as a heightmap. Then download the texture to CPU using asynchronous readback and just use that value as a heightmap.
Depending on how complex your wave math is and how many buoyant objects / samples you need, one or the other might perform better. I often do various non-graphics related stuff on the GPU, and the readback is really not expensive if done asynchronously (most of the cost of synchronous readbacks is waiting)

Usually you do those thing with a shader. The GPU is far more suitable for that!