REAL-TIME RENDERING ALGORITHM BASED ON HYBRID STATIC AND DYNAMIC SIMPLIFICATION METHODS

Level of detail (LoD) method is a key technique for real-time rendering. The generation algorithms of LoD models may be divided into two categories: static or view-independent algorithms and dynamic or view-dependent algorithms, each has its own advantages and drawbacks. This paper presents a new realtime rendering algorithm incorporating both of the two kinds. We simplify polygonal models viewindependently according to a user-specified approximation error first. Then the simplified models are used in a view-dependent real-time rendering algorithm. The paper presents a new view-dependent realtime mesh simplification algorithm. The algorithm can produce simplified models in real time while controlling the rendering pixel error. Examples illustrate efficiency of the algorithm.


Introduction
Many computer graphics applications such as virtual reality, scientific visualization and computer aided design, require complex, highly detailed models to maintain a convincing level of realism.Consequently, models are often created or acquired at millions of polygons, far more than current PCs or workstations can render at interactive frame rates.Many software techniques have been developed to accelerate rendering speed, such as visibility culling, level of detail (LoD), distributed computation and image based rendering.Visibility culling algorithms determine which subset of the model is visible and only render that portion of the model [1].LoD algorithms select appropriate level of detail model (containing different number of polygons) to render according to the distance between the viewpoint and the model in a scene [2].The LoD models are created beforehand or on the fly.Distributed computation algorithms divide the rendering task into several sub-tasks to different processors [3].Image based rendering algorithms replace arbitrary portions of a scene with some pre-created images and synthesize new images from these images to fit the change of viewpoint.The most advantage of image based rendering algorithms is that they are independent of the scene complexity [4].
LoD models can be generated with mesh simplification algorithms.The algorithms may be divided into two categories: static (also called view-independent) algorithms and dynamic (also called viewdependent) algorithms, each has its own advantages and drawbacks.
View-independent simplification algorithms can produce multiple simplified models using different approximation errors, and these simplified models are saved as different levels of detail for using in realtime rendering.The rendering algorithm selects an appropriate level of the model according to the distance of the model to the viewpoint.Typical algorithms are listed as follows.Schroeder [5] describes an algorithm based on vertex removal.Turk [6] presents an algorithm based on re-tiling.Rossignac [7] presents an algorithm based on vertex clustering.Hoppe [8] introduces an incremental representation for mesh model, called progressive mesh.Cohen [9] uses envelopes to control the global approximation error caused by simplification.Low [10] improves Rossignac's original vertex clustering algorithm using floating-cell vertex clustering.Soucy [11] simplifies mesh models with color attributes using texture mapping.Garland [12] develops a robust surface simplification algorithm using quadric error metrics.Cohen [13] samples the surface position, curvature and color attributes of the mesh model and converts the model to a representation that decouples the sampling of these three attributes, storing the colors and normals in texture and normal maps.This simplification algorithm could preserve the appearance of the model very well.
View-dependent simplification algorithms generate simplified models dynamically according to the viewpoint.Important algorithms are as follows.Hoppe [14] and Xia [15] propose two view-dependent algorithms based on progressive mesh representation.Luebke [16] constructs a hierarchical dynamic simplification for arbitrary polygonal environments and produced an appropriate simplified scene viewdependently.
View-independent simplification algorithms generate simplified models and save them beforehand.Their disadvantages are obvious.First, many simplified models occupy large spaces.Secondly, when the rendering algorithm switches f rom one level of a model to another level, visual discontinuity is introduced.View-dependent simplification algorithms create simplified models dynamically according to the viewpoint.It can guarantee smooth transition between different LoD, but existing algorithms have to construct a simplification structure for the whole scene and the structure contains a great amount of positive and retrorse information about the simplification operation.If the scene becomes complex, the structure will consume very large main memory.
In this paper we present a real-time rendering algorithm which incorporates view-independent simplification operations and view-dependent simplification operations.We first simplify polygonal meshes view-independently according to a user-specified approximation error.Then the simplified models are used in a view-dependent real-time rendering algorithm.Furthermore, the view-dependent real-time mesh simplification algorithm presented in this paper has obvious features compared with the existing algorithms.The algorithm is based on floating-cell vertex clustering, takes the viewpoint, the line of sight and the resolution of screen window into account.And it is enhanced with viewing frustum culling and back-face culling.The algorithm can produce simplified model in real time while controlling the rendering pixel error.
The rest of this paper is organized as follows: In Section 2, we present the view-independent presimplification of models briefly.Section 3 describes the view-dependent real-time simplification algorithm in detail.Section 4 shows some results we have obtained by applying our algorithm to two models.Finally, Section 5 will end with some conclusions and discussion on future work.

