10
GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann Scheme Ye Zhao * Kent State University ABSTRACT In this paper, we introduce a parallel numerical scheme, the lat- tice Boltzmann method, to shape modeling applications. The mo- tivation of using this originally-designed fluid dynamics solver in surface modeling is its simplicity, locality, parallelism from the cellular-automata-originated updating rules, which can directly be mapped onto modern graphics hardware. A surface is implicitly represented by the signed distance field. The distances are then used in a modified LBM scheme as its computing primitive, instead of the densities in traditional LBM. The scheme can simulate cur- vature motions to smooth the surface with a diffusion process. Fur- thermore, an initial value level set method can be implemented for surface morphing. The distance difference between a morphing sur- face and a target surface defines the speed function of the evolving level sets, and is used as the driving force in the LBM. Our GPU- accelerated LBM algorithm has achieved outstanding performance for the denoising and morphing examples. It has the great poten- tial to be further applied as a general GPU computing framework to many other solid and shape modeling applications. Keywords: Lattice Boltzmann model, Surface denoising, surface morphing, level set, GPU Index Terms: I.3.5 [Computer Graphics]: Computational Geome- try and Object Modeling—Physically based modeling; I.3.7 [Com- puter Graphics]: Three-Dimensional Graphics and Realism— Animation 1 I NTRODUCTION Surface denoising (fairing) methods are important to improve the mesh quality by removing undesirable noises or rough features. Most techniques minimize energy functions, defined by the nor- mal or curvature properties, to achieve smooth surfaces, leading to solve a Laplace equation of the mesh. Surface morphing (blending or interpolation) generates a sequence of intermediate shapes which gradually change from a source surface to a target one. It has been widely used in movies and games for enhancing animated visual ef- fects. Level set method is applied to compute deforming zero level sets (isosurfaces) of a higher dimensional scalar function, which simulate the shape interpolation results between the source and tar- get surfaces. In this paper, we propose a new approach based on the lattice Boltzmann method (LBM) to achieve fast computation of surface denoising and morphing on modern graphics hardware (GPU). LBM is a microscopically-inspired method initially designed to solve macroscopic fluid dynamics problems. In computer graph- ics and visualization, LBM has grown up into a complete and promising GPU-based flow solver in modeling various fluid phe- nomena. On the other hand, LBM is a deliberately designed nu- merical scheme stemming from the cellular automata technology, which can be extended to many graphical applications beyond fluid * e-mail: [email protected] dynamics. Thus, we can use this simple, volume-based, parallel nu- merical method to solve various partial differential equations (PDE) other than the Navier-Stokes equations. We have used a modified LBM scheme for solving diffusion, Laplace and Poisson equations in image editing and volume smoothing [43], where the densities of 2D pixels or 3D voxels are modified according to these PDEs. For surface fairing, we voxelized a surface to generate a density volume data set [31], smoothed the volume, and then regenerated the smoothed surface from the modified volume. However, the voxelization process compromised the accuracy and speed. The method also cannot be used for shape interpolation between sur- faces. In this paper, we innovate to use the distance field of surface as the primary computing primitive in the LBM for shape modeling and applications. Thus, this parallel computing scheme is naturally extended to solve Laplace equation for generating smooth surface, and to solve initial value level set equation for modeling surface morphing process. The LBM algorithm is very easy for program- ming following a simple two-step process. Direct mapping it onto the GPU is also straightforward for a knowledgable GPU program- mer. In this way, our method provides an easy-to-implement and GPU-amenable framework, and achieves outstanding performance on contemporary graphics hardware. It also has the great potential to be further applied to various shape and solid modeling applica- tions. 2 RELATED WORK Lattice Boltzmann Scheme The LBM was initially designed to simulate continuum flows based on the statistical kinetic assump- tions based on Boltzmann equation. It has achieved great success in the computational physics world [32]. An index function similar to distance field was combined with the LBM to track the interface in multiphase flow dynamics [11]. In computer graphics and visu- alization, the LBM was used to visually simulate fluid flow phe- nomena with complex boundary conditions, such as wind flow and fire [37, 27], ink dispersion [4], free surface liquids [35, 36], float- ing objects [38], melting and flowing [45], fluid control [34], heat shimmering and mirage [44]. A level-of-detail scheme was adopted to simulate 3D fluid dynamics based on the locally-refined LBM on multiple grids, which improves the simulation accuracy and per- formance. Li et. al [19, 18] and Fan et. al [8] implemented the LBM algorithm on single GPU and GPU cluster to accelerate the computation. For non-fluid simulations, LBM was used to lighting participating media [10]. We recently applied it in image denoising, image editing, volume smoothing and surface fairing [43]. Surface Denoising and Morphing Most smoothing techniques propose energy functions defined by the normal or curvature prop- erties, and perform the constrained energy minimization. An ex- plicit integration method [33] was applied with linear time and memory consumption while not performing well for very large mesh. Implicit surface fairing [6] used bi-conjugated gradient to solve the linear system. It adopted a scale-dependent umbrella op- erator with linear approximation and used a curvature flow to re- move noise with an approximation of local curvature normal on the mesh. These approximations rely on the mesh quality due to the mesh-based PDE solution.

GPU-Accelerated Surface Denoising and Morphing with Lattice …zhao/papers/Zhao_LBMMorphing.pdf · 2008-03-22 · GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: GPU-Accelerated Surface Denoising and Morphing with Lattice …zhao/papers/Zhao_LBMMorphing.pdf · 2008-03-22 · GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann

GPU-Accelerated Surface Denoising and Morphing

with Lattice Boltzmann Scheme

Ye Zhao∗

Kent State University

ABSTRACT

In this paper, we introduce a parallel numerical scheme, the lat-tice Boltzmann method, to shape modeling applications. The mo-tivation of using this originally-designed fluid dynamics solver insurface modeling is its simplicity, locality, parallelism from thecellular-automata-originated updating rules, which can directly bemapped onto modern graphics hardware. A surface is implicitlyrepresented by the signed distance field. The distances are thenused in a modified LBM scheme as its computing primitive, insteadof the densities in traditional LBM. The scheme can simulate cur-vature motions to smooth the surface with a diffusion process. Fur-thermore, an initial value level set method can be implemented forsurface morphing. The distance difference between a morphing sur-face and a target surface defines the speed function of the evolvinglevel sets, and is used as the driving force in the LBM. Our GPU-accelerated LBM algorithm has achieved outstanding performancefor the denoising and morphing examples. It has the great poten-tial to be further applied as a general GPU computing framework tomany other solid and shape modeling applications.

Keywords: Lattice Boltzmann model, Surface denoising, surfacemorphing, level set, GPU

Index Terms: I.3.5 [Computer Graphics]: Computational Geome-try and Object Modeling—Physically based modeling; I.3.7 [Com-puter Graphics]: Three-Dimensional Graphics and Realism—Animation

1 INTRODUCTION

Surface denoising (fairing) methods are important to improve themesh quality by removing undesirable noises or rough features.Most techniques minimize energy functions, defined by the nor-mal or curvature properties, to achieve smooth surfaces, leading tosolve a Laplace equation of the mesh. Surface morphing (blendingor interpolation) generates a sequence of intermediate shapes whichgradually change from a source surface to a target one. It has beenwidely used in movies and games for enhancing animated visual ef-fects. Level set method is applied to compute deforming zero levelsets (isosurfaces) of a higher dimensional scalar function, whichsimulate the shape interpolation results between the source and tar-get surfaces. In this paper, we propose a new approach based onthe lattice Boltzmann method (LBM) to achieve fast computationof surface denoising and morphing on modern graphics hardware(GPU).

LBM is a microscopically-inspired method initially designed tosolve macroscopic fluid dynamics problems. In computer graph-ics and visualization, LBM has grown up into a complete andpromising GPU-based flow solver in modeling various fluid phe-nomena. On the other hand, LBM is a deliberately designed nu-merical scheme stemming from the cellular automata technology,which can be extended to many graphical applications beyond fluid

∗e-mail: [email protected]

dynamics. Thus, we can use this simple, volume-based, parallel nu-merical method to solve various partial differential equations (PDE)other than the Navier-Stokes equations. We have used a modifiedLBM scheme for solving diffusion, Laplace and Poisson equationsin image editing and volume smoothing [43], where the densitiesof 2D pixels or 3D voxels are modified according to these PDEs.For surface fairing, we voxelized a surface to generate a densityvolume data set [31], smoothed the volume, and then regeneratedthe smoothed surface from the modified volume. However, thevoxelization process compromised the accuracy and speed. Themethod also cannot be used for shape interpolation between sur-faces.

In this paper, we innovate to use the distance field of surface asthe primary computing primitive in the LBM for shape modelingand applications. Thus, this parallel computing scheme is naturallyextended to solve Laplace equation for generating smooth surface,and to solve initial value level set equation for modeling surfacemorphing process. The LBM algorithm is very easy for program-ming following a simple two-step process. Direct mapping it ontothe GPU is also straightforward for a knowledgable GPU program-mer. In this way, our method provides an easy-to-implement andGPU-amenable framework, and achieves outstanding performanceon contemporary graphics hardware. It also has the great potentialto be further applied to various shape and solid modeling applica-tions.

2 RELATED WORK

Lattice Boltzmann Scheme The LBM was initially designed tosimulate continuum flows based on the statistical kinetic assump-tions based on Boltzmann equation. It has achieved great successin the computational physics world [32]. An index function similarto distance field was combined with the LBM to track the interfacein multiphase flow dynamics [11]. In computer graphics and visu-alization, the LBM was used to visually simulate fluid flow phe-nomena with complex boundary conditions, such as wind flow andfire [37, 27], ink dispersion [4], free surface liquids [35, 36], float-ing objects [38], melting and flowing [45], fluid control [34], heatshimmering and mirage [44]. A level-of-detail scheme was adoptedto simulate 3D fluid dynamics based on the locally-refined LBM onmultiple grids, which improves the simulation accuracy and per-formance. Li et. al [19, 18] and Fan et. al [8] implemented theLBM algorithm on single GPU and GPU cluster to accelerate thecomputation. For non-fluid simulations, LBM was used to lightingparticipating media [10]. We recently applied it in image denoising,image editing, volume smoothing and surface fairing [43].

Surface Denoising and Morphing Most smoothing techniquespropose energy functions defined by the normal or curvature prop-erties, and perform the constrained energy minimization. An ex-plicit integration method [33] was applied with linear time andmemory consumption while not performing well for very largemesh. Implicit surface fairing [6] used bi-conjugated gradient tosolve the linear system. It adopted a scale-dependent umbrella op-erator with linear approximation and used a curvature flow to re-move noise with an approximation of local curvature normal on themesh. These approximations rely on the mesh quality due to themesh-based PDE solution.

Page 2: GPU-Accelerated Surface Denoising and Morphing with Lattice …zhao/papers/Zhao_LBMMorphing.pdf · 2008-03-22 · GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann

Our method uses the volume based approaches to handle surfacedenoising and morphing which does not need to explicitly handletopological relations. Distance fields of two volumes were inter-polated to generate intermediate shapes [26]. This distance fieldinterpolation method is modified so that the interpolation is donein correlation with the warp function [5]. The method provides theanimator with a technique that can be used to create a set of modelsforming a smooth transition between pairs of a given sequence ofkeyframe models. A let set method was presented for achieving 3Dshape metamorphosis [2], where the movements of deformable sur-faces are simulated by a level set defined on signed distance fieldsof the shapes. Furthermore, a level set based approach [22] han-dled various surface editing operations with a deformable implicitrepresentation based on the distance field of a surface. Recently, aT-spline level set method [40] was proposed where where the in-between objects are constructed by using T-spline scalar functions.Our morphing operation does not focus on geometric transforma-tion and warping to establish the correspondence between sourceand target surfaces. We refer the interested readers to [2] and thereferences therein.

For hardware acceleration, an acceleration method of initialvalue level set method was proposed by describing GPU based al-gorithms for solving and visualizing level-set solutions at interac-tive rates [16]. This streaming implementation of the narrow-bandalgorithm packs the level-set isosurface data into 2D texture mem-ory via a multidimensional virtual memory system. As the level setmoves, this texture-based representation is dynamically updated viaa novel GPU-to-CPU message passing scheme.

Unlike these solutions, our method is the first to introduce theLBM for level set solution, which comfortably achieves GPU ac-celeration due to the inherit locality and parallelism of the LBMscheme.

Besides the volume-based methods, PDE surfaces were incor-porated [7] into the powerful physics-based modeling framework,offering many modeling advantages in surface blending and mod-eling. Laplacian coordinates [20, 30] and Poisson based methods[39, 41] were also successfully proposed to implement shape inter-polation on surface meshes. We refer the readers to these papersand the references therein for the details of non-volume-based mor-phing approaches.

3 LBM FOR SHAPE MODELING

LBM is an inherently-parallel computing methodology first de-signed for simulating flow dynamics on 3D or 2D lattices (grids).Traditional computational fluid dynamics (CFD) approaches, suchas finite difference, finite element or boundary element methods,usually compute macroscopic fluid properties by discretizing thecontinuum governing equations (Navier-Stokes). Abandoning thisstrategy, the independent variables in an LBM consist of particledistribution functions in the phase space of the statistical mechan-ics, from which macroscopic continuum fluid properties can be re-covered. This computational approach has the benefits that: (1)it is tractable for simulating nonlinear, complex, macroscopic dy-namic behavior; (2) it can be easily computed in an explicit, lo-cal, parallel numerical scheme with update rules similar to cellularautomata; (3) it enables easy code generation and straightforwardmapping onto streaming SIMD processors, such as GPUs. In thispaper, we introduce these benefits to the shape modeling and appli-cations where the distance field of a shape is used as the computingprimitive of the LBM, instead of the fluid densities in LBM fluidsolvers.

Next, we start to explain the basic LBM algorithm as a numer-ical CFD computational scheme. The interested reader is referredto a good book [32] for details of theoretical analysis, algorithmdevelopment and many physical applications. Then, we show howLBM can be applied to non-fluid PDEs. Finally, we use the distance

(a) (b)

Figure 1: The D3Q19 lattice geometry. (a) The four sub-lattices thatare defined in a 3D grid; (b) The combination of sub-lattices q = 0,1, and 2. The packet distribution fi is associated with the link corre-sponding to the ei velocity vector.

field in LBM computation to initiate the usage of this parallel PDEsolver in solid and shape modeling applications.

3.1 LBM Algorithm

A 3D domain of fluid is first discretized into a cartesian lattice. Thevariables associated with each lattice site are the particle distribu-tions that represent the probability of particle presence with a givenvelocity. Particles stream synchronously along links from each siteto its neighbors in discrete time steps. Between each two consecu-tive streaming steps, a collision computation is executed to modelthe nonlinear dynamics of the fluid medium.

As illustrated in Figure 1, a 3D lattice may be represented as acombination of four sub-lattices: sub-lattice 0 consists of the centercell with zero velocity; sub-lattice 1 includes six axial neighborlinks; sub-lattice 2 has twelve minor-diagonal neighbor links; andsub-lattice 3 consists of eight major-diagonal neighbor links. Asin Figure 1, the most popular 3D LBM lattice structure is the socalled D3Q19 lattice that is a 3D lattice with 18 links representing19 velocity vectors (including the zero velocity), consisting of sub-lattices 0, 1 and 2. Here, D3 means it is a 3D lattice and Q19 meansin total the lattice has 19 discrete velocity distributions. Stored ateach grid node are 19 packet distributions associated with the 19velocity vectors. The two update rules of the LBM can be describedby the following equations:

fi(r,t∗)− fi(r,t) = Ωi ⇒ collision, (1)

fi(r+ei,t +1) = fi(r,t∗) ⇒ streaming, (2)

where r and r + ei locate a lattice site and its neighbor site alonglink i. In one time step t, each particle distribution fi at r is updatedbased on the collision operator Ωi to the value fi(r,t

∗), then, in timestep t+1, the new value fi(r,t

∗) propagates to the nearest site r+ei

along the velocity vector.

The macroscopic fluid variables: density (ρ), velocity (u) andmomentum (j), are obtained as moments of these distribution func-tions:

ρ = ∑i

fi, (3)

Page 3: GPU-Accelerated Surface Denoising and Morphing with Lattice …zhao/papers/Zhao_LBMMorphing.pdf · 2008-03-22 · GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann

j = ρu = ∑i

fiei. (4)

The collision operation is usually implemented as a relaxationprocess of the particle distributions to the equilibrium distributions:

Ωi = −1

τ( fi(x,t)− fi(ρ,u))+ci(F · ei), (5)

where τ is the relaxation time scale, controlling the rate of approachto equilibrium, which determines the viscosity ν of the flow as

ν =2τ −1

6. (6)

fi(ρ,u) is the appropriately chosen equilibrium particle distribu-tion, which is usually defined as a linear function of ρ and u at aparticular time:

fi(ρ,u) = wiρ(1+3(ei ·u)+9

2(ei ·u)2 −

3

2u2),

wi = 1/3, f or i = 0, (7)

wi = 1/18, f or i = 1 . . .6,

wi = 1/36, f or i = 7 . . .18.

The rightmost term in Equation 5 is introduced to modify the fluidmomentum by adding the external force F with the coefficient ci

defined as [3]

ci = (2τ −1

2τ)3wi. (8)

3.2 Derive Macroscopic Equation from LBM

To derive the macroscopic hydrodynamic equation, the Chapman-Enskog expansion of f is employed, which is essentially a formalmultiscaling expansion [12]:

