0
\$\begingroup\$
  1. Would I create the water surface mesh in C++, and control the movement/animation in the CPU, and afterward apply any shaders (reflect/refraction/caustics/etc..).
  2. Or should I only create the mesh in C++ and afterward control movement in the vertex shader?

It seems with the second approach, it would be more difficult to simulate more complex water models.

What is the most common approach in modern video games?

\$\endgroup\$
2
  • 2
    \$\begingroup\$ You don't give any details on what kind of water you are working towards to. Would you accept plain water surface with planar reflection? Or do you need water dynamics like flow and droplets? Or physics based simulation? Or something else? \$\endgroup\$
    – Kromster
    Jun 14, 2016 at 4:36
  • \$\begingroup\$ "Most efficient way" sounds like "I don't know how to do it, please tell me" \$\endgroup\$
    – liggiorgio
    Jun 14, 2016 at 10:22

2 Answers 2

1
\$\begingroup\$

Depends on which level of detail you wanna achieve. Height Maps could be a solution, try to avoid as much work on the CPU as possible in every case.

You can combine also some techniques as tesselation. There are plenty sites on the web for inspiration, you know where to search :)

\$\endgroup\$
0
\$\begingroup\$

Simplest possible way is obviously the following:

  1. create mesh with enough vertices that describes water surface
  2. configure your shader to move the vertices in a circle
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .