10
Research Article Automatic Optimization for Large-Scale Real-Time Coastal Water Simulation Shunli Wang 1,2 and Fengju Kang 1,2 1 School of Marine Technology, Northwestern Polytechnical University, Xi’an, China 2 National Key Laboratory of Underwater Information Process and Control, Xi’an, China Correspondence should be addressed to Shunli Wang; [email protected] Received 6 April 2016; Accepted 10 October 2016 Academic Editor: Ruben Specogna Copyright © 2016 S. Wang and F. Kang. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. We introduce an automatic optimization approach for the simulation of large-scale coastal water. To solve the singular problem of water waves obtained with the traditional model, a hybrid deep-shallow-water model is estimated by using an automatic coupling algorithm. It can handle arbitrary water depth and different underwater terrain. As a certain feature of coastal terrain, coastline is detected with the collision detection technology. en, unnecessary water grid cells are simplified by the automatic simplification algorithm according to the depth. Finally, the model is calculated on Central Processing Unit (CPU) and the simulation is implemented on Graphics Processing Unit (GPU). We show the effectiveness of our method with various results which achieve real-time rendering on consumer-level computer. 1. Introduction Water is a common and important element in nature. It is also frequently encountered in games and other 3D virtual environments. A lot of attention has been paid to rendering water realistically, but the effectiveness of large-scale coastal water is typically limited in games. Large-scale water is oſten simply modeled to decrease computer cost, so there are not enough details, such as surf, foam, spray, and so forth. More details are needed to ensure the visual effect in today’s computer games and 3D virtual environments. Methods of coastal water simulation can be classified into physically based methods and geometry based methods. Physically based methods mainly solve the shallow-water equations (SWE) with a grid-based or particle-based solver, which requires more than thousands of grid cells or particles [1]. A typical grid-based simulation is developed by Playne et al. [2]. ey solve the SWE on multiple graphics processing units (GPUs) and give a standard parallel scheme for realistic fluid simulations. A hybrid grid which consists of regular cells near the water surface and tall cells on the bottom is given by Chentanez and M¨ uller [3]. is method can handle most water phenomena while reducing computation time. It is implemented on a GPU and can get a good real-time perfor- mance. Ojeda and Susin [4] simulated shallow-water with the algorithm based on the Lattice Boltzmann Method (LBM). ey enhanced the shallow-water scene [5] by adding lower details, surface foam, caustics, and so forth. A fast shallow- water is developed by Abbasov [6]. He constructed a discrete model aſter numerical simulating a three-dimensional (3D) shallow-water model. is method can greatly simplify the computation by adjusting the cell fill factor upon a sloping shore. e particle-based methods are more suitable for simulating small-scale water with higher details, such as breaking waves [7], water flows into empty regions [8], and interaction of water and rigid objects [9]. Geometry methods usually use a series of shapes to simulate shallow-water. ey have been used for a long time. Gerstner model is applied by Fournier and Reeves [10] to the computer graphics field and improved with the elliptic function. However, the water shape he obtained cannot be curved in his simulation. A procedural model for breaking wave in coastal water is provided by De Lima et al. [11]. ey generate a wave map and add it to water surface. is method can efficiently simulate the coastal water. Luo et al. [12] put forward a kind of 3D Gerstner wave model with the 3D Bezier curved. ese methods Hindawi Publishing Corporation Mathematical Problems in Engineering Volume 2016, Article ID 9034649, 9 pages http://dx.doi.org/10.1155/2016/9034649

Research Article Automatic Optimization for Large-Scale

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Research ArticleAutomatic Optimization for Large-Scale Real-TimeCoastal Water Simulation

Shunli Wang12 and Fengju Kang12

1School of Marine Technology Northwestern Polytechnical University Xirsquoan China2National Key Laboratory of Underwater Information Process and Control Xirsquoan China

Correspondence should be addressed to Shunli Wang wangsli2011126com

Received 6 April 2016 Accepted 10 October 2016

Academic Editor Ruben Specogna

Copyright copy 2016 S Wang and F KangThis is an open access article distributed under the Creative CommonsAttribution Licensewhich permits unrestricted use distribution and reproduction in any medium provided the original work is properly cited

We introduce an automatic optimization approach for the simulation of large-scale coastal water To solve the singular problem ofwater waves obtained with the traditional model a hybrid deep-shallow-water model is estimated by using an automatic couplingalgorithm It can handle arbitrary water depth and different underwater terrain As a certain feature of coastal terrain coastline isdetected with the collision detection technology Then unnecessary water grid cells are simplified by the automatic simplificationalgorithm according to the depth Finally the model is calculated on Central Processing Unit (CPU) and the simulation isimplemented on Graphics Processing Unit (GPU) We show the effectiveness of our method with various results which achievereal-time rendering on consumer-level computer

1 Introduction

Water is a common and important element in nature It isalso frequently encountered in games and other 3D virtualenvironments A lot of attention has been paid to renderingwater realistically but the effectiveness of large-scale coastalwater is typically limited in games Large-scale water is oftensimply modeled to decrease computer cost so there arenot enough details such as surf foam spray and so forthMore details are needed to ensure the visual effect in todayrsquoscomputer games and 3D virtual environments

Methods of coastal water simulation can be classifiedinto physically based methods and geometry based methodsPhysically based methods mainly solve the shallow-waterequations (SWE) with a grid-based or particle-based solverwhich requires more than thousands of grid cells or particles[1] A typical grid-based simulation is developed by Playne etal [2] They solve the SWE on multiple graphics processingunits (GPUs) and give a standard parallel scheme for realisticfluid simulations A hybrid gridwhich consists of regular cellsnear the water surface and tall cells on the bottom is givenby Chentanez and Muller [3] This method can handle mostwater phenomena while reducing computation time It is

implemented on a GPU and can get a good real-time perfor-mance Ojeda and Susin [4] simulated shallow-water with thealgorithm based on the Lattice Boltzmann Method (LBM)They enhanced the shallow-water scene [5] by adding lowerdetails surface foam caustics and so forth A fast shallow-water is developed by Abbasov [6] He constructed a discretemodel after numerical simulating a three-dimensional (3D)shallow-water model This method can greatly simplify thecomputation by adjusting the cell fill factor upon a slopingshore The particle-based methods are more suitable forsimulating small-scale water with higher details such asbreaking waves [7] water flows into empty regions [8] andinteraction of water and rigid objects [9] Geometry methodsusually use a series of shapes to simulate shallow-water Theyhave been used for a long time Gerstner model is applied byFournier and Reeves [10] to the computer graphics field andimprovedwith the elliptic functionHowever the water shapehe obtained cannot be curved in his simulation A proceduralmodel for breaking wave in coastal water is provided by DeLima et al [11] They generate a wave map and add it towater surfaceThismethod can efficiently simulate the coastalwater Luo et al [12] put forward a kind of 3D Gerstnerwave model with the 3D Bezier curved These methods

Hindawi Publishing CorporationMathematical Problems in EngineeringVolume 2016 Article ID 9034649 9 pageshttpdxdoiorg10115520169034649

2 Mathematical Problems in Engineering

can generate a realistic coastal water scene but they stillcannot meet the real-time requirement when large bodies ofcoastal water need to be rendered A hybrid shallow-waterthat combines grid-based and particles based simulation isprovided by Chentanez andMuller [13] Longo et al [14] gavea review for turbulence in the swash zone and discussed themeasurement techniques and generation of breaking wavesThere also have shallow-water simulations using a depth-integrated [15] spectrum [16 17] 2D Boussinesq equations[18] video-based method [19] and so forth The geometrybased methods are suitable for large-scale real-time waterbecause of simple computation However these methodscannot simulate the vertical movement such as curvedwaves and breaking waves Although the above methods canget a nice shallow-water scene they have some limits tomeet the requirements of large-scale real-time shallow-watersimulations

In order to realize large-scale real-time shallow-watersimulations we analyze the coastal water modeling heightfield map generation ocean wave mesh generation andrendering We find some solutions to enhance the real-timeperformance of the simulations Our contributions of thispaper are as follows

(i) A construction of the hybrid model that allows thesimulation of arbitrary domain scales by coupling ofdeep water and shallow-water waves

(ii) An adaptive optimization of water surface grid thatcan efficiently reduce unnecessary grid cells under thecoastal terrain

(iii) Implementations of our method and water surfaceeffects such as surface foam and reflection with theshader language on GPU

This paper is organized as follows We present our hybridmodel in the next section The optimization of water surfacegrid is shown in Section 3 In Section 4 we present theimplementation of ourmethodThen we show our renderingresults and discussion in Section 5 Finally we conclude andexplore avenues of future work in Section 6

2 Hybrid Coastal Water

When the terrain depth (Depth119863) is greater than half of thewavelength (119871) the water is called deep water otherwise thewater is called shallowwater when119863 is less than 11987120 and theintermediate zone shown in Figure 1 is the transition zone

To achieve a realistic coastal water scene this paperselects the deep water model based on FFT [20] and theshallow-water model based on geometry [21] and the auto-matic fusion algorithm is used to couple the two water wavesin the transitional zone

21 DeepWater TheFFTmethod based onPhillips spectrumfirst gets a series of double frequency sine waves whoseamplitude and phase are relevant and then gets the height ofevery grid point on the ocean face by calculating with FFT

L

Depth

Intermediate zoneDeep waterShallow water

L2L20

Figure 1 The intermediate zone from deep water to shallow-water

Assuming that there are 119872 times 119873 discrete points onthe 119909119911 plane the vertical offset of the discrete point x =(119899119871119909119873119898119871119911119872) at time 119905 is

ℎ (x 119905) = sumkℎ (k 119905) 119890119894ksdotx (1)

where k = (119896119909 119896119910) 119896119909 = 2120587119899119871119909 119896119911 = 2120587119899119871119911 minus1198732 le 119899 le1198732 minus1198722 le 119898 le 1198722 and ℎ(k 119905) is the height amplitudeFourier and can be calculated with the Phillips spectrum

119875ℎ (k) = 119860 11198964 119890minus1(119896119871)

2 10038161003816100381610038161003816k sdot 100381610038161003816100381610038162 (2)

The height amplitude Fourier at time 119905 = 0 isℎ0 (k) = 1

radic2 (120585119903 + 119894120585119894)radic119875ℎ (k) (3)

where 120585119903 and 120585119894 are Gaussian random numbers that meetmathematical expectation 0 and variance 1

The height amplitude Fourier at time 119905 isℎ (k 119905) = ℎ0 (k) 119890119894120596(119896)119905 + ℎlowast0 (minusk) 119890minus119894120596(119896)119905 (4)

where 120596(119896) = radic119892119896Actually in real motion of an ocean wave the continuous

changes of wind direction lead to extrusion between waveswhich make it become sharp at the top of waves and flatat the bottom following the rolling wave effect The heightmap generated by our method is the result of stacking ofmultiple sine waves Top of wave is too flat and not real so weneed to add a roll wave model The model can be realized bychanging the position of the grid in the horizontal directionHere we use the amplitude of the ocean wave to get the offsetof discrete point x in a horizontal direction

119863 (x 119905) = minussumk(119894k119896) ℎ (k 119905) 119890119894ksdotx (5)

But this method needs one more FFT and we simplify itfor accelerated computing

119863(119909 119910) = 119878119873 (119872119909+1119910 minus119872119909119910119872119909119910+1 minus119872119909119910) (6)

where 119878 is the size of the FFT grid 119873 is the number ofFFT grid and 119872 is the wave-height map The deep watersimulation based on FFT is shown in Figure 2(a)

Mathematical Problems in Engineering 3

(a) (b)

(c)

Figure 2 The visual results of deep water (a) shallow-water (b) and the hybrid water (c) after coupling

22 Shallow-Water Compared to the deep water shallow-water is more complicated due to the effects of seafloorterrain Its crest line and amplitude will change as thedepth decreases This greatly increases the difficulty of watermodeling and renderingOn account of the real-time require-ment this paper uses an improved Fournier model based ongeometry instead of the physically based model

Fournier proposed that the motion trails of water pointsgradually change from circular to elliptical with the decreas-ing of seabed depth based on the classical Gerstner modelHe established the Fournier wave model and applied it tocomputer graphics And then he realized the 3D visualizationof coastal water For the sake of rendering of coastal waterincluding curved waves Wang et al [21] made an improve-ment of Fournierrsquos model and could quickly simulate coastalwater and curvedwaves at different wind speedsThe formulais as follows

119909 = 1199090 + 119877 cos (120572) 119878119909 sin (120601) cos (120579)+ 119877 sin (120572) 119878119911 cos (120601) cos (120579) + Δ119909 cos (120579)

119910 = 1199100 + 119877 cos (120572) 119878119909 sin (120601) sin (120579)

+ 119877 sin (120572) 119878119911 cos (120601) sin (120579) + Δ119909 sin (120579) 119911 = 1199110 minus 119877 cos (120572) 119878119911 cos (120601) + 119877 sin (120572) 119878119909 sin (120601)

+ Δ119911(7)

Among them the plane (119909 119911) is a vertical surface wavethe point (1199090 1199110) is the static position of a wave point 119877is the wave amplitude 120596 is the angular frequency 119878119909 =11 minus 119890minus119870119909ℎ and 119878119911 = 119878119909(1 minus 119890minus119870119911ℎ) are the major andminor axes of the ellipse sin(120572) = sin(120573)119890minus1198700ℎ 120573 is theslope of seafloor terrain119870infin is the deep water wave number119870(119909) = 119870infinradictanh(119870infinℎ) denotes the wave number at thepoint (1199090 1199110) 120601 = minus120596119905 + sum11990900 119870(119909)Δ119909 and 120579 is the winddirection

In order to realize the curved waves the wave parameterswhen moving need to be adjusted

When 120601min lt 120601 le 120601min + 1205871206011015840 = 119870120601120601Δ119909 = 1198701206011199090

4 Mathematical Problems in Engineering

Δ119911 = 0

1198781015840119909 = 12 [1 minus (

120601 minus 120601min minus 120587120587 )2] 119878119909(8)

When 120601min + 120587 lt 120601 le 120601min + 21205871206011015840 = 120601

Δ119909 = (120601 minus 120601min minus 1512058705120587 )2 (119909crest minus 119909curve)

Δ119911 = (120601 minus 120601min minus 1512058705120587 )2 (119911crest minus 119911curve)

1198781015840119909 = 119878119909

(9)

And the limit on the long axis is

119878119909 le 119891 (119909) (10)

where 119891(119909) = 1119877119870(119909) cos(120572) and 120578 is the thin coefficientof the waveform Its value is 1 by default The higherthe coefficient is the thinner the waveform is 120601min =minustanminus1((sin(120572)119878119909)(cos(120572)119878119911)) denotes the angular 120601 at thewave trough and119870120601 is the curved coefficient with aminimumof 1

The final coastal water is shown in Figure 2(b)

23 Coupling ofWaterWaves In order tomake the transitionof deep water waves and the shallow ones smooth we use theautomatic coupling algorithm to couple the two waves whenthe depth is in the range of 005119871 to 05119871The fusion algorithmis shown as follows

ℎ (119909 119910) =

ℎFFT (119909 119910) if 119889 ge 05119871119889 minus 00511987105119871 minus 005119871ℎFFT (119909 119910) +

05119871 minus 11988905119871 minus 005119871ℎgeo (119909 119910) if 005119871 lt 119889 lt 05119871

ℎgeo (119909 119910) if 119889 le 005119871(11)

where 119889 is the terrain depth of the grid vertex at the currenttime ℎFFT(119909 119910) and ℎgeo(119909 119910) are the heights generated bythe deep water and shallow-water model

From the formula it can be seen that the couplingalgorithmwill guarantee a smooth transition fromdeepwaterto shallow-waterThe hybrid water after coupling is shown inFigure 2(c)

3 Water Surface Grid AutomaticSimplification

When the water is rendered grid model is usually used tosimulate water surface Yin et al [22] divided the surfaceinto a dynamic one and a static one The dynamic surfaceis formed by 119872 lowast 119873 grid points and revolves around theviewpoint and the outer space of the dynamic surface isthe static surface Hinsinger et al [23] presented an adaptivesurface grid model Cui et al [24] improved the adaptive gridmodel and put forward a trapezoidal grid model Johansonand Lejdfors [25] proposed a projection grid model and usedit to simulate the water surface in world space

The above studies of wave multiresolution grid did nottake the influence of terrain into account However shallow-water will not appear under the land terrain so the surfacegrid under the land should not be computed and renderedIn order to prevent the unnecessary expense we proposedan improved multiresolution grid by detecting whether gridpoints are under the land Then rendering of coastal waterwill be accelerated after reducing computation consuming

31 Multiresolution Grid Multiresolution grid refers to gridswith different levels of details (LOD) existing in differentregions It can greatly improve the efficiency of the grid gen-eration without losing the details Therefore multiresolutiongrids are commonly used in real-time rendering of large-scales of water and terrain

In the coastal scene rendering a part of the water surfacegrid is always under the terrain But the former researchesusually use the same grid they did not make changes to thegrid The general grid is shown in Figure 3

The grid points covered by terrain will be calculatedgenerated and automatically culled by the rendering systemThere is no problem in vision but the process of computinggenerating and culling can severely affect the real-timeperformance

32 Grid Improvement In order to avoid unnecessary com-putation the grid points are detected in advance to ensurewhether they are covered by terrain or not when the watersurface grid is generating If they are the next computationstepwill be not processed if not then continueThe detectionwill last until the whole grid is generated Because the coastalterrain is static the detection does not need to be repeatedThen the speed of generation and rendering of water can beimproved

In the case that coastline data are known the coversituation can be judged according to the relationship betweenthe grid points and the coastline The detection process is asfollows

Mathematical Problems in Engineering 5

Eye

CoastCoastal water

Coastline

(a) (b)

Figure 3 The general multiresolution grid (a) and the rendering mesh (b)

Height

Collision detection lineCollision detection point