[∂t = ∂t0 + ε∂t1 + ε2∂t2 · · · ,∂x = ∂x0+ ε∂x1

+ · · ·] (9)

Following Chapman-Enskog and multivariate Taylor expansion,the LBM equations (Equation 1 and 2) can be rewritten in the con-secutive order of a small expansion parameter ε . The first threeequations in the order of O(ε0), O(ε1), O(ε2) are

f 0i = fi (10)

f 1i = −τ(∂t0 +ei ·∇) f 0

i (11)

f 2i = −τ(∂t1 f 0

i +(2τ −1

2τ)(∂t0 +ei ·∇) f 1

i ). (12)

The distribution function fi is constrained by ∑i f 0i = ρ , ∑i f 0

i ei =

ρu, ∑i f ki = 0, ∑i f k

i ei = 0, for k = 1,2. Based on these constraints,for the first order of the expansion, summing the Equation 11 overall the velocity directions (i) gives the Euler equation ∂tρ +∇ ·ρu =0. Multiplying ei to both sides of Equation 11 and Equation 12, themomentum equation is derived by summing each equation over i

and combine the two equations: ∂t(ρu)+ ∇ · (Π0 + 2τ−12τ Π1) = 0,

where Π0 = ∑i eiei f 0i is the zeroth-order momentum flux tensor,

and Π1 = ∑i eiei f 1i is the first-order momentum flux tensor. The

momentum flux tensors are defined on the specified lattice struc-ture and corresponding equilibrium distribution. Eventually, fromthe Euler equation and the momentum equation, the incompressibleNavier-Stokes equations can be recovered at the limit of low Machnumber flows as

∂tu+u ·∇u = −∇P+ν∇2u+F, (13)

where P is the normalized pressure.

Figure 2: Use distance-field LBM for curvature motion.

(a) Original bolt (b) Dyed by curvature

(c) Isotropic denoising (d) Anisotropic denoising

Figure 3: Anisotropic denoising results of a bolt. (See also ColorPlate 1.)

Using the same analytic procedure, while using an equilibriumequation

fi(ρ) = wiρ, (14)

which is simplified from traditional Equation 7 by removing theeffects of fluid velocity u, we have shown in our previous work[43] that the LBM scheme can be applied to simulate the parabolicdiffusion equation

∂tρ = γ∆ρ, (15)

where γ represents the diffusion coefficient and is defined as

γ =4

9(2τ −1). (16)

This time-dependent diffusion process can be used to solve theLaplace equation ∆ρ = 0 if ∂tρ → 0. Thus the LBM scheme can beeasily used to solve Laplace equation for 2D image or 3D volume,if ρ represents the pixel value or voxel density.

3.3 Distance Field LBM

Polygonal surfaces have traditionally been the most popular primi-tives used for representing shapes with many fully-developed mod-eling and rendering techniques. To promote the LBM scheme tomodel and edit shapes, we used voxelization [31] to bridge thegap between surface and volume models in our previous work [43].However, the transformation may impair the accuracy if not usinga high-resolution or adaptive grid [23].

Distance field represents surfaces or curves with implicit repre-sentation, which has been extensively used in shape modeling pur-poses in computer graphics [15]. A distance field is defined as a

Page 4: GPU-Accelerated Surface Denoising and Morphing with Lattice …zhao/papers/Zhao_LBMMorphing.pdf · 2008-03-22 · GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann

(a) (b) (c)

Figure 4: Results of smoothing a noised surface model, the Armadillo, with simple OpenGL rendering after iso-surface generation by theMarching-Cubes method from the distance field volume. (a) Armadillo with noise; (b) Smoothed Armadillo after 2 LBM steps; (c) SmoothedArmadillo after 7 LBM steps.

(a) (b)

Figure 5: Closeup view of the smoothed Armadillo.

scalar field that specifies a distance to a shape, where the distanceis usually signed to distinguish between the inside and outside ofthe shape. Data set X representing a distance field to surface S isdefined as: X : R3 → R and for p ∈ R3,

X(p) = sgn(p) ·min|p−q| : q ∈ S (17)

where sgn(p) = 1(−1) if p is inside (outside) of S, and || is theEuclidean norm. In the discrete 3D volume data set, X , each voxelstores the distance to the closest point on the surface. In our dis-tance field LBM approach, the LBM use the signed distances tosurface as the computational element, instead of the densities asbefore.

Using the distance field, X , to replace the density ρ in the diffu-sion Equation 15, the equation can be rewritten as

∂tX = γ∆X = γ∇ · (∇X

|∇X |)|∇X | = γκ|∇X |, (18)

where κ represents the mean curvature:

κ = ∇ · (∇X

|∇X |). (19)

Equation 18 is the level set equation for motion by mean curva-ture, which was discussed and solved by semi-implicit methods for

evolving interfaces by mean curvature flow [29]. Here, the dis-tance field LBM presented an alternative GPU-friendly solution forsolving curvature motions of surface or curves. The benefit of theLBM scheme is that we do not need to compute the curvature ex-plicitly as in [16], which is implemented and “hidden” in the mi-croscopic LBM collision procedure. In simulation, we can simplycompute the curvature at a time step n from Equation 18 by apply-ing |∇X | = 1 for distance field during our motion computation:

κ(n) =(X(n+1)−X(n))

γ(n), (20)

where X(n + 1) and X(n) are distances computed in consecutiveLBM time steps n+1 and n. In Equation 15, γ is a function of τ ofthe LBM, which can be defined as a time-dependent factor. Thus,we use γ(n) to represent the diffusion factor used at time step n.

Figure 2 illustrates a simple example using this method, wherethe high-curvature portion of the shape is flattened and becomessmooth. Thus, we use this method to perform the surface denoisingwith the distance-based implicit representation (see Section 5.1).

Our distance field LBM for surface morphing can be described inthe level set framework [28]. The main idea of the level set methodis to embed a propagating interface S(t) as the zero level set ofa higher dimensional scalar function. The motion is described as∂tX +V |∇X | = 0, where X(r(t),t) is the distance function at a po-sition r. The scalar speed function V is usually defined by geomet-ric variables and time t to model the propagation behaviors of theinterface S(t). In our project, the level set equation is rewritten as

