<<

REALISTIC SIMULATION OF SURFACE USING SPECTRA

Jocelyn Frechot´ LaBRI - Laboratoire bordelais de recherche en informatique Domaine universitaire, 351 cours de la Liberation,´ 33405 Talence CEDEX, France

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 indicate the distribution of wave energy as a function of . However, none of the existing methods The reproductions of many natural phenomena is still are able to correctly reproduce states described by an open problem in Computer Graphics. In particular, these spectra. the realistic simulation of oceanic surfaces continues In this paper, we explain how wave spectra are to be of great interest. Many fields of activity rely on related to oceanic surface energy and we detail a it: virtual reality, movies and games, but also sailing method to deduce wave heights from it. We propose (Cieutat et al., 2001) and oceanographic simulations, a solution for optimal spectrum sampling, suitable among others. for parametric and Fourier transform models. This While beautiful pictures and animations such as method enables the accurate simulation of oceanic wave refraction (Gonzato and le Saec,¨ 2000) (Gamito surface. Users can easily produce realistic wave ani- and Musgrave, 2002) are produced, there is still a mations, with respect to supplied weather conditions. need for oceanic scenes with realistic wave features. The structure of this paper is as follows. Section 2 Models based on fluid mechanics equations (Enright summarizes ocean models for Computer Graphics. In et al., 2002) (Mihalef et al., 2004) should give the section 3, we detail our method and give classical more realistic results, but are inadequate for large parametric spectrum examples. We handle wave sta- oceanic surfaces. tistics in section 4. We discuss our results in section 5, For twenty years, procedural models for wave rep- and conclude in section 6. resentation in Computer Graphics have been devel- oped and improved (Iglesias, 2004). The Gerst- ner parametric equations and their Fourier transform 2 OCEAN MODELS rewriting are well known by the oceanographic com- munity. Based on the linear wave theory, they allow representation of natural wave shapes and moves in 2.1 Definitions and Relationships deep water above the capillary size. As they not de- scribe any net mass transport, they are limited to non- The surface elevation, η, is the vertical displacement breaking waves and to scenes without violent storms. from the mean water level of the oceanic surface at Wave height measurement data allow to simulate a given point and time. The wave , a, is the given . In the more general case, oceanic sur- maximum surface elevation due to this wave. The face statistics are taken in account by the use of para- wave height, H, is the vertical distance between a metric wave spectra. For given wind parameters, they trough and an adjacent crest. For a single wave,

76 Fréchot J. (2006). REALISTIC SIMULATION OF OCEAN SURFACE USING WAVE SPECTRA. In Proceedings of the First International Conference on Computer Graphics Theory and Applications, pages 76-83 DOI: 10.5220/0001357800760083 Copyright c SciTePress REALISTIC SIMULATION OF OCEAN SURFACE USING WAVE SPECTRA