Water wave

Terrain

Water line

Figure 4 The collision detection process

If 119909mesh lt 119909line amp 119910mesh lt 119910line the grid point is notcovered by terrain or it is covered and will not need to becomputed

However the coastline data cannot be generally obtainedThen the collision detection technologywill be used to detectwhether the grid point is covered by terrain The collisiondetection process is shown in Figure 4

In the process the collision detection system sends avertical line from above the grid and we can manage to keepan account of the height of the point relative to the horizontalline when the line collision with the terrain

If 119911mesh lt 119867 the grid point is not covered by terrain or itis covered and will not need to be computed The final grid isgiven in Figure 5

4 GPU Implementation Method

In order to rapidly generate large bodies of near oceanwave scene graphics hardware shader language is used inrendering The water height map data are obtained by thecalculating of shallow-water model Then it is loaded in thevertex shader and is fused with Perlin noise Final waterheight and offset in horizontal direction are computed Eachvertex normal vector and color data are calculated in the pixelshader so the water scene is realized The surface reflectionand foam effect are also added to increase the scene fidelity

41 Rendering Based on Height Field Map The curved modelcan be computed to obtain the height and horizontal offsetof each vertex The result will be saved in a height map Each

pixel of the height map can store a vertex information It isexpressed by the formula

colordata sdot 119903119892119887 = (119909 119910 119911) (12)

The height field map data can be read and interpolated inthe vertex shader and Perlin noise is added then the finalvertex information is expressed by

(119909 119910 119911) = (colordata sdot 119903 colordata sdot 119892 colordata sdot 119887+Noiseperlin)

(13)

In the pixel shader the vertex normal vector and color arecalculated the vertex transparency is computed according tothe depth

colorfinal sdot 119903119892119887 = fresnel lowast colorwater sdot 119903119892119887+ (1 minus fresnel) lowast colordifuse

colorfinal sdot 119886 = 1 minus 06119890minusℎ(14)

Here fresnel denotes the fresnel reflection coefficientThewater surface will be gettingmore andmore transpar-

ent with the decreasing of depth The value of 0 means fullytransparent In this paper the minimum transparency valueis 06

42 Realization of the Reflection and FoamEffect The render-ing scene above sea level is rendered to a texture through theRTT (render to texture) technology The reflection texture isloaded in the pixel shader and then the reflection effect of thewave surface is realized by using dynamic texture mappingtechnology The specific calculation formula is as follows

colorfinal sdot 119903119892119887 = fresnel lowast colorwater sdot 119903119892119887+ (1 minus fresnel) lowast colorreflect (15)

Foam will be intermittently generated at the wave crestwhen the wave is moving And foams appear in the trough

6 Mathematical Problems in Engineering

Eye

CoastCoastal water

Coastline

(a) (b)

Figure 5 The improved grid (a) and the rendering result (b)

Figure 6 The reflection and foam effects

and crest of the waves during wave run-up and run-down[14] So we applied two differentmethods to achieve the effectof foamWe load a transparent foam texture and simulate thedynamic foam effect by controlling the offset speed of texturewith texture mapping technologyThe implementation detailand rendering result are shown in Box 1 and Figure 6

colorfinal = density lowast colorfinal + (1 minus density)lowast colorfoam (16)

5 Results and Discussion

To evaluate our method we have created several typicalcoastal water scenes on a 266GHzCore i7 andNVIDIAGTX560 The hybrid water model is computed on CPU and therendering is implemented on GPU The results are shown inFigure 7 In Figures 7(a) and 7(b) the thin coefficient is 10while its value is 12 in Figures 7(c) and 7(d) Compared with10 the waveform is thinner with the coefficient of 12 Butthere is a problem that the waveforms will be crossed whenthe coefficient getting higher It is the limit of our method

and we will research it in future work The foam effects aredifferent in the crest and trough of waves In our methodfoam at the crest moves forward and foam at the troughmoves backward So we can simulate the huge amount ofbubbles fast Table 1 lists the performance values of differentexamples Since the model is geometric and the renderingis implemented with shader language our method makesit possible to simulate a large-scale coastal water scene at astable frame rate of 60 frames per second

The comparison with the referencesrsquo methods is shown inTable 2 Ojedarsquos method [4] is based on physics It can handlearbitrary underlying terrain and interact with dynamic rigidbodies They compute the water model both on CPU and onGPU but only the result on GPU can meet the requirementof real-time performance Another problem of our methodis that it can only get the simulation of small-scale shallow-water Luorsquos method [12] used a Bezier curve so it is based ongeometry They can get a nice real-time middle-scale coastalwater after GPU accelerating However they need to design acoastline before rendering Once the rendering is begun thecoastline cannot be changed As our method can get a highframe rate we will not need a GPU based computation of

Mathematical Problems in Engineering 7

Combine waterbody color and reflected color

vec4 water color = mix(body color reflected color fresnel)

vec4 final color = water color

float depth = texture2D(

DeepMap vec2(pos localx (pos localy))2560 )r 300 - 150

Crest Foam

float alphaFactor = texture2D(

FoamMap pos localxy640 + g PerlinMovement 20)r

float foamFactor = alphaFactor clamp(pos localz 20 - 01 00 10)

final color = vec4(final colorxyz (3000 - pos localx) 3000 )

final color = mix(final color vec4(10 10 10 10) foamFactor)

Trough Foam

alphaFactor = texture2D(

FoamMap vec2(pos localx320 pos localy320)

+ g PerlinMovement 20)r

float foamFactor0 = alphaFactor clamp( (depth + 30) 50 00 10)

alphaFactor = texture2D(

FoamMap pos localxy640 - g PerlinMovement 30)r

float foamFactor1 = alphaFactor clamp( -06 - pos localz 00 10)

clamp( (depth + 200) 150 00 10)

final color = mix(final color vec4(10 10 10 10) foamFactor0)

final color = mix(final color vec4(10 10 10 10) foamFactor1)

Fog

float fogFactor = computeFogFactor( g FogDensity gl FogFragCoord )

water color = final color

Sun spots

float cos spec = clamp(dot(reflect vec g SunDir) 00 10)

float sun spot = pow(cos spec g Shineness)

water colorxyz += g SunColor sun spot

gl FragColor = water color

Box 1 The implementation detail

Table 1 Timing per frame for various examples in millisecond

Grid size Computation grid size Model Rendering Total

51221282 656 506 12062562 2167 1310 36855122 11589 1856 13458

102421282 658 533 13832562 2236 1407 38025122 11623 2199 13869

Table 2 A comparison of the difference between Luorsquos method Ojedarsquos method and our method

Ojedarsquos method Luorsquos method Our methodComputation platform CPU GPU GPU CPUComputation grid size 1282 1282 2502 1282

Water scale Small Small Middle LargeAveraged timing per frame 41088ms 528ms 1667ms 1206ms

the water model We can also handle any underlying terrainsince the model is computed in real-time Furthermore wealso consider the deep water when the depth is getting largerIt can also help to make the coastal scene more real

One drawback of ourmethod is that the rendering resultslack higher details The geometric based model is not thesame as the physically based model and it cannot simulatethe higher details such as splash and breaking damThe other

8 Mathematical Problems in Engineering

(a) 120578 = 10 (b) 120578 = 10

(c) 120578 = 12 (d) 120578 = 12

Figure 7 The rendering result of coastal water scene with different thin coefficients

problem is that thewaveformwill become crossed if we donotlimit the thin coefficient However our method offers a highrendering speed even on an ordinary graphic hardware Thiscan allow more consumer-level computers to run the coastalwater simulation

6 Conclusions

In this paper we present an automatic optimization approachfor the rendering of large-scale real-time coastal water Ahybrid coastal watermodel is estimated for large-scale coastalwater according to the depth of water The deep water isalso considered in our hybrid coastal water Unnecessary gridcells are simplified by our automatic simplification algorithmFinally we implement our method on GPU by using shaderlanguageThe reflection and foam effect are also added to thewater surface to enhance the final rendering result

There are several ways to further improve the visualappearance of the coastal water The extraordinary detailedeffects like waterfall breaking dam and splashes are neededto be complex modeled by using particles systems Theinteraction with rigid bodies is also a challenging work in thefuture

Competing Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] T Kellomaki ldquoWater simulationmethods for games a compari-sonrdquo inProceedings of the 16th International AcademicMindTrekConference (MindTrek rsquo12) pp 10ndash14 Tampere Finland Octo-ber 2012

[2] D P Playne K A Hawick and M G B Johnson ldquoSimulatingand Benchmarking the shallow-water fluid dynamical equa-tions on multiple graphical processing unitsrdquo in Proceedingsof the 12th Australasian Symposium on Parallel and DistributedComputing (AusPDC rsquo14) vol 152 pp 29ndash35 Auckland NewZealand January 2014

[3] N Chentanez and M Muller ldquoReal-time eulerian water simu-lation using a restricted tall cell gridrdquo in Proceedings of the ACMTransactions on Graphics pp 821ndash8210 New York NY USA2011

[4] J Ojeda and A Susin ldquoHybrid particle Lattice Boltzmannshallowwater for interactive fluid simulationsrdquo inProceedings ofthe 8th International Conference on Computer Graphics Theoryand Applications (GRAPP rsquo13) pp 217ndash226 Barcelona Spain2013

Mathematical Problems in Engineering 9

[5] J Ojeda and A Susin ldquoReal-time rendering of enhanced shal-low water fluid simulationsrdquo httpwwwpaginesma1upcedusimtonifileshybrid lbmsw rend newpdf

[6] I Abbasov ldquoThree-dimensional simulation the runup of non-linear surface gravity waves on shallow coastrdquo InternationalJournal of Pure and Applied Mathematics vol 93 no 1 pp 135ndash145 2014

[7] E Darles B Crespin and D Ghazanfarpour ldquoA particle-basedmethod for large-scale breakingwaves simulationrdquo inComputerVision and Graphics pp 316ndash323 Springer Berlin Germany2010

[8] M Chladek and R Durikovic ldquoParticle-based shallow watersimulation for irregular and sparse simulation domainsrdquo Com-puters amp Graphics vol 53 pp 170ndash176 2015

[9] T Kellomaki ldquoRigid body interaction for large-scale real-timewater simulationrdquo International Journal of Computer GamesTechnology vol 2014 Article ID 580154 12 pages 2014

[10] A Fournier andW T Reeves ldquoA simple model of ocean wavesrdquoACM Siggraph Computer Graphics vol 20 no 4 pp 75ndash841986

[11] D S De Lima H Braun and S R Musse ldquoA model for realtime ocean breaking waves animationrdquo in Proceedings of the9th Brazilian Symposium on Games and Digital Entertainment(SBGames rsquo10) pp 19ndash24 Florianopolis Brazil November 2010

[12] M Luo G Gong and A El Kamel ldquoGPU-based real-time vir-tual reality modeling and simulation of seashorerdquo in Advancesin Robotics and Virtual Reality vol 26 of Intelligent SystemsReference Library pp 307ndash332 Springer Berlin Germany 2012

[13] N Chentanez and M Muller ldquoReal-time simulation of largebodies of water with small scale detailsrdquo in Proceedings ofthe ACM SIGGRAPHEurographics Symposium on ComputerAnimation pp 197ndash206 Madrid Spain July 2010

[14] S Longo M Petti and I J Losada ldquoTurbulence in the swashand surf zones a reviewrdquo Coastal Engineering vol 45 no 3-4pp 129ndash147 2002

[15] K Fang Z Liu and Z Zou ldquoModelling coastal water wavesusing a depth-integrated non-hydrostatic model with shock-capturing abilityrdquo Journal of Hydraulic Research vol 53 no 1pp 119ndash133 2015

[16] E Bruneton F Neyret and N Holzschuch ldquoRealminustime realisticocean lighting using seamless transitions from geometry toBRDFrdquo in Computer Graphics Forum pp 487ndash496 2010

[17] Y Yin H-X Ren and X-W Liu ldquoReal-time wave simula-tion based on wave spectrum used in marine simulatorrdquo inProceedings of the Asia Simulation Conference-7th InternationalConference on System Simulation and Scientific Computing(ICSC rsquo08) pp 225ndash229 October 2008

[18] Y Li Y Jin Y Yin and H Shen ldquoSimulation of shallow-waterwaves in coastal region for marine simulatorrdquo in Proceedings ofthe 7th ACM SIGGRAPH International Conference on Virtual-Reality Continuum and Its Applications in Industry (VRCAI rsquo08)p 15 December 2008

[19] C Li D Pickup T Saunders et al ldquoWater surface modelingfrom a single viewpoint videordquo IEEE Transactions on Visualiza-tion and Computer Graphics vol 19 no 7 pp 1242ndash1251 2013

[20] S Wang F Kang and D Wang ldquoOcean wave real-timesimulation based on adaptive fusionrdquo in Proceedings of the 32ndChinese Control Conference (CCC rsquo13) pp 8557ndash8560 IEEEXirsquoan China July 2013

[21] S Wang F Kang and J Xu ldquoModeling and visualization ofcurved waves near seashorerdquo Journal of System Simulation vol26 no 10 pp 2395ndash2399 2014

[22] Y Yin Y-C Jin and H-X Ren ldquoWave simulation of visualsystem in marine simulator based on wave spectrumsrdquo in Pro-ceedings of the International Conference on Marine Simulation

and Ship Maneuverability (MARSIM rsquo03) Kanazawa JapanAugust 2003

[23] D Hinsinger F Neyret and M-P Cani ldquoInteractive ani-mation of ocean wavesrdquo in Proceedings of the 2002 ACMSIGGRAPHEurographics Symposium on Computer Animationpp 161ndash166 San Antonio Tex USA July 2002

[24] X Cui J Yi-Cheng and L Xiu-Wen ldquoReal-time ocean wavein multi-channel marine simulatorrdquo in Proceedings of the ACMSIGGRAPH International Conference on Virtual Reality Contin-uum and its Applications in Industry (VRCAI rsquo04) pp 332ndash335June 2004

[25] C Johanson and C Lejdfors Real-time water rendering [MSthesis in computer graphics] Lund University Lund Sweden2004

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

2 Mathematical Problems in Engineering

can generate a realistic coastal water scene but they stillcannot meet the real-time requirement when large bodies ofcoastal water need to be rendered A hybrid shallow-waterthat combines grid-based and particles based simulation isprovided by Chentanez andMuller [13] Longo et al [14] gavea review for turbulence in the swash zone and discussed themeasurement techniques and generation of breaking wavesThere also have shallow-water simulations using a depth-integrated [15] spectrum [16 17] 2D Boussinesq equations[18] video-based method [19] and so forth The geometrybased methods are suitable for large-scale real-time waterbecause of simple computation However these methodscannot simulate the vertical movement such as curvedwaves and breaking waves Although the above methods canget a nice shallow-water scene they have some limits tomeet the requirements of large-scale real-time shallow-watersimulations

In order to realize large-scale real-time shallow-watersimulations we analyze the coastal water modeling heightfield map generation ocean wave mesh generation andrendering We find some solutions to enhance the real-timeperformance of the simulations Our contributions of thispaper are as follows

(i) A construction of the hybrid model that allows thesimulation of arbitrary domain scales by coupling ofdeep water and shallow-water waves

(ii) An adaptive optimization of water surface grid thatcan efficiently reduce unnecessary grid cells under thecoastal terrain

(iii) Implementations of our method and water surfaceeffects such as surface foam and reflection with theshader language on GPU

This paper is organized as follows We present our hybridmodel in the next section The optimization of water surfacegrid is shown in Section 3 In Section 4 we present theimplementation of ourmethodThen we show our renderingresults and discussion in Section 5 Finally we conclude andexplore avenues of future work in Section 6

2 Hybrid Coastal Water

When the terrain depth (Depth119863) is greater than half of thewavelength (119871) the water is called deep water otherwise thewater is called shallowwater when119863 is less than 11987120 and theintermediate zone shown in Figure 1 is the transition zone

To achieve a realistic coastal water scene this paperselects the deep water model based on FFT [20] and theshallow-water model based on geometry [21] and the auto-matic fusion algorithm is used to couple the two water wavesin the transitional zone

21 DeepWater TheFFTmethod based onPhillips spectrumfirst gets a series of double frequency sine waves whoseamplitude and phase are relevant and then gets the height ofevery grid point on the ocean face by calculating with FFT

L

Depth

Intermediate zoneDeep waterShallow water

L2L20

Figure 1 The intermediate zone from deep water to shallow-water

Assuming that there are 119872 times 119873 discrete points onthe 119909119911 plane the vertical offset of the discrete point x =(119899119871119909119873119898119871119911119872) at time 119905 is

ℎ (x 119905) = sumkℎ (k 119905) 119890119894ksdotx (1)

where k = (119896119909 119896119910) 119896119909 = 2120587119899119871119909 119896119911 = 2120587119899119871119911 minus1198732 le 119899 le1198732 minus1198722 le 119898 le 1198722 and ℎ(k 119905) is the height amplitudeFourier and can be calculated with the Phillips spectrum

119875ℎ (k) = 119860 11198964 119890minus1(119896119871)

2 10038161003816100381610038161003816k sdot 100381610038161003816100381610038162 (2)

The height amplitude Fourier at time 119905 = 0 isℎ0 (k) = 1

radic2 (120585119903 + 119894120585119894)radic119875ℎ (k) (3)

where 120585119903 and 120585119894 are Gaussian random numbers that meetmathematical expectation 0 and variance 1

The height amplitude Fourier at time 119905 isℎ (k 119905) = ℎ0 (k) 119890119894120596(119896)119905 + ℎlowast0 (minusk) 119890minus119894120596(119896)119905 (4)

where 120596(119896) = radic119892119896Actually in real motion of an ocean wave the continuous

changes of wind direction lead to extrusion between waveswhich make it become sharp at the top of waves and flatat the bottom following the rolling wave effect The heightmap generated by our method is the result of stacking ofmultiple sine waves Top of wave is too flat and not real so weneed to add a roll wave model The model can be realized bychanging the position of the grid in the horizontal directionHere we use the amplitude of the ocean wave to get the offsetof discrete point x in a horizontal direction

