<<

Realistic simulation of surface using spectra Jocelyn Fréchot

To cite this version:

Jocelyn Fréchot. Realistic simulation of ocean surface using wave spectra. Proceedings of the First International Conference on Computer Graphics Theory and Applications (GRAPP 2006), 2006, Por- tugal. pp.76–83. ￿hal-00307938￿

HAL Id: hal-00307938 https://hal.archives-ouvertes.fr/hal-00307938 Submitted on 29 Jul 2008

HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. REALISTIC SIMULATION OF OCEAN SURFACE USING WAVE SPECTRA

Jocelyn Frechot´ LaBRI - Laboratoire bordelais de recherche en informatique Domaine universitaire, 351 cours de la Liber´ ation, 33405 Talence CEDEX, France [email protected]

Keywords: Natural phenomena, realistic ocean , procedural animation, parametric energy spectra

Abstract: We present a method to simulate ocean surfaces away from the coast, with correct statistical and direction distributions. By using classical oceanographic parametric wave spectra, our results fit real world measurements, without depending on them. Since wave spectra are independent of the ocean model, Gerstner parametric equations and Fourier transform method can be used with them. Moreover, since they are simple to use and need very few parameters, they allow easy production of ocean surface animations usable in movies and games. We explain how to accurately sample them, to achieve oceanic waves in deep water according to given wind parameters, in a realistic way.

