• No results found

Practical Animation of Turbulent Splashing Water

N/A
N/A
Protected

Academic year: 2022

Share "Practical Animation of Turbulent Splashing Water"

Copied!
10
0
0

Laster.... (Se fulltekst nå)

Fulltekst

(1)

M.-P. Cani, J. O’Brien (Editors)

Practical Animation of Turbulent Splashing Water

Janghee Kim1 Deukhyun Cha2 Byungjoon Chang2 Bonki Koo1 Insung Ihm2

1Electronics and Telecommunications Research Institute, Daejeon, Korea

2Sogang University, Seoul, Korea

Abstract

Despite recent advances influid animation, producing small-scale detail of turbulent water still remains challeng- ing. In this paper, we extend the well-accepted particle level set method in an attempt to integrate the dynamic behavior of splashing water easily into afluid animation system. Massless marker particles that still escape from the main body of water, in spite of the level set correction, are transformed into water particles to represent subcell- level features that are hard to capture with a limited grid resolution. These physical particles are then moved in the air through a particle simulation system that, combined with the level set, creates realistic turbulent splashing.

In the rendering stage, the particle’s physical properties such as mass and velocity are exploited to generate a natural appearance of water droplets and spray. In order to visualize the hybrid water, represented in both level set and water particles, we also extend a Monte Carlo ray tracer so that the particle agglomerates are smoothed, thickened, if necessary, and rendered efficiently. The effectiveness of the presented technique is demonstrated with several examples of pictures and animations.

Categories and Subject Descriptors(according to ACM CCS): I.3.5 [Computer Graphics]: Computational Geometry and Object Modeling – Physically based modeling I.3.7 [Computer Graphics]: Three-Dimensional Graphics and Realism – Animation

1. Introduction

1.1. Problem specification

As a consequence of recent research efforts into the physi- cally based animation of water-like liquids, nowadays photo- realistic water effects are routinely generated in the anima- tion production industry. Among the successful simulation techniques devised by the computer graphics community, the hybrid particle level set method, combined with an octree data structure, produces highly realistic water behavior, by adaptively solving the full three-dimensional Navier–Stokes equations [LGF04].

Despite its excellent results, however, such a method, in which water is represented on an Eulerian grid, often suf- fers from a difficulty in depicting the detailed turbulent be- havior of splashing water, involving the complicated forma- tion of water spray, wave breaking, mist, foam, and com- plex free surface motion. Using more three-dimensional grid cells would supply more convincing results for the Eulerian approach, but their number increases cubically with respect to the resolution adopted, quickly leading to impractical re- quirements for computation time and memory space. In fact,

these natural phenomena are known to be among the most poorly understoodfields influid dynamics.

In parallel with the grid-based approaches, meshless sim- ulation methods have been also developed for water anima- tion, where particles are employed to keep track of the free surface and to solve the underlying partial differential equa- tions. Recently introduced particle-based techniques have shown that these Lagrangian approaches offer a computa- tionally simple and versatile simulation scheme, although reconstructing a natural-looking smooth surface from sim- ulated particles is often difficult.

Particles are an excellent means of producing the dynamic and fuzzy effects of natural phenomena when conventional modeling techniques do not work. They are well suited to producing the small-scale detail of turbulent splashing water that is hard to capture with an Eulerian grid of limited res- olution. The primary goal of this work is to combine both grid-based and particle-based simulation techniques to in- tegrate easily the automatic production of turbulent water effects into afluid animation system. In particular, we ex- tend the well-accepted particle level set method in an attempt to complement the grid-based method, which suffers from a

(2)

difficulty in representing subcell-level features such as tiny droplets and spray. We demonstrate that combining both the Eulerian and the Lagrangian techniques greatly improves the visual reality of splashing effects in turbulent water.

1.2. Previous work

In computer animation, the work of Foster and Metaxas [FM96] is probably the first that attempted to solve the full three-dimensional equations to produce realistic water effects. After some years, Foster and Fedkiw [FF01] improved the water simulation scheme significantly by adopting a semi-Lagrangian integration scheme (which was introduced to the graphics community by Stam [Sta99]) to solve stably for liquid motion. In modeling the water surface, they employed a hybrid front tracking model, combining a dynamic level set and massless marker particles, where the particles are used to reconstruct the level set surface in regions that are poorly resolved.

Enright et al. [EMF02,ELF05] presented an enhanced hybrid front-tracking method, called the particle level set method, which exhibits significantly more realistic behavior for a complex water surface. Combined with an octree-based adaptive computation model [LGF04], this water simulation technique is able to generate very impressive water anima- tion, capturingfine-scale features of the water surface.

In parallel with these efforts, the incompressible Navier–

Stokes equations were also solved for water animation us- ing a variety of extensions and modifications: Hong and Kim [HK03] introduced a volume-of-fluids algorithm for building a multiphasefluid simulator that handles both wa- ter and air, mainly focusing on buoyancy and surface ten- sion in their animation of bubbles. A moving grid window- ing method was proposed by Rasmussen et al. [REN04] to track only the visually interesting portion of a liquid anima- tion. Song et al. [SSK05] also attempted to suppress dissi- pation, arising from the semi-Lagrangian method, by adopt- ing Constrained Interpolation Profile (CIP)-based advection, and converting potentially dissipative cells into droplets or bubbles. Recently, Hong and Kim [HK05] proposed a nu- merical technique that effectively handles the discontinuities in physical properties at interfaces between differentfluids.