119863 (x 119905) = minussumk(119894k119896) ℎ (k 119905) 119890119894ksdotx (5)

But this method needs one more FFT and we simplify itfor accelerated computing

119863(119909 119910) = 119878119873 (119872119909+1119910 minus119872119909119910119872119909119910+1 minus119872119909119910) (6)

where 119878 is the size of the FFT grid 119873 is the number ofFFT grid and 119872 is the wave-height map The deep watersimulation based on FFT is shown in Figure 2(a)

Mathematical Problems in Engineering 3

(a) (b)

(c)

Figure 2 The visual results of deep water (a) shallow-water (b) and the hybrid water (c) after coupling

22 Shallow-Water Compared to the deep water shallow-water is more complicated due to the effects of seafloorterrain Its crest line and amplitude will change as thedepth decreases This greatly increases the difficulty of watermodeling and renderingOn account of the real-time require-ment this paper uses an improved Fournier model based ongeometry instead of the physically based model

Fournier proposed that the motion trails of water pointsgradually change from circular to elliptical with the decreas-ing of seabed depth based on the classical Gerstner modelHe established the Fournier wave model and applied it tocomputer graphics And then he realized the 3D visualizationof coastal water For the sake of rendering of coastal waterincluding curved waves Wang et al [21] made an improve-ment of Fournierrsquos model and could quickly simulate coastalwater and curvedwaves at different wind speedsThe formulais as follows

119909 = 1199090 + 119877 cos (120572) 119878119909 sin (120601) cos (120579)+ 119877 sin (120572) 119878119911 cos (120601) cos (120579) + Δ119909 cos (120579)

119910 = 1199100 + 119877 cos (120572) 119878119909 sin (120601) sin (120579)

+ 119877 sin (120572) 119878119911 cos (120601) sin (120579) + Δ119909 sin (120579) 119911 = 1199110 minus 119877 cos (120572) 119878119911 cos (120601) + 119877 sin (120572) 119878119909 sin (120601)

+ Δ119911(7)

Among them the plane (119909 119911) is a vertical surface wavethe point (1199090 1199110) is the static position of a wave point 119877is the wave amplitude 120596 is the angular frequency 119878119909 =11 minus 119890minus119870119909ℎ and 119878119911 = 119878119909(1 minus 119890minus119870119911ℎ) are the major andminor axes of the ellipse sin(120572) = sin(120573)119890minus1198700ℎ 120573 is theslope of seafloor terrain119870infin is the deep water wave number119870(119909) = 119870infinradictanh(119870infinℎ) denotes the wave number at thepoint (1199090 1199110) 120601 = minus120596119905 + sum11990900 119870(119909)Δ119909 and 120579 is the winddirection

In order to realize the curved waves the wave parameterswhen moving need to be adjusted

When 120601min lt 120601 le 120601min + 1205871206011015840 = 119870120601120601Δ119909 = 1198701206011199090

4 Mathematical Problems in Engineering

Δ119911 = 0

1198781015840119909 = 12 [1 minus (

120601 minus 120601min minus 120587120587 )2] 119878119909(8)

When 120601min + 120587 lt 120601 le 120601min + 21205871206011015840 = 120601

Δ119909 = (120601 minus 120601min minus 1512058705120587 )2 (119909crest minus 119909curve)

Δ119911 = (120601 minus 120601min minus 1512058705120587 )2 (119911crest minus 119911curve)

1198781015840119909 = 119878119909

(9)

And the limit on the long axis is

119878119909 le 119891 (119909) (10)

where 119891(119909) = 1119877119870(119909) cos(120572) and 120578 is the thin coefficientof the waveform Its value is 1 by default The higherthe coefficient is the thinner the waveform is 120601min =minustanminus1((sin(120572)119878119909)(cos(120572)119878119911)) denotes the angular 120601 at thewave trough and119870120601 is the curved coefficient with aminimumof 1

The final coastal water is shown in Figure 2(b)

23 Coupling ofWaterWaves In order tomake the transitionof deep water waves and the shallow ones smooth we use theautomatic coupling algorithm to couple the two waves whenthe depth is in the range of 005119871 to 05119871The fusion algorithmis shown as follows

ℎ (119909 119910) =

ℎFFT (119909 119910) if 119889 ge 05119871119889 minus 00511987105119871 minus 005119871ℎFFT (119909 119910) +

05119871 minus 11988905119871 minus 005119871ℎgeo (119909 119910) if 005119871 lt 119889 lt 05119871

ℎgeo (119909 119910) if 119889 le 005119871(11)

where 119889 is the terrain depth of the grid vertex at the currenttime ℎFFT(119909 119910) and ℎgeo(119909 119910) are the heights generated bythe deep water and shallow-water model

From the formula it can be seen that the couplingalgorithmwill guarantee a smooth transition fromdeepwaterto shallow-waterThe hybrid water after coupling is shown inFigure 2(c)

3 Water Surface Grid AutomaticSimplification

When the water is rendered grid model is usually used tosimulate water surface Yin et al [22] divided the surfaceinto a dynamic one and a static one The dynamic surfaceis formed by 119872 lowast 119873 grid points and revolves around theviewpoint and the outer space of the dynamic surface isthe static surface Hinsinger et al [23] presented an adaptivesurface grid model Cui et al [24] improved the adaptive gridmodel and put forward a trapezoidal grid model Johansonand Lejdfors [25] proposed a projection grid model and usedit to simulate the water surface in world space

The above studies of wave multiresolution grid did nottake the influence of terrain into account However shallow-water will not appear under the land terrain so the surfacegrid under the land should not be computed and renderedIn order to prevent the unnecessary expense we proposedan improved multiresolution grid by detecting whether gridpoints are under the land Then rendering of coastal waterwill be accelerated after reducing computation consuming

31 Multiresolution Grid Multiresolution grid refers to gridswith different levels of details (LOD) existing in differentregions It can greatly improve the efficiency of the grid gen-eration without losing the details Therefore multiresolutiongrids are commonly used in real-time rendering of large-scales of water and terrain

In the coastal scene rendering a part of the water surfacegrid is always under the terrain But the former researchesusually use the same grid they did not make changes to thegrid The general grid is shown in Figure 3

The grid points covered by terrain will be calculatedgenerated and automatically culled by the rendering systemThere is no problem in vision but the process of computinggenerating and culling can severely affect the real-timeperformance

32 Grid Improvement In order to avoid unnecessary com-putation the grid points are detected in advance to ensurewhether they are covered by terrain or not when the watersurface grid is generating If they are the next computationstepwill be not processed if not then continueThe detectionwill last until the whole grid is generated Because the coastalterrain is static the detection does not need to be repeatedThen the speed of generation and rendering of water can beimproved

In the case that coastline data are known the coversituation can be judged according to the relationship betweenthe grid points and the coastline The detection process is asfollows

Mathematical Problems in Engineering 5

Eye

CoastCoastal water

Coastline

(a) (b)

Figure 3 The general multiresolution grid (a) and the rendering mesh (b)

Height

Collision detection lineCollision detection point

Water wave

Terrain

Water line

Figure 4 The collision detection process

If 119909mesh lt 119909line amp 119910mesh lt 119910line the grid point is notcovered by terrain or it is covered and will not need to becomputed

However the coastline data cannot be generally obtainedThen the collision detection technologywill be used to detectwhether the grid point is covered by terrain The collisiondetection process is shown in Figure 4

In the process the collision detection system sends avertical line from above the grid and we can manage to keepan account of the height of the point relative to the horizontalline when the line collision with the terrain

If 119911mesh lt 119867 the grid point is not covered by terrain or itis covered and will not need to be computed The final grid isgiven in Figure 5

4 GPU Implementation Method

In order to rapidly generate large bodies of near oceanwave scene graphics hardware shader language is used inrendering The water height map data are obtained by thecalculating of shallow-water model Then it is loaded in thevertex shader and is fused with Perlin noise Final waterheight and offset in horizontal direction are computed Eachvertex normal vector and color data are calculated in the pixelshader so the water scene is realized The surface reflectionand foam effect are also added to increase the scene fidelity

41 Rendering Based on Height Field Map The curved modelcan be computed to obtain the height and horizontal offsetof each vertex The result will be saved in a height map Each

pixel of the height map can store a vertex information It isexpressed by the formula

colordata sdot 119903119892119887 = (119909 119910 119911) (12)

The height field map data can be read and interpolated inthe vertex shader and Perlin noise is added then the finalvertex information is expressed by

(119909 119910 119911) = (colordata sdot 119903 colordata sdot 119892 colordata sdot 119887+Noiseperlin)

(13)

In the pixel shader the vertex normal vector and color arecalculated the vertex transparency is computed according tothe depth

colorfinal sdot 119903119892119887 = fresnel lowast colorwater sdot 119903119892119887+ (1 minus fresnel) lowast colordifuse

colorfinal sdot 119886 = 1 minus 06119890minusℎ(14)

Here fresnel denotes the fresnel reflection coefficientThewater surface will be gettingmore andmore transpar-

ent with the decreasing of depth The value of 0 means fullytransparent In this paper the minimum transparency valueis 06

42 Realization of the Reflection and FoamEffect The render-ing scene above sea level is rendered to a texture through theRTT (render to texture) technology The reflection texture isloaded in the pixel shader and then the reflection effect of thewave surface is realized by using dynamic texture mappingtechnology The specific calculation formula is as follows

colorfinal sdot 119903119892119887 = fresnel lowast colorwater sdot 119903119892119887+ (1 minus fresnel) lowast colorreflect (15)

Foam will be intermittently generated at the wave crestwhen the wave is moving And foams appear in the trough

6 Mathematical Problems in Engineering

Eye

CoastCoastal water

Coastline

(a) (b)

Figure 5 The improved grid (a) and the rendering result (b)

Figure 6 The reflection and foam effects

and crest of the waves during wave run-up and run-down[14] So we applied two differentmethods to achieve the effectof foamWe load a transparent foam texture and simulate thedynamic foam effect by controlling the offset speed of texturewith texture mapping technologyThe implementation detailand rendering result are shown in Box 1 and Figure 6

colorfinal = density lowast colorfinal + (1 minus density)lowast colorfoam (16)

5 Results and Discussion

To evaluate our method we have created several typicalcoastal water scenes on a 266GHzCore i7 andNVIDIAGTX560 The hybrid water model is computed on CPU and therendering is implemented on GPU The results are shown inFigure 7 In Figures 7(a) and 7(b) the thin coefficient is 10while its value is 12 in Figures 7(c) and 7(d) Compared with10 the waveform is thinner with the coefficient of 12 Butthere is a problem that the waveforms will be crossed whenthe coefficient getting higher It is the limit of our method

and we will research it in future work The foam effects aredifferent in the crest and trough of waves In our methodfoam at the crest moves forward and foam at the troughmoves backward So we can simulate the huge amount ofbubbles fast Table 1 lists the performance values of differentexamples Since the model is geometric and the renderingis implemented with shader language our method makesit possible to simulate a large-scale coastal water scene at astable frame rate of 60 frames per second

The comparison with the referencesrsquo methods is shown inTable 2 Ojedarsquos method [4] is based on physics It can handlearbitrary underlying terrain and interact with dynamic rigidbodies They compute the water model both on CPU and onGPU but only the result on GPU can meet the requirementof real-time performance Another problem of our methodis that it can only get the simulation of small-scale shallow-water Luorsquos method [12] used a Bezier curve so it is based ongeometry They can get a nice real-time middle-scale coastalwater after GPU accelerating However they need to design acoastline before rendering Once the rendering is begun thecoastline cannot be changed As our method can get a highframe rate we will not need a GPU based computation of

Mathematical Problems in Engineering 7

Combine waterbody color and reflected color

vec4 water color = mix(body color reflected color fresnel)

vec4 final color = water color

float depth = texture2D(

DeepMap vec2(pos localx (pos localy))2560 )r 300 - 150

Crest Foam

float alphaFactor = texture2D(

FoamMap pos localxy640 + g PerlinMovement 20)r

float foamFactor = alphaFactor clamp(pos localz 20 - 01 00 10)

final color = vec4(final colorxyz (3000 - pos localx) 3000 )

final color = mix(final color vec4(10 10 10 10) foamFactor)

Trough Foam

alphaFactor = texture2D(

FoamMap vec2(pos localx320 pos localy320)

+ g PerlinMovement 20)r

float foamFactor0 = alphaFactor clamp( (depth + 30) 50 00 10)

alphaFactor = texture2D(

FoamMap pos localxy640 - g PerlinMovement 30)r

float foamFactor1 = alphaFactor clamp( -06 - pos localz 00 10)

clamp( (depth + 200) 150 00 10)

final color = mix(final color vec4(10 10 10 10) foamFactor0)

final color = mix(final color vec4(10 10 10 10) foamFactor1)

Fog

float fogFactor = computeFogFactor( g FogDensity gl FogFragCoord )

water color = final color

Sun spots

float cos spec = clamp(dot(reflect vec g SunDir) 00 10)

float sun spot = pow(cos spec g Shineness)

water colorxyz += g SunColor sun spot

gl FragColor = water color

Box 1 The implementation detail

Table 1 Timing per frame for various examples in millisecond

Grid size Computation grid size Model Rendering Total

51221282 656 506 12062562 2167 1310 36855122 11589 1856 13458

102421282 658 533 13832562 2236 1407 38025122 11623 2199 13869

Table 2 A comparison of the difference between Luorsquos method Ojedarsquos method and our method

Ojedarsquos method Luorsquos method Our methodComputation platform CPU GPU GPU CPUComputation grid size 1282 1282 2502 1282

Water scale Small Small Middle LargeAveraged timing per frame 41088ms 528ms 1667ms 1206ms

the water model We can also handle any underlying terrainsince the model is computed in real-time Furthermore wealso consider the deep water when the depth is getting largerIt can also help to make the coastal scene more real

One drawback of ourmethod is that the rendering resultslack higher details The geometric based model is not thesame as the physically based model and it cannot simulatethe higher details such as splash and breaking damThe other

8 Mathematical Problems in Engineering

(a) 120578 = 10 (b) 120578 = 10

(c) 120578 = 12 (d) 120578 = 12

Figure 7 The rendering result of coastal water scene with different thin coefficients

problem is that thewaveformwill become crossed if we donotlimit the thin coefficient However our method offers a highrendering speed even on an ordinary graphic hardware Thiscan allow more consumer-level computers to run the coastalwater simulation

6 Conclusions

In this paper we present an automatic optimization approachfor the rendering of large-scale real-time coastal water Ahybrid coastal watermodel is estimated for large-scale coastalwater according to the depth of water The deep water isalso considered in our hybrid coastal water Unnecessary gridcells are simplified by our automatic simplification algorithmFinally we implement our method on GPU by using shaderlanguageThe reflection and foam effect are also added to thewater surface to enhance the final rendering result

There are several ways to further improve the visualappearance of the coastal water The extraordinary detailedeffects like waterfall breaking dam and splashes are neededto be complex modeled by using particles systems Theinteraction with rigid bodies is also a challenging work in thefuture

Competing Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] T Kellomaki ldquoWater simulationmethods for games a compari-sonrdquo inProceedings of the 16th International AcademicMindTrekConference (MindTrek rsquo12) pp 10ndash14 Tampere Finland Octo-ber 2012

[2] D P Playne K A Hawick and M G B Johnson ldquoSimulatingand Benchmarking the shallow-water fluid dynamical equa-tions on multiple graphical processing unitsrdquo in Proceedingsof the 12th Australasian Symposium on Parallel and DistributedComputing (AusPDC rsquo14) vol 152 pp 29ndash35 Auckland NewZealand January 2014

[3] N Chentanez and M Muller ldquoReal-time eulerian water simu-lation using a restricted tall cell gridrdquo in Proceedings of the ACMTransactions on Graphics pp 821ndash8210 New York NY USA2011

[4] J Ojeda and A Susin ldquoHybrid particle Lattice Boltzmannshallowwater for interactive fluid simulationsrdquo inProceedings ofthe 8th International Conference on Computer Graphics Theoryand Applications (GRAPP rsquo13) pp 217ndash226 Barcelona Spain2013

Mathematical Problems in Engineering 9

[5] J Ojeda and A Susin ldquoReal-time rendering of enhanced shal-low water fluid simulationsrdquo httpwwwpaginesma1upcedusimtonifileshybrid lbmsw rend newpdf

[6] I Abbasov ldquoThree-dimensional simulation the runup of non-linear surface gravity waves on shallow coastrdquo InternationalJournal of Pure and Applied Mathematics vol 93 no 1 pp 135ndash145 2014

[7] E Darles B Crespin and D Ghazanfarpour ldquoA particle-basedmethod for large-scale breakingwaves simulationrdquo inComputerVision and Graphics pp 316ndash323 Springer Berlin Germany2010

[8] M Chladek and R Durikovic ldquoParticle-based shallow watersimulation for irregular and sparse simulation domainsrdquo Com-puters amp Graphics vol 53 pp 170ndash176 2015

[9] T Kellomaki ldquoRigid body interaction for large-scale real-timewater simulationrdquo International Journal of Computer GamesTechnology vol 2014 Article ID 580154 12 pages 2014

[10] A Fournier andW T Reeves ldquoA simple model of ocean wavesrdquoACM Siggraph Computer Graphics vol 20 no 4 pp 75ndash841986

[11] D S De Lima H Braun and S R Musse ldquoA model for realtime ocean breaking waves animationrdquo in Proceedings of the9th Brazilian Symposium on Games and Digital Entertainment(SBGames rsquo10) pp 19ndash24 Florianopolis Brazil November 2010

[12] M Luo G Gong and A El Kamel ldquoGPU-based real-time vir-tual reality modeling and simulation of seashorerdquo in Advancesin Robotics and Virtual Reality vol 26 of Intelligent SystemsReference Library pp 307ndash332 Springer Berlin Germany 2012

[13] N Chentanez and M Muller ldquoReal-time simulation of largebodies of water with small scale detailsrdquo in Proceedings ofthe ACM SIGGRAPHEurographics Symposium on ComputerAnimation pp 197ndash206 Madrid Spain July 2010

[14] S Longo M Petti and I J Losada ldquoTurbulence in the swashand surf zones a reviewrdquo Coastal Engineering vol 45 no 3-4pp 129ndash147 2002

[15] K Fang Z Liu and Z Zou ldquoModelling coastal water wavesusing a depth-integrated non-hydrostatic model with shock-capturing abilityrdquo Journal of Hydraulic Research vol 53 no 1pp 119ndash133 2015

[16] E Bruneton F Neyret and N Holzschuch ldquoRealminustime realisticocean lighting using seamless transitions from geometry toBRDFrdquo in Computer Graphics Forum pp 487ndash496 2010

[17] Y Yin H-X Ren and X-W Liu ldquoReal-time wave simula-tion based on wave spectrum used in marine simulatorrdquo inProceedings of the Asia Simulation Conference-7th InternationalConference on System Simulation and Scientific Computing(ICSC rsquo08) pp 225ndash229 October 2008

[18] Y Li Y Jin Y Yin and H Shen ldquoSimulation of shallow-waterwaves in coastal region for marine simulatorrdquo in Proceedings ofthe 7th ACM SIGGRAPH International Conference on Virtual-Reality Continuum and Its Applications in Industry (VRCAI rsquo08)p 15 December 2008

[19] C Li D Pickup T Saunders et al ldquoWater surface modelingfrom a single viewpoint videordquo IEEE Transactions on Visualiza-tion and Computer Graphics vol 19 no 7 pp 1242ndash1251 2013

[20] S Wang F Kang and D Wang ldquoOcean wave real-timesimulation based on adaptive fusionrdquo in Proceedings of the 32ndChinese Control Conference (CCC rsquo13) pp 8557ndash8560 IEEEXirsquoan China July 2013

[21] S Wang F Kang and J Xu ldquoModeling and visualization ofcurved waves near seashorerdquo Journal of System Simulation vol26 no 10 pp 2395ndash2399 2014

[22] Y Yin Y-C Jin and H-X Ren ldquoWave simulation of visualsystem in marine simulator based on wave spectrumsrdquo in Pro-ceedings of the International Conference on Marine Simulation

and Ship Maneuverability (MARSIM rsquo03) Kanazawa JapanAugust 2003

[23] D Hinsinger F Neyret and M-P Cani ldquoInteractive ani-mation of ocean wavesrdquo in Proceedings of the 2002 ACMSIGGRAPHEurographics Symposium on Computer Animationpp 161ndash166 San Antonio Tex USA July 2002

[24] X Cui J Yi-Cheng and L Xiu-Wen ldquoReal-time ocean wavein multi-channel marine simulatorrdquo in Proceedings of the ACMSIGGRAPH International Conference on Virtual Reality Contin-uum and its Applications in Industry (VRCAI rsquo04) pp 332ndash335June 2004

[25] C Johanson and C Lejdfors Real-time water rendering [MSthesis in computer graphics] Lund University Lund Sweden2004

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Mathematical Problems in Engineering 3

(a) (b)

(c)

Figure 2 The visual results of deep water (a) shallow-water (b) and the hybrid water (c) after coupling

22 Shallow-Water Compared to the deep water shallow-water is more complicated due to the effects of seafloorterrain Its crest line and amplitude will change as thedepth decreases This greatly increases the difficulty of watermodeling and renderingOn account of the real-time require-ment this paper uses an improved Fournier model based ongeometry instead of the physically based model

Fournier proposed that the motion trails of water pointsgradually change from circular to elliptical with the decreas-ing of seabed depth based on the classical Gerstner modelHe established the Fournier wave model and applied it tocomputer graphics And then he realized the 3D visualizationof coastal water For the sake of rendering of coastal waterincluding curved waves Wang et al [21] made an improve-ment of Fournierrsquos model and could quickly simulate coastalwater and curvedwaves at different wind speedsThe formulais as follows

119909 = 1199090 + 119877 cos (120572) 119878119909 sin (120601) cos (120579)+ 119877 sin (120572) 119878119911 cos (120601) cos (120579) + Δ119909 cos (120579)

119910 = 1199100 + 119877 cos (120572) 119878119909 sin (120601) sin (120579)

+ 119877 sin (120572) 119878119911 cos (120601) sin (120579) + Δ119909 sin (120579) 119911 = 1199110 minus 119877 cos (120572) 119878119911 cos (120601) + 119877 sin (120572) 119878119909 sin (120601)

+ Δ119911(7)

Among them the plane (119909 119911) is a vertical surface wavethe point (1199090 1199110) is the static position of a wave point 119877is the wave amplitude 120596 is the angular frequency 119878119909 =11 minus 119890minus119870119909ℎ and 119878119911 = 119878119909(1 minus 119890minus119870119911ℎ) are the major andminor axes of the ellipse sin(120572) = sin(120573)119890minus1198700ℎ 120573 is theslope of seafloor terrain119870infin is the deep water wave number119870(119909) = 119870infinradictanh(119870infinℎ) denotes the wave number at thepoint (1199090 1199110) 120601 = minus120596119905 + sum11990900 119870(119909)Δ119909 and 120579 is the winddirection

In order to realize the curved waves the wave parameterswhen moving need to be adjusted

When 120601min lt 120601 le 120601min + 1205871206011015840 = 119870120601120601Δ119909 = 1198701206011199090

4 Mathematical Problems in Engineering

Δ119911 = 0

1198781015840119909 = 12 [1 minus (

120601 minus 120601min minus 120587120587 )2] 119878119909(8)

When 120601min + 120587 lt 120601 le 120601min + 21205871206011015840 = 120601

Δ119909 = (120601 minus 120601min minus 1512058705120587 )2 (119909crest minus 119909curve)

Δ119911 = (120601 minus 120601min minus 1512058705120587 )2 (119911crest minus 119911curve)

1198781015840119909 = 119878119909

(9)

And the limit on the long axis is

119878119909 le 119891 (119909) (10)

where 119891(119909) = 1119877119870(119909) cos(120572) and 120578 is the thin coefficientof the waveform Its value is 1 by default The higherthe coefficient is the thinner the waveform is 120601min =minustanminus1((sin(120572)119878119909)(cos(120572)119878119911)) denotes the angular 120601 at thewave trough and119870120601 is the curved coefficient with aminimumof 1

The final coastal water is shown in Figure 2(b)

23 Coupling ofWaterWaves In order tomake the transitionof deep water waves and the shallow ones smooth we use theautomatic coupling algorithm to couple the two waves whenthe depth is in the range of 005119871 to 05119871The fusion algorithmis shown as follows

ℎ (119909 119910) =

ℎFFT (119909 119910) if 119889 ge 05119871119889 minus 00511987105119871 minus 005119871ℎFFT (119909 119910) +

05119871 minus 11988905119871 minus 005119871ℎgeo (119909 119910) if 005119871 lt 119889 lt 05119871

ℎgeo (119909 119910) if 119889 le 005119871(11)

where 119889 is the terrain depth of the grid vertex at the currenttime ℎFFT(119909 119910) and ℎgeo(119909 119910) are the heights generated bythe deep water and shallow-water model

From the formula it can be seen that the couplingalgorithmwill guarantee a smooth transition fromdeepwaterto shallow-waterThe hybrid water after coupling is shown inFigure 2(c)

3 Water Surface Grid AutomaticSimplification

When the water is rendered grid model is usually used tosimulate water surface Yin et al [22] divided the surfaceinto a dynamic one and a static one The dynamic surfaceis formed by 119872 lowast 119873 grid points and revolves around theviewpoint and the outer space of the dynamic surface isthe static surface Hinsinger et al [23] presented an adaptivesurface grid model Cui et al [24] improved the adaptive gridmodel and put forward a trapezoidal grid model Johansonand Lejdfors [25] proposed a projection grid model and usedit to simulate the water surface in world space

The above studies of wave multiresolution grid did nottake the influence of terrain into account However shallow-water will not appear under the land terrain so the surfacegrid under the land should not be computed and renderedIn order to prevent the unnecessary expense we proposedan improved multiresolution grid by detecting whether gridpoints are under the land Then rendering of coastal waterwill be accelerated after reducing computation consuming

31 Multiresolution Grid Multiresolution grid refers to gridswith different levels of details (LOD) existing in differentregions It can greatly improve the efficiency of the grid gen-eration without losing the details Therefore multiresolutiongrids are commonly used in real-time rendering of large-scales of water and terrain

In the coastal scene rendering a part of the water surfacegrid is always under the terrain But the former researchesusually use the same grid they did not make changes to thegrid The general grid is shown in Figure 3

The grid points covered by terrain will be calculatedgenerated and automatically culled by the rendering systemThere is no problem in vision but the process of computinggenerating and culling can severely affect the real-timeperformance

32 Grid Improvement In order to avoid unnecessary com-putation the grid points are detected in advance to ensurewhether they are covered by terrain or not when the watersurface grid is generating If they are the next computationstepwill be not processed if not then continueThe detectionwill last until the whole grid is generated Because the coastalterrain is static the detection does not need to be repeatedThen the speed of generation and rendering of water can beimproved

In the case that coastline data are known the coversituation can be judged according to the relationship betweenthe grid points and the coastline The detection process is asfollows

Mathematical Problems in Engineering 5

Eye

CoastCoastal water

Coastline

(a) (b)

Figure 3 The general multiresolution grid (a) and the rendering mesh (b)

Height

Collision detection lineCollision detection point

Water wave

Terrain

Water line

Figure 4 The collision detection process

If 119909mesh lt 119909line amp 119910mesh lt 119910line the grid point is notcovered by terrain or it is covered and will not need to becomputed

However the coastline data cannot be generally obtainedThen the collision detection technologywill be used to detectwhether the grid point is covered by terrain The collisiondetection process is shown in Figure 4

In the process the collision detection system sends avertical line from above the grid and we can manage to keepan account of the height of the point relative to the horizontalline when the line collision with the terrain

If 119911mesh lt 119867 the grid point is not covered by terrain or itis covered and will not need to be computed The final grid isgiven in Figure 5

4 GPU Implementation Method

In order to rapidly generate large bodies of near oceanwave scene graphics hardware shader language is used inrendering The water height map data are obtained by thecalculating of shallow-water model Then it is loaded in thevertex shader and is fused with Perlin noise Final waterheight and offset in horizontal direction are computed Eachvertex normal vector and color data are calculated in the pixelshader so the water scene is realized The surface reflectionand foam effect are also added to increase the scene fidelity

41 Rendering Based on Height Field Map The curved modelcan be computed to obtain the height and horizontal offsetof each vertex The result will be saved in a height map Each

pixel of the height map can store a vertex information It isexpressed by the formula

colordata sdot 119903119892119887 = (119909 119910 119911) (12)

The height field map data can be read and interpolated inthe vertex shader and Perlin noise is added then the finalvertex information is expressed by

(119909 119910 119911) = (colordata sdot 119903 colordata sdot 119892 colordata sdot 119887+Noiseperlin)

(13)

In the pixel shader the vertex normal vector and color arecalculated the vertex transparency is computed according tothe depth

colorfinal sdot 119903119892119887 = fresnel lowast colorwater sdot 119903119892119887+ (1 minus fresnel) lowast colordifuse

colorfinal sdot 119886 = 1 minus 06119890minusℎ(14)

Here fresnel denotes the fresnel reflection coefficientThewater surface will be gettingmore andmore transpar-

ent with the decreasing of depth The value of 0 means fullytransparent In this paper the minimum transparency valueis 06

42 Realization of the Reflection and FoamEffect The render-ing scene above sea level is rendered to a texture through theRTT (render to texture) technology The reflection texture isloaded in the pixel shader and then the reflection effect of thewave surface is realized by using dynamic texture mappingtechnology The specific calculation formula is as follows

colorfinal sdot 119903119892119887 = fresnel lowast colorwater sdot 119903119892119887+ (1 minus fresnel) lowast colorreflect (15)

Foam will be intermittently generated at the wave crestwhen the wave is moving And foams appear in the trough

6 Mathematical Problems in Engineering

Eye

CoastCoastal water

Coastline

(a) (b)

Figure 5 The improved grid (a) and the rendering result (b)

Figure 6 The reflection and foam effects

and crest of the waves during wave run-up and run-down[14] So we applied two differentmethods to achieve the effectof foamWe load a transparent foam texture and simulate thedynamic foam effect by controlling the offset speed of texturewith texture mapping technologyThe implementation detailand rendering result are shown in Box 1 and Figure 6

colorfinal = density lowast colorfinal + (1 minus density)lowast colorfoam (16)

5 Results and Discussion

To evaluate our method we have created several typicalcoastal water scenes on a 266GHzCore i7 andNVIDIAGTX560 The hybrid water model is computed on CPU and therendering is implemented on GPU The results are shown inFigure 7 In Figures 7(a) and 7(b) the thin coefficient is 10while its value is 12 in Figures 7(c) and 7(d) Compared with10 the waveform is thinner with the coefficient of 12 Butthere is a problem that the waveforms will be crossed whenthe coefficient getting higher It is the limit of our method

and we will research it in future work The foam effects aredifferent in the crest and trough of waves In our methodfoam at the crest moves forward and foam at the troughmoves backward So we can simulate the huge amount ofbubbles fast Table 1 lists the performance values of differentexamples Since the model is geometric and the renderingis implemented with shader language our method makesit possible to simulate a large-scale coastal water scene at astable frame rate of 60 frames per second

The comparison with the referencesrsquo methods is shown inTable 2 Ojedarsquos method [4] is based on physics It can handlearbitrary underlying terrain and interact with dynamic rigidbodies They compute the water model both on CPU and onGPU but only the result on GPU can meet the requirementof real-time performance Another problem of our methodis that it can only get the simulation of small-scale shallow-water Luorsquos method [12] used a Bezier curve so it is based ongeometry They can get a nice real-time middle-scale coastalwater after GPU accelerating However they need to design acoastline before rendering Once the rendering is begun thecoastline cannot be changed As our method can get a highframe rate we will not need a GPU based computation of

Mathematical Problems in Engineering 7

Combine waterbody color and reflected color

vec4 water color = mix(body color reflected color fresnel)

vec4 final color = water color

float depth = texture2D(

DeepMap vec2(pos localx (pos localy))2560 )r 300 - 150

Crest Foam

float alphaFactor = texture2D(

FoamMap pos localxy640 + g PerlinMovement 20)r

float foamFactor = alphaFactor clamp(pos localz 20 - 01 00 10)

final color = vec4(final colorxyz (3000 - pos localx) 3000 )

final color = mix(final color vec4(10 10 10 10) foamFactor)

Trough Foam

alphaFactor = texture2D(

FoamMap vec2(pos localx320 pos localy320)

+ g PerlinMovement 20)r

float foamFactor0 = alphaFactor clamp( (depth + 30) 50 00 10)

alphaFactor = texture2D(

FoamMap pos localxy640 - g PerlinMovement 30)r

float foamFactor1 = alphaFactor clamp( -06 - pos localz 00 10)

clamp( (depth + 200) 150 00 10)

final color = mix(final color vec4(10 10 10 10) foamFactor0)

final color = mix(final color vec4(10 10 10 10) foamFactor1)

Fog

float fogFactor = computeFogFactor( g FogDensity gl FogFragCoord )

water color = final color

Sun spots

float cos spec = clamp(dot(reflect vec g SunDir) 00 10)

float sun spot = pow(cos spec g Shineness)

water colorxyz += g SunColor sun spot

gl FragColor = water color

Box 1 The implementation detail

Table 1 Timing per frame for various examples in millisecond

Grid size Computation grid size Model Rendering Total

51221282 656 506 12062562 2167 1310 36855122 11589 1856 13458

102421282 658 533 13832562 2236 1407 38025122 11623 2199 13869

Table 2 A comparison of the difference between Luorsquos method Ojedarsquos method and our method

Ojedarsquos method Luorsquos method Our methodComputation platform CPU GPU GPU CPUComputation grid size 1282 1282 2502 1282

Water scale Small Small Middle LargeAveraged timing per frame 41088ms 528ms 1667ms 1206ms

the water model We can also handle any underlying terrainsince the model is computed in real-time Furthermore wealso consider the deep water when the depth is getting largerIt can also help to make the coastal scene more real

One drawback of ourmethod is that the rendering resultslack higher details The geometric based model is not thesame as the physically based model and it cannot simulatethe higher details such as splash and breaking damThe other

8 Mathematical Problems in Engineering

(a) 120578 = 10 (b) 120578 = 10

(c) 120578 = 12 (d) 120578 = 12

Figure 7 The rendering result of coastal water scene with different thin coefficients

problem is that thewaveformwill become crossed if we donotlimit the thin coefficient However our method offers a highrendering speed even on an ordinary graphic hardware Thiscan allow more consumer-level computers to run the coastalwater simulation

6 Conclusions

In this paper we present an automatic optimization approachfor the rendering of large-scale real-time coastal water Ahybrid coastal watermodel is estimated for large-scale coastalwater according to the depth of water The deep water isalso considered in our hybrid coastal water Unnecessary gridcells are simplified by our automatic simplification algorithmFinally we implement our method on GPU by using shaderlanguageThe reflection and foam effect are also added to thewater surface to enhance the final rendering result

There are several ways to further improve the visualappearance of the coastal water The extraordinary detailedeffects like waterfall breaking dam and splashes are neededto be complex modeled by using particles systems Theinteraction with rigid bodies is also a challenging work in thefuture

Competing Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] T Kellomaki ldquoWater simulationmethods for games a compari-sonrdquo inProceedings of the 16th International AcademicMindTrekConference (MindTrek rsquo12) pp 10ndash14 Tampere Finland Octo-ber 2012

[2] D P Playne K A Hawick and M G B Johnson ldquoSimulatingand Benchmarking the shallow-water fluid dynamical equa-tions on multiple graphical processing unitsrdquo in Proceedingsof the 12th Australasian Symposium on Parallel and DistributedComputing (AusPDC rsquo14) vol 152 pp 29ndash35 Auckland NewZealand January 2014

[3] N Chentanez and M Muller ldquoReal-time eulerian water simu-lation using a restricted tall cell gridrdquo in Proceedings of the ACMTransactions on Graphics pp 821ndash8210 New York NY USA2011

[4] J Ojeda and A Susin ldquoHybrid particle Lattice Boltzmannshallowwater for interactive fluid simulationsrdquo inProceedings ofthe 8th International Conference on Computer Graphics Theoryand Applications (GRAPP rsquo13) pp 217ndash226 Barcelona Spain2013

Mathematical Problems in Engineering 9

[5] J Ojeda and A Susin ldquoReal-time rendering of enhanced shal-low water fluid simulationsrdquo httpwwwpaginesma1upcedusimtonifileshybrid lbmsw rend newpdf

[6] I Abbasov ldquoThree-dimensional simulation the runup of non-linear surface gravity waves on shallow coastrdquo InternationalJournal of Pure and Applied Mathematics vol 93 no 1 pp 135ndash145 2014

[7] E Darles B Crespin and D Ghazanfarpour ldquoA particle-basedmethod for large-scale breakingwaves simulationrdquo inComputerVision and Graphics pp 316ndash323 Springer Berlin Germany2010

[8] M Chladek and R Durikovic ldquoParticle-based shallow watersimulation for irregular and sparse simulation domainsrdquo Com-puters amp Graphics vol 53 pp 170ndash176 2015

[9] T Kellomaki ldquoRigid body interaction for large-scale real-timewater simulationrdquo International Journal of Computer GamesTechnology vol 2014 Article ID 580154 12 pages 2014

[10] A Fournier andW T Reeves ldquoA simple model of ocean wavesrdquoACM Siggraph Computer Graphics vol 20 no 4 pp 75ndash841986

[11] D S De Lima H Braun and S R Musse ldquoA model for realtime ocean breaking waves animationrdquo in Proceedings of the9th Brazilian Symposium on Games and Digital Entertainment(SBGames rsquo10) pp 19ndash24 Florianopolis Brazil November 2010

[12] M Luo G Gong and A El Kamel ldquoGPU-based real-time vir-tual reality modeling and simulation of seashorerdquo in Advancesin Robotics and Virtual Reality vol 26 of Intelligent SystemsReference Library pp 307ndash332 Springer Berlin Germany 2012

[13] N Chentanez and M Muller ldquoReal-time simulation of largebodies of water with small scale detailsrdquo in Proceedings ofthe ACM SIGGRAPHEurographics Symposium on ComputerAnimation pp 197ndash206 Madrid Spain July 2010

[14] S Longo M Petti and I J Losada ldquoTurbulence in the swashand surf zones a reviewrdquo Coastal Engineering vol 45 no 3-4pp 129ndash147 2002

[15] K Fang Z Liu and Z Zou ldquoModelling coastal water wavesusing a depth-integrated non-hydrostatic model with shock-capturing abilityrdquo Journal of Hydraulic Research vol 53 no 1pp 119ndash133 2015

[16] E Bruneton F Neyret and N Holzschuch ldquoRealminustime realisticocean lighting using seamless transitions from geometry toBRDFrdquo in Computer Graphics Forum pp 487ndash496 2010

[17] Y Yin H-X Ren and X-W Liu ldquoReal-time wave simula-tion based on wave spectrum used in marine simulatorrdquo inProceedings of the Asia Simulation Conference-7th InternationalConference on System Simulation and Scientific Computing(ICSC rsquo08) pp 225ndash229 October 2008

[18] Y Li Y Jin Y Yin and H Shen ldquoSimulation of shallow-waterwaves in coastal region for marine simulatorrdquo in Proceedings ofthe 7th ACM SIGGRAPH International Conference on Virtual-Reality Continuum and Its Applications in Industry (VRCAI rsquo08)p 15 December 2008

[19] C Li D Pickup T Saunders et al ldquoWater surface modelingfrom a single viewpoint videordquo IEEE Transactions on Visualiza-tion and Computer Graphics vol 19 no 7 pp 1242ndash1251 2013

[20] S Wang F Kang and D Wang ldquoOcean wave real-timesimulation based on adaptive fusionrdquo in Proceedings of the 32ndChinese Control Conference (CCC rsquo13) pp 8557ndash8560 IEEEXirsquoan China July 2013

[21] S Wang F Kang and J Xu ldquoModeling and visualization ofcurved waves near seashorerdquo Journal of System Simulation vol26 no 10 pp 2395ndash2399 2014

[22] Y Yin Y-C Jin and H-X Ren ldquoWave simulation of visualsystem in marine simulator based on wave spectrumsrdquo in Pro-ceedings of the International Conference on Marine Simulation

and Ship Maneuverability (MARSIM rsquo03) Kanazawa JapanAugust 2003

[23] D Hinsinger F Neyret and M-P Cani ldquoInteractive ani-mation of ocean wavesrdquo in Proceedings of the 2002 ACMSIGGRAPHEurographics Symposium on Computer Animationpp 161ndash166 San Antonio Tex USA July 2002

[24] X Cui J Yi-Cheng and L Xiu-Wen ldquoReal-time ocean wavein multi-channel marine simulatorrdquo in Proceedings of the ACMSIGGRAPH International Conference on Virtual Reality Contin-uum and its Applications in Industry (VRCAI rsquo04) pp 332ndash335June 2004

[25] C Johanson and C Lejdfors Real-time water rendering [MSthesis in computer graphics] Lund University Lund Sweden2004

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

4 Mathematical Problems in Engineering

Δ119911 = 0

1198781015840119909 = 12 [1 minus (

120601 minus 120601min minus 120587120587 )2] 119878119909(8)

When 120601min + 120587 lt 120601 le 120601min + 21205871206011015840 = 120601

Δ119909 = (120601 minus 120601min minus 1512058705120587 )2 (119909crest minus 119909curve)

Δ119911 = (120601 minus 120601min minus 1512058705120587 )2 (119911crest minus 119911curve)

1198781015840119909 = 119878119909

(9)

And the limit on the long axis is

119878119909 le 119891 (119909) (10)

where 119891(119909) = 1119877119870(119909) cos(120572) and 120578 is the thin coefficientof the waveform Its value is 1 by default The higherthe coefficient is the thinner the waveform is 120601min =minustanminus1((sin(120572)119878119909)(cos(120572)119878119911)) denotes the angular 120601 at thewave trough and119870120601 is the curved coefficient with aminimumof 1

The final coastal water is shown in Figure 2(b)

23 Coupling ofWaterWaves In order tomake the transitionof deep water waves and the shallow ones smooth we use theautomatic coupling algorithm to couple the two waves whenthe depth is in the range of 005119871 to 05119871The fusion algorithmis shown as follows

ℎ (119909 119910) =

ℎFFT (119909 119910) if 119889 ge 05119871119889 minus 00511987105119871 minus 005119871ℎFFT (119909 119910) +

05119871 minus 11988905119871 minus 005119871ℎgeo (119909 119910) if 005119871 lt 119889 lt 05119871

ℎgeo (119909 119910) if 119889 le 005119871(11)

where 119889 is the terrain depth of the grid vertex at the currenttime ℎFFT(119909 119910) and ℎgeo(119909 119910) are the heights generated bythe deep water and shallow-water model

From the formula it can be seen that the couplingalgorithmwill guarantee a smooth transition fromdeepwaterto shallow-waterThe hybrid water after coupling is shown inFigure 2(c)

3 Water Surface Grid AutomaticSimplification

When the water is rendered grid model is usually used tosimulate water surface Yin et al [22] divided the surfaceinto a dynamic one and a static one The dynamic surfaceis formed by 119872 lowast 119873 grid points and revolves around theviewpoint and the outer space of the dynamic surface isthe static surface Hinsinger et al [23] presented an adaptivesurface grid model Cui et al [24] improved the adaptive gridmodel and put forward a trapezoidal grid model Johansonand Lejdfors [25] proposed a projection grid model and usedit to simulate the water surface in world space

The above studies of wave multiresolution grid did nottake the influence of terrain into account However shallow-water will not appear under the land terrain so the surfacegrid under the land should not be computed and renderedIn order to prevent the unnecessary expense we proposedan improved multiresolution grid by detecting whether gridpoints are under the land Then rendering of coastal waterwill be accelerated after reducing computation consuming

31 Multiresolution Grid Multiresolution grid refers to gridswith different levels of details (LOD) existing in differentregions It can greatly improve the efficiency of the grid gen-eration without losing the details Therefore multiresolutiongrids are commonly used in real-time rendering of large-scales of water and terrain

In the coastal scene rendering a part of the water surfacegrid is always under the terrain But the former researchesusually use the same grid they did not make changes to thegrid The general grid is shown in Figure 3

The grid points covered by terrain will be calculatedgenerated and automatically culled by the rendering systemThere is no problem in vision but the process of computinggenerating and culling can severely affect the real-timeperformance

32 Grid Improvement In order to avoid unnecessary com-putation the grid points are detected in advance to ensurewhether they are covered by terrain or not when the watersurface grid is generating If they are the next computationstepwill be not processed if not then continueThe detectionwill last until the whole grid is generated Because the coastalterrain is static the detection does not need to be repeatedThen the speed of generation and rendering of water can beimproved

In the case that coastline data are known the coversituation can be judged according to the relationship betweenthe grid points and the coastline The detection process is asfollows

Mathematical Problems in Engineering 5

Eye

CoastCoastal water

Coastline

(a) (b)

Figure 3 The general multiresolution grid (a) and the rendering mesh (b)

Height

Collision detection lineCollision detection point

Water wave

Terrain

Water line

Figure 4 The collision detection process

If 119909mesh lt 119909line amp 119910mesh lt 119910line the grid point is notcovered by terrain or it is covered and will not need to becomputed

However the coastline data cannot be generally obtainedThen the collision detection technologywill be used to detectwhether the grid point is covered by terrain The collisiondetection process is shown in Figure 4

In the process the collision detection system sends avertical line from above the grid and we can manage to keepan account of the height of the point relative to the horizontalline when the line collision with the terrain

If 119911mesh lt 119867 the grid point is not covered by terrain or itis covered and will not need to be computed The final grid isgiven in Figure 5

4 GPU Implementation Method

In order to rapidly generate large bodies of near oceanwave scene graphics hardware shader language is used inrendering The water height map data are obtained by thecalculating of shallow-water model Then it is loaded in thevertex shader and is fused with Perlin noise Final waterheight and offset in horizontal direction are computed Eachvertex normal vector and color data are calculated in the pixelshader so the water scene is realized The surface reflectionand foam effect are also added to increase the scene fidelity

41 Rendering Based on Height Field Map The curved modelcan be computed to obtain the height and horizontal offsetof each vertex The result will be saved in a height map Each

pixel of the height map can store a vertex information It isexpressed by the formula

colordata sdot 119903119892119887 = (119909 119910 119911) (12)

The height field map data can be read and interpolated inthe vertex shader and Perlin noise is added then the finalvertex information is expressed by

(119909 119910 119911) = (colordata sdot 119903 colordata sdot 119892 colordata sdot 119887+Noiseperlin)

(13)

In the pixel shader the vertex normal vector and color arecalculated the vertex transparency is computed according tothe depth

colorfinal sdot 119903119892119887 = fresnel lowast colorwater sdot 119903119892119887+ (1 minus fresnel) lowast colordifuse

colorfinal sdot 119886 = 1 minus 06119890minusℎ(14)

Here fresnel denotes the fresnel reflection coefficientThewater surface will be gettingmore andmore transpar-

ent with the decreasing of depth The value of 0 means fullytransparent In this paper the minimum transparency valueis 06

42 Realization of the Reflection and FoamEffect The render-ing scene above sea level is rendered to a texture through theRTT (render to texture) technology The reflection texture isloaded in the pixel shader and then the reflection effect of thewave surface is realized by using dynamic texture mappingtechnology The specific calculation formula is as follows

colorfinal sdot 119903119892119887 = fresnel lowast colorwater sdot 119903119892119887+ (1 minus fresnel) lowast colorreflect (15)

Foam will be intermittently generated at the wave crestwhen the wave is moving And foams appear in the trough

6 Mathematical Problems in Engineering

Eye

CoastCoastal water

Coastline

(a) (b)

Figure 5 The improved grid (a) and the rendering result (b)

Figure 6 The reflection and foam effects

and crest of the waves during wave run-up and run-down[14] So we applied two differentmethods to achieve the effectof foamWe load a transparent foam texture and simulate thedynamic foam effect by controlling the offset speed of texturewith texture mapping technologyThe implementation detailand rendering result are shown in Box 1 and Figure 6

colorfinal = density lowast colorfinal + (1 minus density)lowast colorfoam (16)

5 Results and Discussion

To evaluate our method we have created several typicalcoastal water scenes on a 266GHzCore i7 andNVIDIAGTX560 The hybrid water model is computed on CPU and therendering is implemented on GPU The results are shown inFigure 7 In Figures 7(a) and 7(b) the thin coefficient is 10while its value is 12 in Figures 7(c) and 7(d) Compared with10 the waveform is thinner with the coefficient of 12 Butthere is a problem that the waveforms will be crossed whenthe coefficient getting higher It is the limit of our method

and we will research it in future work The foam effects aredifferent in the crest and trough of waves In our methodfoam at the crest moves forward and foam at the troughmoves backward So we can simulate the huge amount ofbubbles fast Table 1 lists the performance values of differentexamples Since the model is geometric and the renderingis implemented with shader language our method makesit possible to simulate a large-scale coastal water scene at astable frame rate of 60 frames per second

The comparison with the referencesrsquo methods is shown inTable 2 Ojedarsquos method [4] is based on physics It can handlearbitrary underlying terrain and interact with dynamic rigidbodies They compute the water model both on CPU and onGPU but only the result on GPU can meet the requirementof real-time performance Another problem of our methodis that it can only get the simulation of small-scale shallow-water Luorsquos method [12] used a Bezier curve so it is based ongeometry They can get a nice real-time middle-scale coastalwater after GPU accelerating However they need to design acoastline before rendering Once the rendering is begun thecoastline cannot be changed As our method can get a highframe rate we will not need a GPU based computation of

Mathematical Problems in Engineering 7

Combine waterbody color and reflected color

vec4 water color = mix(body color reflected color fresnel)

vec4 final color = water color

float depth = texture2D(

DeepMap vec2(pos localx (pos localy))2560 )r 300 - 150

Crest Foam

float alphaFactor = texture2D(

FoamMap pos localxy640 + g PerlinMovement 20)r

float foamFactor = alphaFactor clamp(pos localz 20 - 01 00 10)

final color = vec4(final colorxyz (3000 - pos localx) 3000 )

final color = mix(final color vec4(10 10 10 10) foamFactor)

Trough Foam

alphaFactor = texture2D(

FoamMap vec2(pos localx320 pos localy320)

+ g PerlinMovement 20)r

float foamFactor0 = alphaFactor clamp( (depth + 30) 50 00 10)

alphaFactor = texture2D(

FoamMap pos localxy640 - g PerlinMovement 30)r

float foamFactor1 = alphaFactor clamp( -06 - pos localz 00 10)

clamp( (depth + 200) 150 00 10)

final color = mix(final color vec4(10 10 10 10) foamFactor0)

final color = mix(final color vec4(10 10 10 10) foamFactor1)

Fog

float fogFactor = computeFogFactor( g FogDensity gl FogFragCoord )

water color = final color

Sun spots

float cos spec = clamp(dot(reflect vec g SunDir) 00 10)

float sun spot = pow(cos spec g Shineness)

water colorxyz += g SunColor sun spot

gl FragColor = water color

Box 1 The implementation detail

Table 1 Timing per frame for various examples in millisecond

Grid size Computation grid size Model Rendering Total

51221282 656 506 12062562 2167 1310 36855122 11589 1856 13458

102421282 658 533 13832562 2236 1407 38025122 11623 2199 13869

Table 2 A comparison of the difference between Luorsquos method Ojedarsquos method and our method

Ojedarsquos method Luorsquos method Our methodComputation platform CPU GPU GPU CPUComputation grid size 1282 1282 2502 1282

Water scale Small Small Middle LargeAveraged timing per frame 41088ms 528ms 1667ms 1206ms

the water model We can also handle any underlying terrainsince the model is computed in real-time Furthermore wealso consider the deep water when the depth is getting largerIt can also help to make the coastal scene more real

One drawback of ourmethod is that the rendering resultslack higher details The geometric based model is not thesame as the physically based model and it cannot simulatethe higher details such as splash and breaking damThe other

8 Mathematical Problems in Engineering

(a) 120578 = 10 (b) 120578 = 10

(c) 120578 = 12 (d) 120578 = 12

Figure 7 The rendering result of coastal water scene with different thin coefficients

problem is that thewaveformwill become crossed if we donotlimit the thin coefficient However our method offers a highrendering speed even on an ordinary graphic hardware Thiscan allow more consumer-level computers to run the coastalwater simulation

6 Conclusions

In this paper we present an automatic optimization approachfor the rendering of large-scale real-time coastal water Ahybrid coastal watermodel is estimated for large-scale coastalwater according to the depth of water The deep water isalso considered in our hybrid coastal water Unnecessary gridcells are simplified by our automatic simplification algorithmFinally we implement our method on GPU by using shaderlanguageThe reflection and foam effect are also added to thewater surface to enhance the final rendering result

There are several ways to further improve the visualappearance of the coastal water The extraordinary detailedeffects like waterfall breaking dam and splashes are neededto be complex modeled by using particles systems Theinteraction with rigid bodies is also a challenging work in thefuture

Competing Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] T Kellomaki ldquoWater simulationmethods for games a compari-sonrdquo inProceedings of the 16th International AcademicMindTrekConference (MindTrek rsquo12) pp 10ndash14 Tampere Finland Octo-ber 2012

[2] D P Playne K A Hawick and M G B Johnson ldquoSimulatingand Benchmarking the shallow-water fluid dynamical equa-tions on multiple graphical processing unitsrdquo in Proceedingsof the 12th Australasian Symposium on Parallel and DistributedComputing (AusPDC rsquo14) vol 152 pp 29ndash35 Auckland NewZealand January 2014

[3] N Chentanez and M Muller ldquoReal-time eulerian water simu-lation using a restricted tall cell gridrdquo in Proceedings of the ACMTransactions on Graphics pp 821ndash8210 New York NY USA2011

[4] J Ojeda and A Susin ldquoHybrid particle Lattice Boltzmannshallowwater for interactive fluid simulationsrdquo inProceedings ofthe 8th International Conference on Computer Graphics Theoryand Applications (GRAPP rsquo13) pp 217ndash226 Barcelona Spain2013

Mathematical Problems in Engineering 9

[5] J Ojeda and A Susin ldquoReal-time rendering of enhanced shal-low water fluid simulationsrdquo httpwwwpaginesma1upcedusimtonifileshybrid lbmsw rend newpdf

[6] I Abbasov ldquoThree-dimensional simulation the runup of non-linear surface gravity waves on shallow coastrdquo InternationalJournal of Pure and Applied Mathematics vol 93 no 1 pp 135ndash145 2014

[7] E Darles B Crespin and D Ghazanfarpour ldquoA particle-basedmethod for large-scale breakingwaves simulationrdquo inComputerVision and Graphics pp 316ndash323 Springer Berlin Germany2010

[8] M Chladek and R Durikovic ldquoParticle-based shallow watersimulation for irregular and sparse simulation domainsrdquo Com-puters amp Graphics vol 53 pp 170ndash176 2015

[9] T Kellomaki ldquoRigid body interaction for large-scale real-timewater simulationrdquo International Journal of Computer GamesTechnology vol 2014 Article ID 580154 12 pages 2014

[10] A Fournier andW T Reeves ldquoA simple model of ocean wavesrdquoACM Siggraph Computer Graphics vol 20 no 4 pp 75ndash841986

[11] D S De Lima H Braun and S R Musse ldquoA model for realtime ocean breaking waves animationrdquo in Proceedings of the9th Brazilian Symposium on Games and Digital Entertainment(SBGames rsquo10) pp 19ndash24 Florianopolis Brazil November 2010

[12] M Luo G Gong and A El Kamel ldquoGPU-based real-time vir-tual reality modeling and simulation of seashorerdquo in Advancesin Robotics and Virtual Reality vol 26 of Intelligent SystemsReference Library pp 307ndash332 Springer Berlin Germany 2012

[13] N Chentanez and M Muller ldquoReal-time simulation of largebodies of water with small scale detailsrdquo in Proceedings ofthe ACM SIGGRAPHEurographics Symposium on ComputerAnimation pp 197ndash206 Madrid Spain July 2010

[14] S Longo M Petti and I J Losada ldquoTurbulence in the swashand surf zones a reviewrdquo Coastal Engineering vol 45 no 3-4pp 129ndash147 2002

[15] K Fang Z Liu and Z Zou ldquoModelling coastal water wavesusing a depth-integrated non-hydrostatic model with shock-capturing abilityrdquo Journal of Hydraulic Research vol 53 no 1pp 119ndash133 2015

[16] E Bruneton F Neyret and N Holzschuch ldquoRealminustime realisticocean lighting using seamless transitions from geometry toBRDFrdquo in Computer Graphics Forum pp 487ndash496 2010

[17] Y Yin H-X Ren and X-W Liu ldquoReal-time wave simula-tion based on wave spectrum used in marine simulatorrdquo inProceedings of the Asia Simulation Conference-7th InternationalConference on System Simulation and Scientific Computing(ICSC rsquo08) pp 225ndash229 October 2008

[18] Y Li Y Jin Y Yin and H Shen ldquoSimulation of shallow-waterwaves in coastal region for marine simulatorrdquo in Proceedings ofthe 7th ACM SIGGRAPH International Conference on Virtual-Reality Continuum and Its Applications in Industry (VRCAI rsquo08)p 15 December 2008

[19] C Li D Pickup T Saunders et al ldquoWater surface modelingfrom a single viewpoint videordquo IEEE Transactions on Visualiza-tion and Computer Graphics vol 19 no 7 pp 1242ndash1251 2013

[20] S Wang F Kang and D Wang ldquoOcean wave real-timesimulation based on adaptive fusionrdquo in Proceedings of the 32ndChinese Control Conference (CCC rsquo13) pp 8557ndash8560 IEEEXirsquoan China July 2013

[21] S Wang F Kang and J Xu ldquoModeling and visualization ofcurved waves near seashorerdquo Journal of System Simulation vol26 no 10 pp 2395ndash2399 2014

[22] Y Yin Y-C Jin and H-X Ren ldquoWave simulation of visualsystem in marine simulator based on wave spectrumsrdquo in Pro-ceedings of the International Conference on Marine Simulation

and Ship Maneuverability (MARSIM rsquo03) Kanazawa JapanAugust 2003

[23] D Hinsinger F Neyret and M-P Cani ldquoInteractive ani-mation of ocean wavesrdquo in Proceedings of the 2002 ACMSIGGRAPHEurographics Symposium on Computer Animationpp 161ndash166 San Antonio Tex USA July 2002

[24] X Cui J Yi-Cheng and L Xiu-Wen ldquoReal-time ocean wavein multi-channel marine simulatorrdquo in Proceedings of the ACMSIGGRAPH International Conference on Virtual Reality Contin-uum and its Applications in Industry (VRCAI rsquo04) pp 332ndash335June 2004

[25] C Johanson and C Lejdfors Real-time water rendering [MSthesis in computer graphics] Lund University Lund Sweden2004

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Mathematical Problems in Engineering 5

Eye

CoastCoastal water

Coastline

(a) (b)

Figure 3 The general multiresolution grid (a) and the rendering mesh (b)

Height

Collision detection lineCollision detection point

Water wave

Terrain

Water line

Figure 4 The collision detection process

If 119909mesh lt 119909line amp 119910mesh lt 119910line the grid point is notcovered by terrain or it is covered and will not need to becomputed

However the coastline data cannot be generally obtainedThen the collision detection technologywill be used to detectwhether the grid point is covered by terrain The collisiondetection process is shown in Figure 4

In the process the collision detection system sends avertical line from above the grid and we can manage to keepan account of the height of the point relative to the horizontalline when the line collision with the terrain

If 119911mesh lt 119867 the grid point is not covered by terrain or itis covered and will not need to be computed The final grid isgiven in Figure 5

4 GPU Implementation Method

In order to rapidly generate large bodies of near oceanwave scene graphics hardware shader language is used inrendering The water height map data are obtained by thecalculating of shallow-water model Then it is loaded in thevertex shader and is fused with Perlin noise Final waterheight and offset in horizontal direction are computed Eachvertex normal vector and color data are calculated in the pixelshader so the water scene is realized The surface reflectionand foam effect are also added to increase the scene fidelity

41 Rendering Based on Height Field Map The curved modelcan be computed to obtain the height and horizontal offsetof each vertex The result will be saved in a height map Each

pixel of the height map can store a vertex information It isexpressed by the formula

colordata sdot 119903119892119887 = (119909 119910 119911) (12)

The height field map data can be read and interpolated inthe vertex shader and Perlin noise is added then the finalvertex information is expressed by

(119909 119910 119911) = (colordata sdot 119903 colordata sdot 119892 colordata sdot 119887+Noiseperlin)

(13)

In the pixel shader the vertex normal vector and color arecalculated the vertex transparency is computed according tothe depth

colorfinal sdot 119903119892119887 = fresnel lowast colorwater sdot 119903119892119887+ (1 minus fresnel) lowast colordifuse

colorfinal sdot 119886 = 1 minus 06119890minusℎ(14)

Here fresnel denotes the fresnel reflection coefficientThewater surface will be gettingmore andmore transpar-

ent with the decreasing of depth The value of 0 means fullytransparent In this paper the minimum transparency valueis 06

42 Realization of the Reflection and FoamEffect The render-ing scene above sea level is rendered to a texture through theRTT (render to texture) technology The reflection texture isloaded in the pixel shader and then the reflection effect of thewave surface is realized by using dynamic texture mappingtechnology The specific calculation formula is as follows

colorfinal sdot 119903119892119887 = fresnel lowast colorwater sdot 119903119892119887+ (1 minus fresnel) lowast colorreflect (15)

Foam will be intermittently generated at the wave crestwhen the wave is moving And foams appear in the trough

6 Mathematical Problems in Engineering

Eye

CoastCoastal water

Coastline

(a) (b)

Figure 5 The improved grid (a) and the rendering result (b)

Figure 6 The reflection and foam effects

and crest of the waves during wave run-up and run-down[14] So we applied two differentmethods to achieve the effectof foamWe load a transparent foam texture and simulate thedynamic foam effect by controlling the offset speed of texturewith texture mapping technologyThe implementation detailand rendering result are shown in Box 1 and Figure 6

colorfinal = density lowast colorfinal + (1 minus density)lowast colorfoam (16)

5 Results and Discussion

To evaluate our method we have created several typicalcoastal water scenes on a 266GHzCore i7 andNVIDIAGTX560 The hybrid water model is computed on CPU and therendering is implemented on GPU The results are shown inFigure 7 In Figures 7(a) and 7(b) the thin coefficient is 10while its value is 12 in Figures 7(c) and 7(d) Compared with10 the waveform is thinner with the coefficient of 12 Butthere is a problem that the waveforms will be crossed whenthe coefficient getting higher It is the limit of our method

and we will research it in future work The foam effects aredifferent in the crest and trough of waves In our methodfoam at the crest moves forward and foam at the troughmoves backward So we can simulate the huge amount ofbubbles fast Table 1 lists the performance values of differentexamples Since the model is geometric and the renderingis implemented with shader language our method makesit possible to simulate a large-scale coastal water scene at astable frame rate of 60 frames per second

The comparison with the referencesrsquo methods is shown inTable 2 Ojedarsquos method [4] is based on physics It can handlearbitrary underlying terrain and interact with dynamic rigidbodies They compute the water model both on CPU and onGPU but only the result on GPU can meet the requirementof real-time performance Another problem of our methodis that it can only get the simulation of small-scale shallow-water Luorsquos method [12] used a Bezier curve so it is based ongeometry They can get a nice real-time middle-scale coastalwater after GPU accelerating However they need to design acoastline before rendering Once the rendering is begun thecoastline cannot be changed As our method can get a highframe rate we will not need a GPU based computation of

Mathematical Problems in Engineering 7

Combine waterbody color and reflected color

vec4 water color = mix(body color reflected color fresnel)

vec4 final color = water color

float depth = texture2D(

DeepMap vec2(pos localx (pos localy))2560 )r 300 - 150

Crest Foam

float alphaFactor = texture2D(

FoamMap pos localxy640 + g PerlinMovement 20)r

float foamFactor = alphaFactor clamp(pos localz 20 - 01 00 10)

final color = vec4(final colorxyz (3000 - pos localx) 3000 )

final color = mix(final color vec4(10 10 10 10) foamFactor)

Trough Foam

alphaFactor = texture2D(

FoamMap vec2(pos localx320 pos localy320)

+ g PerlinMovement 20)r

float foamFactor0 = alphaFactor clamp( (depth + 30) 50 00 10)

alphaFactor = texture2D(

FoamMap pos localxy640 - g PerlinMovement 30)r

float foamFactor1 = alphaFactor clamp( -06 - pos localz 00 10)

clamp( (depth + 200) 150 00 10)

final color = mix(final color vec4(10 10 10 10) foamFactor0)

final color = mix(final color vec4(10 10 10 10) foamFactor1)

Fog

float fogFactor = computeFogFactor( g FogDensity gl FogFragCoord )

water color = final color

Sun spots

float cos spec = clamp(dot(reflect vec g SunDir) 00 10)

float sun spot = pow(cos spec g Shineness)

water colorxyz += g SunColor sun spot

gl FragColor = water color

Box 1 The implementation detail

Table 1 Timing per frame for various examples in millisecond

Grid size Computation grid size Model Rendering Total

51221282 656 506 12062562 2167 1310 36855122 11589 1856 13458

102421282 658 533 13832562 2236 1407 38025122 11623 2199 13869

Table 2 A comparison of the difference between Luorsquos method Ojedarsquos method and our method

Ojedarsquos method Luorsquos method Our methodComputation platform CPU GPU GPU CPUComputation grid size 1282 1282 2502 1282

Water scale Small Small Middle LargeAveraged timing per frame 41088ms 528ms 1667ms 1206ms

the water model We can also handle any underlying terrainsince the model is computed in real-time Furthermore wealso consider the deep water when the depth is getting largerIt can also help to make the coastal scene more real

One drawback of ourmethod is that the rendering resultslack higher details The geometric based model is not thesame as the physically based model and it cannot simulatethe higher details such as splash and breaking damThe other

8 Mathematical Problems in Engineering

(a) 120578 = 10 (b) 120578 = 10

(c) 120578 = 12 (d) 120578 = 12

Figure 7 The rendering result of coastal water scene with different thin coefficients

problem is that thewaveformwill become crossed if we donotlimit the thin coefficient However our method offers a highrendering speed even on an ordinary graphic hardware Thiscan allow more consumer-level computers to run the coastalwater simulation

6 Conclusions

In this paper we present an automatic optimization approachfor the rendering of large-scale real-time coastal water Ahybrid coastal watermodel is estimated for large-scale coastalwater according to the depth of water The deep water isalso considered in our hybrid coastal water Unnecessary gridcells are simplified by our automatic simplification algorithmFinally we implement our method on GPU by using shaderlanguageThe reflection and foam effect are also added to thewater surface to enhance the final rendering result

There are several ways to further improve the visualappearance of the coastal water The extraordinary detailedeffects like waterfall breaking dam and splashes are neededto be complex modeled by using particles systems Theinteraction with rigid bodies is also a challenging work in thefuture

Competing Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] T Kellomaki ldquoWater simulationmethods for games a compari-sonrdquo inProceedings of the 16th International AcademicMindTrekConference (MindTrek rsquo12) pp 10ndash14 Tampere Finland Octo-ber 2012

[2] D P Playne K A Hawick and M G B Johnson ldquoSimulatingand Benchmarking the shallow-water fluid dynamical equa-tions on multiple graphical processing unitsrdquo in Proceedingsof the 12th Australasian Symposium on Parallel and DistributedComputing (AusPDC rsquo14) vol 152 pp 29ndash35 Auckland NewZealand January 2014

[3] N Chentanez and M Muller ldquoReal-time eulerian water simu-lation using a restricted tall cell gridrdquo in Proceedings of the ACMTransactions on Graphics pp 821ndash8210 New York NY USA2011

[4] J Ojeda and A Susin ldquoHybrid particle Lattice Boltzmannshallowwater for interactive fluid simulationsrdquo inProceedings ofthe 8th International Conference on Computer Graphics Theoryand Applications (GRAPP rsquo13) pp 217ndash226 Barcelona Spain2013

Mathematical Problems in Engineering 9

[5] J Ojeda and A Susin ldquoReal-time rendering of enhanced shal-low water fluid simulationsrdquo httpwwwpaginesma1upcedusimtonifileshybrid lbmsw rend newpdf

[6] I Abbasov ldquoThree-dimensional simulation the runup of non-linear surface gravity waves on shallow coastrdquo InternationalJournal of Pure and Applied Mathematics vol 93 no 1 pp 135ndash145 2014

[7] E Darles B Crespin and D Ghazanfarpour ldquoA particle-basedmethod for large-scale breakingwaves simulationrdquo inComputerVision and Graphics pp 316ndash323 Springer Berlin Germany2010

[8] M Chladek and R Durikovic ldquoParticle-based shallow watersimulation for irregular and sparse simulation domainsrdquo Com-puters amp Graphics vol 53 pp 170ndash176 2015

[9] T Kellomaki ldquoRigid body interaction for large-scale real-timewater simulationrdquo International Journal of Computer GamesTechnology vol 2014 Article ID 580154 12 pages 2014

[10] A Fournier andW T Reeves ldquoA simple model of ocean wavesrdquoACM Siggraph Computer Graphics vol 20 no 4 pp 75ndash841986

[11] D S De Lima H Braun and S R Musse ldquoA model for realtime ocean breaking waves animationrdquo in Proceedings of the9th Brazilian Symposium on Games and Digital Entertainment(SBGames rsquo10) pp 19ndash24 Florianopolis Brazil November 2010

[12] M Luo G Gong and A El Kamel ldquoGPU-based real-time vir-tual reality modeling and simulation of seashorerdquo in Advancesin Robotics and Virtual Reality vol 26 of Intelligent SystemsReference Library pp 307ndash332 Springer Berlin Germany 2012

[13] N Chentanez and M Muller ldquoReal-time simulation of largebodies of water with small scale detailsrdquo in Proceedings ofthe ACM SIGGRAPHEurographics Symposium on ComputerAnimation pp 197ndash206 Madrid Spain July 2010

[14] S Longo M Petti and I J Losada ldquoTurbulence in the swashand surf zones a reviewrdquo Coastal Engineering vol 45 no 3-4pp 129ndash147 2002

[15] K Fang Z Liu and Z Zou ldquoModelling coastal water wavesusing a depth-integrated non-hydrostatic model with shock-capturing abilityrdquo Journal of Hydraulic Research vol 53 no 1pp 119ndash133 2015