H =2a. The , λ, is the distance between sponds to calm weather conditions. Considering a lo- two successive crests. The period, T , is the time inter- cation x0 lying on a 1D surface at rest, the elevation val between the passage of successive crests through z = η at time t due to a wave with √ κ, a fixed point. The frequency, f =1/T , is the number amplitude a and angular velocity ω = gκ is of crests that pass a fixed point in 1 second. The wave z(x0,t)=a cos(κx0 − ωt). (2) speed or phase speed, c = λ/T , is the speed of wave crests or troughs. It can also be expressed as c = ω/κ, When the steepness of the wave increases, its crests where ω =2πf is the angular velocity or angular fre- become sharper and its troughs flatter. Therefore, quency, and κ =2π/λ is the wavenumber. The water (Fournier and Reeves, 1986) used a more realistic de- depth, d, is the vertical distance between the floor and scription based on trochoids, made by (von Gerstner, the mean water level. 1804) and by (Rankine, 1863). The surface equation The concept of deep water is wave dependent and is now is related to the ratio of the water depth to the wave- x(x0,t)=x0 + a sin(κx0 − ωt) (3) length of the wave. This comes from the transcenden- z(x0,t)=z0 − a cos(κx0 − ωt), tal expression 0 where z0 is the surface elevation at rest (typically ). gT 2 2πd Note that the important point here is the phase term λ = tanh , (1) − 2 ( ) ( ) 2π λ difference of π/ between x x0,t and z x0,t , not the use of a particular sine or cosine function. This where g ≈ 9.807 m·s−2 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). ⎪ ⎪ + ˆ ( )sin( · − ( ) + ( )) ⎨⎪ x0 κa κ κ x0 ω κ t φ κ κ Table 1: Relations between oceanographic terms. The sub- ⎪ z(x0,t)= ∞ ⎪ script indicates a deep water term. ⎪ ⎩⎪ z0 − a(κ)cos(κ · x0 − ω(κ)t + φ(κ)), Transitional depth: Deep water: κ (4) 1/20 1/2 where x =(x, y) is the horizontal particle position at = λ = ω =( ) =( ) c T κ time t, x0 x0,y0 its position at rest, κ κx,κy gT gT a wave vector, i.e. a vector with magnitude κ = c = tanh(κd) c∞ = 2π 2π κ and direction of the considered wave propagation c2 = g tanh(κd) c2 = g =(g )2 ˆ κ ∞ κ ω and κ = κ/κ is the unit vector of κ. Because of the presence of uniformly distributed random phase = 2π κ λ terms, φ(κ) ∈ [0, 2π[, this model is also known as = tanh( ) κ∞ κ κd random waves. Any set of x0 can be taken, which allows the use of adaptive mesh, for optimal surface = 2π = λ κ cT sampling (Hinsinger et al., 2002). 2 2 gT 2πd gT λ = 2 tanh( ) λ∞ = 2 π λ π 2.3 Inverse Fourier Transform λ = λ∞ tanh(κd)

2 Another method for computing equation 4 is the 2D ω = π = κc 2 T 2 inverse discrete Fourier transform, used by (Mastin ω = gκ tanh(κd)=gκ∞ ω = gκ ∞ 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 f = F exp i2π + , (5) The base model for ocean waves simulation comes p,q n,m N M from the linear (or small-amplitude) wave theory by n=1 m=1 (Airy, 1845), widely used in oceanic engineering, and where p ∈{1, .., N} and q ∈{1, .., M}. This is in Computer Graphics by (Peachey, 1986). It de- of particular interest because the fast Fourier trans- scribes waves with a sinusoidal shape, which corre- form (FFT) algorithm is an efficient way to compute

77 GRAPP 2006 - COMPUTER GRAPHICS THEORY AND APPLICATIONS

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 ( ) ∈ [− 2 2[ nx0 Lx/N, my0 Ly/M , where nx0 N/ ,N/ domain. This decomposition of the surface elevation ∈ [− 2 2[ and mx0 M/ ,M/ 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(x0,t)=x0 +  κA(κ, t)exp(iκ · x0) ⎨⎪ (Tessendorf, 2001) (Thon and Ghazanfarpour, 2002). κ An amplitude spectrum can be used to generate a ⎪ ⎪ surface with the same characteristics as the related ⎪ ( )= − ( )exp(i · ) ⎩⎪ z x0,t z0 A κ, t κ x0 , one. However, to get several oceanic surfaces with κ different sea states, as many spectra are needed. In- (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) 3.1 Wave Energy and Amplitudes Rather than the random phase term φ, authors com- monly use a normally distributed random amplitude Oceanographers are mostly concerned by wave en- (see section 4). To comply with equation 5, the set of ergy rather than amplitude. For this purpose, they wave vectors must be use another type of spectrum, S(ω), called wave fre- n m κ =(2π κ , 2π κ ), (8) quency energy spectrum or wave spectrum, which Lx Ly gives information about wave energy distribution as a continuous function of frequency. This is a smoothed where n and m are defined as n and m above. κ κ x0 x0 version of a modified amplitude spectrum (see be- The resulting surface is periodic in all directions and low). Directional informations are taken into account can be used as a tile (Tessendorf, 2001). with a directional wave spectrum: To decrease the FFT computation time by a fac- tor two, real numbers can be used instead of com- E(ω,θ)=S(ω)D(ω,θ), (10) plex ones. This is achieved by adding two waves with ( ) same amplitude and travelling in opposite directions where θ is the direction of the wave and D ω,θ is a (Tessendorf, 2001). Equation 7 becomes directional spreading function, defined such that ( )= ( )exp(i(− ( ) + ( ))) +π A κ, t a κ ω κ t φ κ E(ω,θ)dθ = S(ω) (11) + a(κ)exp(−i(−ω(κ)t + φ(κ))) (9) −π =2a(κ)cos(−ω(κ)t + φ(κ)). for all values of ω. The Pierson-Moskowitz paramet- ric wave spectrum (see section 3.2) has been regularly This results in a single stationary wave with time de- used in the field of Computer Graphics since (Mastin pendent amplitude. This phenomenon is known as et al., 1987) as a direct evaluation of wave amplitudes. standing wave. The drawback of this method is that But this method cannot reflect statistical characteris- the generated surface is only half the size of the ex- tics of the oceanic surface. First, this is a continuous pected one. The second half is obtained with a rota- function, so it needs to be integrated to be used with a tion of the first one by 180 degrees around the origin, discrete model. Second, wave spectrum does not give leading to pattern duplications. direct information about wave amplitude but energy. The mean energy per unit surface area is E = ρg var(η), where ρ is the water density and var(η) the 3 WAVE SPECTRA variance of the surface elevation. The wave spectrum is defined to be related to the surface energy by To be able to use the models discussed so far, we +∞ need a function a(κ). For the parametric model, we var(η)= S(ω)dω. (12) also need to know which set of wave vectors char- 0 acterizes the surface we want to generate. The more For a zero mean process, like the sinusoidal wave natural method is to use records of surface elevation model from equation 2, the variance is measurement data used by oceanic engineering (Thon var( )= 2 and Ghazanfarpour, 2002). Measurements are made x xrms, (13)

78 REALISTIC SIMULATION OF OCEAN SURFACE USING WAVE SPECTRA

where xrms is the root mean square of the values. For where α =0.0081 is called the Phillips constant. 2 − ¯2 a general process, this becomes xrms x . The mean Taking into account wind speed, (Pierson and Mos- amplitude of the model from equa- kowitz, 1964) found an expression that describes a tion 3 is a¯ = −(κa2)/2, which can be reasonably ne- theoretical fully developed sea with infinite fetch (see glected in most cases for practical purposes. So, we figure 1). The wind has blown with no change over apply equation 13 to this model as well for simplic- a large area for several hours, and waves growth is ity. The rms of a sinusoidal or trochoidal wave with almost null. The spectrum is amplitude a is 5 4 a2 ( )= ( )exp − ωp 2 = SPM ω SP ω , (21) arms 2 . (14) 4 ω

As we see the oceanic surface as the sum of many where ωp is the frequency of the peak of the spectrum, waves with independent random phases, the total vari- i.e. dSPM/dω =0for ωp. Usual value for ωp is ance of the surface elevation is the sum of the variance 0 855 of each wave. So, taking a finite range of frequen- . g ωp = , cies [ωmin,ωmax] such that it is representative of the U10 whole energy, i.e. where U10 is the wind speed at a height of 10 meters ωmax +∞ above the sea surface. S(ω)dω ≈ S(ω)dω, (15) ωmin 0 ∆ · −1 we divide it in N samples of width ωn and tag the 16 10.0 m s−1 12.5 m·s mean frequency of each of them as ωn to get the rela- −1

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

Regarding equations 12 and 15, this is rewritten as variance (m 4 ωmax N 0 var(η)= S(ω)dω = S(ω)dω, 0 0.2 0.4 0.6 0.8 1 1.2 ∆ −1 ωmin n=1 ωn frequency (rad·s ) (17) and so we found the amplitude of each wave with Figure 1: Pierson-Moskowitz frequency spectrum SPM(ω) with different wind speed values U10. 2 a(ωn) =2 S(ω)dω ≈ 2 S(ωn)∆ωn. (18) ∆ ω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 =2 ( )d d a ωn,θn E ω,θ θ ω. (19) ditional term: ∆ωn ∆θn r So, for each wave with angular frequency ω and direc- SJ (ω)=SPM(ω)γ , (22) tion θ, we can now compute the corresponding ampli- with tude a(ω,θ). ( − )2 =exp − ω ωp r 2 2 2 . 3.2 Parametric Spectra σ ωp Here, γ is a peak enhancement factor, i.e. when same Parametric spectrum models are empirical expres- values are used for α and ωp in both spectra, we get = ( ) ( ) sions with user defined parameters that have been γ SJ ωp /SPM ωp . The parameter σ controls found to fit ocean surface elevation measurements. the width of the peak. Usual parameter values for this Most common parameters include wind speed and di- spectrum are rection and fetch. They are useful to simulate realistic 0 22 U 2 . ocean waves without measurement data, but can also α =0.076 10 , be altered to fit specific data. Fg The base of modern parametric wave spectrum was where F is the fetch in meters, found by (Phillips, 1957) and has the form 1 3 2 2 / αg =22 g S (ω)= , (20) ωp , P ω5 U10F

79 GRAPP 2006 - COMPUTER GRAPHICS THEORY AND APPLICATIONS

γ =3.3, but can vary between 1 and 7, and 2 2 variance (m ·s) 0.1 m ·s 2· 0.07 if ω ≤ ω 3 1.1 m2 s σ = p 2.1 m ·s 0.09 if ω>ωp. 2 As the fetch is an important element of the sea state 1 description, we use the JONSWAP spectrum, rather 0 than the Pierson-Moskowitz one. 1.2 1 −π − 2 0.8 Pierson-Moskowitz π/ 0 2 0.6 16 π/ π 0.4 100 km · −1

s) direction (rad) freq. (rad s )

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

variance (m 4

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

= (2 ) 2 f ω/ π . To preserve integral equality, conver- 0.6 sion between spectra is done using substitution: σ =0.03 =1 dω 0.4 γ Sf (f)df = Sω(ω)dω = Sω(ω(f)) df df wp × 1.2 variance (m 0.2 = S (2πf)2π df. ω 0 0.6 0.8 1 1.2 1.4 1.6 1.8 (23) · −1 For the relation, we use the expression frequency (rad s ) found by (Longuet-Higgins, 1962): Figure 4: JONSWAP frequency spectrum, SJ (ω), showing U − 2s(ω) how different parameter values alter the curve shape ( 10 = ( )= ( ( )) cos θw θ 15 m·s−1, F = 50 km). D ω,θ N s ω 2 , (24) where θw is the main direction of the spectrum, usu- ally the direction of the wind, and N(s(ω)) is a nor- 3.3 Spectrum Sampling malization factor defined as 1 Γ(s(ω)+1) We now look for a selection of wave frequencies and N(s(ω)) = √ , 2 π Γ(s(ω)+1/2) directions. For the FFT based model, the size and 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, 2.5 µ we sample the wave spectrum over a limited domain ( )=115 g ω s ω . , [ωmin,ωmax] × [θmin,θmax]. We want this domain ω U10 ω p p to be the most representative of the whole spectrum, with i.e. we want it to be as dense as possible. So, by 5 if ω ≤ ωp iteration, we found one of the smallest domain that µ = −2.5 if ω>ωp. contains roughly 95% of the total energy.

80 REALISTIC SIMULATION OF OCEAN SURFACE USING WAVE SPECTRA

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) cannot be used. ple, with ∆ω =(ωmax − ωmin)/N and ∆θ = To preserve integral equality, spectrum conversion is (θmax − θmin)/M , where N and M are the num- done according to substitution rule. First, we convert 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 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 (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 κ to and polar coordinates to Cartesian Finally, we get ones, to get a set of wave vectors (κ). √ 1 g E (κ)=E ( gκ,θ) . (27) κ ω,θ 2κ κ

) ωmax 1 − s

· 4 variance (m ) 4 1 50 m 400 150 m4 300 250 m4 200 ωmin 100

frequnecy (rad 0 0 8 θmin 0 θmax 4 direction (rad) 8 0 4 0 -4 κx −3 −1 -4 -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 κ × κ E (κ) realistic wave shapes and global structure which cor- vector domain x y (i.e. J ). 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 |κx| <πN/Lx and 2π/Ly ≤|κy| <πM/Ly. So, 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, For the FFT based model, we sample a spectrum we choose the number of surface (and so spectrum) E(κ) in the Cartesian wavenumber domain (figure 6). samples, knowing that it is related to the highest As the parametric spectra do not give same values wavenumber value.

81 GRAPP 2006 - COMPUTER GRAPHICS THEORY AND APPLICATIONS

4 STATISTICAL PROPERTIES OF objects with ocean surfaces are not specially handled THE OCEAN SURFACE by the Lagrangian model we use, and are beyond the scope of this paper. Measurements of oceanic wave statistics have shown Since our method preserves the main spectrum en- that, to a reasonable accuracy, the surface elevation η ergy, the global structure of the rendered surface is in- follows a normal distribution. Attributes of oceanic dependent of the number of waves we sum. For both waves we simulate are consistent with these observa- ocean models, the sea state we get is always consis- tions. If we look at the oceanic surface as an infinite tent with the provided wind parameters, which cannot sum of waves with infinitely small amplitude, we see be achieved with other existing methods. Since these that the wave spectrum is a probability density func- parameters are the only ones needed to have full con- tion of wave frequencies and directions. Furthermore, trol of the method, there is no need for the user to the variance of the surface elevation is finite (equa- adjust the resulting surface by trial and error. tion 12). So, by virtue of the central limit theorem, As previously noted, the FFT model can be partic- we know that the more waves we sum, the closer to ularly tedious to use. To catch a reasonable part of the the normal distribution is the simulated surface eleva- spectrum, the grid length and the number of samples tion. have to be carefully chosen, whatever are the desired surface characteristics. For example, taking 512 sam- Another observed characteristic of oceanic waves · −1 is that their heights follow a Rayleigh distribution,as ples up to a frequency of 25 rad s requires a grid length of no more than 25 m. Furthermore, as this noted by (Fournier and Reeves, 1986). This distribu- −1 = 2 ≈ leads to a lowest frequency of about 1.5 rad·s , the tion is used with a parameter σ Hs/ , where Hs 4 var( ) spectrum peak may be under-sample. η is known as the significant height. From We have tested our implementation with a 3 GHz this, it can be shown that the probability that a wave exp(−2) ≈ 0 1353 Pentium 4 PC and a Radeon 9200 graphic board. With has a larger height than Hs is . . the FFT model, we got about 65 fps and 13 fps with, Since they use defined amplitudes, the ocean mod- respectively, a grid of 128 × 128 and 256 × 256 sam- els presented in section 2 are known as determinis- ples. With the parametric equations, we got 8 fps with tic methods. (Tucker et al., 1984) showed that uni- a regular grid of 128 × 128 samples and 50 waves. formly distributed random phase terms φ should be And taking less than 100 waves leads to poor detailed replaced with random amplitudes. An expression like cos( − + ) results. Clearly, only the FFT can reach interactive a κx0 ωt φ becomes rate. Although we do not implement an adaptive sur- r1a cos(κx0 − ωt)+r2a sin(κx0 − ωt) face mesh, it seems obvious this could not compete (28) with the FFT speed. Parametric equations should be = Ra sin(κx0 − ωt +Φ), kept for non-interactive rendering, since they are eas- where r1 and r2 are random numbers from the stan- iest to use. 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 ⎧ 6 CONCLUSION ⎪ r1 ⎨⎪ arctan if r2 ≥ 0 r2 We have presented a method for accurate wave energy Φ= ⎪ spectrum sampling that allows realistic ocean surface ⎩⎪ r1 arctan + π if r2 < 0. synthesis and animation. For given wind parameters, r2 the wave heights and directions are computed such This non-deterministic method has better statistical that statistical properties of the resulting surface are properties than the previous one. In order to use it correct. Since it does not rely on any ocean model, with parametric and FFT methods, we rewrite equa- this method is suitable for Gerstner equations and tions 4 and 6 according to equation 28. 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. without considering effects like Fresnel reflectivity and transmissivity, or foam and spray (figure 7). Of course, rendering could have been achieved with clas- sical high quality techniques as well. Interactions of

82 REALISTIC SIMULATION OF OCEAN SURFACE USING WAVE SPECTRA

Figure 7: FFT with a grid of 512 × 512 samples. Left: grid length is 50 m and wind speed is 5 m·s−1. Middle: grid length is 450 m and wind speed is 15 m·s−1. Right: grid length is 1500 m and wind speed is 25 m·s−1. 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 Koniglichen¨ Bohmischen¨ Gesellschaft der London, 254:557–599. Wissenschaften, 1:1–65.

83