Along with these grid-based methods, many different particle-based techniques from thefield of Computational Fluid Dynamics (CFD) have been also adapted for liq- uid animation. A particle-basedfluid simulation was intro- duced to the graphics community by Stam and Fium [SF95], where a set of “fuzzy” particles were used to solve diffu- sion equations, in the hope of reducing the severe mem- ory overheads for the grid-based method. Desbrun and Gas- cuel [DG96] applied the Smoothed Particle Hydrodynam- ics (SPH) method [Luc77,GM77] to the animation of vis- cousfluids with a wide range of stiffness and viscosity.

Recently, the SPH technique was applied by M¨uller et al. [MCG03], focusing on the interactive simulation of wa- ter. In subsequent work, M¨uller et al. [MSKG05] extended the SPH-based simulation model to considerfluid–fluid in-

teraction, enabling it to handle such phenomena as mul- tiplefluids, trapped air, and phase transition. Premoˇze et al. [PTB03] simulated water, using the Moving-Particle Semi-Implicit (MPS) method [KTO95]. This alleviates the difficulty of enforcing the incompressibility condition, aris- ing from the SPH technique. Zhu and Bridson [ZB05] also presented a particle simulation system appropriate for ani- mating sand and water, based on two hybridfluid simulation methods called Particle-In-Cell (PIC) [Har64] and Fluid- Implicit-Particle (FLIP) [BR86]. In animating viscoelastic fluids, Clavet et al. [CBP05] exploited particles whose po- sitions were updated using a method called double density relaxation, to enforce incompressibility and particle anti- clustering.

In addition to the works cited above, Lagrangian particles have also been used, often complementing the grid-based approaches, with the aim of modelingfine details of water that are difficult to create with the underlying grid resolu- tion. Sims [Sim90] and O’Brien and Hodgins [OH95] used a particle system to model water droplets and splashes, in which simple dynamics equations were applied to model particles falling under gravity, without considering interac- tion between them. Foster and Fedkiw [FF01] directly ren- dered the particles that are escaped despite the level set cor- rection in regions of high curvature, treating them as small water drops. Takahashi et al. [TFK03] combined a parti- cle system with a CIP-basedfluid system that solves the full Navier–Stokes equations, where particles intending to repre- sent splashes and foams were created in a high-curvature wa- ter surface, and advected independently under the influence of velocityfields, obtained through a volume-of-fluid tech- nique and/or gravity. Greenwood and House [GH04] gener- ated the visual effect of bubbles, based on the method of En- right et al. [EMF02], by creating them whenever air marker particles moved too far across thefluid’s interface, and be- came trapped inside the fluid. On the other hand, Guen- delman et al. [GSLF05] rendered the negative particles, re- moved from their particle level set system, to depict splash and spray. Selle et al. [SRF05] generated turbulent water ef- fects by seeding vorticity-carrying particles in theflows to overcome the weakness of the semi-Lagrangian scheme.

1.3. Our contribution

In this paper, we present a practical animation technique that easily generates a natural appearance of turbulent splashes in a particle-level-set-based liquid animation system. In devel- oping our scheme, we aim to minimize the extra cost induced by the extension. For this, the massless marker particles that still escape from the main body of water, despite the error correction, are used as seeds to produce the subcell-level de- tail. In contrast to previous works that also exploit the stray particles [FF01,GH04,GSLF05] or the particles generated in high-curvatured regions [TFK03], for generating droplets and bubbles, our technique attempts to estimate the volume loss quantitatively and distributes it to water particles. These physical particles are then moved in the air by an advanced particle simulation system that, combined with the dynamic level set, creates realistic behavior for a turbulent splash. We

(3)

show that their physical properties, such as mass and veloc- ity, may be used effectively to generate the natural appear- ance of the tiny water agglomerates and spray that are in- duced by the turbulent movement of water.

We also present rendering techniques suitable for taking a close-up view of merging water drops with minimized aliases. These smoothing and thickening methods, easily in- tegrated into a Monte Carlo ray tracer, enable an animator to control the small-scale rendering effects for creating turbu- lent splashes. Our experiments with several example scenes demonstrates that the interesting subcell-level features of splashing water may be added to the level-set-based simu- lation system at a very small additional cost, and that the presented visualization techniques easily create realistic vi- sual effects.

2. Modeling of water particles

2.1. Identification of underresolved regions

The presented hybrid simulation system is built with a level set simulator that represents the main body of splashing wa- ter, and a particle simulator that depicts its small-scale de- tail. For the level set evolution, we use the particle level set method, withφ0 representing water andφ>0 designat- ing air. Combined with an octree data structure, the level set simulator creates very detailed surfaces of dynamically evolving water, although it is not easy to generate splashing effects such as tiny droplets, spray, and mist.

The primary idea of the hybrid particle level set method is to rebuild the level set in underresolved regions using massless marker particles. Its effectiveness has been demon- strated in a variety of liquid animation systems. However, it sometimes fails to recover subcell-level features, which often occurs when water undergoes turbulent motion. Fig-

p p p p

p p p

p

p p

n n n n

p p

(a) Before correction

p

p p p

p p

p

p p p

n

n n

n n n

(b) After correction Figure 1:Marker particles that are still missing after the error correction process. The circled characters indicate the sign of the level set function at grid points. The particle level set method rebuilds the interface (green curve), exploit- ing the error information provided by the escaped negative maker particles (blue circles). This hybrid technique offers quite an effective interface-capturing scheme. However, it still suffers from the difficulty of reconstructing subcell-level features.

ure1illustrates such a case of small-scale detail being lost.

In (a), the escaped negative marker particles (blue circles) are shown with the water interface (green curve) that has been evolved with a level set method only. Through the er- ror correction process of the particle level set method, the interface is forced to move upwards, reducing its local vol- ume loss as shown in (b). Unfortunately, there still remain escaped negative particles near the sharp corner, even after the correction stage. This phenomenon is due to the fact that the stretching part is too tiny to be resolved with the current grid resolution.

In the original particle level set method [EFFM02], the missing marker particles are kept alive in the subsequent simulation, in the hope that they agglomerate and contribute to the level set in the future. In fact, the missing particles pro- vide an excellent clue to the generation of various rendering effects for splashing water. Rather than wait until they reap- pear in the level set, we explicitly transform thesemarker particles intophysicalparticles to model small-scale detail that the given Eulerian grid fails to represent.

2.2. Generation of water particles

In the work of Song et al. [SSK05], a smeared Heaviside function was applied to potentially dissipative cells in or- der to detect small isolated regions, and to convert them into droplets or bubbles with an estimated volume. Thisfirst- order approximation tool may be an effective means of gen- erating visually pleasing effects in cases where there is no information other than level set values to imply any subcell- level features.

On the other hand, the particle level set method offers more information that helps correct poorly resolved regions of theflow. The maker particles that move with a higher- order accuracy enables the extraction of more characteristic information about the dissipating water. Recall that the pur- pose of using marker particles in the particle level set method is to improve interface capturing, not to represent a specific volume of water. A side effect of the marker particles is that their agglomerates, formed by overlapping escaped negative particles, offer a good indication of the volume and shape of the water lump that still dissipates despite the error correc- tion process.

In order to exploit fully the information provided by the particle level set method, we utilize the lost particles to treat subcell-level details. In our implementation, a negative par- ticle is defined as escaped when it crosses the corrected in- terface by more than its radius. Then the volume that is lost in a cell is approximated by a Monte Carlo integration tech- nique. For every cell that contains at least one escaped parti- cle, a series of random three-dimensional points are repeat- edly generated within the cell, checking if they fall in any of the escaped marker particles. The ratio of inner points, mul- tiplied by the cell’s volume, then gives a good approximation to the actual minute volume of disappearing water.

Once the volume loss in a cell is estimated, the escaped maker particles are transformed into physical water particles

(4)

(unit: %) (0.0, 1.0] (1.0, 2.0] (2.0, 3.0] (3.0, 4.0] (4.0, 5.0] (5.0, 6.0] (6.0, )

Scene 1 61.8 18.7 9.0 4.5 2.6 1.4 2.0

Scene 3 56.3 21.6 10.0 4.8 2.8 1.6 2.9

Table 1:Average ratios of volume loss in a cell. A simple Monte Carlo integration method was applied to the estimation of volume loss that arises despite the error correction of the particle level set method. Two animation scenes, displayed in Figure4(a) and (c), were tested, where the ratios for the cells containing at least one escaped marker particle were averaged over thefirst 600 simulation frames. Here, the value in column(a,b]represents the ratio of volume-losing cells whose volume loss ratio falls in the interval(a%,b%]. As shown in the table, most volume-losing cells lose less than 3% of volume. The statistics, in fact, reveal that the particle level set method traces the error-prone level set very well, while the small amount of volume loss may be exploited for depicting the small-scale detail of splashing water, complementing the grid-based method.

in such a way that the estimated volume is distributed to the water particles. Assume that there existnpescaped marker particles in the cell whose cluster takes up volumeV inside it. Each water particle inherits the position and velocity from the corresponding marker particle. Then its radius is initially set to the average radiusrave=3

4πn3Vp. To make a more nat- ural rendering effect, it is also possible to distribute the ini- tial radii according to, for example, a Gaussian distribution, so that the total sum becomesV. Once the radius of each particle is determined, by either method, the water particles are examined to see if any two particles overlap excessively, incurring a noticeable error in volume reconstruction. If this occurs, they are merged into a single particle with a radius rnew=3

r31+r23, wherer1andr2are the radii of the overlap- ping particles. Once generated, the water particles are added into the particle simulation system, and then undergo La- grangian motions until they are absorbed back into the main body of water or leave the scene.

Table1shows a typical distribution of estimated ratios of the volume loss that occurs after the error correction stage. In this experiment, we sampled 2048 times per volume-losing cell for a precise approximation, while our experience indi- cates that 256 samplings per cell are usually enough to ob- tain reliable volume-loss estimates. Note that the additional overhead caused by the integration process is not severe be- cause it is carried out only in those cells that contain an es- caped marker particle. As revealed in the statistics, the ratios are usually quite low. In fact, this experimental result demon- strates that the particle level set method performs very well in rebuilding the level set in underresolved regions. On the other hand, the small amount of volume loss explains the induced errors when an Eulerian grid of limited resolution is used. By representing the lost volume (even though very small) as water particles, we are enabling the effective gen- eration of detailed splashing effects whose depiction is diffi- cult with grid-based simulation methods.

2.3. Advection of water particles

In order to produce visually convincing splashing effects, it is important to implement an appropriate simulator for ad- vecting water particles. In the computationalfluid dynamics community, several meshfree particle methods or particle-

like methods have been developed and extended in order to have a range of mixed features. Among them, the SPH method and its variants are widely used for discrete parti- cle systems. Although they work well in general, our pre- liminary implementation indicates that the water particles tend to scatter excessively when animating turbulent water.

We assume that this phenomenon arises from the difficulty in enforcing the incompressibility constraint, especially for nonuniformly distributed particles.

While such extensions as the MPS method, already ap- plied in the computer graphics community [PTB03], may possibly be exploited, we find that combining the PIC [Har64] and FLIP [BR86] methods, both recently introduced to the graphics community by Zhu and Bridson [ZB05], leads to an effective implementation that easily produces vi- sually pleasing behavior for turbulent splashes. One advan- tage of this hybrid implementation is that it is possible to tune the viscosity of splashes, which permits control of the smoothness of surfaces. As in [ZB05], we use a weighted average of PIC and FLIP when particle velocities are up- dated after the nonadvection steps. On the other hand, when the particle velocities are transferred to an auxiliary Eule- rian grid, we extend the standard trilinear interpolation so that the particle’s mass is also reflected as a weighting fac- tor. Since the mass is distributed nonuniformly to particles in our scheme, this modification will reflect the influence of the water particles more precisely.

In coding the hybrid particle system, we usually set the resolution of the auxiliary grid to the same effective resolu- tion as the grid used in the adaptive level set computation, although they do not have to align. Note that this secondary grid is dynamically allocated only in the regions where the water particles exist. Since they usually take up only a small portion of the computational domain, a simple memory man- agement technique enables efficient implementation without a great increase in memory requirements.

2.4. Interaction of water particles with level set surface and objects

The interaction of water particles with themselves is re- flected in two ways. First, any two particles overlapping too much are merged into a single particle in the water particle generation step. Secondly, the masses and velocities of water

(5)

Figure 2:Impact of falling droplets on water surface. The individual masses of the particles are minuscule. However, their impact accumulates as the droplets continue to hit the surface, causing noticeable ripples.

particles are used in the PIC/FLIP-based particle simulator, that causes the particles to interact to each other.

On the other hand, their interaction with the main body of water and objects must be carefully coded into the simu- lation system. When a water particle hits the level set inter- face during its advection, it becomes absorbed into the main body of water. As the returning water particle has mass, the velocityfield of the Eulerian grid representing the level set is affected near the hit point. Letmp and vp be the mass and velocity of the particle, respectively, at the moment of collision. Letmi jkandvi jk denote the corresponding quan- tities for the surface cell hit by the particle. Then, according to the law of momentum conservation, the new velocity of the cell isvnewi jk = mp·vp+mi jk·vi jk

mp+mi jk . As the density is constant, this can be expressed as vnewi jk = Vp·vp+Vi jk·vi jk

Vp+Vi jk in terms of volume quantities, where the volumesVpandVi jkcan be ap- proximated by using the particle’s radius, and the technique described in Subsection2.2, respectively (see Figure2for the particle-level set interaction).

In addition to the velocity, the volume of the cell needs be updated properly. To achieve this, level set values in the neighboring cells need to be updated, by solving the inverse problem to that of computing of the volume of particles that depart from the main body. This is not a cheap computation because it entails the adjustment of marker particles to the new interface as well as the modification of level set values.

In [SSK05], the inverse

h g

a

g

b

Figure 3:Approximation of volume increase

smeared Heaviside function was applied to modify the neighboring level set values.

Another possible, simple-to- implement update method is to find the edge of grid, closest to the returning water particle, that intersects with the level set interface, and adjust the level set values at its two incident grid points (see the edge connecting ga and gb in Figure 3). Now, their level set values are to be increased byhso that the intersection point between the interface and the edge moves upward by distance h. Then the entire volume increase induced by this modification can be approximated by summing the

volumes of all incident tetrahedra, formed by the triangles of iso-surface obtained using the trilinear interpolation and the marching cube algorithm (the triangle in dashed line), and the new triangles formed as a result of moving the intersection point (the triangle in solid line). Since the volume of a tetrahedron is one-third the distance from a vertex to the opposite face, times the area of that face, it is possible to express the total volume increase in a linear expression ofh. As we know the volume of the returning water particleVp, the unknownhmay be easily computed.

Note that the actual volume of absorbed water particles is quite small compared to that of the main body of water (re- fer to Table2in Section 4). While the minute volume of re-entering particles can be added back to the main body in level set form using either of the mentioned techniques, this process may often be omitted without making a visual dif- ference in the animation results.

In addition to the main body, the water particles also in- teract with solid objects in the environment. When a par- ticle hits an object with elasticity coefficientαe, it bounces back from the surface with the velocityvnewp =−αe·vn+vt, wherevnandvtare the normal and the tangential velocities, respectively, of the particle at the moment of the collision.

By introducing random noise toαeandvt, the splashing wa- ter spatters on solid boundaries more naturally. See Figure4 for some simulation results.

3. Rendering of a close-up view of water particles Most particle rendering systems, including the classical technique presented by Sims [Sim90], draw particles point- by-point without considering their connectivity, which is usually satisfactory when they are seen from a distance.

When the splashing water is viewed closely, however, it is often desirable to reconstruct complex surfaces of tiny water drops. However, this is difficult to achieve with sphere-based particle clusters, due to problems in controlling the resulting smoothness of the extracted surfaces. Insufficient smooth- ing produces rough-looking bumps. On the other hand, too much smoothing blurs the small-scale detail that a particle- based simulation technique needs to generate. In this section, we present two useful techniques that enable an animator to control the small-scale rendering effects for creating turbu- lent splashes. Then, we also describe how to generate water spray in our ray tracer. Note that the smoothing and thicken- ing techniques are unnecessary when scenes are taken, like the examples in Figure8, from some distance. These supple- mentary rendering tools are just for reducing visual aliases that may occur when taking a very close-up view of particle clusters.

3.1. Smoothing particle clusters

Several surface reconstruction techniques for particle- related water simulations have been proposed, including those in [FF01,MCG03,PTB03,ZB05], which employ an Eulerian grid to extract a set of isosurfaces from a scalar

(6)

(a) Scene 1 (b) Scene 2 (c) Scene 3

Figure 4:Simulation results. These snapshot images are taken from three different test scenes, where both level sets and particles are displayed. The corresponding rendering images are shown in Figure8.

field defined by the particles. When particle clusters are vi- sualized in detail, it is undesirable to generate their polyg- onal models explicitly, because a memory-consuming high resolution grid must be used. Instead of adopting such an approach, we have designed a smoothing technique for tiny particle clusters that permits direct control over the smooth- ness of reconstructed water surfaces. As will be described below, our smoothing scheme, similar to the blending tech- niques of other works [Bli82,WMW86], is naturally com- bined with the level-set-based ray tracer without any need to generate intermediate isosurfaces.

Consider a set of particlespi= (xi,ri)with centerxi= (xi yi zi)t and radiusri. Given a pointx∈R3, we define a scalar functionW(x)as a weighted sum of contributions from nearby particles:W(x) =∑iWi(x). Here, Wi(x)is a smoothing kernel whose detail is provided in the Appendix.

For a pair of global parametersα(>1)andβ(0,1), it has some interesting properties. First, for a particlei, its radius of influence isα·ri. Furthermore, its spherical boundary can be extracted from the implicit equationWi(x) =β.

By summing the smoothing kernels, andfinding the iso- surface corresponding toW(x) =β, we can blend particle clusters quite easily. Figure5shows an example of cluster smoothing with differentαvalues: (a) displays an original particle cluster represented in terms of spheres. The other figures show the smoothed surfaces withα=1.5, 2.0, and 2.5, respectively. Our experiments indicate that the appear- ance of combining water droplets may be controlled byα intuitively, providing a continuous spectrum of blended sur- faces. The other parameterβmay be used as another control parameter, for afixedα, which adjusts the detail of surfaces.

However, wefind thatαis sufficient in this application of water particle smoothing.

In order to extend the level-set-based ray tracer to han- dle automatic particle cluster smoothing, we must be able to perform the ray–surface intersection calculation efficiently.

In our implementation, a ray is first intersected with the spheres of influence, that is, spheres with radii α·ri (see Figure5(e)). Then the ray is marched from the intersection pointx(0) with an initial step size, where a change in the sign ofW(x)βis tested for. This jump-and-check process is repeated with a halved step size until the smoothed sur- face is crossed. Once that happens, the marching direction is reversed. Ray marching stops when the step size falls below

(a) A particle cluster (b) Blended withα=1.5

(c) Blended withα=2.0 (d) Blended withα=2.5

x(0) x(1)

x(2) x(3) ray

spheres of influence

particles

(e) Ray–surface intersection

Figure 5:Smoothing of clusters of spheres. The smoothness of blended surfaces is effectively controlled by the kernel’s parameterα. (a) to (d) show the gradual changes made by increasingα. (e) illustrates our adaptive ray-marching al- gorithm for intersecting a ray with smoothed surfaces. By using a K-d tree structure, the intersection computation can be implemented efficiently.

a specified lower bound. If no sign change occurs when the marching isfinished, the ray does not intersect the smoothed surfaceW(x)−β=0. Note thatW(x)can be computed by storing the nonuniformly distributed particles in a K-d tree, and examining only a small number of interacting particles.

(7)

(a) Before smoothing 1 (b) After smoothing 1 (c) Before smoothing 2 (d) After smoothing 2

(e) Before thickening 1 (f) After thickening 1 (g) Before thickening 2 (h) After thickening 2 Figure 6:Examples of the smoothing and thickening effects. Figures (a) to (d) illustrate that the smoothing method successfully creates the natural appearance of merging droplets, where (b) and (d) are blended withα=2.5. The rectangle in thesefigures shows the size of the lowest level cell employed in the level set computation, indicating that the scene is zoomed-in significantly without noticeable aliases. Figures (e) to (h) demonstrate that the thickening technique enables a user to control the appearance of water agglomerates intuitively. Here, the values of dintraand dinterused for (f) and (h) are 0.035 and 0.07, respectively.

Figures6(a) to (d) demonstrate the significant differences our smoothing technique makes in rendering close-up im- ages of splashing water. The surface built with the smooth- ing kernel has a geometric continuity of 2, which is due to the fact that the base splineP[α,β](r)has three multiple roots atr=β. Notice that theG2continuity provides remarkably smoother results in surface blending than does theG1conti- nuity.

3.2. Thickening water agglomerates

The appearance of droplet agglomerates resulting from the smoothing process depends on the distribution of water par- ticles computed by the particle system. In our scheme, as ex- plained above, the escaped marker particles are transformed into water particles on a one-to-one basis. Sometimes, there are insufficient marker particles in the underresolved re- gions, entailing overall deficiencies in the distribution of wa- ter particles. A possible way of resolving this is to generate more water particles during the transform, based on a one- to-many mapping for example, but we observe that the par- ticles tend to become scattered quickly during the particle advection unless sufficient numbers of particles are used.

A more effective strategy is to view the set of water parti- cles simulated through the particle system as a skeleton, and to seed more particles between them in the rendering stage.

For this, we use two distance measuresdintraanddinterto de- cide where to add new particles. First, at every time step, the simulated water particles are partitioned so that all particles within distancedintrabelong to the same group. The idea of the partitioning is tofind regions automatically where par- ticles are poorly distributed, and therefore in need of more particles. Once grouping is complete, nearby groups are in- terconnected by inserting new particles between particles

