^{1}

^{2}

^{3}

^{2}

^{4}

^{1}

^{2}

^{3}

^{4}

Modeling and rendering realistic ocean scenes have been thoroughly investigated for many years. Its appearance has been studied and it is possible to find very detailed simulations where a high degree of realism is achieved. Nevertheless, among the solutions to ocean rendering, real-time management of the huge heightmaps that are necessary for rendering an ocean scene is still not solved. We propose a new technique for simulating the ocean surface on GPU. This technique is capable of offering view-dependent approximations of the mesh while maintaining coherence among the extracted approximations. This feature is very important as most solutions previously presented must retessellate from the initial mesh. Our solution is able to use the latest extracted approximation when refining or coarsening the mesh.

Describing ocean waves is a very complicated challenge, as oceans are composed of different elements that form a very complex system. It is possible to find very complex mathematical models that simulate the behaviour of ocean waves, some of them are based on the direct observation of the sea [

Whitted was among the firsts to attempt the simulation of water [

The approaches to simulate oceans that were based on bump mapping techniques [

An ocean can be seen as an animated heightmap.

Managing the geometry of the mesh representing the ocean still poses a limitation in simulating ocean. Kryachko [

In this paper we propose a new ocean simulation using a GPU-based tessellation process. The main characteristics of the proposed ocean model are as follows.

The ocean surface is refined on the GPU by means of a new view-dependent tessellation algorithm.

Geometry shader capabilities are exploited to reuse extracted approximations.

Wave movements are simulated with Perlin noise [

The basic ideas of the solution presented in this paper were initially presented in a two-paged portfolio paper [

This paper has the following structure. Section

In this state-of-the-art, we will firstly present the techniques that have been developed to offer a realistic visualization of the mesh simulating the ocean. We do not review here papers dedicated to running water or rivers such as [

In this section we present a taxonomy of ocean simulation frameworks by following the type of animation of the oceans, as this is a key aspect for offering a realistic visualization. Following this classification we can distinguish between five sets of models for modeling ocean surfaces.

Parametric approaches represent the ocean surface as a sum of periodic functions which describe waves as a motion of particles. The physicist Gerstner presented the first theory in 1802 to approximate the solution to fluid dynamics by describing the surface in terms of motion of individual points on the surface [

One of the first descriptions of water waves in computer graphics was presented by Fournier and Reeves [

The Navier-Stokes equations offer a set of partial derivative equations which describe fluid movements. Kass and Miller [

This family of approaches, also known as statistical methods, is based on oceanographic measures, synthesized by spectral analysis. Spectral analysis assumes that the sea state can be considered as a combination or superposition of a large number of regular sinusoidal wave components with different frequencies, heights, and directions. As an example of these oceanographic measures, in 1964 Pierson and Moskowitz [

Mathematically, spectral analysis is based on the Fourier transform of the sea surface. Hence, these methods represent the ocean surface as a heightfield computed from a sum of sinusoids of various amplitudes and phases; small-scale waves and ripples are modeled directly by adding noise perturbation [

Tessendorf [

Summarizing, these approaches ensure high realism, but they are not easily controllable. Moreover, since the mathematic model and the related computations are very complex, these methods are more adequate for animation than for real-time rendering.

Fractals can be an adequate solution for simulating open sea, although they would not be capable of simulating how waves break on the seashore. A very general procedural technique for the simulation of water surfaces by means of stochastic fractals was proposed in [

To overcome the problems of each family of solutions, hybrid procedural models were proposed. Thon and Ghazanfarpour [

Terrain tessellation has been researched for a long time (see [

Recently, adaptive schemes have successfully been used for efficient modeling, rendering, or animation of complex objects. The idea is to minimize the sampling of the geometry according to criteria such as the distance from the viewpoint. Since the adaptive sampling is done on the fly for each frame, this fits well with procedural surface displacement, which can easily be animated. Hinsinger et al. [

In paper [

Table

Characterization of ocean models.

Authors | GPU usage | Tessellation | Animation technique | Reflection/refraction | Others |
---|---|---|---|---|---|

Tessendorf [ |
Vertex, pixel | No | Spectral | Yes/yes | Fresnel, caustics, Godrays |

Schneider and Westermann [ |
Vertex | Yes | Fractals (Perlin) | Yes/yes | Fresnel |

Hinsinger et al. [ |
Vertex buffers | Yes | Parametrical (Gerstner) | Yes/no | Avoid unnecessary animation, fresnel |

Johanson [ |
Vertex, pixel | Yes | Fractals (Perlin) | Yes/yes | Fresnel, sunlight |

Mitchell [ |
Vertex, pixel | No | Spectral (FFT) | Yes/no | Interactions with objects, wedge |

Demers [ |
Vertex, pixel | Yes | Parametrical (Gerstner) | Yes/no | Fresnel, foam, physics |

Yang et al. [ |
Vertex, pixel | Yes | Fractal (Perlin) | No/no | Shallow water |

Chiu and Chang [ |
Vertex, pixel | — | Spectral (Tessendorf) | Yes/yes | Fresnel, spray dynamics, depth-dependent water color |

Fréchot [ |
— | No | Hybrid | No/no | |

Hu et al. [ |
Vertex, pixel | Yes | Spectral (Tessendorf) | Yes/yes | Fresnel |

Darles et al. [ |
— | Yes | Hybrid (Tessendorf) | Yes/yes | Fresnel, glare, foam |

Thürey et al. [ |
— | No | Physical (Navier-Stokes) | Yes/no | Shallow water, foam, interactions with objects, |

Bruneton et al. [ |
Vertex, pixel geometry | No | Parametrical (Gerstner) | Yes/yes | BRDF, fresnel, wedge |

Our proposal | Vertex, pixel geometry | Yes | Fractals (Perlin) | Yes/no | Fresnel |

As we have mentioned in the previous section, tessellation is a widely used technique in ocean simulation. Adaptive approaches are much more interesting, as they can refine those areas that need more details, while those areas which are less interesting can be coarsened. Nevertheless, there is no ocean tessellation technique which considers the use of the latest features of graphics hardware. It is our objective to exploit these features in order to improve the performance of previous adaptive tessellation techniques.

Many of the tessellation algorithms presented in the state-of-the-art section modify the details of the triangles following some criteria applied to the triangle. The calculations involved could consider the distance of the triangle to the camera or its position on screen. Nevertheless, applying the level-of-detail criterion in a triangle basis implies a limitation for adaptive solutions. As an example, Figure

Example of crack after a tessellation step. Correct tessellation to avoid crack is also shown.

In order to avoid crack problems, some authors apply the refinement criterion only to the edges of the triangle. Therefore, if an edge needed refinement, then both triangles sharing the edge would act accordingly. In this case, following the example presented before in Figure

Guided by the idea of developing an edge-based tessellation algorithm that avoids cracks, Ulrich described some edge-based patterns for tessellating triangles [

Tessellation patterns from Ulrich [

In order to avoid this limitation, the work presented in [

In our case, we will use the patterns presented in [

As we are processing the mesh in a geometry shader, each triangle is processed separately. For this reason, we have developed a technique which can alter the geometry of two triangles that share an edge without any communication among them. With this approach we will be able to exploit the parallelism of graphics hardware. Algorithm

T.RefineTriangle

T.CoarsenTriangle() //Restore original triangle and discard the rest

T.Emit() //Triangle remains unaffected

When refining the mesh, the algorithm checks the edges of each triangle to see whether they need refinement. Depending on the edges that need more detail, the algorithm selects a pattern for tessellating the input triangle (see Figure

The identification value

As we can see, each

In Figure

Tessellation example with the

Initial mesh

First tessellation step

Second tessellation step

Following on with this example, each of the two initial triangles go through the extraction process of the algorithm that we are presenting. In the specific case of the triangle number 1, the algorithm detects that none of its edges needs refinement and, as a consequence, no change will be made. Nevertheless, the algorithm detects that triangle with

Figure

Tessellation tree. Each node presents the

Our proposed tessellation algorithm has been devised to offer a very efficient coarsening of the surface mesh, as we can reuse the latest approximation without having to start from the initial mesh. Thus, following with the previous example, if we wanted to reduce the detail and return to the state shown in Figure

The

We must remember that, in the refining process, each triangle generated from the same parent had a different

Once we know which triangle is responsible for becoming the parent triangle, we must know which tessellation pattern was used to generate it. In this case, the

At this point, the only task that remains is to calculate the new

Following on with the example presented in Figure

In the previous section we have described the tessellation process but we have considered that the conditions used to decide which triangles to tessellate are not modified. In this way, in the example presented above (see Figure

Figure

Example of retessellation when the refinement criterion is changed (old criterion in red and the new in blue).

Following with triangles 18 and 19, we would coarse them eliminating one of them, while the other becomes triangle 4 again. Then, we apply the adequate pattern to refine again the triangle. Similarly, triangles 14, 15, 16, and 17 are affected and three of them are eliminated, while the remaining one becomes triangle 3 and is refined again, creating new triangles with

It is important to underline that both processes (coarsening and refining again) are executed at the same time, so that we can coarsen the triangle in more than one level of detail and refine it again. The

The previous technique is capable of modifying the details of the mesh in real time to offer a fast rendering of the ocean. It is important to mention that the geometry obtained in this pass will be output and stored in GPU memory, so that it can be used in the following frames for further tessellations or for maintaining the current tessellation if necessary.

Nevertheless, in addition to the geometry management of the mesh simulating the ocean, we must perform other tasks in order to obtain a visually satisfying ocean simulation. In this section we will briefly describe the different techniques used to enhance the realism of the simulation.

One of the first features that we must consider is the algorithm applied to simulate the ocean waves. In the state-of-the-art we have presented many techniques that have been developed to model ocean surfaces. Among them, we have selected the Perlin noise [

In our implementation, the shader in charge of updating the Perlin-based animation of the ocean will calculate the appropriate height according to the position of the vertex within the mesh and to the time of the animation. For enabling the Perlin noise calculation on GPU, we initially upload a texture containing some noise information that is necessary for the real-time noise update.

In addition to animating the waves, we must also consider other interactions of the ocean, such as refraction, reflection, and foam. Reflection can be obtained by applying environmental mapping on GPU. This technique consists in using 3D texture coordinates to access a cubemap storing the precalculated reflex. The Fresnel term is commonly computed by calculating, for each pixel, the dot product between the normal and the eye vector. This value is used to access a one-dimensional texture which stores different reflections for different fresnel values [

To analyze the performance and visual results of our ocean simulation, we integrated our approach in an application which controls the tessellation and the final rendering quality. This application was programmed with GLSL and C++ on Windows 7, and the results included in this section have been obtained with a Pentium D 2.8 GHz. with 2 GB. RAM and an nVidia GeForce 8800 GT graphics card.

Before describing the results obtained, it is worth noting that in these tests the distance to the camera has been used as the criterion to guide the tessellation process, indicating which areas need more details. Moreover, screenspace error has been used to limit the tessellation, so that triangles smaller than an indicated size are not further tessellated.

As an example of how this application works, Figure

Sample tessellation guided by a simulated frustum (in red).

First tessellation step (598 triangles)

Second tessellation step (1,264 triangles)

Third tessellation step (2,546 triangles)

Fourth tessellation step (5,002 triangles)

Fourth tessellation step with surface animation

To test the performance of our ocean simulation, we present a study of the temporal cost of the whole system. Nevertheless, we would like to start by analyzing why we have decided to use Perlin noise to animate the water surface. In order to test the performance of this displacement technique, we have compared Perlin noise and FFT.

Table

Comparison of time (in milliseconds) required for animating ocean surfaces with different polygonal complexities with Perlin noise and a FFT-based solution.

Number of triangles | Perlin noise | FFT |
---|---|---|

4,096 | 2.45 | 4.89 |

16,384 | 3.14 | 6.45 |

65,536 | 4.18 | 7.22 |

262,144 | 5.69 | 10.23 |

562,500 | 13.25 | 18.65 |

Figure

Performance obtained when completely tessellating the mesh.

We consider it interesting to compare our solution against the two previously existing ocean simulation frameworks presented by Kryachko [

The results in Table

Comparison of time (in milliseconds) required for visualizing ocean surfaces with similar polygonal complexities using different solutions.

Solution | Number of triangles | FPS |
---|---|---|

Kryachko [ |
293,470 | 139 |

Bruneton et al. [ |
226,200 | 137 |

Our solution | 250,000 | 225 |

Finally, Figure

Simulation integrated into the final application.

Ocean simulation has been addressed by many researchers to offer realistic visualization, although some of them were not aimed for real-time animation. In this sense, we have reviewed many related papers in order to choose the main features that affect the realism of the surface of the sea, although only some of them have proposed improvements on the management of the underlying geometry.

We have presented a method for simulating ocean in real time. The presented approach is based on the use of a new adaptive tessellation scheme which exploits coherence among extracted approximations. Accordingly, by storing some information, we are capable of reusing the latest extracted mesh when refining and coarsening the surface. In this framework, the final simulation includes reflection and considers the fresnel term to offer realistic approximations, although our main objective was the development of a new tessellation scheme.

For future work we are focused on the inclusion of more effects like refraction or the interaction of objects with the surface. In this sense, we must perform further research to combine the use of fractal noise with the interactions of objects with the ocean.

From a different perspective, it is worth mentioning that this tessellation algorithm could be also applied to terrain rendering. In this sense, there have previously been ocean techniques applied to terrain rendering, like the projected grid method [

Moreover, the latest graphics API from Microsoft (Direct3D 11) suppose, among other features, the establishment of tessellation as a compulsory feature in real-time applications [

The authors declare that there is no conflict of interests regarding the publication of this paper.

This work was supported by the Spanish Ministry of Science and Technology (Projects TIN2010-21089-C03-03 and TIN2010-21089-C03-01), Feder Funds, Bancaixa (Project P1.1B2010-08), Catalan Government (2009-SGR-643), and Generalitat Valenciana (Project PROMETEO/2010/028).