∂tX = V0|∇X |+ γκ|∇X |. (21)

The constant external expansion speed V0 can be incorporated intothe LBM diffusion scheme as an external force term as in Equation5. In particular, we set F = V0|∇X |. In this case, the distance fieldX satisfies |∇X |= 1, therefore, the level set expansion can be easilyincorporated into the LBM simulation. For surface morphing, wedefine V0 on any particular 3D position and time step as a functionof distances to the source and target surfaces (see Section 5.2).

4 COMPUTATIONAL PROCEDURE

In summary, the computing procedure underlying our simulationsinvolves the following series of steps:

Page 5: GPU-Accelerated Surface Denoising and Morphing with Lattice …zhao/papers/Zhao_LBMMorphing.pdf · 2008-03-22 · GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann

(a) (b) (c)

Figure 6: Results of smoothing a noised horse. (a) Noised horse; (b) Smoothed horse after 2 LBM steps; (c) Smoothed horse after 7 LBM steps.(See also Color Plate 2.)

0. Generate distance fields X from surface models.

1. Initialize LBM: compute fi from initial distance field usingρ = X in Equation 7.

2. Perform collision with Equation 1 and 5.

3. Update fi at each lattice site by performing streaming withEquation 2.

4. Compute new macroscopic distance field X with Equation 4.

5. Apply postprocessing (e.g. mesh generation) and renderingoperations.

6. Return to step 2.

5 APPLICATIONS

We have shown that the GPU-accelerated distance field LBMscheme can be used for surface denoising and surface morphing.Next, we show the examples of our application.

5.1 Surface Denoising

Our LBM scheme simulates curvature motion of a surface by solv-ing Equation 18. A user-specified parameter γ is used to controlthe diffusion behavior. If γ is defined as a function of the normaland/or curvature, our method can model the anisotropic smoothing.The user sets this control factor, thus, the relaxation parameter τ isdetermined from Equation 16. Finally, τ is applied to the two-stepLBM simulation in Equation 5 at each particular lattice site.

Figure 3 illustrates the anisotropic denoising results of a bolt sur-face. Figure 3a is the original rough surface. Figure 3b shows thecurvature distribution with red for high-curvature regions and greenfor smooth regions. In Figure 3c, the surface is denoised with anisotropic γ = 0.5 definition after 10 LBM steps. In comparison, Fig-ure 3d is the result of smoothing with simple anisotropic smoothingafter the same 10 LBM steps, where γt = 0.2 + κt . We can seethe anisotropic denoising preserves the bolt feature better duringsmoothing. Following the Equation 20, our LBM scheme com-putes the curvature in a very easy way with no more computationaloverhead, compared other methods [17, 43].

Figure 4 shows the results of our LBM denoising on the Ar-madillo. We use a 128×128×128 distance field for LBM simula-tion. The classic Marching Cubes method [21] is used to regener-ate an iso-surface from the modified distance fields. The MarchingCubes method and OpenGL are also used in the following exam-ples unless other methods are particularly mentioned. Figure 4ais the surface degraded by adding random noise (up to 5% of itsorigin value) to the distance field. Figure 4b shows the denoisingresult after only 2 LBM simulation steps. Figure 4c illustrates the

smooth result after 7 LBM steps. The smoothing factor is definedas γ = 0.2.

In Figure 5, we render a portion of the triangle mesh of the Ar-madillo that is generated by the Marching Cubes method, from thesame simulation as in Figure 4. Figure 5b shows that the originalnoised surface in Figure 5a is smoothed after 7 LBM simulationsteps.

In Figure 6, a horse model is denoised to show our LBM-basedsmoothing method. Figure 6a is the original mesh with up to 5%random noise. Figure 6b and Figure 6c illustrate the LBM smooth-ing results after 2 and 7 simulation steps, respectively. The smooth-ing factor is defined as γ = 0.1.

Figure 7a-d illustrates the denoising results for different portionsof the horse. The wire frames are rendered together with the sur-face.

The denoising operation is completed in only a few LBM sim-ulation steps on the distance field volume. All the computationsare implemented on the GPU and achieve very good performance,which are reported in Section 7. Note that the triangle mesh qual-ity can be further improved by using more complicated generationmethod [9] comparing with the simple Marching Cubes.

5.2 Surface Morphing

The modified LBM scheme can be used in shape interpolation in alevel set framework (Equation 21). The expansion speed V0 of theevolving surface is applied in the simulation as the driving externalforce F. We define the speed by the difference between the distancefields of a morphing surface and a target surface, which is similarto [24]:

V0 = F = Cs(Xtarget −Xmorphing), (22)

where Cs is a control parameter of morphing speed, Xtarget andXmorphing are the distance fields of the target surface and the mor-phing surface, respectively. Note that this morphing driving forceis computed dynamically at each time step, since Xmorphing is thedynamic distance field that defines the evolving level set. Indeed,Xmorphing is the key computational element simulated by the LBM.

Unlike the previous work [2], our morphing operation incorpo-rates the curvature motion, together with the surface propagation.Therefore, the surface is smoothed during morphing. In [40], it hasbeen shown that the coupling of curvature into the speed functioncan improve the morphing behavior and quality , where the curva-ture is linearly combined with the distance in the speed function.Different from this method, our curvature motion is independent ofthe expansion speed. In simulation, the user defines two factors, γand Cs, to control the dynamic morphing behavior.

Page 6: GPU-Accelerated Surface Denoising and Morphing with Lattice …zhao/papers/Zhao_LBMMorphing.pdf · 2008-03-22 · GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann

(a) Noised horse (b) Denoised horse (c) Noised horse (d) Denoised horse

Figure 7: Results of smoothing a noised horse, rendered with the triangle meshes of different portions of the horse. (See also Color Plate 2.)