1 INTRODUCTION face statistics are taken in account by the use of para- metric wave spectra. For given wind parameters, they The reproductions of many natural phenomena is still indicate the distribution of wave energy as a function an open problem in Computer Graphics. In particular, of . However, none of the existing methods the realistic simulation of oceanic surfaces continues are able to correctly reproduce states described by to be of great interest. Many fields of activity rely on these spectra. it: virtual reality, movies and games, but also sailing In this paper, we explain how wave spectra are (Cieutat et al., 2001) and oceanographic simulations, related to oceanic surface energy and we detail a among others. method to deduce wave heights from it. We propose While beautiful pictures and animations such as a solution for optimal spectrum sampling, suitable wave refraction (Gonzato and le Saec,¨ 2000) (Gamito for parametric and Fourier transform models. This and Musgrave, 2002) are produced, there is still a method enables the accurate simulation of oceanic need for oceanic scenes with realistic wave features. surface. Users can easily produce realistic wave ani- Models based on fluid mechanics equations (Enright mations, with respect to supplied weather conditions. et al., 2002) (Mihalef et al., 2004) should give the The structure of this paper is as follows. Section 2 more realistic results, but are inadequate for large summarizes ocean models for Computer Graphics. oceanic surfaces. In section 3, we detail our method and give classi- For twenty years, procedural models for wave rep- cal parametric spectrum examples. We handle wave resentation in Computer Graphics have been devel- statistics in section 4. We discuss our results in sec- oped and improved (Iglesias, 2004). The Gerst- tion 5, and conclude in section 6. ner parametric equations and their Fourier transform rewriting are well known by the oceanographic com- munity. Based on the linear wave theory, they allow 2 OCEAN MODELS representation of natural wave shapes and moves in deep water above the capillary size. As they not de- scribe any net mass transport, they are limited to non- 2.1 Definitions and relationships breaking waves and to scenes without violent storms. Wave height measurement data allow to simulate a The surface elevation, η, is the vertical displacement given . In the more general case, oceanic sur- from the mean water level of the oceanic surface at given point and time. The wave , a, is the (Airy, 1845), widely used in oceanic engineering, and maximum surface elevation due to this wave. The in Computer Graphics by (Peachey, 1986). It de- wave height, H, is the vertical distance between a scribes waves with a sinusoidal shape, which corre- trough and an adjacent crest. For a single wave, sponds to calm weather conditions. Considering a lo- H = 2a. The , λ, is the distance between cation x0 lying on a 1D surface at rest, the elevation two successive crests. The period, T , is the time inter- z = η at time t due to a wave with κ, val between the passage of successive crests through amplitude a and angular velocity ω = √gκ is frequency f = 1/T a fixed point. The , , is the number z(x , t) = a cos(κx ωt). (2) of crests that pass a fixed point in 1 second. The wave 0 0 − speed or phase speed, c = λ/T , is the speed of wave When the steepness of the wave increases, its crests crests or troughs. It can also be expressed as c = ω/κ, become sharper and its troughs flatter. Therefore, where ω = 2πf is the angular velocity or angular fre- (Fournier and Reeves, 1986) used a more realistic de- quency, and κ = 2π/λ is the wavenumber. The water scription based on trochoids, made by (von Gerstner, depth, d, is the vertical distance between the floor and 1804) and by (Rankine, 1863). The surface equation the mean water level. is now The concept of deep water is wave dependent and x(x0, t) = x0 + a sin(κx0 ωt) − (3) is related to the ratio of the water depth to the wave- z(x , t) = z a cos(κx ωt), length of the wave. This comes from the transcenden-  0 0 − 0 − tal expression where z0 is the surface elevation at rest (typically 0). gT 2 2πd Note that the important point here is the phase term λ = tanh , (1) difference of π/2 between x(x0, t) and z(x0, t), not 2π λ −   the use of a particular sine or cosine function. This 2 where g 9.807 m s− is the standard acceleration Lagrangian model describes the trajectory in a ver- of gravity≈. Since tanh· (x) 1 when x > π, and tical plane of a particle (x, z) around its position at ≈ tanh(x) x when x < π/10, water is considered rest (x0, z0). Summing several waves and extending deep if d/λ≈ > 1/2 and shallow if d/λ > 1/20. This equation 3 to a 2D surface gives leads to some simplifications in the expressions of the ~x(~x0, t) = terms given above (see table 1). ~x + ~κˆ a(~κ) sin(~κ ~x ω(κ)t + φ(~κ))  0 · 0 −  ~κ  X Table 1: Relations between oceanographic terms. The sub-  z(~x , t) = script indicates a deep water term.  0 ∞  z0 a(~κ) cos(~κ ~x0 ω(κ)t + φ(~κ)),  − · − Transitional depth: Deep water:  ~κ  X (4) 1/20 < d/λ < 1/2 d/λ > 1/2   ~x = (x, y) λ ω where is the horizontal particle position at c = T = κ time t, ~x0 = (x0, y0) its position at rest, ~κ = (κx, κy) c = gT tanh(κd) c = gT a wave vector, i.e. a vector with magnitude ~κ = 2π ∞ 2π k k 2 g 2 g g 2 κ and direction of the considered wave propagation c = κ tanh(κd) c = κ = ( ω ) ∞ and ~κˆ = ~κ/ ~κ is the unit vector of ~κ. Because of k k κ = 2π the presence of uniformly distributed random phase λ terms, φ(~κ) [0, 2π[, this model is also known as κ = κ tanh(κd) ∈ ∞ random waves. Any set of ~x0 can be taken, which 2π allows the use of adaptive mesh, for optimal surface λ = κ = cT 2 2 sampling (Hinsinger et al., 2002). λ = gT tanh( 2πd ) λ = gT 2π λ ∞ 2π λ = λ tanh(κd) 2.3 Inverse Fourier transform ∞ 2π Another method for computing equation 4 is the 2D ω = T = κc ω2 = gκ tanh(κd) = gκ ω2 = gκ inverse discrete Fourier transform, used by (Mastin ∞ ∞ et al., 1987), (Premozeˇ and Ashikhmin, 2001) and (Tessendorf, 2001). The set of N M complex num- × bers Fn,m is transformed into a set of complex num- 2.2 Parametric equations bers fp,q by N M np mq The base model for ocean waves simulation comes f = F exp i2π + , (5) p,q n,m N M from the linear (or small-amplitude) wave theory by n=1 m=1 X X    where p 1, .., N and q 1, .., M . This is natural method is to use records of surface elevation of particular∈ {interest }because the∈ {fast Fourier} trans- measurement data used by oceanic engineering (Thon form (FFT) algorithm is an efficient way to compute and Ghazanfarpour, 2002). Measurements are made these sum. However, in comparison with the previous with accelerometers mounted on buoys, satellite al- method, its usage is more restrictive. The set of ~x0 is timeters, high frequency radars and others techniques. defined as a regular grid of N M points with dimen- A spectral analysis of the collected data is done using × sions Lx Ly and origin at the center, such that ~x0 = the Fourier transform from time domain to frequency (n L /N×, m L /M), where n [ N/2, N/2[ domain. This decomposition of the surface elevation x0 x y0 y x0 ∈ − and mx0 [ M/2, M/2[ are integers. We rewrite gives a histogram of wave ω, with corre- equation 4∈as − sponding and possibly directions, known as frequency amplitude spectrum. The same analysis method can be used with oceanic surface photographs ~x(~x , t) = ~x + ~κˆ A(~κ, t) exp(i ~κ ~x ) 0 0 = · 0 (Tessendorf, 2001) (Thon and Ghazanfarpour, 2002).  ~κ !  X An amplitude spectrum can be used to generate a   surface with the same characteristics as the related z(~x0, t) = z0 A(~κ, t) exp(i ~κ ~x0) , one. However, to get several oceanic surfaces with − < · !  ~κ different sea states, as many spectra are needed. In-  X (6)  stead, we rely on parametric wave spectra, which can where () and () correspond, respectively, to the = < fit any environment conditions, like wind speed and imaginary part and real part of the expression, and fetch. A(~κ, t) = a(~κ) exp( i( ω(κ)t + φ(~κ))). (7) − Rather than the random phase term φ, authors com- 3.1 Wave energy and amplitudes monly use a normally distributed random amplitude (see section 4). To comply with equation 5, the set of Oceanographers are mostly concerned by wave en- wave vectors must be ergy rather than amplitude. For this purpose, they n m use another type of spectrum, S(ω), called wave fre- ~κ = (2π κ , 2π κ ), (8) L L quency energy spectrum or wave spectrum, which x y gives information about wave energy distribution as a where nκ and mκ are defined as nx0 and mx0 above. continuous function of frequency. This is a smoothed The resulting surface is periodic in all directions and version of a modified amplitude spectrum (see be- can be used as a tile (Tessendorf, 2001). low). Directional informations are taken into account To decrease the FFT computation time by a fac- with a directional wave spectrum: tor two, real numbers can be used instead of com- plex ones. This is achieved by adding two waves with E(ω, θ) = S(ω)D(ω, θ), (10) same amplitude and travelling in opposite directions (Tessendorf, 2001). Equation 7 becomes where θ is the direction of the wave and D(ω, θ) is a directional spreading function, defined such that A(~κ, t) = a(~κ) exp( i( ω(κ)t + φ(~κ))) − +π + a(~κ) exp( i( ω(κ)t + φ(~κ))) (9) E(ω, θ) dθ = S(ω) (11) − − π = 2a(~κ) cos( ω(κ)t + φ(~κ)). Z− − This results in a single stationary wave with time de- for all values of ω. The Pierson-Moskowitz paramet- pendent amplitude. This phenomenon is known as ric wave spectrum (see section 3.2) has been regularly standing wave. The drawback of this method is that used in the field of Computer Graphics since (Mastin the generated surface is only half the size of the ex- et al., 1987) as a direct evaluation of wave amplitudes. pected one. The second half is obtained with a rota- But this method cannot reflect statistical characteris- tion of the first one by 180 degrees around the origin, tics of the oceanic surface. First, this is a continuous leading to pattern duplications. function, so it needs to be integrated to be used with a discrete model. Second, wave spectrum does not give direct information about wave amplitude but energy. The mean energy per unit surface area is E = 3 WAVE SPECTRA ρg var(η), where ρ is the water density and var(η) the variance of the surface elevation. The wave spectrum To be able to use the models discussed so far, we is defined to be related to the surface energy by need a function a(~κ). For the parametric model, we + also need to know which set of wave vectors char- ∞ acterizes the surface we want to generate. The more var(η) = S(ω) dω. (12) Z0 For a zero mean process, like the sinusoidal wave ocean waves without measurement data, but can also model from equation 2, the variance is be altered to fit specific data. 2 The base of modern parametric wave spectrum was var(x) = xrms, (13) found by (Phillips, 1957) and has the form where xrms is the root mean square of the values. For αg2 2 2 S (ω) = , (20) a general process, this becomes xrms x¯ . The mean P ω5 amplitude of the model− from equa- where α = 0.0081 is called the Phillips constant. tion 3 is a¯ = (κa2)/2, which can be reasonably ne- Taking into account wind speed, (Pierson and Mos- glected in most− cases for practical purposes. So, we kowitz, 1964) found an expression that describes a apply equation 13 to this model as well for simplic- theoretical fully developed sea with infinite fetch (see ity. The rms of a sinusoidal or trochoidal wave with figure 1). The wind has blown with no change over amplitude a is 2 a large area for several hours, and waves growth is 2 a arms = . (14) almost null. The spectrum is 2 4 5 ωp As we see the oceanic surface as the sum of many SP M (ω) = SP (ω) exp , (21) waves with independent random phases, the total vari- −4 ω     ance of the surface elevation is the sum of the variance where ωp is the frequency of the peak of the spectrum, of each wave. So, taking a finite range of frequen- i.e. dSP M /dω = 0 for ωp. Usual value for ωp is cies [ωmin, ωmax] such that it is representative of the 0.855g whole energy, i.e. ωp = , U10 ω + max ∞ where U is the wind speed at a height of 10 meters S(ω) dω S(ω) dω, (15) 10 ≈ above the sea surface. Zωmin Z0 we divide it in N samples of width ∆ωn and tag the 1 10.0 m s− mean frequency of each of them as ωn to get the rela- 16 1 12.5 m·s− tion 1 s) ·

· 15.0 m s−

2 1 N N 12 17.5 m·s− a(ω )2 1 n (m · var(η) = var(a(ω )) = . (16) 20.0 m s− n 2 · n=1 n=1 8 X X

Regarding equations 12 and 15, this is rewritten as ariance v 4

ωmax N var(η) = S(ω) dω = S(ω) dω, 0 0 0.2 0.4 0.6 0.8 1 1.2 Zωmin n=1 Z∆ωn 1 X frequency (rad s− ) (17) · and so we found the amplitude of each wave with Figure 1: Pierson-Moskowitz frequency spectrum SP M (ω) with different wind speed values U10. a(ω )2 = 2 S(ω) dω 2 S(ω )∆ω . (18) n ≈ n n Z∆ωn For a fetch limited sea, where waves continue to To take into account the direction of the wave, we grow, the JONSWAP spectrum has been found by sample the whole directional spectrum E(ω, θ): (Hasselmann and al., 1973) to be more appropriate (figure 2). This is the previous spectrum with an ad- 2 a(ωn, θn) = 2 E(ω, θ) dθ dω. (19) ditional term: ∆ωn ∆θn r Z Z SJ (ω) = SP M (ω)γ , (22) So, for each wave with angular frequency ω and direc- with tion θ, we can now compute the corresponding ampli- (ω ω )2 r = exp − p . tude a(ω, θ). − 2σ2ω2  p  3.2 Parametric spectra Here, γ is a peak enhancement factor, i.e. when same values are used for α and ωp in both spectra, we get γ = SJ (ωp)/SP M (ωp). The parameter σ controls Parametric spectrum models are empirical expres- the width of the peak. Usual parameter values for this sions with user defined parameters that have been spectrum are found to fit ocean surface elevation measurements. 0.22 Most common parameters include wind speed and di- U 2 α = 0.076 10 , rection and fetch. They are useful to simulate realistic F g   where F is the fetch in meters, with 5 if ω ω g2 1/3 µ = ≤ p ω = 22 , 2.5 if ω > ωp. p U F −  10  γ = 3.3, but can vary between 1 and 7, and 2 variance (m s) 0.1 m2 s 0.07 if ω ωp · 2 σ = 3 1.1 m ·s ≤ 2 0.09 if ω > ωp. 2.1 m ·s  2 · As the fetch is an important element of the sea state 1 description, we use the JONSWAP spectrum, rather than the Pierson-Moskowitz one. 0 1.2 1 Pierson-Moskowitz 0.8 16 π π/2 0.6 100 km − − 0 π/2 0.4

s) π · 200 km 1 2 12 300 km direction (rad) freq. (rad s− ) · (m 400 km 8 Figure 3: 3D plot of the JONSWAP spectrum, EJ (ω, θ), 1 with U10 = 25 m s− , F = 100 km and θw = 0 rad.

ariance ·

v 4 For a simple use, only wind speed, direction and 0 0 0.2 0.4 0.6 0.8 1 1.2 fetch need to be given to the spectrum. In order 1 to make the spectrum curve fit particular data, like frequency (rad s− ) · oceanic measurements, the default parameter values Figure 2: JONSWAP frequency spectrum, SJ (ω), with a can be changed, until the desired curve shape is 1 wind speed of U10 = 15 m s− , and different fetch values F . reached (figure 4). · Other parametric spectrum models can be found 1 in oceanographic literature, including double peaked α 1.3 0.8 × spectrum for coming from distant storm. These s) · spectra are often expressed as a function of frequency 2

(m 0.6 f = ω/(2π). To preserve integral equality, conver- σ = 0.03 sion between spectra is done using substitution: 0.4 γ = 1 dω ariance wp 1.2

S (f) df = S (ω) dω = S (ω(f)) df v f ω ω df 0.2 × Z Z Z 0 = Sω(2πf)2π df. 0.6 0.8 1 1.2 1.4 1.6 1.8 1 Z frequency (rad s− ) (23) · For the relation, we use the expression Figure 4: JONSWAP frequency spectrum, SJ (ω), showing found by (Longuet-Higgins, 1962): how different parameter values alter the curve shape (U10 = 1 θ θ 2s(ω) 15 m s− , F = 50 km). D(ω, θ) = N(s(ω)) cos w − , (24) · 2   where θw is the main direction of the spectrum, usu- 3.3 Spectrum sampling ally the direction of the wind, and N(s(ω)) is a nor- malization factor defined as We now look for a selection of wave frequencies and 1 Γ(s(ω) + 1) N(s(ω)) = , directions. For the FFT based model, the size and 2√π Γ(s(ω) + 1/2) sample number of the rendered surface determine the and Γ() is the gamma function (figure 3). The func- set of wave vectors to be used (see equation 8). For tion s(ω) controls the sharpness of the directional the parametric one, as there is not such restriction, spreading and has been defined by (Mitsuyasu and al., we select waves that are the most representative of 1975) as the spectrum energy dispersion. For this purpose, we sample the wave spectrum over a limited domain 2.5 µ g ω [ω , ω ] [θ , θ ]. We want this domain s(ω) = 11.5 , min max × min max ω U ω to be the most representative of the whole spectrum,  p 10   p  i.e. we want it to be as dense as possible. So, by For the FFT based model, we sample a spectrum iteration, we found one of the smallest domain that E(~κ) in the Cartesian wavenumber domain (figure 6). contains roughly 95% of the total energy. As the parametric spectra do not give same values For simplicity, a regular sampling could be used for a wave and its opposite (i.e. E(~κ) = E( ~κ)), by taking a constant size ∆ω ∆θ for each sam- the real number method (equation 9) cannot6 be−used. × ple, with ∆ω = (ωmax ωmin)/N and ∆θ = To preserve integral equality, spectrum conversion is (θ θ )/M, where−N and M are the num- done according to substitution rule. First, we convert max − min ber of frequency and angle samples, respectively. But the frequency spectrum Sω(ω) to a wavenumber spec- an adaptive sampling is more appropriate, especially trum Sκ(κ): when few waves are summed, as this better reflects the dω spectrum attributes. For this purpose, we over-sample S (κ) dκ = S (ω) dω = S (ω(κ)) dκ κ ω ω dκ parts of the spectrum representing large amount of Z Z Z energy, like (Thon and Ghazanfarpour, 2002). For a 1 g = S (√gκ) dκ. given spectrum, we build a quadtree of 4 + 6n sam- ω 2 κ ples, where n is an integer. Samples have different Z r (25) sizes but each of them roughly corresponds to the Second, we convert the wavenumber directional spec- same energy, and so the same amplitude. Sample cen- trum Eκ,θ(κ, θ) = Sκ(κ)D(ω = √gκ, θ) from polar ters give us corresponding wave vector polar coordi- coordinates to Cartesian ones: nates (figure 5). So, we now have a set of wave ampli- 1 tudes, frequencies and directions (a, ω, θ). In order to E (~κ) d~κ = E (κ, θ) dθ dκ. (26) ~κ κ,θ κ use them with ocean models, we convert frequencies Z ZZ to and polar coordinates to Cartesian Finally, we get ones, to get a set of wave vectors (~κ). 1 g E (~κ) = E (√gκ, θ) . (27) ~κ ω,θ 2κ κ r

) ωmax 1 − s · variance (m4) 50 m4 (rad 1 400 4

y 150 m 300 250 m4 200 ωmin 100 frequnec 0 0 8 θmin 0 θmax 4 direction (rad) 8 4 0 0 -4 -4 κx 3 1 -8 -8 3 1 Figure 5: 2D projection of the spectrum from figure 3, κy (10− m− ) (10− m− ) showing adaptive sampling with 16 waves.

Using this method, we make oceanic surfaces with Figure 6: The same spectrum as in figure 3, but in the wave vector domain κx κy (i.e. EJ (~κ)). realistic wave shapes and global structure which cor- × responds to the wanted weather condition. However, if a close look at the surface is needed, we have to pay As the wavenumber vectors are set by the rendered special attention to short waves. When wind speed surface attributes, we cannot use adaptive sampling. or fetch increase, energy is transferred to lower fre- Furthermore, many vectors correspond to a negligible quency waves, i.e. to high wavelength waves (see fig- energy amount but are still used. This is somehow ures 1 and 2). As we use adaptive sampling, we take balanced by the effectiveness of the FFT algorithm: more samples for low frequencies and less for high for the same computation time, we can use a lot more ones, resulting in a smoother surface at a human scale waves, and so spectrum samples, than with the para- and a lack of realism. So, the spectrum needs to be metric method. However, we have to deal with sur- sampled over a second domain corresponding to short face size and sampling on one hand, and with spec- waves, up to the capillary wave size. This domain trum sampling on the other hand. Looking at equa- must be close to the first one, to avoid a “hole” in the tion 8, we see that absolute values of wave vector whole frequency range. The number of samples we components κx and κy are bounded, i.e. 2π/Lx take can vary, depending of the distance between the κ < πN/L and 2π/L κ < πM/L . So,≤ | x| x y ≤ | y| y observer and the surface, in the spirit of (Hinsinger we first have to consider surface size Lx Ly, as et al., 2002). it determines the lowest wavenumber value.× Then, we choose the number of surface (and so spectrum) without considering effects like Fresnel reflectivity samples, knowing that it is related to the highest and transmissivity, or foam and spray (figure 7). Of wavenumber value. course, rendering could have been achieved with clas- sical high quality techniques as well. Interactions of objects with ocean surfaces are not specially handled by the Lagrangian model we use, and are beyond the 4 STATISTICAL PROPERTIES OF scope of this paper. THE OCEAN SURFACE Since our method preserves the main spectrum en- ergy, the global structure of the rendered surface is in- Measurements of oceanic wave statistics have shown dependent of the number of waves we sum. For both that, to a reasonable accuracy, the surface elevation η ocean models, the sea state we get is always consis- follows a normal distribution. Attributes of oceanic tent with the provided wind parameters, which cannot waves we simulate are consistent with these observa- be achieved with other existing methods. Since these tions. If we look at the oceanic surface as an infinite parameters are the only ones needed to have full con- sum of waves with infinitely small amplitude, we see trol of the method, there is no need for the user to that the wave spectrum is a probability density func- adjust the resulting surface by trial and error. tion of wave frequencies and directions. Furthermore, As previously noted, the FFT model can be partic- the variance of the surface elevation is finite (equa- ularly tedious to use. To catch a reasonable part of the tion 12). So, by virtue of the central limit theorem, spectrum, the grid length and the number of samples we know that the more waves we sum, the closer to have to be carefully chosen, whatever are the desired the normal distribution is the simulated surface eleva- surface characteristics. For example, taking 512 sam- tion. 1 ples up to a frequency of 25 rad s− requires a grid Another observed characteristic of oceanic waves length of no more than 25 m. Furthermore,· as this is that their heights follow a Rayleigh distribution, as 1 leads to a lowest frequency of about 1.5 rad s− , the noted by (Fournier and Reeves, 1986). This distribu- spectrum peak may be under-sample. · tion is used with a parameter σ = H /2, where H s s ≈ We have tested our implementation with a 3 GHz 4 var(η) is known as the significant height. From Pentium 4 PC and a Radeon 9200 graphic board. With this, it can be shown that the probability that a wave the FFT model, we got about 65 fps and 13 fps with, haspa larger height than H is exp( 2) 0.1353. s − ≈ respectively, a grid of 128 128 and 256 256 sam- Since they use defined amplitudes, the ocean mod- ples. With the parametric equations,× we got×8 fps with els presented in section 2 are known as determinis- a regular grid of 128 128 samples and 50 waves. tic methods. (Tucker et al., 1984) showed that uni- And taking less than 100× waves leads to poor detailed formly distributed random phase terms φ should be results. Clearly, only the FFT can reach interactive replaced with random amplitudes. An expression like rate. Although we do not implement an adaptive sur- a cos(κx ωt + φ) becomes 0 − face mesh, it seems obvious this could not compete r1a cos(κx0 ωt) + r2a sin(κx0 ωt) with the FFT speed. Parametric equations should be − − (28) = Ra sin(κx0 ωt + Φ), kept for non-interactive rendering, since they are eas- − iest to use. where r1 and r2 are random numbers from the stan- dard normal distribution, i.e. with a mean of zero and 2 2 a standard deviation of one, R = r1 + r2 follows a Rayleigh distribution and p 6 CONCLUSION r1 arctan if r2 0 r2 ≥ Φ =    We have presented a method for accurate wave energy  r1 spectrum sampling that allows realistic ocean surface  arctan + π if r2 < 0. r synthesis and animation. For given wind parameters,  2  This non-deterministic method has better statistical the wave heights and directions are computed such  properties than the previous one. In order to use it that statistical properties of the resulting surface are with parametric and FFT methods, we rewrite equa- correct. Since it does not rely on any ocean model, tions 4 and 6 according to equation 28. this method is suitable for Gerstner equations and Fourier transforms.

5 RESULTS AND DISCUSSION Acknowledgments

We made a simple real-time implementation of ocean The author wish to thank Bertrand le Saec¨ and Jean- models. We focused on wave shapes and animations, Christophe Gonzato for rereading this paper. 1 Figure 7: FFT with a grid of 512 512 samples. Left: grid length is 50 m and wind speed is 5 m s− . Middle: grid length ×1 1 · is 450 m and wind speed is 15 m s− . Right: grid length is 1500 m and wind speed is 25 m s− . White square is 1 m wide. · ·

REFERENCES Mastin, G. A., Watterberg, P. A., and Mareda, J. F. (1987). Fourier synthesis of ocean scenes. IEEE Computer Airy, G. B. (1845). and waves. In Encyclopaedia Me- Graphics and Applications, 7(3):16 – 23. tropolitana, volume 5, chapter 192, pages 241–396. Mihalef, V., Metaxas, D., and Sussman, M. (2004). Anima- Cieutat, J.-M., Gonzato, J.-C., and Guitton, P. (2001). A tion and control of breaking waves. In Symposium on new efficient wave model for maritime training simu- Computer Animation, pages 315–324. lator. In Spring Conference on Computer Graphics. Mitsuyasu, H. and al. (1975). Observations of the direc- Enright, D., Marschner, S., and Fedkiw, R. (2002). Anima- tional spectrum of ocean waves using a cloverleaf tion and rendering of complex water surfaces. In Conf. buoy. Jour. of physical , 5(4):750–760. on C. G. and interactive techniques, pages 736–744. Peachey, D. R. (1986). Modeling waves and surf. SIG- Fournier, A. and Reeves, W. T. (1986). A simple model GRAPH Computer Graphics, 20(4):65–74. of ocean waves. SIGGRAPH Computer Graphics, Phillips, O. M. (1957). On the generation of waves by tur- 20(4):75–84. bulent wind. Journal of fluid mechanics, 2:417–445. Gamito, M. N. and Musgrave, F. K. (2002). An accurate Pierson, W. J. and Moskowitz, L. (1964). A proposed spec- model of wave refraction over shallow water. Com- tral form for fully developed wind . Journal of puters & Graphics, 26(2):291–307. geophysical research, 69:5181–5203. Gonzato, J.-C. and le Saec,¨ B. (2000). On modeling and Premoze,ˇ S. and Ashikhmin, M. (2001). Rendering natural rendering ocean scenes. Journal of visualisation and waters. Computer Graphics Forum, 20(4):189–199. computer simulation, 11:27–37. Rankine, W. J. M. (1863). On the exact form of waves near Hasselmann, K. and al. (1973). Measurements of wind- the surface of deep water. Philosophical transactions wave growth and swell decay. Erganzungsheft¨ zur of the Royal society of London, pages 127–138. Deutschen Hydrographischen Zeitschrift, (12). Tessendorf, J. (2001). Simulating ocean water. ACM SIG- Hinsinger, D., Neyret, F., and Cani, M.-P. (2002). Inter- GRAPH course notes. Updated in 2004. active animation of ocean waves. In Symposium on Thon, S. and Ghazanfarpour, D. (2002). Ocean waves syn- Computer Animation, pages 161–166. thesis and animation using real world information. Iglesias, A. (2004). Computer graphics for water modeling Computers and Graphics, 26(1):99–108. and rendering: a survey. Future generation computer Tucker, M. J., Challenor, P. G., and Carter, D. J. T. (1984). systems, 20(8):1355–1374. Numerical simulation of a random sea. Applied ocean Longuet-Higgins, M. S. (1962). The distribution of inter- research, 6(2):118–122. vals between zeros of a stationary random function. von Gerstner, F. J. (1804). Theorie der wellen. Abhand- Philosophical Transactions for the Royal Society of lungen der Koniglic¨ hen Bohmisc¨ hen Gesellschaft der London, 254:557–599. Wissenschaften, 1:1–65.