Ocean Wave Simulation Based on Wind Field

Ocean wave simulation has a wide range of applications in movies, video games and training systems. Wind force is the main energy resource for generating ocean waves, which are the result of the interaction between wind and the ocean surface. While numerous methods to handle simulating oceans and other fluid phenomena have undergone rapid development during the past years in the field of computer graphic, few of them consider to construct ocean surface height field from the perspective of wind force driving ocean waves. We introduce wind force to the construction of the ocean surface height field through applying wind field data and wind-driven wave particles. Continual and realistic ocean waves result from the overlap of wind-driven wave particles, and a strategy was proposed to control these discrete wave particles and simulate an endless ocean surface. The results showed that the new method is capable of obtaining a realistic ocean scene under the influence of wind fields at real time rates.


Introduction
Ocean simulation techniques are widely applied in the fields of virtual reality, 3D video games and so forth. Describing ocean waves requires a high degree of complexity, not only because the wavelengths of ocean waves range from millimeters to kilometers but also because ocean wave movement is related to wind, tide and terrain. While today's ocean simulation techniques are highly realistic, presenting a simple and efficient approach to simulate realistic ocean scenes in real time remains a challenge.
A large number of contributions and improvements on ocean simulation have been achieved. In early work, some authors used the method of summing a series of periodic functions to represent an ocean surface [1][2][3][4]. While this method offers lower fidelity than subsequent methods of ocean simulation, it remains a choice for some programmers due to the merits of fast and stable computation, high controllability and inexpensive computation cost.
Rather than deterministic entities, other researchers treat ocean waves as statistical processes. For instance, Mastin et al. [5] applied the Pierson-Moskowitz spectrum [6], and Premoze and Ashikhmin [7] used the JONSWAP spectrum [8]. Following these authors, Tesserdorf [9] used the spectral components obtained from the Phillips spectrum [10] and a Gaussian pseudo-random generator to achieve a realistic result, and such approaches have become a classical method of ocean simulation. Mitchell [11] implemented Tesserdorf's method on GPU by employing a low-frequency band to displace the geometry of the ocean surface and a broad band to represent fine ocean details with interactive frame rates. LeBlanc et al. [12] further divided the broad wave spectra into several narrow bands to decrease the computational cost with superior visual results.
In addition, particle system techniques are a popular method for simulating fluids, and Reeves [13] first introduced such techniques to simulate clouds, water, fire and smoke. Peachey [2] used particle systems to represent spray, which is produced by breaking waves and collisions with obstacles. The Smoothed Particle Hydrodynamics (SPH) model [14] has been used in various applications to simulate fluids: animating the soft bodies of lava flow [15], rendering the free surface of low compressibility fluids [16] and representing the splashing behavior of viscoelastic fluids, such as paint and mud [17]. Highly realistic simulation results have been produced by these physically based methods at the cost of complex computation, which leads to limited use in simulating large bodies of water. Our method resembles the particle system method introduced by Yuksel et al. [18] in that the wave particles are also applied into height field construction. However, the authors in [18] mainly focused on the interaction of ocean waves and solid objects instead of on ocean waves themselves. The method we proposed is a fresh attempt to apply the particle system techniques. The particles, called wave particles in our paper, are driven by field data, an artificial data which is called wind field. Through introduce the wind field data to the constructing process of the ocean height, as well as to management and controlling of wave particles, all types of ocean waves under the influence of wind fields can be obtained by our method.

Methods
For an observer, the ocean surface can be treated as the result of the superposition of wind waves with various properties, including position, propagation direction, speed and shape. We hope to directly relate wind force to the formation and propagation processes of ocean waves, a mechanism that is extremely complex in the real world. However, it should be clear that the the formation and propagation processes of ocean waves driven by wind force we mentioned is the simplication of the similar processes in physical environment. It means that the physical mechanism that wind force driving ocean waves is out of consideration in this paper, and physical-accurate model to simulate endless ocean surface in real time is impossible for current graphic hardware. The main aim of our paper is to construct a simple, efficient and useful ocean scene which can be applied in computer graphic, rather than a physical model that simulates ocean surface height field. Therefore, the main challenges of our method are how to represent ocean waves and how to reflect wind in the behaviors of ocean waves. It is our objective to solve these difficulties in obtaining realistic ocean scenes.
We begin our explanation of our method with the mathematical description of ocean waves, introducing wave particles to represent wind waves, in the first subsection. The second subsection describes how to construct a realistic height field for the ocean surface under the influence of a wind field.

