fast simulation and rendering techniques for fluid objects

10
EUROGRAPHICS 2001 / A. Chalmers and T.-M. Rhyne Volume 20 (2001), Number 3 (Guest Editors) ' The Eurographics Association and Blackwell Publishers 2001. Published by Blackwell Publishers, 108 Cowley Road, Oxford OX4 1JF, UK and 350 Main Street, Malden, MA 02148, USA Fast simulation and rendering techniques for fluid objects A.Kunimatsu 1 , Y.Watanabe 1 , H.Fujii 2 , T.Saito 1 , K.Hiwada 1 , T.Takahashi 2 , H.Ueki 3 1 System LSI R&D Center, TOSHIBA Corp., Japan 2 Corporate R&D Center, Toshiba Corp., Japan 3 CAE Technology Department, Toshiba CAE Systems Inc., Japan Abstract Movies with actions and light effects of fluid objects are aesthetically pleasing and interesting. Until now, the calculation costs of simulation and rendering of fluid objects have been very high. Using a modern PC system and appropriate methods, we achieved a time of 10-20 seconds per frame for this application. Our system uses a full Navier-Stokes equation solver with uniform Eulerian mesh, marching cube isosurface techniques, Catmull-Clark subdivision surface techniques, ray tracing techniques on each vertex and conventional polygon base rendering by HW accelerator. In this paper, we describe the components of our system and the reasons for choosing them. By measuring CPU times of each process for some movie scenes of fluid objects, we evaluate this system. We consider what factors are important for creating movies of fluid objects with short TAT. 1. INTRODUCTION In three-dimensional computer graphics (3DCG) animation, simulations are starting to play important roles, because, in recent years, expressions of action of 3DCG objects are becoming more important than pixel rendering. The simulations of computer graphics animation are of various types; for example, rigid body dynamics simulations[1][2], fluid dynamics simulations[3], cloth simulations, waving hair simulations. In this paper, we focused solely on fluid simulations, because we are interested in beautiful and dynamic forms of surface of active waters, and fantastic patterns of caustics generated by lights and water surfaces. Wild waves breaking, the action of a raft on a fast flowing mountain stream, the foam on a class of milk, leaves on a rippling, shimmering pool with caustics on a summer day these are the sorts of actions and light effects we wish to create in CG movies. Our ultimate goal is real-time CG such as in video games. Until now, the calculation costs of simulation and rendering of fluid objects have been very high. For example, using fluid simulation with a full Navier-Stokes equation solver and ray tracing renderer with metaballs, roughly an hour of CPU time has been required for each frame of fluid objects animation with 32x32x32 simulation mesh, on the 250MHz R10000 processor system[3]. Using a modern PC and choosing appropriate methods, we reduce the time required to about 1020 seconds. We used a 933MHz Pentium III processor with GeForce2. Our goal is to make aesthetically pleasing and interesting movies of fluids. We do not need perfect simulation. If the result seems real that is sufficient. A short turnaround time (TAT) is more important than perfect realism. We think it is important to give CG designers plenty of opportunities for trial and error in simulation, in order to facilitate the creation of aesthetically pleasing and interesting movies. We think the followings are key items for concerning the creation of movies with fluid objects. ! Short TAT ! Not perfectly realistic simulation ! Aesthetically pleasing light effect (caustics, shadow and refraction) ! Dynamic action (joining and separating) of fluids As the first step toward our goal, we developed the "Interactive Fluid Modeler". This modeler can specify the initial state of fluid and rigid objects, and can simulate fluid with interactive replacing of objects and adjusting of position of light sources and eye point. For the designer who requires short TAT, this modeler is a convenient tool. In this paper, we report on the development of an experimental system for which the simulation and rendering engine of the above modeler is used. Based on evaluation of certain items, we discuss important points concerning fluid movies with short TAT. 2. RELATED WORK 2.1 Fluid dynamics simulation To solve fluid dynamics with free surfaces in computer graphics, height fields are mainly used as practical approximations to solve the Navier-Stokes equations. Using height fields, waves of liquid such as an ocean surface are simulated[4]. However, simulation of dynamic motions of fluids, such as breaking waves, water drops falling on water surfaces, and separation and combination of free surfaces, is impossible because of the nature of height fields. As a result, the variety of fluid motions simulated by height fields is

Upload: a-kunimatsu

Post on 26-Sep-2016

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Fast simulation and rendering techniques for fluid objects

EUROGRAPHICS 2001 / A. Chalmers and T.-M. Rhyne Volume 20 (2001), Number 3 (Guest Editors)

© The Eurographics Association and Blackwell Publishers 2001. Published by Blackwell Publishers, 108 Cowley Road, Oxford OX4 1JF, UK and 350 Main Street, Malden, MA 02148, USA

Fast simulation and rendering techniques

for fluid objects

A.Kunimatsu1, Y.Watanabe1, H.Fujii2, T.Saito1, K.Hiwada1, T.Takahashi2, H.Ueki3

1 System LSI R&D Center, TOSHIBA Corp., Japan 2 Corporate R&D Center, Toshiba Corp., Japan

3 CAE Technology Department, Toshiba CAE Systems Inc., Japan

Abstract

Movies with actions and light effects of fluid objects are aesthetically pleasing and interesting. Until now, the calculation costs of simulation and rendering of fluid objects have been very high. Using a modern PC system and appropriate methods, we achieved a time of 10-20 seconds per frame for this application. Our system uses a full Navier-Stokes equation solver with uniform Eulerian mesh, marching cube isosurface techniques, Catmull-Clark subdivision surface techniques, ray tracing techniques on each vertex and conventional polygon base rendering by HW accelerator. In this paper, we describe the components of our system and the reasons for choosing them. By measuring CPU times of each process for some movie scenes of fluid objects, we evaluate this system. We consider what factors are important for creating movies of fluid objects with short TAT.

1. INTRODUCTION In three-dimensional computer graphics (3DCG) animation,

simulations are starting to play important roles, because, in recent years, expressions of action of 3DCG objects are becoming more important than pixel rendering.

The simulations of computer graphics animation are of various types; for example, rigid body dynamics simulations[1][2], fluid dynamics simulations[3], cloth simulations, waving hair simulations. In this paper, we focused solely on fluid simulations, because we are interested in beautiful and dynamic forms of surface of active waters, and fantastic patterns of caustics generated by lights and water surfaces.

Wild waves breaking, the action of a raft on a fast flowing mountain stream, the foam on a class of milk, leaves on a rippling, shimmering pool with caustics on a summer day � these are the sorts of actions and light effects we wish to create in CG movies. Our ultimate goal is real-time CG such as in video games.

Until now, the calculation costs of simulation and rendering of fluid objects have been very high. For example, using fluid simulation with a full Navier-Stokes equation solver and ray tracing renderer with metaballs, roughly an hour of CPU time has been required for each frame of fluid objects animation with 32x32x32 simulation mesh, on the 250MHz R10000 processor system[3]. Using a modern PC and choosing appropriate methods, we reduce the time required to about 10�20 seconds. We used a 933MHz Pentium III processor with GeForce2.

Our goal is to make aesthetically pleasing and interesting movies of fluids. We do not need perfect simulation. If the result seems real that is sufficient. A short turnaround time (TAT) is more important than perfect realism. We think it is important to

give CG designers plenty of opportunities for trial and error in simulation, in order to facilitate the creation of aesthetically pleasing and interesting movies. We think the followings are key items for concerning the creation of movies with fluid objects.

! Short TAT ! Not perfectly realistic simulation ! Aesthetically pleasing light effect (caustics, shadow and

refraction) ! Dynamic action (joining and separating) of fluids

As the first step toward our goal, we developed the "Interactive Fluid Modeler". This modeler can specify the initial state of fluid and rigid objects, and can simulate fluid with interactive replacing of objects and adjusting of position of light sources and eye point. For the designer who requires short TAT, this modeler is a convenient tool.

In this paper, we report on the development of an experimental system for which the simulation and rendering engine of the above modeler is used. Based on evaluation of certain items, we discuss important points concerning fluid movies with short TAT.

2. RELATED WORK 2.1 Fluid dynamics simulation

To solve fluid dynamics with free surfaces in computer graphics, height fields are mainly used as practical approximations to solve the Navier-Stokes equations. Using height fields, waves of liquid such as an ocean surface are simulated[4]. However, simulation of dynamic motions of fluids, such as breaking waves, water drops falling on water surfaces, and separation and combination of free surfaces, is impossible because of the nature of height fields. As a result, the variety of fluid motions simulated by height fields is

Page 2: Fast simulation and rendering techniques for fluid objects

Kunimatsu and Watanabe / Fast simulation and rendering techniques for fluid objects

© The Eurographics Association and Blackwell Publishers 2001.

limited. The other practical method for interactive fluid simulation is a stable fluids simulation[5]. This approach allows large time steps that are not limited by the velocity of the fluids and the mesh size. Therefore, fast simulation can be achieved. But it is difficult to apply this method to fluids with free surfaces such as water because the geometry of the surface evolves dynamically over time.

To generate the dynamic motions of fluids, a full Navier-Stokes equation solver must be considered. Thousands of books and articles have been published in various fields on how to compute the Navier-Stokes equation numerically. There are two distinct approaches to solving the equations: the Lagrangian method and the Eulerian method. The Lagrangian method has an advantage in that it moves the mesh to fit the geometry of the free surface and it can capture the interfaces easily. On the other hand, the Eulerian method describes fluid flow on the static meshes. Consequently, it is difficult to capture the interface between fluids and solids by means of the Eulerian method[6].

However, the problems that can be handled by the pure Lagrangian method are limited to those that do not involve drastic deformation, or separation and union of fluid. In the Lagrangian method, calculation points are arranged irregularly in the computational domain, and the computational load per point is heavy. Moreover, dynamic transition of mesh topology or re-meshing results in a much heavier computational load. In the Eulerian method, the calculation points can be arranged so as to achieve efficiency and accuracy (e.g. staggered mesh points).

Recently, another representation of fluid flow has been emerging, the particle method[7]. The particle method is essentially a Lagrangian method that performs dynamic re-meshing, and so it is disadvantageous.

2.2 Surface subdivision algorithm A simulation of fluids with free surfaces, which solves a full

Navier-Stokes equation, is a very time-consuming process. To obtain the fluid state after a certain time step in a reasonable simulation time for short TAT, the simulation mesh size (i.e., the number by which the simulation space is divided) has to be limited. As a result, the generated polygonal surface is too coarse for water surfaces. To solve this problem, the polygonal surface is subdivided.

Subdivision is an algorithmic technique to generate smooth surfaces as a sequence of successively refined polyhedral meshes. There are various subdivision schemes. The Catmull-Clark[11], Loop[12], and Modified Butterfly[13] subdivision surface schemes are widely known. These schemes can be distinguished in terms of whether they are approximating or interpolating schemes. The modified butterfly scheme is an interpolating scheme, and the Catmull-Clark and Loop schemes are approximating schemes.

The quality of surfaces produced by interpolating schemes is lower than that of those produced by approximating schemes, and the schemes do not converge as fast to the limit surface as the approximating schemes. To apply the Loop scheme to arbitrary polygonal meshes, the mesh must be converted to a triangular mesh, and this often leads to an inhomogeneous (asymmetric) result.

2.3 Rendering water with caustics Interaction of light rays and water surfaces produces caustics

