Translated from "fr dossier 2001 / projet_3d_eau_reviewed" and "fr dossier 2002 / Projet NeL - 3D - Rendu eau REVIEWED". Both versions are identical.
Realistic water surface rendering has been known in computer graphics for a long time. However, real-time water rendering is a relatively recent domain. In the context of the emerging interactive experiences that are MMORPGs (Massively Multiplayer Online Role Playing Games), it has become a necessity. Indeed, natural environments are often represented in these games, and bodies of water and the quality of their representation are often put forward to demonstrate the level of technical advancement of a multimedia product.
In the context of the Ryzom project, our goal is to develop a technique for rendering animated water that is sufficiently convincing while having moderate machine resource requirements. Our investigation focused in particular on bump mapping techniques — a technique that simulates an impression of relief on a surface without making its geometry more complex.
The representation of water in interactive 3D applications has proven relatively simple until now due to the limited capabilities of graphics cards.
The difficulty lies at two levels:
Modeling the reflection of the environment on a water surface has been possible in real time since the appearance of 3D cards supporting the mapping of an environment texture onto a surface with an irregular texture (this technique is also known as EMBM, or Environment Mapped Bump Mapping). It uses two textures: an environment texture and a perturbation texture applied to the mapping coordinates of the environment texture. There is another technique using a cubic environment texture to achieve a comparable effect, but it is more expensive.
The technique, although available for several years, is only beginning to be used in multimedia applications. EMBM was seen in action during the commercialization of the Matrox G400 graphics card in a technology demonstration.

Matrox G400 demo: use of EMBM to simulate reflections on the water surface.
The first part of the research consisted of investigating the different techniques available for modeling the appearance of water. Then we focused on geometry generation.
Several techniques are available:
However, none of these techniques allows modeling the variation of the micro-geometry of the water surface (modeled by a perturbation texture, the macro-geometry being modeled by a polygonal mesh). For this, we developed a technique that consists of perturbing the perturbation texture of the water surface by another perturbation texture. This is made possible by the texture addressing techniques introduced by GeForce 3-class graphics cards.
We use a height table to which we apply the two-dimensional propagation equation to simulate waves on the water surface. To avoid numerical instability problems, we chose to apply a Gaussian filter to the height table after each application of the propagation filter.
To build a suitable geometric mesh, we make the assumption that waves at the water's height are negligible. Several techniques exist, but none of them provides an optimal result for this case. Our technique consists of using raycasting on a regular grid in the observer's space to obtain such a mesh. The fineness can be controlled by using rays that are more or less closely spaced.
In order to apply the propagation equation over large surfaces, we consider that waves far from the observer are not visible. Consequently, the height table represents only the immediate surroundings of the observer, and it is shifted according to the observer's movements. The heights of regions leaving the field of view are lost.
Use of raycasting. Mesh generation in the model's coordinate frame.
This technique also guarantees a number of triangles proportional to the area occupied by the surface on screen. After computing the mesh for a given viewpoint, a vertex program (an OpenGL technique allowing arbitrary geometric calculations on mesh vertices to be performed directly by the 3D card) is used to calculate the reflection vector in order to obtain the texture coordinates for the environment texture.
The prototype was integrated into the NeL library within the MOT (Model Object Traversal) system as a model. The following screenshots illustrate the results obtained.

Use of two perturbation textures to model the water surface.

Application of a perturbation to the water surface (mesh deformation).

Computing mesh vertices using the raycasting technique. Only the perturbations of the water surface, applied on the Z axis, modify the regularity of the grid.
The results of this first prototype are conclusive. There remains however the problem of robustness of the system in the case of rapid observer movement: noise can appear due to the representation technique. Nevertheless, in the context of the Ryzom project, movement speeds remain reasonable and this problem is not felt.