Definition of wave particle
The ocean surface can be represented by a dynamic height field Y(x, z, t), which is the deviation amplitude at time t in the horizontal position X = (x, z). Ocean waves, which are generated by wind force, propagate with velocity v and satisfy a second order wave equation: In our method, we utilize and expand the idea of particle systems to represent ocean waves as wave particles. Wave particles contain all relevant properties of ocean waves. Applying wave particles makes it convenient to receive wind information so that we can easily manage and control ocean waves.
The shape of an individual wave particle is represented by the deviation function D i (x, z, t). Hence, the dynamic height field of ocean can be described as where W i (x, z, t) is the waveform function, the amplitude of the i th particle a i (t) is given by where t born is the time when particles are generated, t span is the time span from birth time to dead time of particle, and amp i is the maximum amplitude. Eq 4 reflects the formation, development and dying process of a wave particle. As each ocean wave moves, the amplitude increases to the maximum amplitude amp i and then decreases to zero at time t dead . A stronger wind force causes the wave particle to move with higher maximum amplitude and energy, so amp i can be formulated as where V i is the wind propagation direction. The choice of k a is arbitrary: any positive number is acceptable. Either a mathematical model or a statistical model assumes that the ocean surface can be considered as a combination or superposition of a large number of regular sinusoidal wave components with different properties. According to this assumption, the sinusoidal wave is the natural choice of the waveform function. In addition to providing a similar shape to the ocean wave, the waveform function W i (x, z, t) should also fulfill other requirements as follows: • The deviation values of the waveform function must be zero at boundary points to ensure that the waveform function is continuous at boundary areas.
• Considering the lighting computation when we need to render a wave particle, the first derivative of the deviation values of the waveform function versus position should be continuous.