with complex and aesthetically pleasing patterns. To calculate caustics patterns, two-pass algorithms are often used. In the first pass, distribution of the rays from the light sources is calculated. For this purpose, Arvo[14] suggested using an illumination map generated by backward ray tracing. Watt[15] developed backward beam tracing for specular polygons, where the illumination information is stored as caustics polygons. Heckbert[16] recorded the pattern of light and shadow on every diffuse surface as the radiosity textures. Shinya[17] pre-calculated illumination distribution on surfaces by using grid-pencil tracing. Jensen[18] developed the photon map where the distribution of photons that propagate flux is stored.

In the case of caustics generation at water surfaces, in the first pass, rays from the light sources are cast on the water surfaces. Rays are refracted in certain directions and the distribution information of the rays is stored. This is done in a view-independent step. Then in the second pass (rendering pass), the scene including caustics is rendered using the distribution information depending on the viewpoint. Intensity of each pixel of the screen is calculated using the distribution map of the illumination in the second pass. This calculation in former methods does not match existing rendering hardware and is time-consuming for short TAT image generation if implemented by software.

3. COMPONENTS OF THE SYSTEM For fast simulation and rendering of fluid objects, there are two

critical points: selection of suitable components/algorithms and acceleration of their speed. We briefly summarize the key components in our system.

For fast simulation ! Eulerian method and uniform mesh: for speed up ! CIP method: for low resolution of simulation space ! Surface smoothing: for low resolution of simulation mesh

# High-resolution marching cube: suitable for the CIP method

# Catmull-Clark subdivision surface: suitable for free surface of fluid

For fast rendering ! Subdivision surface: for polygon rendering ! Fast caustics generation

# Texture-based caustics: for using HW accelerator ! Full scene polygon rendering: for using HW accelerator

By using high-resolution marching cube or Catmull-Clark subdivision surface method, our system can present smooth water surface with low-resolution mesh for simulation. The low-resolution mesh accelerates simulation speed. And in polygon-based rendering, a conventional HW graphics accelerator is useful. The evaluation of our system reveals trade off among resolution of simulation mesh, surface smoothing method and quality.

This paper mainly covers these components. The details of the components are described in the following sections.

Page 3: Fast simulation and rendering techniques for fluid objects

EUROGRAPHICS 2001 / A. Chalmers and T.-M. Rhyne Volume 20 (2001), Number 3 (Guest Editors)

© The Eurographics Association and Blackwell Publishers 2001.

4. TEXTURE BASED CAUSTICS AND SHADOW REPRESENTATION

Conventional methods of generating caustics are too time-consuming for short TAT use because they are basically designed for rendering realistic images of a wide range of scenes, and in addition, because their implementations are not for hardware but for software. By restricting the application range and utilizing rendering hardware, we have derived a method suitable for short TAT use.

4.1 Basic ideas

Illuminationvolume

Water surface

Light

Q

PF

Caustics texture domainObject domain

IN

L

Icaustics

Figure 1: Caustics texture mapped on a cylinder. Distribution of

illumination volume of each water surface polygon is stored as the caustics texture.

4.1.1 Generating caustics textures Since we consider polygonal water surfaces, we use the

backward beam tracing method. For each polygon of a water surface, we construct a refracted light beam by casting rays from the light to each vertex and refracting each ray at each vertex (see Figure 1). This refracted light beam is called the illumination volume. If an illumination volume hits a diffuse object, the illumination volume lights the object with a certain intensity. In our method, this information is stored as the caustics texture for every object in the scene.

First of all, caustics texture memory is prepared for each object, and the memory is cleared to zero. For each triangle of each water surface, an illumination volume is constructed, and the illumination volume is swept throughout the entire scene, testing for intersections with diffuse objects. If an intersection occurs, the intensity is calculated and the information is added to the corresponding texels of the intersected object. The intensity

causticsI to be added is obtained by the following equation:

ISS

Icaustics2