(a) Noised sphere (b) LBM step 6 (c) LBM step 12 (d) LBM step 17

(e) LBM step 24 (f) LBM step 31 (g) LBM step 38 (h) Target Armadillo

Figure 8: Simulation of morphing a noised sphere to the Armadillo. Images are generated in a few LBM simulation steps. (See also Color Plate3.)

Figure 8 shows several snapshots of our simulation of morphinga sphere to the Armadillo. We initialize the sphere surface withrandom noise. It is denoised after several steps and then deformsto the shape of the Armadillo surface in a few LBM steps. In thisexample, we use the parameters: γ = 0.05 and Cs = 0.1.

Figure 9 illustrates another example with several snapshots ofmorphing a noised horse surface to a bunny surface. Here γ = 0.1and Cs = 0.3.

6 GPU ACCELERATION

The booming development of modern graphics hardware has en-couraged researchers to utilize the graphics processing unit (GPU)in many general purpose computing applications. Acceleratingnon-graphics computation on GPUs [25] has been a state-of-the-arttechnique in physically based modeling. We have shown that theLBM-based curvature motion and level set methods can be appliedto handle surface fairing and interpolation. Previous work [18] hasshown LBM can be mapped onto the GPU easily, whose simplicityand parallelism encourage our application of LBM in shape model-

ing. In the basic GPU LBM method, the particle distributions of the19 links are packed into 5 particle distribution 4-channel textures.Then, the collision operator (Equation 1, 5 and 14) evaluation isimplemented which involves only local operations at the texel unitsof each lattice site. Finally, in the streaming operator (Equation 2),the post-collision values are shifted in the texture memory to updatethe texel units of adjacent lattice sites with only local neighboringaccess.

In this paper, we extend our previous GPU implementation [43]to incorporate distance field as the computing element in the LBMfor surface operations. The density texture is replaced by the dis-tance field texture, while indeed there is no difference for the GPUimplementation. Curvature motion computation is computed in thesame way as in the diffusion LBM method [43], while the initialparticle distribution values on each link are computed by Equation14 from the input distance field texture. In particular for surfacemorphing, we add one distance field texture of the target surface.For each morphing step, the GPU program computes current mor-phing force by using the fixed target distance minus the current dis-

Page 7: GPU-Accelerated Surface Denoising and Morphing with Lattice …zhao/papers/Zhao_LBMMorphing.pdf · 2008-03-22 · GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann

(a) Noised horse (b) LBM step 3 (c) LBM step 15 (d) LBM step 27

(e) LBM step 35 (f) LBM step 49 (g) LBM step 63 (h) Target bunny

Figure 9: Simulation of morphing a noised horse to a bunny. Images are generated in different LBM steps. (See also Color Plate 4.)

Table 1: Performance report: Per LBM step simulation speed (in milliseconds) for the CPU and GPU, the GPU/CPU speedup factor, and thetexture memory size (in MByte).

LBM Lattice CPU Speed GPU Speed GPU Speedup Texture MemoryApplications Examples Size (millisec) (millisec) Factor Used (MByte)

Denoising Figure 3 70×123×66 672 3.1 217 109.1

Denoising Figure 4 107×128×97 1559 6.2 251 236.2

Denoising Figure 6 58×128×106 909 3.7 246 138.5

Morphing Figure 8 128×128×128 2523 14.5 174 402.6

Morphing Figure 9 80×80×80 580 4.5 129 98.3

tance of the morphing surface in the collision operator.

Our LBM-based solver is a straightforward mapping the CPUcode, which can be understood and duplicated by a knowledgableGPU programmer in a short programming time. In Section 7, wereport that our algorithm achieves outstanding performance for sur-face denoising and morphing.

7 PERFORMANCE AND DISCUSSION

Being used in the physically-based modeling of non-fluid applica-tions, the LBM based method provides us

1. Easy implementation of some PDEs in the cellular-automata-originated updating rules, where the nonlinear operations areimplicitly implemented in its collision operation, avoidingcomplex numerical computations;

2. Good programmability in implementing the core LBM algo-rithm with a few lines of codes and a short coding time;

3. Straightforward mapping to GPUs for achieving great perfor-mance of simulation.

All the examples are implemented on both CPU (Intel Core26300 with 3.25 GB RAM memory) and GPU (Nvidia Geforce8800GTX with 768MB texture memory). We show in Table 1 thatour LBM-enabled GPU simulation of surface denoising and morph-

ing achieves great speed acceleration with the GPU/CPU speedupfactors more than two hundred for denoising and more than onehundred for morphing. It includes the LBM lattice size (i.e. the3D distance field volume size), the computation speed on the CPUand GPU, and the GPU/CPU speedup factor per simulation step.On the advanced GPU, the smoothing and morphing speed runsat only a few millisecond per step, therefore, indicating a supe-rior realtime frame rate. For example, the morphing running ona 128× 128× 128 grid can reach about 69 frames per second (at14.5 millisecond per step).

As a volume-based, GPU-amenable method for surface model-ing, the computing speed of our distance field LBM simulation de-pends mainly on the lattice size, due to its simple, parallel updatingscheme per lattice site. However, our LBM-based approach suffersfrom a problem that the accuracy of the simulation depends on thesize of the simulation grid, as other Eulerian methods. The qualityof surface processing results are depending on the resolution of thepre-generated distance field. Meanwhile, explicit numerical meth-ods were regarded as expensive, due to its small time steps andhigh resolution of discrete grid, to compete with well-developedimplicit solvers. The dramatic growth of the computing powers isnow changing this. The explicit methods are considered again [1] inphysics and mathematics with their ease of use, convenient bound-

Page 8: GPU-Accelerated Surface Denoising and Morphing with Lattice …zhao/papers/Zhao_LBMMorphing.pdf · 2008-03-22 · GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann

ary handling and gentle learning curve. This is even more true asthe high-performance GPU and GPU clusters becomes available togeneral numerical computations. The GPU acceleration relies onthe availability of contemporary GPU texture memory size. Cur-rently, a maximum of 2.0GB texture memory (ATI FireGL V8650)is provided on one ultra-high-end GPU, which makes it possibleto accelerate our LBM scheme for very large surface models thatinvolves very large distance field volumes. Meanwhile, we are op-timistically anticipating a continuous increase of the GPU mem-ory size in the near future, and multiple GPUs can be used forextremely-large data sets (e.g. nVidia Telsa S870 provides 6 GBtotal memory).

Furthermore, we will implement an “intelligent” LBM schemeon the GPU, similar to the narrow band algorithm of the levelset method, which executes the operations only in the volumetricneighborhood of the original surface by indirectly packing theminto textures. This will decrease the consumption of computa-tional resources, however, may increase the complexity and com-putational time for the hardware implementation.

During preprocessing, we use a fast marching method [28] togenerate the distance field of a surface. It solves a boundary valueformulation with an ordered upwind scheme. This method is rela-tively time-consuming and can be improved [42]; recently, a newmethod [14] has been presented in order to accelerate the computa-tion on parallel systems [13]. Our current LBM method solves theinitial value level set equation on the GPU. In the future, we willalso try to implement the fast marching style computation on GPUbased on the microscopic LBM updating rules.

8 CONCLUSION

We implement surface denoising and morphing on contemporarygraphics hardware with a modified lattice-Boltzmann scheme. Us-ing the distance field of a surface as the primary computing elementin the simple two step collision-streaming updating rules, we areable to perform surface modeling simulations on the low-cost paral-lel machine (GPU), with its local, explicit and linear computationalfeatures. Achieving superior performance, it presents a promisingparallel computing framework to be applied for more shape model-ing applications.

9 ACKNOWLEDGMENT

The bunny and the Armadillo model are courtesy of the ComputerGraphics Laboratory, Stanford University. The horse model is cour-tesy of Cyberware, Inc. The bolt model are courtesy of the Vislab,Stony Brook University.

REFERENCES

[1] J. Boris. New directions in computational fluid dynamics. Annual

Review of Fluid Mechanics, 21:695, 1987.

[2] D. Breen and R. Whitaker. A level-set approach for the metamorphosis

of solid models. IEEE Transactions on Visualization and Computer

Graphics, 7(2):173–192, 2001.

[3] J. Buick and C. Greated. Gravity in a lattice Boltzmann model. Phys-

ical Review E, 51(5):5307–5319, 2000.

[4] N. Chu and C. Tai. Moxi: real-time ink dispersion in absorbent paper.

ACM Trans. Graph., 24(3):504–511, 2005.

[5] D. Cohen-Or, A. Solomovic, and D. Levin. Three-dimensional dis-

tance field metamorphosis. ACM Trans. Graph., 17(2):116–141, 1998.

[6] M. Desbrun, M. Meyer, P. Schroder, and A. Barr. Implicit fairing of

irregular meshes using diffusion and curvature flow. Proceedings of

SIGGRAPH, pages 317–324, 1999.

[7] H. Du and H. Qin. Dynamic pde-based surface design using geometric

and physical constraints. Graphical Models, 67(1):43–71, 2005.

[8] Z. Fan, F. Qiu, A. Kaufman, and S. Yoakum-Stover. GPU cluster for

high performance computing. Proceedings of ACM/IEEE Supercom-

puting Conference, pages 47–59, 2004.

[9] M. Gavriliu, J. Carranza, D. E. Breen, and A. H. Barr. Fast extrac-

tion of adaptive multiresolution meshes with guaranteed properties

from volumetric data. Proceedings of the conference on Visualization,

pages 295–303, 2001.

[10] R. Geist, K. Rasche, J. Westall, and R. Schalkoff. Lattice-Boltzmann

lighting. Eurographics Workshop on Rendering Techniques, pages

355–362, 2004.

[11] X. He, S. Chen, and R. Zhang. A Lattice Boltzmann Scheme for

Incompressible Multiphase Flow and Its Application in Simulation

of Rayleigh-Taylor Instability. Journal of Computational Physics,

152:642–663, 1999.

[12] X. He and L. Luo. Lattice Boltzmann model for the incompressible

Navier-Stokes equation. Journal of Statistical Physics, 88(3/4):927–

944, 1997.

[13] W.-K. Jeong, P. T. Fletcher, R. Tao, and R. Whitaker. Interactive vi-

sualization of volumetric white matter connectivity in dt-mri using a

parallel-hardware hamilton-jacobi solver. IEEE Transactions on Visu-

alization and Computer Graphics, 13(6):1480–1487, 2007.

[14] W.-K. Jeong and R. Whitaker. A fast iterative method for a class of

Hamilton-Jacobi equations on parallel systems. University of Utah

School of Computing Technical Report UUCS-07-010, 2007.

[15] M. W. Jones, J. A. Baerentzen, and M. Sramek. 3d distance fields: A

survey of techniques and applications. IEEE Transactions on Visual-

ization and Computer Graphics, 12(4):581–599, 2006.

[16] A. Lefohn, J. Kniss, C. Hansen, and R. Whitaker. A streaming narrow-

band algorithm: interactive computation and visualization of level

sets. 10:422–433, 2004.

[17] A. Lefohn and R. Whitaker. A GPU-based, three-dimensional level

set solver with curvature flow. University of Utah technical report

UUCS-02-017, 2002.

[18] W. Li, Z. Fan, X. Wei, and A. Kaufman. Flow Simulation with Com-

plex Boundaries, chapter 47, pages 747–764. GPU Gems 2. Addison-

Wesley, 2005.

[19] W. Li, X. Wei, and A. Kaufman. Implementing lattice Boltzmann

computation on graphics hardware. The Visual Computer, 19(7-

8):444–456, 2003.

[20] Y. Lipman, O. Sorkine, D. Cohen-Or, D. Levin, C. Rossl, and H.-P.

Seidel. Differential coordinates for interactive mesh editing. Proceed-