[16] E Bruneton F Neyret and N Holzschuch ldquoRealminustime realisticocean lighting using seamless transitions from geometry toBRDFrdquo in Computer Graphics Forum pp 487ndash496 2010

[17] Y Yin H-X Ren and X-W Liu ldquoReal-time wave simula-tion based on wave spectrum used in marine simulatorrdquo inProceedings of the Asia Simulation Conference-7th InternationalConference on System Simulation and Scientific Computing(ICSC rsquo08) pp 225ndash229 October 2008

[18] Y Li Y Jin Y Yin and H Shen ldquoSimulation of shallow-waterwaves in coastal region for marine simulatorrdquo in Proceedings ofthe 7th ACM SIGGRAPH International Conference on Virtual-Reality Continuum and Its Applications in Industry (VRCAI rsquo08)p 15 December 2008

[19] C Li D Pickup T Saunders et al ldquoWater surface modelingfrom a single viewpoint videordquo IEEE Transactions on Visualiza-tion and Computer Graphics vol 19 no 7 pp 1242ndash1251 2013

[20] S Wang F Kang and D Wang ldquoOcean wave real-timesimulation based on adaptive fusionrdquo in Proceedings of the 32ndChinese Control Conference (CCC rsquo13) pp 8557ndash8560 IEEEXirsquoan China July 2013

[21] S Wang F Kang and J Xu ldquoModeling and visualization ofcurved waves near seashorerdquo Journal of System Simulation vol26 no 10 pp 2395ndash2399 2014

[22] Y Yin Y-C Jin and H-X Ren ldquoWave simulation of visualsystem in marine simulator based on wave spectrumsrdquo in Pro-ceedings of the International Conference on Marine Simulation

and Ship Maneuverability (MARSIM rsquo03) Kanazawa JapanAugust 2003

[23] D Hinsinger F Neyret and M-P Cani ldquoInteractive ani-mation of ocean wavesrdquo in Proceedings of the 2002 ACMSIGGRAPHEurographics Symposium on Computer Animationpp 161ndash166 San Antonio Tex USA July 2002

[24] X Cui J Yi-Cheng and L Xiu-Wen ldquoReal-time ocean wavein multi-channel marine simulatorrdquo in Proceedings of the ACMSIGGRAPH International Conference on Virtual Reality Contin-uum and its Applications in Industry (VRCAI rsquo04) pp 332ndash335June 2004

[25] C Johanson and C Lejdfors Real-time water rendering [MSthesis in computer graphics] Lund University Lund Sweden2004

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

6 Mathematical Problems in Engineering

Eye

CoastCoastal water

Coastline

(a) (b)

Figure 5 The improved grid (a) and the rendering result (b)

Figure 6 The reflection and foam effects

and crest of the waves during wave run-up and run-down[14] So we applied two differentmethods to achieve the effectof foamWe load a transparent foam texture and simulate thedynamic foam effect by controlling the offset speed of texturewith texture mapping technologyThe implementation detailand rendering result are shown in Box 1 and Figure 6

colorfinal = density lowast colorfinal + (1 minus density)lowast colorfoam (16)

5 Results and Discussion

To evaluate our method we have created several typicalcoastal water scenes on a 266GHzCore i7 andNVIDIAGTX560 The hybrid water model is computed on CPU and therendering is implemented on GPU The results are shown inFigure 7 In Figures 7(a) and 7(b) the thin coefficient is 10while its value is 12 in Figures 7(c) and 7(d) Compared with10 the waveform is thinner with the coefficient of 12 Butthere is a problem that the waveforms will be crossed whenthe coefficient getting higher It is the limit of our method

and we will research it in future work The foam effects aredifferent in the crest and trough of waves In our methodfoam at the crest moves forward and foam at the troughmoves backward So we can simulate the huge amount ofbubbles fast Table 1 lists the performance values of differentexamples Since the model is geometric and the renderingis implemented with shader language our method makesit possible to simulate a large-scale coastal water scene at astable frame rate of 60 frames per second

The comparison with the referencesrsquo methods is shown inTable 2 Ojedarsquos method [4] is based on physics It can handlearbitrary underlying terrain and interact with dynamic rigidbodies They compute the water model both on CPU and onGPU but only the result on GPU can meet the requirementof real-time performance Another problem of our methodis that it can only get the simulation of small-scale shallow-water Luorsquos method [12] used a Bezier curve so it is based ongeometry They can get a nice real-time middle-scale coastalwater after GPU accelerating However they need to design acoastline before rendering Once the rendering is begun thecoastline cannot be changed As our method can get a highframe rate we will not need a GPU based computation of

Mathematical Problems in Engineering 7

Combine waterbody color and reflected color

vec4 water color = mix(body color reflected color fresnel)

vec4 final color = water color

float depth = texture2D(

DeepMap vec2(pos localx (pos localy))2560 )r 300 - 150

Crest Foam

float alphaFactor = texture2D(

FoamMap pos localxy640 + g PerlinMovement 20)r

float foamFactor = alphaFactor clamp(pos localz 20 - 01 00 10)

final color = vec4(final colorxyz (3000 - pos localx) 3000 )

final color = mix(final color vec4(10 10 10 10) foamFactor)

Trough Foam

alphaFactor = texture2D(

FoamMap vec2(pos localx320 pos localy320)

+ g PerlinMovement 20)r

float foamFactor0 = alphaFactor clamp( (depth + 30) 50 00 10)

alphaFactor = texture2D(

FoamMap pos localxy640 - g PerlinMovement 30)r

float foamFactor1 = alphaFactor clamp( -06 - pos localz 00 10)

clamp( (depth + 200) 150 00 10)

final color = mix(final color vec4(10 10 10 10) foamFactor0)

final color = mix(final color vec4(10 10 10 10) foamFactor1)

Fog

float fogFactor = computeFogFactor( g FogDensity gl FogFragCoord )

water color = final color

Sun spots

float cos spec = clamp(dot(reflect vec g SunDir) 00 10)

float sun spot = pow(cos spec g Shineness)

water colorxyz += g SunColor sun spot

gl FragColor = water color

Box 1 The implementation detail

Table 1 Timing per frame for various examples in millisecond

Grid size Computation grid size Model Rendering Total

51221282 656 506 12062562 2167 1310 36855122 11589 1856 13458

102421282 658 533 13832562 2236 1407 38025122 11623 2199 13869

Table 2 A comparison of the difference between Luorsquos method Ojedarsquos method and our method

Ojedarsquos method Luorsquos method Our methodComputation platform CPU GPU GPU CPUComputation grid size 1282 1282 2502 1282

Water scale Small Small Middle LargeAveraged timing per frame 41088ms 528ms 1667ms 1206ms

the water model We can also handle any underlying terrainsince the model is computed in real-time Furthermore wealso consider the deep water when the depth is getting largerIt can also help to make the coastal scene more real

One drawback of ourmethod is that the rendering resultslack higher details The geometric based model is not thesame as the physically based model and it cannot simulatethe higher details such as splash and breaking damThe other

8 Mathematical Problems in Engineering

(a) 120578 = 10 (b) 120578 = 10

(c) 120578 = 12 (d) 120578 = 12

Figure 7 The rendering result of coastal water scene with different thin coefficients

problem is that thewaveformwill become crossed if we donotlimit the thin coefficient However our method offers a highrendering speed even on an ordinary graphic hardware Thiscan allow more consumer-level computers to run the coastalwater simulation

6 Conclusions

In this paper we present an automatic optimization approachfor the rendering of large-scale real-time coastal water Ahybrid coastal watermodel is estimated for large-scale coastalwater according to the depth of water The deep water isalso considered in our hybrid coastal water Unnecessary gridcells are simplified by our automatic simplification algorithmFinally we implement our method on GPU by using shaderlanguageThe reflection and foam effect are also added to thewater surface to enhance the final rendering result

There are several ways to further improve the visualappearance of the coastal water The extraordinary detailedeffects like waterfall breaking dam and splashes are neededto be complex modeled by using particles systems Theinteraction with rigid bodies is also a challenging work in thefuture

Competing Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] T Kellomaki ldquoWater simulationmethods for games a compari-sonrdquo inProceedings of the 16th International AcademicMindTrekConference (MindTrek rsquo12) pp 10ndash14 Tampere Finland Octo-ber 2012

[2] D P Playne K A Hawick and M G B Johnson ldquoSimulatingand Benchmarking the shallow-water fluid dynamical equa-tions on multiple graphical processing unitsrdquo in Proceedingsof the 12th Australasian Symposium on Parallel and DistributedComputing (AusPDC rsquo14) vol 152 pp 29ndash35 Auckland NewZealand January 2014

[3] N Chentanez and M Muller ldquoReal-time eulerian water simu-lation using a restricted tall cell gridrdquo in Proceedings of the ACMTransactions on Graphics pp 821ndash8210 New York NY USA2011

[4] J Ojeda and A Susin ldquoHybrid particle Lattice Boltzmannshallowwater for interactive fluid simulationsrdquo inProceedings ofthe 8th International Conference on Computer Graphics Theoryand Applications (GRAPP rsquo13) pp 217ndash226 Barcelona Spain2013

Mathematical Problems in Engineering 9

[5] J Ojeda and A Susin ldquoReal-time rendering of enhanced shal-low water fluid simulationsrdquo httpwwwpaginesma1upcedusimtonifileshybrid lbmsw rend newpdf

[6] I Abbasov ldquoThree-dimensional simulation the runup of non-linear surface gravity waves on shallow coastrdquo InternationalJournal of Pure and Applied Mathematics vol 93 no 1 pp 135ndash145 2014

[7] E Darles B Crespin and D Ghazanfarpour ldquoA particle-basedmethod for large-scale breakingwaves simulationrdquo inComputerVision and Graphics pp 316ndash323 Springer Berlin Germany2010

[8] M Chladek and R Durikovic ldquoParticle-based shallow watersimulation for irregular and sparse simulation domainsrdquo Com-puters amp Graphics vol 53 pp 170ndash176 2015

[9] T Kellomaki ldquoRigid body interaction for large-scale real-timewater simulationrdquo International Journal of Computer GamesTechnology vol 2014 Article ID 580154 12 pages 2014

[10] A Fournier andW T Reeves ldquoA simple model of ocean wavesrdquoACM Siggraph Computer Graphics vol 20 no 4 pp 75ndash841986

[11] D S De Lima H Braun and S R Musse ldquoA model for realtime ocean breaking waves animationrdquo in Proceedings of the9th Brazilian Symposium on Games and Digital Entertainment(SBGames rsquo10) pp 19ndash24 Florianopolis Brazil November 2010

[12] M Luo G Gong and A El Kamel ldquoGPU-based real-time vir-tual reality modeling and simulation of seashorerdquo in Advancesin Robotics and Virtual Reality vol 26 of Intelligent SystemsReference Library pp 307ndash332 Springer Berlin Germany 2012

[13] N Chentanez and M Muller ldquoReal-time simulation of largebodies of water with small scale detailsrdquo in Proceedings ofthe ACM SIGGRAPHEurographics Symposium on ComputerAnimation pp 197ndash206 Madrid Spain July 2010

[14] S Longo M Petti and I J Losada ldquoTurbulence in the swashand surf zones a reviewrdquo Coastal Engineering vol 45 no 3-4pp 129ndash147 2002

[15] K Fang Z Liu and Z Zou ldquoModelling coastal water wavesusing a depth-integrated non-hydrostatic model with shock-capturing abilityrdquo Journal of Hydraulic Research vol 53 no 1pp 119ndash133 2015

[16] E Bruneton F Neyret and N Holzschuch ldquoRealminustime realisticocean lighting using seamless transitions from geometry toBRDFrdquo in Computer Graphics Forum pp 487ndash496 2010

[17] Y Yin H-X Ren and X-W Liu ldquoReal-time wave simula-tion based on wave spectrum used in marine simulatorrdquo inProceedings of the Asia Simulation Conference-7th InternationalConference on System Simulation and Scientific Computing(ICSC rsquo08) pp 225ndash229 October 2008

[18] Y Li Y Jin Y Yin and H Shen ldquoSimulation of shallow-waterwaves in coastal region for marine simulatorrdquo in Proceedings ofthe 7th ACM SIGGRAPH International Conference on Virtual-Reality Continuum and Its Applications in Industry (VRCAI rsquo08)p 15 December 2008

[19] C Li D Pickup T Saunders et al ldquoWater surface modelingfrom a single viewpoint videordquo IEEE Transactions on Visualiza-tion and Computer Graphics vol 19 no 7 pp 1242ndash1251 2013

[20] S Wang F Kang and D Wang ldquoOcean wave real-timesimulation based on adaptive fusionrdquo in Proceedings of the 32ndChinese Control Conference (CCC rsquo13) pp 8557ndash8560 IEEEXirsquoan China July 2013

[21] S Wang F Kang and J Xu ldquoModeling and visualization ofcurved waves near seashorerdquo Journal of System Simulation vol26 no 10 pp 2395ndash2399 2014

[22] Y Yin Y-C Jin and H-X Ren ldquoWave simulation of visualsystem in marine simulator based on wave spectrumsrdquo in Pro-ceedings of the International Conference on Marine Simulation

and Ship Maneuverability (MARSIM rsquo03) Kanazawa JapanAugust 2003

[23] D Hinsinger F Neyret and M-P Cani ldquoInteractive ani-mation of ocean wavesrdquo in Proceedings of the 2002 ACMSIGGRAPHEurographics Symposium on Computer Animationpp 161ndash166 San Antonio Tex USA July 2002

[24] X Cui J Yi-Cheng and L Xiu-Wen ldquoReal-time ocean wavein multi-channel marine simulatorrdquo in Proceedings of the ACMSIGGRAPH International Conference on Virtual Reality Contin-uum and its Applications in Industry (VRCAI rsquo04) pp 332ndash335June 2004

[25] C Johanson and C Lejdfors Real-time water rendering [MSthesis in computer graphics] Lund University Lund Sweden2004

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Mathematical Problems in Engineering 7

Combine waterbody color and reflected color

vec4 water color = mix(body color reflected color fresnel)

vec4 final color = water color

float depth = texture2D(

DeepMap vec2(pos localx (pos localy))2560 )r 300 - 150

Crest Foam

float alphaFactor = texture2D(

FoamMap pos localxy640 + g PerlinMovement 20)r

float foamFactor = alphaFactor clamp(pos localz 20 - 01 00 10)

final color = vec4(final colorxyz (3000 - pos localx) 3000 )

final color = mix(final color vec4(10 10 10 10) foamFactor)

Trough Foam

alphaFactor = texture2D(

FoamMap vec2(pos localx320 pos localy320)

+ g PerlinMovement 20)r

float foamFactor0 = alphaFactor clamp( (depth + 30) 50 00 10)

alphaFactor = texture2D(

FoamMap pos localxy640 - g PerlinMovement 30)r

float foamFactor1 = alphaFactor clamp( -06 - pos localz 00 10)

clamp( (depth + 200) 150 00 10)

final color = mix(final color vec4(10 10 10 10) foamFactor0)

final color = mix(final color vec4(10 10 10 10) foamFactor1)

Fog

float fogFactor = computeFogFactor( g FogDensity gl FogFragCoord )

water color = final color

Sun spots

float cos spec = clamp(dot(reflect vec g SunDir) 00 10)

float sun spot = pow(cos spec g Shineness)

water colorxyz += g SunColor sun spot

gl FragColor = water color

Box 1 The implementation detail

Table 1 Timing per frame for various examples in millisecond

Grid size Computation grid size Model Rendering Total

51221282 656 506 12062562 2167 1310 36855122 11589 1856 13458

102421282 658 533 13832562 2236 1407 38025122 11623 2199 13869

Table 2 A comparison of the difference between Luorsquos method Ojedarsquos method and our method

Ojedarsquos method Luorsquos method Our methodComputation platform CPU GPU GPU CPUComputation grid size 1282 1282 2502 1282

Water scale Small Small Middle LargeAveraged timing per frame 41088ms 528ms 1667ms 1206ms

the water model We can also handle any underlying terrainsince the model is computed in real-time Furthermore wealso consider the deep water when the depth is getting largerIt can also help to make the coastal scene more real

One drawback of ourmethod is that the rendering resultslack higher details The geometric based model is not thesame as the physically based model and it cannot simulatethe higher details such as splash and breaking damThe other

8 Mathematical Problems in Engineering

(a) 120578 = 10 (b) 120578 = 10

(c) 120578 = 12 (d) 120578 = 12

Figure 7 The rendering result of coastal water scene with different thin coefficients

problem is that thewaveformwill become crossed if we donotlimit the thin coefficient However our method offers a highrendering speed even on an ordinary graphic hardware Thiscan allow more consumer-level computers to run the coastalwater simulation

6 Conclusions

In this paper we present an automatic optimization approachfor the rendering of large-scale real-time coastal water Ahybrid coastal watermodel is estimated for large-scale coastalwater according to the depth of water The deep water isalso considered in our hybrid coastal water Unnecessary gridcells are simplified by our automatic simplification algorithmFinally we implement our method on GPU by using shaderlanguageThe reflection and foam effect are also added to thewater surface to enhance the final rendering result

There are several ways to further improve the visualappearance of the coastal water The extraordinary detailedeffects like waterfall breaking dam and splashes are neededto be complex modeled by using particles systems Theinteraction with rigid bodies is also a challenging work in thefuture

Competing Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] T Kellomaki ldquoWater simulationmethods for games a compari-sonrdquo inProceedings of the 16th International AcademicMindTrekConference (MindTrek rsquo12) pp 10ndash14 Tampere Finland Octo-ber 2012

[2] D P Playne K A Hawick and M G B Johnson ldquoSimulatingand Benchmarking the shallow-water fluid dynamical equa-tions on multiple graphical processing unitsrdquo in Proceedingsof the 12th Australasian Symposium on Parallel and DistributedComputing (AusPDC rsquo14) vol 152 pp 29ndash35 Auckland NewZealand January 2014