from different groups whose distance is less thandinter. For each selected pair of particles, the number of particles to be seeded is determined from their distance and their radii, so that the new particles with linearly varying radii overlap.

Figures 6(e) to (h) show some examples of the thicken- ing technique in which the additional particles were seeded withdintra=0.035 anddinter=0.07. Our tests with several scenes show that this simple technique enables an animator to control the thickness of water agglomerates intuitively by changing the values of the distance measures appropriately.

3.3. Creating water spray

Water spray is quite useful as a rendering element that en- hances the visual realism in water animation. While parti- cles may be exploited to depict the spray effect, the number of particles required can easily become enormous. In work by Takahashi et al. [TFK03], a volume-rendering technique was applied to render water mist, where mist is sprayed by particles and diffused in the air. We also adopt the volumet- ric approach, but employ an augmented simulation model to create a natural spray and mist effect.

In our renderer, the water particles are assumed to gener- ate both external force and mist density in the air. For the simulation of spray, we use another Eulerian grid whose res- olution may usually be two or four times coarser than that for the level set simulation. At every time step, each parti- cle’s velocity is added onto grid points in its neighborhood, weighted by its distance and mass using a kernel function similar to those used in the SPH simulation [DG96,MCG03].

The accumulated velocityvaccumis then added to the exter- nal forcefin the incompressible Euler equations:

∇ ·u=0, ∂u

t =−(u· ∇)u− ∇p+ (f+vaccum).

(8)

simulation time (sec.)

PS NS LS NPT VMB VAP

3.6 15.1 327.0 220,599 1,719.3 0.0065 Table 2:Statistics on the proposed simulation method. The numbers were averaged per frame for a part of animation sequence from Scene 3 whose average number of processed water particles (NPT) were 220,599. Here, PS, NS and LS in- dicate the average times taken for updating the particle sys- tem, velocityfield and level sets, respectively. On the other hand, VMB and VAP respectively denote the volumes of the main body of water and re-entering water particles. The tim- ings were measured on an Intel Xeon 3.6 GHz CPU.

The updated force drives the velocityfielduin the air, which creates naturalflows, reflecting the movement of particles.

vaccum also determines the amount of mist to be added at each time step. In our experiments, we use a simple lin- ear functionS(vaccum)as a source term. Once generated, the mist with densitydis moved along the velocityfield using an advection–diffusion type equation:

d

t =−u· ∇dd2d+S(vaccum)−αdd, whereκdis a diffusion constant andαdis a dissipation rate.

Where previous work [TFK03] has used a particle’s den- sity as a measure of mist generation, we additionally use both velocity and mass. Using the velocity is particularly important, as it creates interesting drag forces as well as in- ducing more spray in the more turbulent regions.

4. Experimental Results

We have fully implemented the hybrid water simulation technique, and extended our photon-mapping based Monte Carlo ray tracer to generate realistic rendering effects of water droplets and spray effectively. In order to update the Eulerian velocityfield, we solved the Navier-Stokes equa- tions based on an unrestricted octree data structure as ex- plained in [LGF04]. In our implementation, the level set computation was performed on a uniform grid using the par- ticle level set method presented in [EFFM02], where afifth- order accurate Hamilton-Jacobi WENO scheme and a third- order accurate TVD Runge-Kutta scheme were applied to integrate the marker particles and the level set function for- ward in space and time, respectively, while fast, lower-order discretization methods may enhance the computational effi- ciency [ELF05]. The escaped water particles were advected using a weighted average of the PIC and FLIP methods as described in subsection2.3[ZB05].

Figure8gives examples of scenes capturing the turbulent behaviors of splashing water. The extra computational cost incurred when the particle system is integrated into the par- ticle level set method depends on the number of water par- ticles generated during the simulation. However, our experi- ments with several test scenes indicate that the particle sim-

ulation component takes only a small portion of the compu- tation time. For example, when a sequence of frames in the middle of Scene 3, whose average number of processed par- ticles per frame is 220,599, were examined (see Table2), we observed that only 1.05% of the simulation time was taken by the particle system (3.6 sec.), including the time taken for deciding the radii of newly generated water particles, while the remaining time was spent on the entire particle level set computation (15.1 sec. + 327.0 sec.), with a grid having an effective resolution of 336×144×672. While we agree that the particle level set part may possibly be implemented more efficiently, it is obvious that the extra cost spent for running the particle system is very small.

The table also reveals that the entire volume of all water particles, re-entering the main body of water, is only 0.0065 per frame, which is minuscule compared to that of the main body (1,719.3), estimated with a smeared Heaviside func- tion. In generating the example animations, we skipped the correction step that updates the level set values since the rela- tive magnitude of the lost volume per frame is just ignorable.

5. Conclusion

We have presented a hybrid water animation technique that focuses on improving the visual realism of splashing wa- ter with turbulent motion. We have shown that the minute amount of simulation error that is inevitable with a grid- based method in fact provides a valuable key to the pro- duction of complex and fuzzy phenomena, such as tiny wa- ter agglomerates and spray. The effectiveness of the pre- sented simulation and rendering methods has been demon- strated using several examples of pictures and animations.

Bubbles and foams are another set of important ingredients that greatly improve the illusion of realism for turbulent wa- ter. While we have not yet implemented bubbles into our system, they may easily be included by implementing, for instance, the work of Greenwood and House [GH04], which may be considered in parallel with this work.

Acknowledgement

This research was supported by the Ministry of Information and Communication of Korea under the IT Research Center support program.

Appendix: The cubic smoothing kernelWi(x)

