Feature-Based Vector Simulation ...

image Indeks       image Finanse,       image Finanse(1),       image Filozofos,       image Fesenjan,       image Fenix,       

Odnośniki

Feature-Based Vector Simulation of Water Waves, Tworzenie gier, Resources, Water

[ Pobierz całość w formacie PDF ]
//-->Feature-Based Vector Simulation of Water WavesQizhi Yu, Fabrice Neyret, Anthony SteedTo cite this version:Qizhi Yu, Fabrice Neyret, Anthony Steed. Feature-Based Vector Simulation of WaterWaves. Computer Animation and Virtual Worlds, Wiley-Blackwell, 2011, 22 (2-3), pp.91-98.<10.1002/cav.391>. <inria-00590401>HAL Id: inria-00590401https://hal.inria.fr/inria-00590401Submitted on 3 May 2011HALis a multi-disciplinary open accessarchive for the deposit and dissemination of sci-entific research documents, whether they are pub-lished or not. The documents may come fromteaching and research institutions in France orabroad, or from public or private research centers.L’archive ouverte pluridisciplinaireHAL,estdestin´e au d´pˆt et ` la diffusion de documentsee oascientifiques de niveau recherche, publi´s ou non,e´manant des ´tablissements d’enseignement et deeerecherche fran¸ais ou ´trangers, des laboratoirescepublics ou priv´s.eFeature-Based Vector Simulation of Water WavesQizhi YuLJK/INRIA Grenoble/UCL∗Fabrice NeyretLJK/INRIA GrenobleAnthony SteedUCLAbstractWe present a method for simulating local waterwaves caused by obstacles in water streamsfor real-time graphics applications.Givena low-resolution water surface and velocityfield, our method is able to decorate the inputwater surface with high resolution detail for theanimated waves around obstacles. We constructand animate a vector representation of thewaves. It is then converted to feature-alignedmeshes for capturing the surfaces of the waves.Results demonstrate that our method has thebenefits of real-time performance and easycontrollability.The method also fits wellinto a state-of-the-art river animation system.Keywords:water waves, real-time simula-tion, procedural methods1 IntroductionRealistic animation of large bodies of water,such as rivers, lakes or oceans, is an impor-tant aspect for graphics applications where nat-ural environments are involved. Though fluidsimulation based on solving the full 3D Navier-Stokes equations has achieved great progress inrecent years, it is still too computationally ex-pensive to be directly used for the animation oflarge water volumes. In practice, it is commonto simplify the problem to simulating water sur-face waves based on height-fields.On the surfaces of water streams, one caneasily see some local wave phenomena (Fig. 1)which have quasi-regular and stationary geomet-ric structures. However, they are often missed incurrent animation applications due to technique∗This work was mainly done when the first author was aPhD student at LJK/INRIA Grenoble.difficulties. Using Computational Fluid Dynam-ics (CFD) techniques, even in 2D [1], would re-quire very high resolution discretization to cap-ture the details of the waves, which is not afford-able in real-time applications. Other obstacles touse CFD in this case include complicated phys-ical causes for these local waves, and difficultcontrol of the output waves geometries. Proce-dural wave models can avoid some of these ob-stacles, but most of existing ones are designedeither for non-local waves [2] or non-flowingwater [3] typically for ocean scenes.In this paper we choose to simulate a typ-ical local wave phenomenon which is causedby obstacles in shallow streams (Figs. 1a and1b). We approach the problem by locally addingdetailed waves to a coarse water surface pro-vided by usual simulation methods. For the lo-cal waves, we propose the use of two differentrepresentations, vectors and meshes, for simula-tion and rendering respectively. Our simulationmethod, improved from Neyret and Praizelin’salgorithm [5], usesvectorrepresentation to cap-ture the geometricfeaturesof the waves. Toachieve high-quality surface details, we pro-pose to build feature-aligned wave meshes. Wealso propose efficient ways to merge the wavemeshes with underlying support water surfaceand handle wave intersection.Results show that our method can simulate re-alistic waves caused by obstacles with very lowcomputational cost. In addition, the geometricshapes of the waves is intuitively controllable.Our method also has good compatibilities withother water wave or water flow models. We en-vision that the approach of feature-based vectorsimulation is also applicable for other local wavephenomena.(a)(b)(c)(d)(e)Figure 1:Photograph of local wave phenomena in water flow: waves caused by obstacles in shallow water and theirintersection (a, b), waves caused by underwater obstacles (c), hydraulic jump and foams (d), and boils caused by ejectionsfrom river bed [4](e). Please zoom-in for more details.2 Related workIn this section we review the water simula-tion techniques that are suitable for large bodiesof water in real-time graphics applications. Werefer readers to Bridson’s book [6] for a morecomprehensive introduction of water simulationfor computer graphics.Procedural techniques are a good choice forcases where computation resources are limited.Perlin noise [7] is a simple way to simulate ran-dom water waves. More realistic ocean wavescan be achieved by superimposing sinusoidalwaves in the spatial domain [8] or spectral do-main [2]. Also there exist methods for simu-lating local waves. Yukselet al.[3] proposea particle system to simulate water waves madeby water-object interaction. Glassner [9] sim-ulates ship waves in deep water by geometricconstruction. Neyret and Praizelin [5] proposeda procedural way to construct the geometric fea-tures of the waves caused by obstacles in shal-low streams. One of our contributions is to im-prove it for more stable and efficient animation.Another category of methods is based onCFD techniques. Water waves in shallow watercan be simulated by solving linear wave equa-tions [10] or shallow water equations [11] overa dynamic height field. Kipfer and Westermann[12] simulate river flow with Smoothed Parti-cle Hydrodynamics (SPH) method. These meth-ods can handle interaction better than the pro-cedural ones, but do not scale well. Some real-time CFD-based methods have demonstrated thewave phenomenon we target but only with lowresolution surface details [13].A promising solution for simulating largebodies of water with small scale details inreal-time is to couple several models together.Th¨ reyet al.[14] add breaking waves uponushallow water simulation. Yuet al.[15, 16] sim-ulate rivers by superimposing advected textureson procedurally generated flow. Chentanez andM¨ ler [1] also demonstrate a river animationusystem that combines the shallow water simu-lation with other wave models. However, bothof the two state-of-the-art river animation sys-tems fail to demonstrate detailed waves causedby obstacles. Our aim is to fill this gap.3 Input dataWe model the surface of a river by super-imposing local water waves upon a mean flow(Fig. 2). The mean flow provides not only a sup-port geometry for constructing wave surfaces,but also flow velocity required by our wave sim-ulation algorithm (Section 4). The compositionallows that the resolution of the large mean flowcould be much coarser than that of the localwaves we want to simulate.Wave surfaceMean water surfaceMean flowObstacleFigure 2:We model the surface of a river by superimpos-ing local wave surfaces on a mean water surface.We assume the mean flow is a steady 2.5Dflow as everyday’s river is generally calm.Therefore, it has a time-invariant horizontal ve-locity fieldvs, and a time-invariant depth fieldh.To enhance dynamic details of the flow ve-locity, we superimpose local perturbationsvpionvsand get a quasi-stationary flow as in [17]:v=vs+ivpi,(1)wherevpicould be the analytic solution of sink,source or vortex with a cutoff radius which isadvected with the steady flow velocityvs.4 Vector simulation of wavesThe purpose of vector simulation is to capturethe geometric features of the wave patterns wetarget (Figs. 1a and 1b). Our method is mostlybased on Neyret and Praizelin’s algorithm [5]with improvements for better stability and per-formance. To ease the reader’s understanding,we briefly introduce the original algorithm be-fore detailing our improvements to it.point,starting point,of a shockwave, the wavecrest should be orthogonal to local flow velocityv,i.e.,√= 0.Substituting it into Eq. 2 givesα|v|=ghat the starting point. Recall that the|v|Froude numberFr=√gh. A supercritical flow(Fr>1)past an obstacle leaves a subcriticalarea (Fr<1)in front of the obstacle. Thismeans the starting point whereFr= 1can befound at the boundary of the subcritical area.dvStarting pointcxλxαvObstacleFr<1Water flow (Fr>1)PerturbationShockwave crestParticleisoFr=14.1 Original algorithmNeyret and Praizelin’s wave model assumesthat the predominant stationary wave caused byan obstacle in a shallow stream can be approxi-mated by the shallow water theory [18, page 22],√which suggests that the wave speed|c|=gh,wheregis the gravitational acceleration andhisthe local water depth. By using an analogy be-tween the shallow water theory and compress-ible gas dynamics, the wave in consideration iscalledshockwavein the following discussion. Inaddition, the model assumes that the shockwavetriggers a series of ripples upstream of it (Fig. 3).veFigure 4:Schematic illustration of the vector simulationof shockwaves. Our improvements to [5] include: usingparticles to trace the wave crest, and efficiently finding thestarting point.Figure 3:Neyret and Praizelin’s wave model assumes thatthe waves made by an obstacle consist of a predominantshockwave and a series of ripples.Based on the above analysis, Neyret andPraizelin’s algorithm at each time step can besummarized as follows:- Identify a subcritical region upstream fromthe obstacle by constructing a contour line ofFr= 1starting form the obstacle boundary.- Find the starting point of the shockwavealong the contour line ofFr= 1.- Construct a curve, which represents theshockwave crest, passing through the startingpoint and satisfying Eq. 2.In the following sections, we improve theabove algorithm for more stable and efficient an-imation.Neyret and Praizelin achieved an algorithmfor determining the wave crest of the shockwaveby analysing its geometric properties (Fig. 4). Ina running stream, a wave can be stationary pro-vided its wave speed|c|=|v|cosα,wherevisthe local flow velocity andαis the propagationangle of the wave relative to the upstream direc-tion. Therefore, the crest of a shockwave shouldlie at an angle√gh(2)α= arccos|v|to the upstream direction. At the most upstream4.2 Updating wave starting pointsThe original algorithm has drawbacks whenupdating shockwave starting points. At eachsimulation step, it must reconstruct a new con-tour line ofFr= 1to locate the new position ofthe starting point. However, an abrupt velocityperturbation might occasionally yield discontin-uous constructions which leads to the poppingof wave crests. In addition, reconstructing thecontour line at each time step is inefficient.Considering that the water flow in our prob-lem is quasi-stationary with small perturbations,we precompute the starting point. At everyframe, we directly move the starting point toa nearby position whereFr= 1without con-structing a new contour line ofFr= 1,thus thenew scheme is more robust and efficient.For a shockwave starting pointx,we storeits initial locationxand a local steady velocitygradientdv=∇|vs(x)|.As shown in Fig. 4,at each time step we locatexat a distance ofλfromxalong the directiondv:dvx=x+λ,|dv|(3)In addition, in order to simulate the attenuationof wave energy, we associate an intensity valueto each particle. The intensity value starts from1and linearly decreases towith a user givenwave attenuation ratek.We kill a particle whenits intensity vanishes. Finally, connecting exist-ing particles with line segments gives a shock-wave crest.5 Wave surfaces generationIn this section, we present how to generatehigh-quality wave surfaces to support realisticrendering in real-time based on the vector simu-lation.to ensure|v(x)|=|c|,i.e.,F r= 1.Now ourtask is to solveλat each time step. Using linearapproximation, we estimate the stationary flowvelocity withvs(x)≈vs(x) +λdv. In ad-dition, we assume that only the nearest pertur-bationvphas a significant influence on the po-sition of the shockwave starting point. Substi-tutingvs(x)andvp(x)in Eq. 1 yieldsv(x)=dvvs(x) +λdv+vp(x+λ|dv|).Then, wecan solve|v(x)|=|c|forλby using a simpleiterative scheme.5.1 Extruding wave surfacesThe waves produced by an obstacle consist ofa dominating shockwave and a train of parasiticripples upstream of it. To construct the wave sur-face, in theory we need to simulate the crests,profiles and amplitudes of both the shockwaveand the ripples. However, what we can obtainfrom our vector simulation is only the shock-wave crest. Fortunately, one important featureof the wave pattern we target is that all the wavecrests are nearly regular and parallel. Therefore,it is reasonable to assume that the wave surfaceto be constructed is the resultant of sweeping aprofile curve along a shockwave crest (Fig. 5b).Here, the profile curve represents the superposi-tion of one shockwave and a series of ripples.With the above assumption, we can formulatethe surface definition as follows. The sweep-ing operation uses a shockwave crest as its basecurveC(u).LetT, B, Nbe a local framemoving along the base curve, withTthe unittangent to the base curve,Nthe normal of themean water surface, andB=T×N.Given anormalized wave profilez(v),a wave amplitudefunctiona(u)and a wave width functionw(u),we define the parameterized wave surface as:S(u,v)=Sm(x(u,v))+a(u)·z(v)·N,(4)whereSmis the mean water surface andx(u,v)=C(u)+v·w(u)·B.If we neglect thederivative of amplitudea(u),the surface normalcan be calculated byNw(u,v)=−a ∂zB+N.w ∂v(5)4.3 Tracing wave crests with particlesThe original algorithm constructs a shock-wave crest passing through the starting point byiteratively creating short line segments satisfy-ing Eq. 2. However, this Eulerian scheme makesthe propagation of perturbations along the wavecrest complicated and unstable. Instead, we pro-pose a Lagrangian particle-based scheme, whichis more suitable for advecting physical quanti-ties.First let’s investigate the behavior of the ele-ments of a stationary wave (Fig. 4). In a run-ning stream, waves not only propagate at thewave velocitycbut also advect with the cur-rent of velocityv.Hence the resultant velocityof a wave element is the vector sum of the twovelocities:ve=v+c.As we discussed inSection 4.1, the component|v|cosαof streamvelocity at right angles to the crest cancels thecrest’s motion at the wave speed|c|.Thus wehave|ve|=|v|sinα=|v|2− |c|2, andveistangent to the wave crest.Based on the above observation, we use par-ticles to represent the wave elements. At eachtime step, we generate two new particles respec-tively at the two sides of a shockwave startingpoint and update all existing particles withve. [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • gbp.keep.pl