iakov.dev

First tests with water

· 1 min read

Video

The video shows my first tests with water in the engine. The method comes from chapter 19 of GPU Gems 2, and it is two-pass rendering: the scene is drawn once for refraction and once for reflection before the water itself goes on top.

  1. Render everything except the water. This is the refraction pass.
  2. Copy the image into the refraction map.
  3. Render everything again from the “reflected” camera, which is the camera position mirrored across the water plane.
  4. Copy that image into the reflection map.
  5. Render the water using the reflection and refraction maps.