ings of the Shape Modeling International, pages 181–190, 2004.

[21] W. Lorensen and H. Cline. Marching cubes: A high resolution 3D

surface construction algorithm. Proceedings of SIGGRAPH, pages

163–169, 1987.

[22] K. Museth, D. Breen, R. Whitaker, and A. Barr. Level set surface

editing operators. Proceedings of SIGGRAPH, pages 330–338, 2002.

[23] M. Nielsen and K. Museth. Dynamic tubular grid: An efficient data

structure and algorithms for high resolution level sets. Journal of Sci-

entific Computing, 26(3):261–299, 2006.

[24] D. B. O. Nilsson and K. Museth. Surface reconstruction via contour

metamorphosis: An eulerian approach with lagrangian particle track-

ing. Proceedings of the conference on Visualization, pages 407–414,

2005.

[25] J. Owens, D. Luebke, N. Govindaraju, M. Harris, J. Kruger,

A. Lefohn, and T. Purcell. A survey of general-purpose computation

on graphics hardware. Eurographics State of the Art Reports, pages

21–51, Aug. 2005.

[26] B. Payne and A. Toga. Distance field manipulation of surface models.

IEEE Computer Graphics and Applications, 12(1):65–71, 1992.

[27] F. Qiu, Y. Zhao, Z. Fan, X. Wei, H. Lorenz, J. Wang, S. Yoakum-

Stover, A. Kaufman, and K. Mueller. Dispersion simulation and visu-

alization for urban security. Proceedings of IEEE Visualization, pages

553–560, October 2004.

[28] J. Sethian. Level Set Methods and Fast Marching Methods, second ed.

Cambridge University Press, 1999.

[29] P. Smereka. Semi-implicit level set methods for curvature and surface

diffusion motion. Journal of Scientific Computing, 19(1-3):439–456,

2003.

[30] O. Sorkine, D. Cohen-Or, Y. Lipman, M. Alexa, C. Rossl, and H.-

P. Seidel. Laplacian surface editing. Proceedings of the 2004 Eu-

rographics/ACM SIGGRAPH symposium on Geometry processing,

pages 175–184, 2004.

Page 9: GPU-Accelerated Surface Denoising and Morphing with Lattice …zhao/papers/Zhao_LBMMorphing.pdf · 2008-03-22 · GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann

(a) Original bolt (b) Dyed by curvature (c) Isotropic denoising (d) Anisotropic denoisingColor Plate 1: Anisotropic denoising results of a bolt.

(a) Noised horse (b) Smoothed horse (c) Noised horse (d) Smoothed horseColor Plate 2: Results of smoothing a noised horse.

Color Plate 3: Simulation of morphing a noised sphere to the Armadillo.

Color Plate 4: Simulation of morphing a noised horse to a bunny.

Page 10: GPU-Accelerated Surface Denoising and Morphing with Lattice …zhao/papers/Zhao_LBMMorphing.pdf · 2008-03-22 · GPU-Accelerated Surface Denoising and Morphing with Lattice Boltzmann

[31] M. Sramek and A. Kaufman. Alias-free voxelization of geometric

objects. IEEE Transactions on Visualization and Computer Graphics,

5(3):251–267, 1999.

[32] S. Succi. The Lattice Boltzmann Equation for Fluid Dynamics and

Beyond. Numerical Mathematics and Scientific Computation. Oxford

University Press, 2001.

[33] G. Taubin. A signal processing approach to fair surface design. Pro-

ceedings of SIGGRAPH, pages 351–358, 1995.

[34] N. Thurey, R. Keiser, M. Pauly, and U. Rude. Detail-preserving fluid

control. Proceedings of ACM SIGGRAPH/Eurographics Symposium

on Computer Animation, 2006.

[35] N. Thurey and U. Rude. Free surface lattice-Boltzmann fluid simula-

tions with and without level sets. Workshop on Vision, Modeling, and

Visualization, pages 199–208, 2004.

[36] N. Thurey, U. Rude, and M. Stamminger. Animation of open water

phenomena with coupled shallow water and free surface simulations.

Proceedings of ACM SIGGRAPH/Eurographics Symposium on Com-

puter Animation, 2006.

[37] X. Wei, W. Li, K. Mueller, and A. Kaufman. Simulating fire with

texture splats. Proceedings of IEEE Visualization, pages 227–237,

2002.

[38] X. Wei, Y. Zhao, Z. Fan, W. Li, F. Qiu, S. Yoakum-Stover, and

A. Kaufman. Lattice-based flow field modeling. IEEE Transactions

on Visualization and Computer Graphics, 10(6):719–729, November

2004.

[39] D. Xu, H. Zhang, Q. Wang, and H. Bao. Poisson shape interpola-

tion. Proceedings of the 2005 ACM symposium on Solid and physical

modeling, pages 267–274, 2005.

[40] H. Yang and B. Juttler. 3D shape metamorphosis based on T-spline

level sets. The Visual Computer, 23(12), 2007.

[41] Y. Yu, K. Zhou, D. Xu, X. Shi, H. Bao, B. Guo, and H. Shum. Mesh

editing with poisson-based gradient field manipulation. Proceedings

of SIGGRAPH, pages 644–651, 2004.

[42] H. Zhao. Fast sweeping method for eikonal equations. Mathematics

of Computation, 74:603–627, 2004.

[43] Y. Zhao. Lattice Boltzmann based PDE solver on the GPU. The Visual

Computer, International Journal of Computer Graphics, To appear,

2008.

[44] Y. Zhao, Y. Han, Z. Fan, F. Qiu, Y.-C. Kuo, A. Kaufman, and

K. Mueller. Visual simulation of heat shimmering and mirage. IEEE

Transactions on Visualization and Computer Graphics, 13(1):179–

189, Jan/Feb 2007.

[45] Y. Zhao, L. Wang, F. Qiu, A. Kaufman, and K. Mueller. Melt-

ing and flowing in multiphase environment. Computers & Graphics,

30(4):519–528, 2006.