1)( LN •= , (1)

Where I is the intensity incident upon the water triangle, N is

the normal vector associated with the plane of the water triangle, and L is the direction of the light. We assume N and L are normalized. 1S is the area of water triangle, and 2S is the area of cross section of the illumination volume and the plane which

includes the intersection point and whose normal vector is equal to that on the object of the intersection point.

In the case of parallel light such as sunlight, I and L are constant, but if the water surfaces are lit by a point light source, I and L are functions of the relationship of the vertex and the point light.

Now, we denote intersection area of the illumination volume and the diffuse object as P in the object coordinate system, and then the corresponding texture area Q is represented using projection function F as

)F(PQ = . (2)

For every texel kQ included in Q , corresponding object

coordinate kP is obtained by

)(F 1

kk QP −= , (3)

then the position and normal vector of kP in the global coordinate are obtained. By using these values, causticsI to be added to the texel kQ is determined by equation (1).

By applying the above procedure to every water surface polygon, caustics textures are generated.

4.1.2 Generating shadows The principle of generating shadows is simple. If no direct light

is cast onto a water surface polygon, we assume the polygon does not contribute to generating caustics. If a certain diffuse object is hit by no illumination volume of the polygon, the object is considered to be in shadow. To do this, equation (2) is replaced by

)F( effPQ = , (4)

where effP is the intersection area of an object and efficient

portion of the illumination volume. If a water surface triangle is completely in the shadow generated by the objects between the triangle and the light source, effP becomes empty. If there is no

object between the water triangle and the light, effP is equal to P .

4.1.3 Rendering To render a scene using caustics textures, polygon-based

rendering methods with Z-buffers are available. Since refraction occurs at the water surface, textures on the water surface must be specified as the result of the refraction effects. For this purpose, we construct a refracted view volume for each water surface polygon. This is the same idea as that of the illumination volume except that rays from the eye are refracted at the polygon vertices and generate a refracted view volume. Intersection checks of the refracted view volume and the diffuse objects are carried out, and the textures of the objects, which are hit by the view volume, are used as the textures of the water surface polygon.

Page 4: Fast simulation and rendering techniques for fluid objects

Kunimatsu and Watanabe / Fast simulation and rendering techniques for fluid objects

© The Eurographics Association and Blackwell Publishers 2001.

The color of each pixel of the water surface is calculated by the combination of the general texture and the caustics texture as follows:

}),(){,( ambientvuTvuTColor causticsobj += , (5)

where ),( vu denotes the texture coordinate, objT and causticsT

are the general texture and the caustics texture of the object, respectively. The ambient is the ambient parameter. Information on caustics and shadows is included in the caustics textures, and the resulting rendered image includes the caustics and the shadows. An example is shown in Figure 2. Note that these water surface polygons are drawn using a Z-buffer. Objects other than water surfaces are drawn by a conventional rendering method using a Z-buffer. Thus, objects under the water surfaces are not drawn directly but drawn as the texture of the water surfaces with refracted caustics and shadows.

(a) (b)

(c)

Figure 2: Rendering of the caustics (c) using the general texture (a) and the caustics texture (b). The color of each pixel is evaluated by equation (5).

4.2 Applying the basic idea to polygon-based graphics hardware

Here, we explain how to implement our method described in the previous section using conventional rendering hardware for fast rendering. There are some approximations for the implementation. Assume that the water surfaces consist of triangles, and each vertex of the triangle has its coordinate and normal vector.

4.2.1 Generating caustics textures First of all, all the refractions of the light vector at the water

polygon vertices are calculated and the results are stored. To generate caustics textures, the following procedure is carried out for each water surface triangle.

(a) (b) (c) Figure 3: Mid-point subdivision of a water surface triangle to

eliminate triangles that do not contribute to generating caustics. (a): One vertex is in shadow and the other two vertices are not in shadow. (b): Subdivision of a water surface triangle (level 1 through level 4). (c): Result of the subdivision. The dark portion of the triangle is considered not to contribute to generating caustics.

(a) (b) (c) Figure 4: Mid-point subdivision of a water surface triangle to

assign each water surface triangle to a single diffuse object. (a):Three refracted rays do not hit the same object. (b): Subdivision of a water surface triangle (level 1 through level 4). (c): Result of the subdivision. Sky blue and red portions are used to generate caustics texture of the upper box and the lower box, respectively. (1). Each vertex of the triangle is checked to determine whether the

vertex is in shadow or not by casting a ray from the vertex to the light source. If this ray intersects any object, the vertex is deemed to be in shadow. Shadow information is stored for rendering of step (5). If all three vertices of the triangle are in shadow, no other step is carried out for this triangle. If no vertex is in shadow, go to step (2). Otherwise, the triangle is subdivided, and again step (1) is carried out for each subdivided triangle. In the implementation, a triangle is subdivided as shown in Figure 3. We call this �Mid-point subdivision�. Three new vertices are generated at the mid-point of the edges, and the refracted vectors are interpolated by averaging the ones of the adjacent two vertices. In this case, if the triangle is to be subdivided beyond a certain maximum subdivision level, no further subdivision is carried out, and the triangles are regarded as being in shadow.

Page 5: Fast simulation and rendering techniques for fluid objects

EUROGRAPHICS 2001 / A. Chalmers and T.-M. Rhyne Volume 20 (2001), Number 3 (Guest Editors)

© The Eurographics Association and Blackwell Publishers 2001.

(2). Intersections of the three refracted vectors and diffuse objects are tested. If all the refracted vectors, which form the illumination volume, hit the same diffuse object, go to step (3). Otherwise, subdivide the water surface triangle in the same manner as in step (1) (see Figure 4), and then go back to step (2). Also in this subdivision, if the triangle is to be subdivided beyond a certain maximum level, no further subdivision is carried out and the triangle is ignored.

(3). Each texture coordinate of the intersected points of the object is calculated. A triangle, which is formed by the three texture coordinates, is added to the caustics texture of the object by using α blending functions of the graphic hardware. Utilizing the graphic hardware contributes to the fast generation of caustics textures. The intensity of the triangle is determined by equation (1), where 2S is approximated by the area of the triangle formed by the three intersected points.

4.2.2 Rendering First, all the refractions of the eye vector at the water polygon

vertices are calculated and the results are stored. To render the water surface triangles, the following procedure is carried out for each water surface triangle. (4). Intersections of the three refracted eye vectors and the objects in the

scene are tested. If all the three refracted eye vectors, which form a refracted view volume, hit the same object, go to step (5). Otherwise, subdivide the water surface triangle in the same manner as in step (1), and then go back to step (4). If the triangle is to be subdivided beyond a certain maximum level, no further subdivision is carried out and the triangle is ignored.

(5). Each texture coordinate of the intersected points of the object is calculated. The water surface triangle is rendered with the graphics hardware using the general texture and the caustics texture of the intersected object with the calculated texture coordinates. Here, to satisfy equation (5), both textures are used in a multi-pass way (each water triangle is rendered twice with different textures) or as multi-textures. Before rendering the water polygon, if none of the vertices of the polygon is in shadow, which has been tested in step (1), a specular component is added to the triangle.

The maximum level of the subdivision relates to the quality of the image and the speed of the image generation. There is a trade-off between quality and speed. We can change the maximum level of the subdivision interactively depending on the phase of the process of generating animation with fluids. While we simulate the scene by trial and error to determine the initial states of the simulation we can choose a small maximum level. At the final rendering phase, we can choose a large maximum level to generate the high-quality animation with water.

5. FLUID DYNAMICS SOLVER We solve 3-dimensional, time-dependent full Navier-Stokes

equations to simulate the fluids. The Eulerian approach is used to simulate the realistic motions of fluids including drastic deformations. In addition, both liquid and gas are solved, and motions of solids within the fluid are solved by a method which is based on rigid-body dynamics. Therefore, gas, liquid and solid can be handled within a single simulation system.

The problem of free surfaces of fluids is treated as a transport problem of Volume of Fluid (VOF) or a density function. When a transport equation is treated, attention must be paid to numerical diffusion. The transport problem has been solved by the donor-accepter method. The donor-acceptor method satisfies conservation laws in terms of cell-averaged quantity, because it calculates the inflow and the outflow between nearby cells.

However, since the method only has first-order precision, it is difficult to simulate the interaction between liquid and solid accurately.

Hence, we have employed the Cubic Interpolated Pseudo-particle / Propagation (CIP) method[8][9][10] as well, which has third-order precision, to treat the transport problem of VOF. The CIP method also can be applied to the non-linear transport term of Navier-Stokes equations or various kinds of transport problems with high accuracy. Moreover, since the CIP method takes into account the profile of transport quantity, it facilitates obtaining a highly accurate result with a relatively low-resolution mesh compared to other methods. This also leads to an accurate calculation of the interactions between fluids and solids for realistic motions of solids in the simulation space. However, the CIP method has a problem in that the volume of the water is not preserved, and so the volume of the water sometimes decreases as the simulation progresses.

Since the donor-acceptor method and the CIP method have their own merits/demerits, the method for the transport problem can be selected in our system depending on the problem to simulate.

For efficiency, we use a uniform mesh to describe the geometry of fluids and solids. Using a uniform mesh makes it simple to calculate a finite difference quantity so efficient calculation can be achieved. Furthermore, the Poisson solver for pressure, which is the most time-consuming procedure in fluid simulation, can be accelerated because a good convergence rate can be obtained with a uniform mesh.

6. Isosurface and subdivision surface Results of the fluid dynamics solver are given as VOF values,

which describe the ratio of the liquid in each voxel in the fluid simulation space. To visualize these values, isosurfaces are generated and transformed into polygon data. We employed a marching cubes algorithm for this purpose. The surface polygons in each voxel are generated by the relationship of eight vertices of the voxel. These polygons can be triangles, quadrilaterals or hexagons.

Furthermore, though the CIP method can simulate fluids with high accuracy with low-resolution meshes, the surfaces generated by normal resolution marching cubes are as rough as the fluid simulation resolution. Using high-resolution simulation meshes leads to a smoother surface, but this consumes much time in fluid dynamics simulations. This approach is unsuitable for our purpose of generating an animation with short TAT. Hence, we have employed high-resolution marching cube and a surface subdivision algorithm to smooth the surface generated by low-resolution simulation meshes. The CG animation designer can select both methods.

6.1 High-resolution marching cube The CIP method has third-order precision. Hence, an

interpolation of the VOF values by using gradient of the VOF is suitable for the low-resolution simulation. Interpolating the VOF values, we can use more information than resolution of simulation mesh. In our system, the high-resolution marching cube method can use eight times (x: 2 times, y: 2 times, z: 2 times) resolution of simulation mesh. An example is shown in Figure 5.

Page 6: Fast simulation and rendering techniques for fluid objects

Kunimatsu and Watanabe / Fast simulation and rendering techniques for fluid objects

© The Eurographics Association and Blackwell Publishers 2001.

(a)

(b) (c)

Figure 5: An example of high-resolution marching cube and Catmull-Clark subdivision surface in the same simulation. (a): Surface generated by normal-resolution marching cube algorithm. (b): High-resolution marching cube can capture small and thin surface of fluid objects. (c): Catmull-Clark subdivision surface with normal-resolution marching cube.

6.2 Catmull-Clark subdivision surface For the surface subdivision, a Catmull-Clark scheme is used in

our system. We chose a Catmull-Clark scheme because this scheme can handle quadrilaterals as well as triangles without breaking into triangles. This feature leads to smoother subdivision results. For example, consider a cube composed of six quadrilaterals. If each face is divided into two triangles and the Loop scheme is applied, the result of subdivision becomes inhomogeneous. This does not seem fit for water surfaces if surface tension is taken into account.

After isosurfaces are generated, the polygon vertices are numbered, the edges are indexed by the vertices and the faces are indexed by the edges for the subdivision algorithm. Furthermore, to accelerate the subdivision process, reverse index tables are also generated redundantly.

Applying the subdivision algorithm once yields about four times as many polygons as the original number of polygons. The number of polygons affects the rendering time. An example is shown in Figure 5.

7. EVALUATIONS We evaluated some scenes on our system, a PC with Pentium

III 933MHz, 512MByte memory and GeForce2 GTS DDR SGRAM. We measured consumed time for each process. These processes are as follows: ! [simulation] Time of simulation

# Depending on simulation mesh size and scene situation (e.g. max. speed of fluid), selection of the CIP method or the donor-acceptor VOF method is possible.

! [isosurface] Time required to create isosurface # Using the marching cube method, free surface is

created from numerical numbers of the simulation result. Using the CIP method, normal-resolution

marching cube or high-resolution marching cube can be selected.

! [subdivide] Time required to subdivide for free surface # On the Catmull-Clark method, selection of invalid this

method or valid (and levels) is possible. ! [caustics] Time required to create caustics texture

# Create caustics and shadow textures # Ray-trace from light sources on each vertex # Recursive mid-point subdivision. Selection of mid-

point subdivision levels is possible. ! [draw] Time required to draw surface of fluid

# Ray-trace from eye on each vertex of fluid surfaces # Recursive mid-point subdivision. Selection of mid-

point subdivision levels is possible. # Rendering surface

Times for other processes such as polygon rendering are very short. They can be ignored.

In the following sections, we show evaluation results and consider techniques for realizing fluid objects movies of reasonable quality and with short TAT.

7.1 Scenes Figure 8, Figure 10, Figure 11 and Figure 12 show simulation

time of each process and number of polygons, for each frame. Figure 9, Figure 13, Figure 14 and Figure 15 show average time of each process and average number of polygons with the following options: mesh size, marching cube resolution, subdivision levels. The bar [M-R-C] denotes mesh size M, marching cube resolution R, and Catmull-Clark subdivision level C.

7.1.1 [Scene 1/Rain] Rain and a pool This scene features a deep pool and falling rain. Caustics

patterns due to ripples produced by falling rain are aesthetically pleasing. This scene has no dynamic action of fluid. Setting of a small, thin simulation space on only nearby water surface is possible. The small number of simulation meshes accelerates simulation speed. (See Figure 6 (A))

The evaluation results are shown in Figure 8 and Figure 9. As shown in Figure 8, the [simulation] time and polygon numbers are stable. In Figure 9, on [48-2-0] and [48-1-1](48x48x18 mesh), the simulation time and total time of the others are roughly equal. In less than 48x48x18 mesh, simulation time is not dominant.

7.1.2 [Scene 2/Fountain] A fountain and a ball This scene features a fountain and a ball. The ball is put onto

the top of the fountain. In the case of using the CIP method, small water objects disappear. This scene requires high-resolution simulation mesh for expression of the aesthetically pleasing fountain. (See Figure 6 (B))

The evaluation results are shown in Figure 10 and Figure 13. The [simulation] time is stable. As in [scene 4/Shoot], [caustics] and [draw] times become longer due to the complexity of fluid objects.

Page 7: Fast simulation and rendering techniques for fluid objects

EUROGRAPHICS 2001 / A. Chalmers and T.-M. Rhyne Volume 20 (2001), Number 3 (Guest Editors)

© The Eurographics Association and Blackwell Publishers 2001.

(A)

(B)

Figure 6: (A)[Scene 1/Rain] Rain and a pool and (B)[Scene 2/Fountain] A fountain and a pool

7.1.3 [Scene 3/Pot] Throwing a pot into a pool This scene features a pot thrown into a pool. This scene has

interactive action between fluid objects and solid objects. The dynamics of action of fluid objects is middle level. After the pot sank, some bubbles appeared. The problem is inconsistency between expression of this bubble and a smoothed surface method such as the Catmull-Clark method. (See Figure 7 (A))

The evaluation results are shown in Figure 11 and Figure 14. This is a time-consuming scene for simulation. In Figure 11, two parts, frame 2 to 3 and frame 32 to 34, have large [simulation] time. At frame 2, the pot touches the water surface. At frame 32, after the pot has sunk, water gathers quickly at the mouth of the pot. We employ an adaptive time-step in the fluid simulation. So, in the case that a scene includes a complex solid object and the velocity of the fluid is high, [simulation] time becomes longer. (A)

(B)

Figure 7: (A)[Scene 3/Pot] Throwing a pot into a pool and (B) [Scene 4/Shoot] Shooting water balls

7.1.4 [Scene 4/Shoot] Shooting water balls This scene features shooting water balls into a shallow pool.

Immediately after shooting, action of fluid objects is very dynamic and complex. Deforming, joining and separating of fluid occur frequently. This scene requires a large number of simulation

meshes for dynamic action of fluid objects, and long [simulation] time depends on mesh size and speed of shooting water balls. (See Figure 7(B))

The evaluation results are shown as Figure 12 and Figure 15. At the beginning of the scene, two water balls move fast. So, at the beginning, [simulation] time is long. As the simulation advances, [simulation] time becomes shorter. On the contrary, the shape of fluid objects becomes more complex, thus [caustics] and [draw] times become longer.

00.5

11.5

22.5

33.5

44.5

5

1 11 21 31 41

frame number

tim

e(s

ec)

23

24

25

26

27

28

29

30

31

poly

gon n

um

ber(

x1000)

Figure 8: [Scene 1/Rain] Evaluation times for frames: 40x40x16, marching cube: normal, Catmull-Clark: use, mid-point level: 1

0

1

2

3

4

5

6

7

24-1-0

24-2-0

24-1-1

32-1-0

32-2-0

32-1-1

40-1-0

40-2-0

40-1-1

48-1-0

48-2-0

48-1-1

tim

e(se

c)

0

10

20

30

40

50

poly

gon

num

ber(

x100

0)

Figure 9: [Scene 1/Rain] Comparison of simulation mesh size, resolution of marching cube and Catmull-Clark

simulation isosurface subdivide

caustics draw other

polygon

Page 8: Fast simulation and rendering techniques for fluid objects

Kunimatsu and Watanabe / Fast simulation and rendering techniques for fluid objects

© The Eurographics Association and Blackwell Publishers 2001.

0

2

4

6

8

10

12

14

1 11 21 31 41

frame number

tim

e(se

c)

0

10

20

30

40

50

poly

gon

num

ber(

x100

0)

Figure 10: [Scene 2/Fountain] Evaluation times for frames: 40x40x18, marching cube: normal, Catmull-Clark: use, mid-point level: 1

0

10

20

30

40

50

60

70

80

1 11 21 31 41

frame number

tim

e(se

c)

0

10

20

30

40

50

60

70

80

90

100

poly

gon

num

ber(

x100

0)

Figure 11: [Scene 3/Pot] Evaluation times for frames: 40x40x40, marching cube: normal, Catmull-Clark: use, mid-point level: 1

0

1

2

3

4

5

6

7

8

9

10

1 11 21 31 41

frame number

tim

e(se

c)

0

5

10

15

20

25

30

35

40

poly

gon

num

ber(

x100

0)

Figure 12: [Scene 4/Shoot] Evaluation times for frames: 40x40x12, marching cube: normal, Catmull-Clark: use, mid-point level: 1

0

2

4

6

8

10

12

24-1-0

24-2-0

24-1-1

32-1-0

32-2-0

32-1-1

40-1-0

40-2-0

40-1-1

48-1-0

48-2-0

48-1-1

tim

e(s

ec)

0

10

20

30

40

50

60

70

poly

gon n

um

ber

(x1000)

Figure 13: [Scene 2/Fountain] Comparison of simulation mesh size, resolution of marching cube and Catmull-Clark

0

5

10

15

20

25

30

35

40

45

50

24-1-0

24-2-0

24-1-1

32-1-0

32-2-0

32-1-1

40-1-0

40-2-0

40-1-1

48-1-0

48-1-1

tim

e(s

ec)

0

20

40

60

80

100

120

140

poly

gon n

um

ber(

x1000)

Figure 14: [Scene 3/Pot] Comparison of simulation mesh size, resolution of marching cube and Catmull-Clark1

0

2

4

6

8

10

12

14

16

24-1-0

24-2-0

24-1-1

32-1-0

32-2-0

32-1-1

40-1-0

40-2-0

40-1-1

48-1-0

48-2-0

48-1-1

tim

e(s

ec)

0

10

20

30

40

50

60

poly

gon n

um

ber(

x1000)

Figure 15: [Scene 4/Shoot] Comparison of simulation mesh size, resolution of marching cube and Catmull-Clark

simulation isosurface subdivide

caustics draw other

polygon

1 The bar of [48-2-0] : memory error

Page 9: Fast simulation and rendering techniques for fluid objects

EUROGRAPHICS 2001 / A. Chalmers and T.-M. Rhyne Volume 20 (2001), Number 3 (Guest Editors)

© The Eurographics Association and Blackwell Publishers 2001.

8. CONSIDERATIONS 8.1 Mid-point subdivision levels for ray

tracing on vertices We evaluated mid-point subdivision levels for caustics and

refraction. The results are shown in Figure 16 and Figure 17. Over level 2 subdivisions, calculation time of ray tracing was

the dominant part. Level 1 mid-point subdivision seems reasonable for short TAT. For all evaluations shown in section 7, level 1 mid-point subdivision was employed.

(a) level 0 (b) level 1 (c) level 2

Object1Object1

Object2Object2

Figure 16: Mid-point subdivision levels for ray tracing on

each vertex. mesh: 40x40x40, marching cube: normal, Catmull-Clark: use

0

5

10

15

20

25

30

35

0 1 2

mid-point subdivision levels

tim

e(s

ec)

simulation isosurface subdivide caustics draw other

Figure 17: Time comparison of mid-point subdivision levels. mesh: 40x40x40, marching cube: normal, Catmull-Clark: use

8.2 High-resolution marching cube vs. subdivision surface vs. simulation mesh size

In this section, we compare high-resolution marching cube and the Catmull-Clark subdivision surface with normal-resolution marching cube.

In the results presented in section 7, calculation time of high-resolution marching cube and that of subdivision surface are

roughly equal. The Catmull-Clark subdivision method produces more polygons than does the high-resolution marching cube. Furthermore, as the mesh size increases, the time required for high-resolution marching cube becomes remarkably long. If smooth surface are desired, the subdivision surface method seems reasonable for creating movies of fluid objects with short TAT. On the other hand, high-resolution marching cube can capture small and thin fluid objects. In a scene that has long simulation time and thin fluid objects, such as [shoot], high-resolution marching cube is useful for keeping small simulation mesh size.

8.3 For short TAT For short TAT, we need to decrease the time of [simulation],

[caustics] and [draw]. Using low-resolution simulation mesh, in almost all cases,

simulation time is not the dominant part. But, in the case of a scene with high velocity fluid, the [simulation] time will be the dominant part. In this case, we have to reduce simulation mesh further.

The time consumed by [caustics] and [draw] depends on the mid-point subdivision levels and polygon numbers. Level 1 mid-point subdivision seems reasonable for short TAT. On the other hand, large numbers of polygon are required to create smooth water surface and dynamic action of fluid. Ray tracing is the most time-consuming part of [caustics] and [draw].

In summary, for short TAT, the key factors are low-simulation mesh, the CIP method, surface smoothing techniques (such as high-resolution marching cube and the Catmull-Clark method) and the level 1 mid-point subdivision.

9. PROBLEMS AND FUTURE WORK The problems of our system are as follows: ! Small fluid objects disappear ! Inability to express spray and splash ! Poor ray tracing level ! Inability to create a scene in which eye position is in

water. ! Poor rendering quality of mid-point subdivision ! Acceleration required in order to create smooth surface There are two reasons for the disappearance of small fluid

objects. One is the inability to express small VOF value (less than threshold 0.5). The other is that the VOF values are not preserved in the CIP method. As a mean of solving the former problem, we have to consider a method to express VOF values of less than 0.5. To solve the latter problem, we are considering employing the donor-acceptor VOF method that can handle interaction between solid and fluid. The donor-acceptor VOF method does not have this problem. However, created actions of fluid are clearly different. If we manage to combine them, CG designers will be able to select the method they prefer depending on the nature of the movie they wish to realize.

It is very difficult to express spray and splash. To express them, small VOF values should be displayed as particles or semitransparent polygons based on some rule. We will have to determine this rule.

Our system uses ray tracing on vertices, with mid-point subdivision. At present, this system supports only level 1 ray

Page 10: Fast simulation and rendering techniques for fluid objects

Kunimatsu and Watanabe / Fast simulation and rendering techniques for fluid objects

© The Eurographics Association and Blackwell Publishers 2001.

tracing for short TAT. To create more complex scenes such as water and ice cubes in a glass, we intend to support more levels of ray tracing. But there is a trade-off with short TAT.

In our current system, polygons of the backside of water surface are not rendered. Furthermore, addition of caustics illumination to the original texture of polygons makes the polygons with caustics (the remarkable inner world of water) too bright. For eye position within water, it is necessary to render the backside of water surface and reduce brightness within water. For this purpose, a method is required to determine whether objects are in or out of water. The need to develop such a method constitutes a major problem.

Rendering quality of mid-point subdivision depends on levels of mid-point subdivision. High levels create many vertices, and a great deal of ray tracing has to be performed for these vertices. There is a trade-off between mid-point subdivision levels and short TAT. In future work, we intend to introduce adaptive mid-point subdivision dependent on polygon size. If we use HW accelerator for ray tracing, we can achieve further acceleration.

In the [Scene 1/Rain] and [Scene 2/Fountain], on the bar of [48-2-0], a time of high-resolution marching cube: [isosurface] becomes a large rate. In future work, we think that some HW accelerator is needed for marching cube or Catmull-Clark subdivision surface.

10. CONCLUSIONS We have presented a fluid objects simulation and rendering

system that achieves short TAT, reasonable quality, dynamic action of fluid based on full Navier-Stokes equation solver, light effects such as refraction/caustics and interaction with solid objects. Calculation time is roughly 10-20 seconds per frame. For short TAT, we think that key factors are low-simulation mesh, the CIP method, surface smoothing techniques and the mid-point subdivision method for caustics and refraction. If we use HW accelerator for ray tracing, the high-resolution marching cube and the Catmull-Clark subdivision surface method, we can achieve further acceleration. We think that this system will help CG designers who wish to create aesthetically pleasing and interesting movies of fluid objects.

ACKNOWLEDGEMENTS We would like to thank Takashi Fujiwara, Kiyoshi Hayakawa,

Hiroshi Miyazaki, Kenichi Mori, Mitsuo Saito, Haruyuki Tago, Yasunobu Yamauchi and Hideki Yasukawa for useful suggestions, discussion and cooperation.

REFERENCES [1] J. Popovic and S. M. Seitz and M. Erdmann and Z. Popovic and

A. Witkin, Interactive Manipulation of Rigid Body Simulations, Proceedings of SIGGRAPH 2000, Computer Graphics Proceedings, Annual Conference Series, pp. 209-218 (July 2000).

[2] S. Chenney and D. A. Forsyth, Sampling Plausible Solutions to Multi-Body Constraint Problems, Proceedings of SIGGRAPH 2000, Computer Graphics Proceedings, Annual Conference Series, pp. 219-228 (July 2000).

[3] J. A. Turner, A. C. Mazzone, Multifluid Finite Volume Navier-Stokes Solutions for Realistic Fluid Animation, Sketches and Applications of SIGGRAPH 99, p. 259.

[4] D. S. Ebert, Simulating Nature: From Theory to Applications, Course Note #25 of SIGGRAPH 2000, pp. 3.1-3.16.

[5] J. Stam. Stable Fluids, Proceedings of SIGGRAPH 99, Computer Graphics Proceedings, Annual Conference Series, pp. 121-128 (August 1999, Los Angeles, California).

[6] T. Nakayama, Numerical Analyses of Free Surface Flow Problems, News Letter/Asian CFD Society, Vol. 8, No.1 (1999), pp.3-17.

[7] S. Koshizuka and H. Yoon and D. Yamashita and Y. Oka. Numerical analysis of Natural Convection in a Square Cavity Using MPS-MAFL, Comput. Fluid. Dynamics J. Vol. 8 No. 4 (2000), pp. 485-495.

[8] T. Yabe, Universal Solver CIP for Solid, Liquid and Gas, Computational Fluid Dynamics Review 1997 Ed. by M. M. Hafez and K. Oshima (Wiley, 1997).

[9] T. Tanahashi and T. Takafumi, CIP Finite Element Method, News Letter/Asian CFD Society, Vol. 8, No. 3 (2000), pp. 137-156.

[10] N. Tanaka, The CIVA Method for Mesh-free Approaches: Improvement of the CIP Method for n-Simplex, Compt. Fluid Dynamics J. Vol 8 (1999), pp. 121-127.

[11] E. Catmull and J. Clark. Recursively Generated B-Spline Surfaces on Arbitrary Topological Meshes, Computer-Aided Design, 10,6 (1978), pp. 350-355.

[12] C. Loop, Smooth Subdivision Surfaces Based on Triangles. Master�s thesis, University of Utah, Department of Mathematics, 1987.

[13] D. Zorin and P. Schröder and W. Sweldens, Interpolating Subdivision for Meshes with Arbitrary Topology, Proceedings of SIGGRAPH 96, Computer Graphics Proceedings, Annual Conference Series, pp. 189-192 (August 1996, New Orleans, Louisiana).

[14] J. Arvo, Backward ray tracing. Developments in ray tracing, SIGGRAPH course notes, Vol. 12. (August 1986).

[15] M. Watt. Light-Water Interaction Using Backward Beam Tracing, Computer Graphics (Proceedings of SIGGRAPH 90), 24 (4), pp. 377-385 (August 1990, Dallas, Texas).

[16] P. S. Heckbert, Adaptive Radiosity Textures for Bidirectional Ray Tracing, Computer Graphics (Proceedings of SIGGRAPH 90), 24 (4), pp. 145-154 (August 1990, Dallas, Texas).

[17] M. Shinya and T. Saito and T. Takahashi, Rendering techniques for transparent objects, Graphics Interface '89, pp. 173-182 (June 1989).

[18] H. W. Jensen and N. J. Christensen, Photon maps in bidirectional Monte Carlo ray tracing of complex objects, Computers & Graphics, 19 (2), pp. 215-224 (March 1995).

[19] http://www.povray.org/