Thus, we choose
as our waveform function, where r i is the radius of wave particle, )| is the distance between the sampled point (x, y) and the central point of particle (x i (t), z i (t)). The position of a wave particle is represented by the position of the central point of the wave particle, and the change in particle location is influenced by the wind propagation direction, which can be described by where (x i (0), z i (0) is the initial position of the i th wave particle, D i is the propagation direction of wave particle which perpendicular to the wave front along which the crest travels, and C i is the propagation velocity of wave particle to represent the distance the crest moves forward per second. Both of propagation velocity and direction of wave particle are closely related to the the wind direction V i . Although we will be occupied mostly by a ocean wave simulation method based on wind field and wave particles, we begin by introducing a method presented by Tessendorf [9] to describe how the motions of wave particles are affected by wind. Let us to describe the ocean surface using a spectral distribution of waves, obtained from theoretical or measured data. The wave height h(x, t) at the horizontal position x = (x, z) as the sum of sinusoids with complex, time-dependent amplitudes: where t is the time and k i is a two-dimensional vector, called the wavevector, which is a horizontal vector that points in the direction of travel of the wave. The magnitude of wavevector, wavenumber k i , which is inversely proportional to the wave length λ i as Statistical analysis of a number of wave-buoy, photographic, and radar measurements of the ocean surface demonstrates that the wave height amplitudeshðk i ; tÞ are nearly statistically stationary, independent, gaussian fluctuations with a spatial spectrum denoted by for data-estimated ensemble averages denoted by the brackets hi. For wind-driven waves in a fully developed sea, the spectrum P h (k i ) is given by where W is the normalized direction of the wind, A is a numeric constant. Eq 12 provides us two important points. Firstly, the cosine factor |k i Á W| 2 in the Phillips spectrum eliminates waves that move perpendicular to the wind direction. The mathematical description of Phillips spectrum reflects that, the smaller the angle between the wind direction and the propagation direction of ocean wave, the larger the value P h (k i ). The cosine factor |k i Á W| 2 in the spreading function ensures that waves travel predominantly in the direction of the wind. Therefore, it is reasonable that the wind direction can be treated as the propagation direction of wave particles to represent the ocean waves which are the most significant in ocean surface, as described as Eq 13 Secondly, λ i = |V i | 2 /g is the largest waves that carry the most energy arising from a continuous wind of speed |V i |. Such formulation indicates the relationship between wind speed and wavelength of ocean wave, thus can further relate wind speed to the propagation velocity of wave particle. Specially, according to Eq 10, the wavenumber k i can be calculated as Additionally, in the deep, open ocean, the wave dispersion relation relates the angular wave frequency to the wave number. Meanwhile, the angular frequency ω i is also related to the period T i by On the other hand, in the implementation procedure of our method, the wave particles are emitted from the particle origin at a constant time interval Δt i (the relevant contents are specially presented in the next section), and the wave crests are located in the central points of wave particles. Thus, the distance, which is actually the wavelength of ocean waves λ i , between wave particles can be described as The well-known dispersion relationship between wavelength and wave propagate speed is written as The period of ocean waves T i , therefore, can be calculated as Δt i . Thus, according to Eqs 14, 15 and 16, the period can be formulated as As a result, the relationship between the propagation velocity of wave particle and the wind speed is given by Nonetheless, the ocean surface cannot be represented solely by the sum of sine waves in vertical direction. The shape of an ocean wave is often depicted as a sine wave with vertical motion only, but the actual shape should be described as a trochoidal shape with both vertical and horizontal motions. Fig 1 shows the comparison and difference between the Gerstner wave and the sinusoidal wave. The Gerstner waves model [19] is a physical model to describe the motion of particles on ocean surface. The particles move in circles when a wave passes by. Specially, the motion of water surface is forward as the peak of the ocean wave passes, but backward as the trough of the wave passes, arriving again at the same position when the next peak arrives. Compared with the crest of the Gerstner wave, the crest of the sinusoidal wave is less sharper, and the sinusoidal wave trough is less smooth than the through of the Gerstner wave. The difference of wave shapes between the Gerstner wave and the sinusoidal wave is due to the fact that the Gerstner wave is composed of both transverse and longitudinal waves. Fig 2 illustrates the transverse and longitudinal components of ocean waves, as well as how the transverse component is aligned with the longitudinal. There is a constant phase relationship between the transverse and the longitudinal components. With respect to the direction of the oscillation relative to the propagation direction, we can distinguish between longitudinal wave and transverse wave.  Hence, the lateral movement of vertices in the extended height field can be described by where D L i ðx; z; tÞ is the longitudinal deviation on the ocean surface, which can be formulated as D L i ðx; z; tÞ ¼ a i ðtÞ Â W L i ðx; z; tÞ ð 22Þ The state of each longitudinal wave as a function of horizontal position (x, z) and time t is defined as

Construction of wind-driven ocean waves
The wind force is the main energy resource to generate ocean waves, and waves cannot exist by themselves. We begin our explanation of the process that transforms wind energy to ocean surface movement with two concepts: wind field and particle origin. The wind field, in oceanography and meteorology, is actually a vector field that can be used to describe wind information, such as direction and velocity, at any discretely sampled position (see Fig 3). But in our method, the wind field is actually an artificial vector field. This means that through setting different wind field data, the ocean surface height field influenced by such wind field can be simulated. The particle origin does not actually exist in the ocean scene, but is a medium for wind force to drive ocean waves in our method. The process by which wind force drive ocean waves, therefore, can be described as follows: based on the wind data from the wind field, the particle origins initialize and generate wave particles which are constantly updated according to their properties assigned by particle origins and which represent the wind waves in the ocean surface.
Distribution of particle origins. Because the wave particles independently update their positions and phases of life, the chaotic movement of wave particles without global control strategies would affect the realism of the ocean scene.
Because the initialized positions of wave particles are directly related to the positions of their particle origins, the distribution of particle origins affect the distribution of wave particles on the ocean surface. Therefore, we divide a certain area of ocean equally into N × M small patches (N rows and M columns), with one or a few particle origins in each patch. This procedure causes the distribution to disperse wave particles uniformly across the ocean surface. Without this restriction on the distribution, the wave particles would most likely gather in some areas, leading to excessive amplitudes of ocean waves. Meanwhile, there might be fewer or even no wave particles in some other areas.
Emitting of ocean waves. The particle origins emit the ocean waves, which each consist of several wave particles instead of a single one. The dispersive wave particles cannot form the integral and continuous ocean wave that should result from the effective overlap between particles.
Concerning the initial wavefront shape emitted from the particle origin, Fig 4 shows us two options. Fig 4A shows that wave particles emitted from the same particle origins at the same time are exactly on the same circular arc, and the middle particle gains the propagation direction from its particle origin. SplitAngle is the offset between the propagation directions of neighboring particles, so the radial wavefront ( Fig 4B) still moves along the direction assigned by the wave origin. The wave particles in Fig 4C are placed side by side with identical propagation velocity and direction, and the relevant wavefront is shown in Fig 4D. We tend to choose the wavefront shape in Fig 4B because the angle α can change the shape of the curved wavefront, and the curved shape is similar to the result of interaction between water surface and wind, whereas the wavefront illustrated in Fig 4D looks artificial. Note that α should be small, as a larger angle produces an excessively curved wavefront shape. Additionally, if α is large, the distance between neighboring particles would increase rapidly and thus split more unnecessary new particles. The particle splitting procedure is discussed in the next subsection.
Splitting of wave particles. The radial wavefront presents a problem when the wave particles travel some distance after they are emitted. Because the propagation directions of neighboring wave particles are different, the distance between neighboring particles will increase gradually, and the continuous wavefront will split into several dispersive particles, as shown in Fig 5A. The solution we provided to avoid this phenomenon is to introduce new wave particles in the area between neighboring particles. The new wave particles fill in the gradually widening area between neighboring particles, and thus the overlap between wave particles cannot be destroyed (Fig 5B), an operation process we called splitting of wave particles (Fig 6). A pseudocode description of the different steps in the splitting process is given in Table 1 in Algorithm 1.
The distance d i between neighboring particles determines when we need to introduce new wave particles, and the computation of d i can be formulated as where D i is the propagation distance of the wave particle. However, when SplitAngle i is small enough, sin (SplitAngle i /2) = SplitAngle i /2, so Eq 25 can be replaced by the formula in line 5 in Table 1. If the distance d i between neighboring particles becomes larger than half the particle radius, as shown in line 6, the wave particle i will split to produce the new wave particles j, k on either side. To preserve the overall amplitude of the wavefront unchanged, a i (t) the amplitude of particle i, should be shared among the three wave particles (see line 7). Similarly, the offset angle between the propagation directions of neighboring particles should reduce to SplitAngle i / 3 after the new wave particles are split (line 8).
Aperiodicity of wind field. The height field of an endless ocean is the result of the tiled extension of patches, which is a popular method for rendering an ocean surface with the  limited computational capabilities of current hardware. However, it is an essential premise that the patch must be perfectly periodic, if we need to simulate the endless ocean surface. It should be noted that, unlike the ocean waves produced by the Fast Fourier Transform (FFT) method, the wind field data and the ocean waves driven by such wind fields are in most cases aperiodic. Therefore, the wave particles located on either side of the boundaries of the patch cannot form a complete wavefront, and the resulting crack phenomenon between the patches is obvious. Fig  7A shows the crack problem in an ocean surface tiled by small ocean patches in which the wave particles move randomly.
The solution we proposed to this problem is to create eight mirror wave particles, which are actually the copies of a reference wave particle (the red box) with the change in position in Table 1. Algorithm 1: Splitting of wave particles.
1: for each wave particle i do 2: //compute the distance between the position of particle at time t and its position P x (0), P z (0) at time t 0 3: Ocean Wave Simulation Based on Wind Field eight directions, as illustrated in Fig 8. All of these mirror particles and the reference wave particle share the same properties and dynamic behavior, and thus the relevant locations of these particles are fixed. Fig 8A shows that, as the reference wave particle (the red box) crosses the lower and right boundaries of the Rendered Area, two effective mirror particles (the green boxes), above and to the left of the reference wave particle, enter the upper and left boundaries. The other six noneffective mirror particles (the gray boxes) that do not enter the Rendered Area are neglected to reduce the performance cost. Hence, from the perspective of the whole infinite ocean scene, the wave particles located in the boundaries of the ocean patch consist partly of the reference wave particles themselves and partly of their mirror particles (see Fig  8B). Fig 7B shows that the crack phenomenon is solved by the introduction of the mirror wave particles.

Results
The following simulations were run on an off-the-shelf PC with an AMD FX-6100 processor (3.3GHz) and a GeForce GTX 550 Ti graphics card. The size of the patch, which can be tiled seamlessly over an endless area, was 1024 × 1024.
To enhance the visualization of the controlling wind field, we simulated several ocean scenes under the conditions of different simple wind fields in

Conclusion and future work
A novel and efficient method that introduces the concept of wind-driven wave particles into ocean wave construction is proposed in this paper. In most cases of ocean simulation, obtaining a dynamic height map of ocean waves is a complex process, although parallel computing technology is able to speed up the computation. However, via control and management of wave particles driven by wind field data, the height field can be easily and directly converted from the overlap between wave particles without additional computation cost. The final result shows that this approach has the ability to construct various ocean surfaces based on different wind field data.
By constructing various wind fields, we can consider more possible ocean scenes, as the flexibility of the experimental results arises from the flexibility of wind data. For example, in the case of a coastal area near an island, the wind field should be modified to match terrain conditions to provide a possible way to simulate the shallow water. In this way, the ocean waves in both the deep sea and the coastal region could potentially be handled by the same modeling method.