0
\$\begingroup\$

https://i.imgur.com/GkEYhGa.gif

enter image description here

I have a plane mesh that I am trying to make 'water' from by deforming the vertices on CPU in a 'waves' motion. (I know this is not ideal for performance). But currently I am trying to figure out how to render water underneath the plane such that it perfectly follows the 'waterline' of the plane mesh's movements.

I have tried a Fog-based solution, but that did not allow for aligning with the plane's deforming 'waterline'. I have tried to make another plane perpendicular to this one and deform it in with the same CPU mesh formula, but that was flawed because it does not create the same motions when working with a vertically-oriented plane as opposed to the horizontally-oriented plane that I'm working with.

Therefore, does anyone have ideas for how to render water underneath a deforming 'water' plane mesh, such that the 'waterline' of the plane's moving vertices is indeed adhered to?

\$\endgroup\$
2
  • \$\begingroup\$ Why deform on the CPU instead of the GPU? If you need collisions with the water surface, you can do this by evaluating your deformation on the CPU only at the points where a colliding object needs to sample it, rather than at every vertex, for greatly improved efficiency. \$\endgroup\$
    – DMGregory
    Jan 26 at 22:15
  • 1
    \$\begingroup\$ One possible approach is described over at gamedev.stackexchange.com/a/103901/5824 \$\endgroup\$
    – Adam
    Jan 27 at 0:08

0

You must log in to answer this question.

Browse other questions tagged .