[3] N Chentanez and M Muller ldquoReal-time eulerian water simu-lation using a restricted tall cell gridrdquo in Proceedings of the ACMTransactions on Graphics pp 821ndash8210 New York NY USA2011

[4] J Ojeda and A Susin ldquoHybrid particle Lattice Boltzmannshallowwater for interactive fluid simulationsrdquo inProceedings ofthe 8th International Conference on Computer Graphics Theoryand Applications (GRAPP rsquo13) pp 217ndash226 Barcelona Spain2013

Mathematical Problems in Engineering 9

[5] J Ojeda and A Susin ldquoReal-time rendering of enhanced shal-low water fluid simulationsrdquo httpwwwpaginesma1upcedusimtonifileshybrid lbmsw rend newpdf

[6] I Abbasov ldquoThree-dimensional simulation the runup of non-linear surface gravity waves on shallow coastrdquo InternationalJournal of Pure and Applied Mathematics vol 93 no 1 pp 135ndash145 2014

[7] E Darles B Crespin and D Ghazanfarpour ldquoA particle-basedmethod for large-scale breakingwaves simulationrdquo inComputerVision and Graphics pp 316ndash323 Springer Berlin Germany2010

[8] M Chladek and R Durikovic ldquoParticle-based shallow watersimulation for irregular and sparse simulation domainsrdquo Com-puters amp Graphics vol 53 pp 170ndash176 2015

[9] T Kellomaki ldquoRigid body interaction for large-scale real-timewater simulationrdquo International Journal of Computer GamesTechnology vol 2014 Article ID 580154 12 pages 2014

[10] A Fournier andW T Reeves ldquoA simple model of ocean wavesrdquoACM Siggraph Computer Graphics vol 20 no 4 pp 75ndash841986

[11] D S De Lima H Braun and S R Musse ldquoA model for realtime ocean breaking waves animationrdquo in Proceedings of the9th Brazilian Symposium on Games and Digital Entertainment(SBGames rsquo10) pp 19ndash24 Florianopolis Brazil November 2010

[12] M Luo G Gong and A El Kamel ldquoGPU-based real-time vir-tual reality modeling and simulation of seashorerdquo in Advancesin Robotics and Virtual Reality vol 26 of Intelligent SystemsReference Library pp 307ndash332 Springer Berlin Germany 2012

[13] N Chentanez and M Muller ldquoReal-time simulation of largebodies of water with small scale detailsrdquo in Proceedings ofthe ACM SIGGRAPHEurographics Symposium on ComputerAnimation pp 197ndash206 Madrid Spain July 2010

[14] S Longo M Petti and I J Losada ldquoTurbulence in the swashand surf zones a reviewrdquo Coastal Engineering vol 45 no 3-4pp 129ndash147 2002

[15] K Fang Z Liu and Z Zou ldquoModelling coastal water wavesusing a depth-integrated non-hydrostatic model with shock-capturing abilityrdquo Journal of Hydraulic Research vol 53 no 1pp 119ndash133 2015

[16] E Bruneton F Neyret and N Holzschuch ldquoRealminustime realisticocean lighting using seamless transitions from geometry toBRDFrdquo in Computer Graphics Forum pp 487ndash496 2010

[17] Y Yin H-X Ren and X-W Liu ldquoReal-time wave simula-tion based on wave spectrum used in marine simulatorrdquo inProceedings of the Asia Simulation Conference-7th InternationalConference on System Simulation and Scientific Computing(ICSC rsquo08) pp 225ndash229 October 2008

[18] Y Li Y Jin Y Yin and H Shen ldquoSimulation of shallow-waterwaves in coastal region for marine simulatorrdquo in Proceedings ofthe 7th ACM SIGGRAPH International Conference on Virtual-Reality Continuum and Its Applications in Industry (VRCAI rsquo08)p 15 December 2008

[19] C Li D Pickup T Saunders et al ldquoWater surface modelingfrom a single viewpoint videordquo IEEE Transactions on Visualiza-tion and Computer Graphics vol 19 no 7 pp 1242ndash1251 2013

[20] S Wang F Kang and D Wang ldquoOcean wave real-timesimulation based on adaptive fusionrdquo in Proceedings of the 32ndChinese Control Conference (CCC rsquo13) pp 8557ndash8560 IEEEXirsquoan China July 2013

[21] S Wang F Kang and J Xu ldquoModeling and visualization ofcurved waves near seashorerdquo Journal of System Simulation vol26 no 10 pp 2395ndash2399 2014

[22] Y Yin Y-C Jin and H-X Ren ldquoWave simulation of visualsystem in marine simulator based on wave spectrumsrdquo in Pro-ceedings of the International Conference on Marine Simulation

and Ship Maneuverability (MARSIM rsquo03) Kanazawa JapanAugust 2003

[23] D Hinsinger F Neyret and M-P Cani ldquoInteractive ani-mation of ocean wavesrdquo in Proceedings of the 2002 ACMSIGGRAPHEurographics Symposium on Computer Animationpp 161ndash166 San Antonio Tex USA July 2002

[24] X Cui J Yi-Cheng and L Xiu-Wen ldquoReal-time ocean wavein multi-channel marine simulatorrdquo in Proceedings of the ACMSIGGRAPH International Conference on Virtual Reality Contin-uum and its Applications in Industry (VRCAI rsquo04) pp 332ndash335June 2004

[25] C Johanson and C Lejdfors Real-time water rendering [MSthesis in computer graphics] Lund University Lund Sweden2004

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

8 Mathematical Problems in Engineering

(a) 120578 = 10 (b) 120578 = 10

(c) 120578 = 12 (d) 120578 = 12

Figure 7 The rendering result of coastal water scene with different thin coefficients

problem is that thewaveformwill become crossed if we donotlimit the thin coefficient However our method offers a highrendering speed even on an ordinary graphic hardware Thiscan allow more consumer-level computers to run the coastalwater simulation

6 Conclusions

In this paper we present an automatic optimization approachfor the rendering of large-scale real-time coastal water Ahybrid coastal watermodel is estimated for large-scale coastalwater according to the depth of water The deep water isalso considered in our hybrid coastal water Unnecessary gridcells are simplified by our automatic simplification algorithmFinally we implement our method on GPU by using shaderlanguageThe reflection and foam effect are also added to thewater surface to enhance the final rendering result

There are several ways to further improve the visualappearance of the coastal water The extraordinary detailedeffects like waterfall breaking dam and splashes are neededto be complex modeled by using particles systems Theinteraction with rigid bodies is also a challenging work in thefuture

Competing Interests

The authors declare that there is no conflict of interestsregarding the publication of this paper

References

[1] T Kellomaki ldquoWater simulationmethods for games a compari-sonrdquo inProceedings of the 16th International AcademicMindTrekConference (MindTrek rsquo12) pp 10ndash14 Tampere Finland Octo-ber 2012

[2] D P Playne K A Hawick and M G B Johnson ldquoSimulatingand Benchmarking the shallow-water fluid dynamical equa-tions on multiple graphical processing unitsrdquo in Proceedingsof the 12th Australasian Symposium on Parallel and DistributedComputing (AusPDC rsquo14) vol 152 pp 29ndash35 Auckland NewZealand January 2014

[3] N Chentanez and M Muller ldquoReal-time eulerian water simu-lation using a restricted tall cell gridrdquo in Proceedings of the ACMTransactions on Graphics pp 821ndash8210 New York NY USA2011

[4] J Ojeda and A Susin ldquoHybrid particle Lattice Boltzmannshallowwater for interactive fluid simulationsrdquo inProceedings ofthe 8th International Conference on Computer Graphics Theoryand Applications (GRAPP rsquo13) pp 217ndash226 Barcelona Spain2013

Mathematical Problems in Engineering 9

[5] J Ojeda and A Susin ldquoReal-time rendering of enhanced shal-low water fluid simulationsrdquo httpwwwpaginesma1upcedusimtonifileshybrid lbmsw rend newpdf

[6] I Abbasov ldquoThree-dimensional simulation the runup of non-linear surface gravity waves on shallow coastrdquo InternationalJournal of Pure and Applied Mathematics vol 93 no 1 pp 135ndash145 2014

[7] E Darles B Crespin and D Ghazanfarpour ldquoA particle-basedmethod for large-scale breakingwaves simulationrdquo inComputerVision and Graphics pp 316ndash323 Springer Berlin Germany2010

[8] M Chladek and R Durikovic ldquoParticle-based shallow watersimulation for irregular and sparse simulation domainsrdquo Com-puters amp Graphics vol 53 pp 170ndash176 2015

[9] T Kellomaki ldquoRigid body interaction for large-scale real-timewater simulationrdquo International Journal of Computer GamesTechnology vol 2014 Article ID 580154 12 pages 2014

[10] A Fournier andW T Reeves ldquoA simple model of ocean wavesrdquoACM Siggraph Computer Graphics vol 20 no 4 pp 75ndash841986

[11] D S De Lima H Braun and S R Musse ldquoA model for realtime ocean breaking waves animationrdquo in Proceedings of the9th Brazilian Symposium on Games and Digital Entertainment(SBGames rsquo10) pp 19ndash24 Florianopolis Brazil November 2010

[12] M Luo G Gong and A El Kamel ldquoGPU-based real-time vir-tual reality modeling and simulation of seashorerdquo in Advancesin Robotics and Virtual Reality vol 26 of Intelligent SystemsReference Library pp 307ndash332 Springer Berlin Germany 2012

[13] N Chentanez and M Muller ldquoReal-time simulation of largebodies of water with small scale detailsrdquo in Proceedings ofthe ACM SIGGRAPHEurographics Symposium on ComputerAnimation pp 197ndash206 Madrid Spain July 2010

[14] S Longo M Petti and I J Losada ldquoTurbulence in the swashand surf zones a reviewrdquo Coastal Engineering vol 45 no 3-4pp 129ndash147 2002

[15] K Fang Z Liu and Z Zou ldquoModelling coastal water wavesusing a depth-integrated non-hydrostatic model with shock-capturing abilityrdquo Journal of Hydraulic Research vol 53 no 1pp 119ndash133 2015

[16] E Bruneton F Neyret and N Holzschuch ldquoRealminustime realisticocean lighting using seamless transitions from geometry toBRDFrdquo in Computer Graphics Forum pp 487ndash496 2010

[17] Y Yin H-X Ren and X-W Liu ldquoReal-time wave simula-tion based on wave spectrum used in marine simulatorrdquo inProceedings of the Asia Simulation Conference-7th InternationalConference on System Simulation and Scientific Computing(ICSC rsquo08) pp 225ndash229 October 2008

[18] Y Li Y Jin Y Yin and H Shen ldquoSimulation of shallow-waterwaves in coastal region for marine simulatorrdquo in Proceedings ofthe 7th ACM SIGGRAPH International Conference on Virtual-Reality Continuum and Its Applications in Industry (VRCAI rsquo08)p 15 December 2008

[19] C Li D Pickup T Saunders et al ldquoWater surface modelingfrom a single viewpoint videordquo IEEE Transactions on Visualiza-tion and Computer Graphics vol 19 no 7 pp 1242ndash1251 2013

[20] S Wang F Kang and D Wang ldquoOcean wave real-timesimulation based on adaptive fusionrdquo in Proceedings of the 32ndChinese Control Conference (CCC rsquo13) pp 8557ndash8560 IEEEXirsquoan China July 2013

[21] S Wang F Kang and J Xu ldquoModeling and visualization ofcurved waves near seashorerdquo Journal of System Simulation vol26 no 10 pp 2395ndash2399 2014

[22] Y Yin Y-C Jin and H-X Ren ldquoWave simulation of visualsystem in marine simulator based on wave spectrumsrdquo in Pro-ceedings of the International Conference on Marine Simulation

and Ship Maneuverability (MARSIM rsquo03) Kanazawa JapanAugust 2003

[23] D Hinsinger F Neyret and M-P Cani ldquoInteractive ani-mation of ocean wavesrdquo in Proceedings of the 2002 ACMSIGGRAPHEurographics Symposium on Computer Animationpp 161ndash166 San Antonio Tex USA July 2002

[24] X Cui J Yi-Cheng and L Xiu-Wen ldquoReal-time ocean wavein multi-channel marine simulatorrdquo in Proceedings of the ACMSIGGRAPH International Conference on Virtual Reality Contin-uum and its Applications in Industry (VRCAI rsquo04) pp 332ndash335June 2004

[25] C Johanson and C Lejdfors Real-time water rendering [MSthesis in computer graphics] Lund University Lund Sweden2004

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Mathematical Problems in Engineering 9

[5] J Ojeda and A Susin ldquoReal-time rendering of enhanced shal-low water fluid simulationsrdquo httpwwwpaginesma1upcedusimtonifileshybrid lbmsw rend newpdf

[6] I Abbasov ldquoThree-dimensional simulation the runup of non-linear surface gravity waves on shallow coastrdquo InternationalJournal of Pure and Applied Mathematics vol 93 no 1 pp 135ndash145 2014

[7] E Darles B Crespin and D Ghazanfarpour ldquoA particle-basedmethod for large-scale breakingwaves simulationrdquo inComputerVision and Graphics pp 316ndash323 Springer Berlin Germany2010

[8] M Chladek and R Durikovic ldquoParticle-based shallow watersimulation for irregular and sparse simulation domainsrdquo Com-puters amp Graphics vol 53 pp 170ndash176 2015

[9] T Kellomaki ldquoRigid body interaction for large-scale real-timewater simulationrdquo International Journal of Computer GamesTechnology vol 2014 Article ID 580154 12 pages 2014

[10] A Fournier andW T Reeves ldquoA simple model of ocean wavesrdquoACM Siggraph Computer Graphics vol 20 no 4 pp 75ndash841986

[11] D S De Lima H Braun and S R Musse ldquoA model for realtime ocean breaking waves animationrdquo in Proceedings of the9th Brazilian Symposium on Games and Digital Entertainment(SBGames rsquo10) pp 19ndash24 Florianopolis Brazil November 2010

[12] M Luo G Gong and A El Kamel ldquoGPU-based real-time vir-tual reality modeling and simulation of seashorerdquo in Advancesin Robotics and Virtual Reality vol 26 of Intelligent SystemsReference Library pp 307ndash332 Springer Berlin Germany 2012

[13] N Chentanez and M Muller ldquoReal-time simulation of largebodies of water with small scale detailsrdquo in Proceedings ofthe ACM SIGGRAPHEurographics Symposium on ComputerAnimation pp 197ndash206 Madrid Spain July 2010

[14] S Longo M Petti and I J Losada ldquoTurbulence in the swashand surf zones a reviewrdquo Coastal Engineering vol 45 no 3-4pp 129ndash147 2002

[15] K Fang Z Liu and Z Zou ldquoModelling coastal water wavesusing a depth-integrated non-hydrostatic model with shock-capturing abilityrdquo Journal of Hydraulic Research vol 53 no 1pp 119ndash133 2015

[16] E Bruneton F Neyret and N Holzschuch ldquoRealminustime realisticocean lighting using seamless transitions from geometry toBRDFrdquo in Computer Graphics Forum pp 487ndash496 2010

[17] Y Yin H-X Ren and X-W Liu ldquoReal-time wave simula-tion based on wave spectrum used in marine simulatorrdquo inProceedings of the Asia Simulation Conference-7th InternationalConference on System Simulation and Scientific Computing(ICSC rsquo08) pp 225ndash229 October 2008

[18] Y Li Y Jin Y Yin and H Shen ldquoSimulation of shallow-waterwaves in coastal region for marine simulatorrdquo in Proceedings ofthe 7th ACM SIGGRAPH International Conference on Virtual-Reality Continuum and Its Applications in Industry (VRCAI rsquo08)p 15 December 2008

[19] C Li D Pickup T Saunders et al ldquoWater surface modelingfrom a single viewpoint videordquo IEEE Transactions on Visualiza-tion and Computer Graphics vol 19 no 7 pp 1242ndash1251 2013

[20] S Wang F Kang and D Wang ldquoOcean wave real-timesimulation based on adaptive fusionrdquo in Proceedings of the 32ndChinese Control Conference (CCC rsquo13) pp 8557ndash8560 IEEEXirsquoan China July 2013

[21] S Wang F Kang and J Xu ldquoModeling and visualization ofcurved waves near seashorerdquo Journal of System Simulation vol26 no 10 pp 2395ndash2399 2014

[22] Y Yin Y-C Jin and H-X Ren ldquoWave simulation of visualsystem in marine simulator based on wave spectrumsrdquo in Pro-ceedings of the International Conference on Marine Simulation

and Ship Maneuverability (MARSIM rsquo03) Kanazawa JapanAugust 2003

[23] D Hinsinger F Neyret and M-P Cani ldquoInteractive ani-mation of ocean wavesrdquo in Proceedings of the 2002 ACMSIGGRAPHEurographics Symposium on Computer Animationpp 161ndash166 San Antonio Tex USA July 2002

[24] X Cui J Yi-Cheng and L Xiu-Wen ldquoReal-time ocean wavein multi-channel marine simulatorrdquo in Proceedings of the ACMSIGGRAPH International Conference on Virtual Reality Contin-uum and its Applications in Industry (VRCAI rsquo04) pp 332ndash335June 2004

[25] C Johanson and C Lejdfors Real-time water rendering [MSthesis in computer graphics] Lund University Lund Sweden2004

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of

Submit your manuscripts athttpwwwhindawicom

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical Problems in Engineering

Hindawi Publishing Corporationhttpwwwhindawicom

Differential EquationsInternational Journal of

Volume 2014

Applied MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Probability and StatisticsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

OptimizationJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

CombinatoricsHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Operations ResearchAdvances in

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Function Spaces

Abstract and Applied AnalysisHindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of Mathematics and Mathematical Sciences

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Algebra

Discrete Dynamics in Nature and Society

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Decision SciencesAdvances in

Discrete MathematicsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom

Volume 2014 Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Stochastic AnalysisInternational Journal of