Static View-independent Pre-simplification
In this pre-simplification process, we generate only one simplified model according to a userspecified approximation error, instead of producing many simplified models and saving them.The simplified model will replace the original model in the following view-dependent real-time rendering process.We employ this pre-simplification process based on the following facts: (a) most mesh models are created using well-developed modeling software.To maintain a convincing level of realism, models are usually over-sampled greatly.For example, models created by CAD systems have many vertices, edges and triangles sharing the same plane and models generated using Marching Cube algorithms contain many redundant triangles too.(b) applications may require different levels of realism.Many applications put more emphasis on rendering in real time than on rendering precisely.Therefore, we can delete the redundant polygons in original models and simplify models within the user-specified approximation error.
We have listed many view-independent mesh simplification algorithms in Section 1.If the algorithm can control the approximation error between the simplified model and the original model, then it can be used as our pre-simplification algorithm.In this paper, we adopt the algorithm based on triangle collapsing operation developed by the authors in 1997 [17].We assume that models consist of triangles only.This implies no loss of generality, since every polygon in original models can be triangulated easily.Figure 1 illustrates the operation of triangle collapsing operation.The basic operation in our algorithm is triangle collapse.The algorithm computes error matrix for every vertex in the original mesh, the location of the new point generated by the contracting operation is the optimized point according to the computation of distance of point to plane.We introduce an efficient method for transmitting simplification error, and can control the error between the simplified mesh and the original mesh.Readers may refer to [17] for detailed information.
where o X and s X are the vertex sets in the original model s M and the simplified mode is the minimum distance from the vertex v to the closest face of the mesh M .Table 1 gives the approximation errors of the models shown in Figure 2. According to our experiments, when the relative approximation error (the last column in Table 1) is less than 0.02%, we can't tell the difference between the simplified model and the original model by our eyes.

Dynamic View-dependent Real-time Simplification
Considering the real-time requirement of the rendering algorithm, we adopt the mesh simplification algorithm based on vertex clustering [7,10].To get rid of the shortcoming of the original simplification algorithm based on vertex clustering [7], Low presents a simplification algorithm using floating-cell clustering to generate simplified models [10].The algorithm takes vertices with greater weight values (the more important vertices) as the centers of vertex clustering.Although the algorithm considers the distance between the viewpoint and the model in a scene when it calculates the radius of the bounding sphere used in vertex clustering, it doesn't emphasize particularly on real-time simplification, but takes the distance as an input parameter used in automatic simplification.It puts more emphasis on the calculation of the weight values of vertices for better preservation of important features of models, and it is regarded as a static mesh simplification algorithm.However, we extend the algorithm for dynamic real-time simplification.Compared with Low's algorithm, our algorithm use a simple method to calculate the weight values of vertices and focus particularly on rendering error (evaluated with pixels) of the model in screen window.It simplifies the model in real-time according to the viewpoint, the line of sight and the resolution of the screen window.Furthermore, to accelerate rendering speed, this algorithm is enhanced with viewing frustum culling and back-face culling.The whole algorithm consists of pre-computation of weight values of vertices and real-time simplification.We discuss them in detail respectively.