Consider a cubic spline functionP[α,β](r), made of two cubic polynomials (see Figure7):

P[α,β](r) =

⎧⎪

⎪⎩

p(r) =ar3+br2+1 0≤r≤1 q(r) =(α−1)β 3−r)3 1<r≤α

0 r>α

The polynomialq(x)has three multiple roots atr=α(α>

1), and has value β (0<β<1) at r=1. On the other hand,p(x)has two degrees of freedom after satisfying two constraints p(0) =1 and p(0) =0. If we additionally re- quire the polynomials to satisfy another two constraints

(9)

p(1) =q(1)andp(1) =q(1), we obtain aC1-continuous cubic spline whose unknown coefficients are expressed as:

a=α−1 2(β1)andb= α−1 +3(β1).

Now, for a particleiwith centerxi= (xi yi zi)tand ra- dius ri, define a kernel functionWi:R3→R asWi(x) = P[α,β](|xxi|

ri ). Then the kernel has a compact support do- main such thatWi(x) =0 if and only if|x−xi| ≥α·ri. Also, it has function valueβon the particle’s spherical boundary, for any value of the radiusri. It is an important property of our kernel function that is designed to smooth particles with different radii. Furthermore, the property that the base spline has three multiple roots at the boundary of influence enables the kernel to produce aG2-continuous blended surface. In designing the smoothing function, we have not considered other conditions such as normalization, since the main pur- pose of our kernel is tofind the smoothed boundary of parti- cle clusters.

Figure 7:Base cubic kernel function P[α,β](r). For smooth- ing spheres of different radii, this base function is scaled in r to account for the radius of each particle. It is made of two cubic polynomials that meet with C1-continuity at r=1.

A quartic polynomial might have been used for p(r)to in- crease the continuity. However, it is more important to make q(r)have three multiple roots at rfor visually pleasing smoothing.

Note that the parameterαcontrols the general smoothness of blended particle clusters. On the other hand, the second parameterβdefines the isovalue for which smoothed isosur- faces are extracted during ray tracing. Because cubic splines may overshoot, it is important to set the value ofβproperly, as a function ofα, so that the resulting spline is monotonic and sigmoidal, as shown in Figure7. While it might be pos- sible to derive a monotonicity condition that gives a feasible range ofβcorresponding to a givenα, a simple sampling- and-interpolation process is sufficient for our purposes.

Finally, the surface normal of a smoothed surface can be computed using the kernel’s gradient vector, which is simply given by∇Wi(x) =P[α,β] (|xxi|

ri )(x−xiri|y−yxixiz−z| i)t.

References

[Bli82] BLINNJ.: A generalization of algebraic surface drawing.

ACM Transactions on Graphics 1, 3 (1982), 235–256.6

[BR86] BRACKBILLJ. U., RUPPELH. M.: FLIP: a method for adaptively zoned, particle-in-cell calculations offluidflows in two dimensions.Journal of Computational Physics 65, 2 (1986), 314–343.2,4

[CBP05] CLAVET S., BEAUDOIN P., POULIN P.: Particle- based viscoelasticfluid simulation. In Proceedings of ACM SIGGRAPH/Eurographics on Computer Animation 2005(2005), pp. 219–228.2

[DG96] DESBRUNM., GASCUELM.-P.: Smoothed particles: a new paradigm for animating highly deformable bodies. InPro- ceedings of the Eurographics Workshop on Computer Animation and Simulation 1996(1996), pp. 61–76.2,7

[EFFM02] ENRIGHTD., FEDKIWR., FERZIGERJ., MITCHELL I.: A hybrid particle level set method for improved interface cap- turing.Journal of Computational Physics 183, 1 (2002), 83–116.

3,8

[ELF05] ENRIGHTD., LOSASSOF., FEDKIWR.: A fast and accurate semi-Lagrangian particle levle set method. Computers and Structures 83(2005), 479–490.2,8

[EMF02] ENRIGHTD., MARSCHNERS., FEDKIWR.: Anima- tion and rendering of complex water surfaces.ACM Transactions on Graphics (ACM SIGGRAPH 2002) 21, 3 (2002), 736–744.2 [FF01] FOSTERN., FEDKIWR.: Practical animation of liquids.

InProceedings of ACM SIGGRAPH 2001(2001), pp. 23–30.2, 5

[FM96] FOSTERN., METAXASD.: Realistic animation of liq- uids.Graphical Models and Image Processing 58, 5 (1996), 471–

483.2

[GH04] GREENWOODS. T., HOUSED. H.: Better with bubbles:

enhancing the visual realism of simulatedfluid. InProceedings of ACM SIGGRAPH/Eurographics on Computer Animation 2004 (2004), pp. 287–296.2,8

[GM77] GINGOLDR. A., MONAGHANJ. J.: Smoothed parti- cle hydrodynamics: theory and application to non-spherical stars.

Monthly Notices of the Royal Astronomical Society 181, 2 (1977), 375–389.2

[GSLF05] GUENDELMANE., SELLEA., LOSASSOF., FEDKIW R.: Coupling water and smoke to thin deformable and rigid shells.ACM Transactions on Graphics (ACM SIGGRAPH 2005) 24, 3 (2005), 973–981.2

[Har64] HARLOWF. H.: The particle-in-cell computing methods forfluid dynamics.Methods in Computational Physics 3(1964), 319–343.2,4

[HK03] HONGJ., KIMC.: Animation of bubbles in liquid.Com- puter Graphics Forum (Eurographics 2003) 22, 3 (2003), 253–

262.2