PRE-COMPUTATION OF WEIGHT VALUES OF VERTICES
This step calculates the weight values of the vertices in the simplified model obtained by the presimplification process, and sorts the vertices in decreasing order on their weight values.In fact, this step is performed as a preprocessing process.The sorted queue is to be used in real-time simplification process discussed in Subsection 3.2.There are many methods to calculate the weight value of a vertex.We employ a simple method.For non-boundary vertex i V (the triangles sharing the vertex form a ring), let i Ts be the set of the triangles sharing i V , then the weight value i C of V i can be calculated using the following equations: Where T ∆ is the area of triangle T , T n is the normal vector of the triangle T , ) , ( is the angle between the vector i n and the vector T n , i Ts is the number of triangles in the triangle set i Ts .For boundary vertex V i (refer to Figure 3), if vertex V i , V j and V k are on the same line, the weight value of V i is the same as non-boundary vertex.Otherwise, the triangle formed by V i , V j and V k has to be considered when calculating i n .The weight value can represent the importance of a vertex in geometry: the greater the weight value of the vertex, the more important the vertex.
(a) V i , V j and V k are in the same line (b) V i , V j and V k are not in the same line Figure 3: The weight value calculation of boundary vertex

REAL-TIME SIMPLIFICATION
Real-time simplification algorithm simplifies the model in real time according to the viewpoint, the line of sight and the resolution of the screen window.To accelerate rendering process, our algorithm combines with viewing frustum culling and back-face culling.Although many graphics packages contain viewing frustum culling and back-face culling, but they have to execute many other operations before executing these two operations in the rendering pipeline.Our algorithm integrates these two operations very well, on the one hand it saves rendering time, on the other hand it is helpful to preserve the silhouette when the model is rendered in screen window.We will discuss this further in the following section.The algorithm framework is discussed below.

Algorithm framework
Let N be the number of vertices, queue[N] be the sorted queue described in Section 3.1, and Map[N] be the vertex mapping array which is the key data structure in our algorithm.The real-time simplification algorithm can be described using the following pseudo-code: begin //Step 1: Initialization, each vertex is mapped to itself.

for ( each vertex V i in the mesh ) if ( V i is not in the current viewing frustum or V i is back-face vertex ) Map[V i ] := -1;
//Step 3: Vertex clustering.

for (i:=1; i<=N; i++) { V i := queue[i]; if ( Map[V i ] = V i ) { Calculating the radius R i of the bounding sphere according to the current viewpoint, the line of sight and the resolution of screen window ; for ( each vertex V k falling in the sphere with center V i and radius R i ) if ( Map[V k ] = V k ) Map[V k ] := V i ; } }
//Step 4: Generating the simplified mesh.

Viewing frustum culling and back-face culling
Figure 4 illustrates the relations among viewing frustum, line of sight and models in rendering process.For viewing frustum culling, we first calculate the equations (represented by Plane [6] [4] ) of the six planes of the viewing frustum and the coordinate of an arbitrary point in the viewing frustum (for example, the center of the viewing frustum Q [4] ), then we can decide whether a spatial P [4] is in the viewing frustum by the following method: for all 1≤ i ≤6 ,if (Plane[i]•Q) * (Plane[i]•P)>0, then P is in the viewing frustum; Otherwise, P is not in the viewing frustum.
Let d [3] be the vector from a vertex to the viewpoint and n [3] be the normal vector of the vertex, if (d•n)<0, then the vertex is a back-face vertex.We point out particularly that one or two vertices of some triangles in the mesh model (for example, triangle T 1 and T 2 in Figure 4) are outside the viewing frustum or are back-face vertex, the other two or one vertices of them are not.Our algorithm does not cull these vertices but keep these triangles as a whole.However, these triangles are usually in the silhouette of the model when they are rendered, so our algorithm keeps the silhouette of the model very well.

VERTEX CLUSTERING
The key of vertex clustering is to calculate the radius of the bounding sphere, it is also the key of our real-time mesh simplification algorithm.We analyze how to calculate the radius of the bounding sphere according to the rendering pixel error in screen window (refer to Figure 4).If the resolution of the screen window is (Width * Height) and the size of the near plane of the viewing frustum is (W * H), then the area in the near plane corresponding to one pixel in the window is (W * H)/(Width * Height).If a vertex P of the model is projected to P′ (as in Figure 4) in the near plane and the rendering error is within K pixel(s), then the radius R of the bounding sphere at vertex P can be calculated using the following equation: Considering the following fact about the line of sight, the farther the model is away from the central line of sight, the blurrier the model is.Let the angle between OP and the central line of sight OO′ be θ and we assume that the radius of the bounding sphere is increased with θ as a 2-power function (other functions are available), the equation for computing radius R is as the following:

GENERATING THE SIMPLIFIED MODEL
After the vertex mapping array is obtained from vertex clustering, we only need to decide whether each triangle in the input mesh can still form a triangle after the vertices are mapped.If it can, it is output to the simplified mesh.Figure 5 illustrates several simplified bunny models according to different rendering pixel errors.

Implementation and experiment results
We implemented the hybrid real-time rendering algorithm on Pentium Pro 233M PC with 64M memory using OpenGL.Users can change viewpoint, line of sight, viewing frustum and rendering pixel error in our system.Functions for recording and playing walkthrough paths are also provided.
We applied the algorithm to various models, two models (Bunny and Helicopter) are shown below.For each model, we recorded a path through the model.Figure 6 and Figure 7 illustrate three frames during the walkthrough1 .(a), (b) and (c) are rendered without using LoD method, (d), (e) and (f) are rendered using our dynamic simplification method (without pre-simplification), (g), (h) and (i) are rendered using our hybrid algorithm, while (j), (k) and (l) are the differences between (a) and (g), (b) and (h), (c) and (i), respectively.From these images, it is obvious that our algorithm can control the rendering pixel error very well.Table 2 lists the frame rates of the walkthrough processes.Compared with the frame rates of the rendering process without using LoD method, the frame rates of the rendering process only using dynamic simplification method is improved, but not greatly.When the static pre-simplification process is added, the frame rate is improved greatly, while the rendering pixel error is very small.It should be noted that the two examples given here are individual f rames grabbed from the walkthrough process, and the scene is composed of a single model.However, our algorithm can be applied to scenes composed of multiple objects.And with the increase of models, the effect of viewing frustum culling is more obvious, the algorithm will become more efficient.

Conclusions and future work
In this paper, we present a hybrid real-time rendering algorithm incorporating static viewindependent simplification method and dynamic view-dependent simplification method.Our algorithm makes use of the advantages of these two methods, it improves the rendering speed greatly while the visual effect is preserved.In addition, compared with the existing view-independent mesh simplification algorithms, the algorithm presented in this paper has its own features, it is based on floating-cell vertex clustering and simplifies the model in real time according to the viewpoint, the line of sight and the resolution of screen window.And it is enhanced with viewing frustum culling and back-face culling.Our algorithm is expected to be applied in virtual reality, interactive visualization and CAD systems.
We are currently investigating ways to deal with the color and texture features of mesh models.Although some algorithms are available [11,13], but they can't run in real time.Furthermore, we are developing methods to rendering models with constant frame rates, which is very important in virtual environment.In addition, the way to combine our algorithm with other real-time rendering techniques is also under exploration Since 1993, he has been working at the State Key Lab of CAD&CG on a number of academic and industrial projects related with distributed graphics, virtual reality, multimedia.He have been engaged in research and development on VR/VE since 1991.Now he is the project leader or co-leader of 4 projects on VR.
He has published more than 40 papers on international journals, national journals and international conferences.He is the author or co-author of two books related to computer graphics.He and Prof. Jiaoying Shi, the academic director of State Key Lab of CAD&CG, were invited to write papers for ACM Computer Graphics to introduce CG achievements in China(Computer Graphics, No.2, No. 3,1996).He acted as one of the Guest Editors of a Special Issue of the international journal Computers & Graphics.His current research interests include virtual reality/virtual environment (multi-resolution modeling; timecritical rendering; distributed VR, et al.), distributed graphics, and multimedia (collaborative CAD, SCW, shared application, et al).

Figure 2 :
Figure 2: Pre-simplification results of Bunny model

Figure 4 :
Figure 4: Viewing frustum, line of sight and models

Figure 5 :
Figure 5: Simplify bunny model with different rendering pixel errors

Figure 6 :Figure 7
Figure 6: Rendering of Helicopter Zhigeng Pan, is a full professor at the State Key Lab. of CAD&CG, Zhejiang University, a member of the IS&T, a member of the committee on Multimedia Computing, Chinese Image and Graphics Association.He held the position of the Scientific Assistant to the Director from 1995-1997, responsible for coordination and strategy activities.Now he is the vice director of Hangzhou Center, CAD Training Network in China.He is on the Editorial Board of Chinese Computer Image & Graphics Journal.

Table 1 :
Approximation errors according to the models illustrated in Figure2

Table 2 :
Frame rates of the rendering processes