[HK05] HONGJ., KIMC.: Discontinuousfluids.ACM Transac- tions on Graphics (ACM SIGGRAPH 2005) 24, 3 (2005), 915–

920.2

[KTO95] KOSHIZUKA S., TAMAKO H., OKA Y.: A particle method for incompressible viscousflow withfluid fragmentation.

Computational Fluid Dynamics Journal 4, 1 (1995), 29–46.2 [LGF04] LOSASSOF., GIBOUF., FEDKIWR.: Simulating water

and smoke with an octree data structure. ACM Transactions on Graphics (ACM SIGGRAPH 2004) 23, 3 (2004), 457–462.1,2, 8

[Luc77] LUCY L. B.: A numerical approach to the testing of thefission hypothesis.The Astronomical Journal 82, 12 (1977), 1013–1024.2

[MCG03] M ¨ULLER M., CHARYPARD., GROSS M.: Particle- basedfluid simulation for interactive applications. InProceed- ings of ACM SIGGRAPH/Eurographics Symposium on Computer Animation 2003(2003), pp. 154–372.2,5,7

[MSKG05] M ¨ULLER M., SOLENTHALER B., KEISER R., GROSSM.: Particle-basedfluid-fluid interaction. InProceed- ings of ACM SIGGRAPH/Eurographics on Computer Animation 2005(2005), pp. 237–244.2

(10)

(a) Scene 1: Pouring water in the room

(b) Scene 2: Pouring water onto the stairs

(c) Scene 3: Flood in the corridor

(d) Scene 3: Flood in the corridor - another view

Figure 8:Animation results. For the three test scenes, the effective grid resolutions employed for the level set computation were320×200×560,320×320×320and336×144×672, respectively. On the other hand, 109,842, 468,520 and 238,763 particles per frame were processed on average by the particle simulation system to produce the accompanying movies. Again, it should be emphasized that the smoothing and thickening processes are not necessary when the splashes are seen, like these examples, from a distance. These supplementary rendering tools aim to reduce visual aliases that may occur when taking a very close-up view of particle clusters like in the examples of Figure6.

[OH95] O’BRIENJ. F., HODGINSJ. K.: Dynamic simulation of splashingfluids. InProc. of Computer Animation 1995(1995), pp. 198–206.2

[PTB03] PREMOZEˇ S., TASDIZENT., BIGLERJ., LEFOHNA., WHITAKERR. T.: Particle-based simulation offluids.Computer Graphics Forum (Eurographics 2003) 22, 3 (2003), 401–410.2, 4,5

[REN04] RASMUSSEN N., ENRIGHT D., NGUYEN D., MARINOS., SUMMERN., GEIGERW., HOONS., FEDKIWR.:

Directable photorealistic liquids. InProceedings of Eurograph- ics/ACM SIGGRAPH Symposium on Computer Animation 2004 (2004), pp. 193–202.2

[SF95] STAMJ., FIUMEE.: Depictingfire and other gaseous phe- nomena using diffusion processes. InProc. of ACM SIGGRAPH 1995(1995), pp. 129–136.2

[Sim90] SIMSK.: Particle animation and rendering using data parallel computation. InProc. of ACM SIGGRAPH 1990(1990), pp. 405–413.2,5

[SRF05] SELLEA., RASMUSSENN., FEDKIWR.: A vortex par- ticle method for smoke, water and explosions.ACM Transactions on Graphics (ACM SIGGRAPH 2005) 24, 3 (2005), 910–914.2 [SSK05] SONGO., SHINH., KOH.: Stable but nondissipative

water.ACM Transactions on Graphics 24, 1 (2005), 81–97.2,3, 5

[Sta99] STAMJ.: Stablefluids. InProceedings of ACM SIG- GRAPH 1999(1999), pp. 121–128.2

[TFK03] TAKAHASHIT., FUJIIH., KUNIMATSUA., HIWADA K., SAITOT., TANAKAK., UEKIH.: Realistic animation of fluid with splash and foam. Computer Graphics Forum (EURO- GRAPHICS 2003) 22, 3 (2003), 391–400.2,7,8

[WMW86] WYVILLG., MCPHEETERSC., WYVILLB.: Data structure for soft objects.The Visual Computer 2, 4 (1986), 227–

234.6

[ZB05] ZHUY., BRIDSONR.: Animating sand as afluid. ACM Transactions on Graphics (ACM SIGGRAPH 2005) 24, 3 (2005), 965–972.2,4,5,8

Referanser

RELATERTE DOKUMENTER

The purpose of the outer boundary input data is to provide varying conditions outside the model area to get realistic effects of water exchange driven by variations in water level

He proposes modifying the Iranian heavy water research reactor IR-40, so that it uses low enriched uranium instead of natural uranium as fuel, thereby making the reactor less

The effects of ozone and water exchange rates on water quality and rainbow trout Oncorhynchus mykiss performance in replicated water recirculating systems.. Comparing the effects

To achieve this, we present a hybrid simulation method, that couples a two-dimensional shallow water simulation with a full three-dimensional free surface fluid simulation.. We

We will present the underlying data structures and their enhance- ments in the context of specific rendering algorithms such as ray shooting, photon mapping, and hidden

As a result, the dynamics of a splash de- pends on many factors – the material properties of the surface (roughness, rigidity, etc.), the properties of the falling drop (size,

A complete model naturally comprises two components: a water density model, used to generate the spatial and tempo- ral distribution of both vapor and condensate, and a photon

We compared our algorithm with other recent hardware- based volume rendering algorithms, based on the ray casting paradigm, and on a hybrid version mixing ray casting and