[IEEE 2010 International Conference on Audio, Language and Image Processing (ICALIP) - Shanghai,...

5
978-1-4244-5858-5/10/$26.00 ©2010 IEEE ICALIP2010 234 Real-time Rendering of Large Scale Scenes Based on Multiresolutional Strip Models Qingqiong Deng, Mingquan Zhou, Jiaying Zhang College of Information Science and Technology , Beijing Normal University , Beijing 100875 [email protected] Abstract In the paper, a real-time rendering method based on continuous level of detail models is proposed for large scale scenes. First, each object included in the scene is converted into a triangle strip model, and simplified using edge collapse algorithm. Then, a GPU-oriented data structure is applied to store the information of the simplification. The structure also takes advantage of temporal coherence when the viewing position moves gradually. Using this structure, the LOD model for each object according to the current view can be extracted efficiently with a little communication between the CPU and the GPU, so that a high frame rate can be achieved. In addition, an octree-based culling algorithm is used to clip the objects that are outside of the current viewing frustum for further acceleration on rendering. 1. Introduction Real-time rendering of large scale scenes is important in computer graphics and virtual reality. It involves in numerous applications, such as virtual battlefield, flight simulation, urban visualization, visual environment and entertainment. Usually, a virtual scene contains thousands of objects, and each object consists of thousands of polygons, leading to tens of millions, even billions of polygons for the scene. Although the recent evolution of Graphics Processing Unit (GPU) makes it possible to render such scenes in real time, the requirements on rendering quality and size are increasing at the same time. So, fast and realistic rendering of large scale scenery is still a challenge. Level of detail (LOD) technique is an efficient way to speed up rendering. It is one of the earliest topics in computer graphics [1]. The LOD technique usually contains two phases: preprocessing and rendering. In the first phase, a simplification algorithm is applied to simplify the object to establish multiresolution models of the object. Then, an appropriate level of detail model will be chosen for rendering according a heuristic in the second phase. There are many methods for simplification, such as Vertex Remove [2], Edge Collapse [3,4], Vertex Pair Contraction [5,6] and Vertex Clustering [7]. An overview of these methods is given in [8,9]. There are three kinds of LOD: discrete [10], continues [4], and view-dependent [11]. Discrete LOD creates a small number of models with different geometric details in the preprocessing, and chooses one of the models for rendering. It is simple, efficient, and widely used in graphics libraries and game engines, but it suffers from popping artifacts that appear when switching between the different levels of detail. Continuous LOD can overcome the popping problem, as they offer a wide range (from the coarsest to the finest) of different approximations of the original object. However, the time cost for updating levels of detail will be high, which would lower its overall performance, and make it less attractive for interactive graphics applications. View-dependent LOD is a development of the continuous LOD, and it allows different resolutions coexist in an object at the same time. Although an higher geometric compression ratio can be obtained without sacrificing the visual effect, more complicated computation is required for level-of-detail model extraction process. In this paper, we have proposed a continuous LOD based on triangle strips. It is similar to the methods such as Lodstrips [12] and Speed Strips [13], but with two main improvements. The first is that we can keep the orientation of the triangles when deleting degenerate triangles. The second is that we have adopted a better data structure than that of the Speed Strips [13], which can further decrease the communication between the CPU and the GPU during the extraction process, so that higher frame rates can be achieved.

Transcript of [IEEE 2010 International Conference on Audio, Language and Image Processing (ICALIP) - Shanghai,...

Page 1: [IEEE 2010 International Conference on Audio, Language and Image Processing (ICALIP) - Shanghai, China (2010.11.23-2010.11.25)] 2010 International Conference on Audio, Language and

978-1-4244-5858-5/10/$26.00 ©2010 IEEE ICALIP2010 234

Real-time Rendering of Large Scale Scenes Based on Multiresolutional Strip Models

Qingqiong Deng, Mingquan Zhou, Jiaying Zhang College of Information Science and Technology , Beijing Normal University , Beijing 100875

[email protected]

Abstract

In the paper, a real-time rendering method based on continuous level of detail models is proposed for large scale scenes. First, each object included in the scene is converted into a triangle strip model, and simplified using edge collapse algorithm. Then, a GPU-oriented data structure is applied to store the information of the simplification. The structure also takes advantage of temporal coherence when the viewing position moves gradually. Using this structure, the LOD model for each object according to the current view can be extracted efficiently with a little communication between the CPU and the GPU, so that a high frame rate can be achieved. In addition, an octree-based culling algorithm is used to clip the objects that are outside of the current viewing frustum for further acceleration on rendering.

1. Introduction

Real-time rendering of large scale scenes is important in computer graphics and virtual reality. It involves in numerous applications, such as virtual battlefield, flight simulation, urban visualization, visual environment and entertainment. Usually, a virtual scene contains thousands of objects, and each object consists of thousands of polygons, leading to tens of millions, even billions of polygons for the scene. Although the recent evolution of Graphics Processing Unit (GPU) makes it possible to render such scenes in real time, the requirements on rendering quality and size are increasing at the same time. So, fast and realistic rendering of large scale scenery is still a challenge.

Level of detail (LOD) technique is an efficient way to speed up rendering. It is one of the earliest topics in computer graphics [1]. The LOD technique usually contains two phases: preprocessing and rendering. In the first phase, a simplification algorithm is applied to simplify the object to establish multiresolution models

of the object. Then, an appropriate level of detail model will be chosen for rendering according a heuristic in the second phase. There are many methods for simplification, such as Vertex Remove [2], Edge Collapse [3,4], Vertex Pair Contraction [5,6] and Vertex Clustering [7]. An overview of these methods is given in [8,9].

There are three kinds of LOD: discrete [10], continues [4], and view-dependent [11]. Discrete LOD creates a small number of models with different geometric details in the preprocessing, and chooses one of the models for rendering. It is simple, efficient, and widely used in graphics libraries and game engines, but it suffers from popping artifacts that appear when switching between the different levels of detail. Continuous LOD can overcome the popping problem, as they offer a wide range (from the coarsest to the finest) of different approximations of the original object. However, the time cost for updating levels of detail will be high, which would lower its overall performance, and make it less attractive for interactive graphics applications. View-dependent LOD is a development of the continuous LOD, and it allows different resolutions coexist in an object at the same time. Although an higher geometric compression ratio can be obtained without sacrificing the visual effect, more complicated computation is required for level-of-detail model extraction process.

In this paper, we have proposed a continuous LOD based on triangle strips. It is similar to the methods such as Lodstrips [12] and Speed Strips [13], but with two main improvements. The first is that we can keep the orientation of the triangles when deleting degenerate triangles. The second is that we have adopted a better data structure than that of the Speed Strips [13], which can further decrease the communication between the CPU and the GPU during the extraction process, so that higher frame rates can be achieved.

Page 2: [IEEE 2010 International Conference on Audio, Language and Image Processing (ICALIP) - Shanghai, China (2010.11.23-2010.11.25)] 2010 International Conference on Audio, Language and

235

2. Simplification of 3D models

We use triangle strips to represent each object of the virtual scene. Compared to triangle models, the triangle strip model needs less storage, and it is more efficient in rendering. The Stripe algorithm [14] is used to convert triangle models to strip models in our method. It can process a model consisting with tens of thousands triangles within a few seconds, and it can keep the orientation of the original model.

The strip models are then simplified to construct multiresolution models for the objects. The method proposed in [5] is used for the simplification. The main steps of the simplification are shown as follows:

1 Compute the quadric matrices for all the vertices of the model.

2 Compute the optimal contraction target v', and the cost value for each edge (u v) using the quadric matrices of the vertex u and v. In order to not add any new vertex to the original mesh, the v' can only be u or v.

3 Place all the edges in a heap keyed on cost with the minimum cost pair at the top.

4 Iteratively remove the edge (u, v) of least cost from the heap, contract this edge to v', and update the costs of all edges involving u or v.

Figure 1 shows an example of the simplification. A strip model is simplified by two edge collapse operations.

During the simplification, some degenerate triangles will be appeared. As shown in the lod2 of Figure 1, the triangles 323 and 232 degenerate to a line in fact. Such triangles add no information to the final geometry but increase rendering time. So, we have to delete these triangles in preprocessing. Three kinds of filters are applied to solve this problem. They can filter out a large number of degenerate triangles, but not all. It would be possible to eliminate all degenerate triangles by adding more filtering patterns, but the amount of information transformed from CPU to GPU during the visualization will increase simultaneously, making it is not worth the effort.

The tree filters of our method are listed in the following. The symbol a and b are vertex indices, + represents repetition. The first two patterns can be used for the vertex at any position of a strip, and the last is only process the first and the last vertex of a strip.

1 Repetitions follow the pattern ab(ab)+, and then ab(ab)+ can be replaced by ab.

2 Repetitions follow the pattern aa(aa)+, and then aa(aa)+ can be replaced by aa.

3 Repetitions follow the pattern a(aa)+ or (aa)+(a), and then a(aa)+ or (aa)+(a) can be replaced by a.

About 60% degenerate triangles can be removed by the three filters, and the orientation of the triangles can be kept in this process.

Figure 1: Simplification results of a triangle strip after two edge collapse operations

3. Storage of simplification information

Using the method described in the second section, we can simplify an object from its original model to a triangle. However, we need to store the information of each edge collapse operations, so that we can extract any level-of-detail model that we want.

A GPU-oriented data structure is used to store the simplification information. The structure takes advantage of the coherence between lodi-1 and lodi,where each edge collapse supposes a change in the level of detail. So, only a little communication between the CPU and the GPU is required when updating detail levels.

Two kinds of simplification information should be stored. One is the vertex replacement happened in edge collapse operations. The other involves the changes happened in the degenerate removal.

Three data structures: StripInfo, RepalceInfo and FiltInfo are used to store the simplification information. The number and the indices of the strips involving in each collapse are stored in StripInfo. The information about the vertex replacement, i.e. the two vertex indices preserved and disappeared after each edge collapse,

2lod1 4

0 2 6 8 10

3 5 7 93

Strip: 0 1 2 3 4 5 6 7 8 9 10

Strip: 0 1 2 3 2 5 6 7 8 9 10

Strip: 0 3 2 3 2 5 6 7 8 9 10

0 2 6 8 10

1 3 5 7 9

0 2 4 6 8 10

1 3 5 7 9lod0: original model

lod2 1

Page 3: [IEEE 2010 International Conference on Audio, Language and Image Processing (ICALIP) - Shanghai, China (2010.11.23-2010.11.25)] 2010 International Conference on Audio, Language and

236

and the position where the collapse occurs is stored in RepalceInfo. The degenerate triangle removal information, including the position where the removal happens, the two vertex index arrays before and after the removal, is stored in FiltInfo. When there is no degenerate triangle removal occurs, the position stored in FiltInfo is set to be -1, and the two vertex index arrays are null. In order to reduce the data transformed from the CPU to the GPU in LOD extraction, additional information about the directions of the filtering is stored in FiltInfo. It has two values: 1 (default value) and -1, where the positive value means the two positions stored in RepalceInfo and FiltInfo are counted from the first entry of a strip, and the negative value means that they are counted from the last entry. The direction of a filter depends on the position where the filtering happens. If the position is nearer to the first entry of the strip, then the direction is -1; otherwise, it is 1. Another attention must be paid is that the vertex entry of a strip involved in a filtering and those involved in an edge collapse may be overlaid sometimes. In this condition, the overlaid position stored in FiltInfo is set to -1, means there is no collapse occurs.

The simplification data about the two edge collapse operations of Figure 1, is stored in the three data structures, as shown in Figure 2. The first simplification involves only vertex replacement: vertex 4 is collapsed to vertex 2. The second involves vertex replacement: vertex 1 is collapsed to vertex 3, and it also involves degenerate triangle removal: the repetition 3232 is replaced by 32. In addition, the two operations are overlaid. So, the pos of the RepalceInfo is -1. The two vertex index arrays before and after the removal, i.e.VerSNs_Bef and VerSNs_Aft are 2 1 0 and 0 respectively. However, if we don’t take filtering direction into account, VerSNs_Bef and VerSNs_Aftwill be 3 2 5 6 7 8 9 10 and 5 6 7 8 9 10 respectively. As a result, much more data is needed to transform from the CPU to the GPU when updating lods (see Section 4).

Simp1 Simp2 stripsNum stripSN stripsNum stripSNStripInfo

1 0 1 0

Simp1 Simp2

serSN_Bef serSN_Aft pos

verSN_Bef verSN_Aft po

sRepalceInf

o4 2 4 1 3 -1

Simp1 Simp2 pos

dir

verSNs_Bef

verSNs_Aft

pos

dir

verSNs_Bef

verSNs_Aft

FiltInfo

-1 1 null null 8 -1 2 1 0 0

Figure 2 The three data structures used for storage of the simplification information

4. LOD extraction and rendering

The geometric data of an object, such as the vertex coordinates and normal vectors, remains unchanged during rendering, so that it is initially loaded into the GPU memory as a static data using the Vertex Buffer Objects (VBOs) of OpenGL. The vertex indices of the strips of the object are also loaded into the GPU memory, but as a dynamic data. When viewpoint is changed, we need to update the vertex indices of the strips to get a new lod. The update can be done very fast by using the three data structures: StripInfo,RepalceInfo and FiltInfo.

Figure 3 shows the update from lod0 to lod1, and that from lod1 to lod2. In the first update, only the information stored in the RepalceInfo is useful, and the vertex 4 is changed to vertex 2 accordingly. In the second update, the pos of RepalceInfo is -1, so that it doesn’t work in fact. According to FiltInfo, the vertex 2 1 0 is replaced by 0. It shows that both modify in lods involves a little communication between the CPU and the GPU by changing a few vertex indices.

To render a virtual scene, an octree-based culling algorithm is used to clip the objects that are outside of the current viewing frustum. Then for each object in the viewing frustum, an appropriate LOD model will be extracted according to the current viewing parameters and the object location, by using the method described above. Finally, these models will be rendered.

Figure 3: LOD updating according to the three data structures

5. Experiments and results

Our method is written in the C language based on OpenGL. To show the validity of our method, we have created a virtual scene consisting of warriors and horses, and have rendered the scene on a HP xw4400 workstation with Intel(R) Xeon(R) 1.86GHz CPU, 3GB

2

CPU GPUlod0�lod1: 4�2

0

CPU GPUlod1� lod2: 1�3

Simplification information

Page 4: [IEEE 2010 International Conference on Audio, Language and Image Processing (ICALIP) - Shanghai, China (2010.11.23-2010.11.25)] 2010 International Conference on Audio, Language and

237

memory and an NVIDIA Quadro fx 4600 GPU with 512 memory.

Figure 4 shows 6 different LOD models of a horse. Each strip of the models are rendered using a color random selected from a color table.

Figure 4: Six horse models with different resolutions

Figure 5 shows two snapshots of the virtual scene of warriors and horses. There are 2968 horses and 301 warriors in the scene. All the horses are obtained by instancing a horse sample, which consists of 10924 triangles, and all the warriors are instanced by a warrior sample that consists of 3510 triangles. The scene contains other objects as well, such as war drum, flag, mountains and tower. Before simplification, the scene contains 33,498,410 triangles. The resolution of the two pictures of Figure 5 is 1680 by 1050. The numbers of objects in the two views are 356 and 297, and the rendering speeds of the two views are 21.28 and 32.75 frames per second respectively.

Figure5: Rendering results of the virtual scene composed of warriors and horses

6. Conclusion

In the paper, we have proposed a real-time rendering method based on multiresolution triangle strip models. The method is an improvement of the Lodstriops [12] and the Speed Strips [13]. It can keep the orientation of the triangles when deleting degenerate triangles. In addition, it can reduce the data transfers between the CPU and the GPU when updating levels of detail by taking advantage of the directions of the degenerate triangles filtering. The method also uses an octree-based culling algorithm to clip the objects that are outside of the current viewing frustum. The test on the virtual scene composed of warriors and horses shows the efficiency of our method.

Our presented work oriented towards being able to make full use of the GUP memory, but there is still much room to be exploited in the GPU. For example, the occlusion queries function of the GPU can be used to speed up the rendering further.

Acknowledgements

This work is supported by the key project of the National Natural Science Foundation of China No. 60736008, the National High-Tech Research and Development 863 Plan of China under Grant No. 2008AA01Z301.

References

[1] J.H. Clark, “Hierarchical geometric models for visible surface algorithms”, Communications of the ACM, 1976, 19(10): 547-554. [2] W.J. Schroeder, J.A. Zarge, and W.E. Lorensen, “Decimation of triangle meshes”, In SIGGRAPH '92: Proceedings of the 19th annual conference on Computer graphics and interactive techniques, New York, USA, 1992, pp. 65-70. [3] M.E. Algorri, and F. Schmitt, “Mesh simplification”, In Proc. of the 1996 Eurographics Computer Graphics Forum,1996, volume 5, pp. 78-86. [4] H. Hoppe, “Progressive meshes”, In Proceedings of the Computer Graphics, Annual Conference Series, New Orleans, 1996, pp. 99-08. [5] M.l. Garland, and P.S. Heckbert, “Surface simplification using quadric error metrics”, In SIGGRAPH '97: Proceedings of the 24th annual conference on Computer graphics and interactive techniques, New York, USA, 1997, pp. 209-216. [6] J. Popovic, and H. Hoppe, “Progressive simplicial complexes”, In SIGGRAPH '97: Proceedings of the 24th annual conference on Computer graphics and interactive techniques, New York, USA, 1997, pp. 217-224.

Page 5: [IEEE 2010 International Conference on Audio, Language and Image Processing (ICALIP) - Shanghai, China (2010.11.23-2010.11.25)] 2010 International Conference on Audio, Language and

238

[7] K. Low, and T. Tan, “Model simplification using vertex-clustering”, In SI3D '97: Proceedings of the 1997 symposium on Interactive 3D graphics, New York, USA, 1997, pp. 75-82.[8] P. Cignoni, C. Montani, and R. Scopigno, “A Comparison of Mesh Simplification Algorithms”, Computers & Graphics, 1998, Vol. 22, pp. 37-54. [9] D. Luebke, “A Developer's Survey of Polygonal Simplification Algorithms”, IEEE Computer Graphics and Applications, 2001, 21(1): 24-35. [10] T, Funkhouser, C. Séquin, and S. Teller, “Management of large amounts of data in interactive building walkthroughs”, In Symposium on Interactive 3D Graphics,1992. pp. 11–20.

[11] H. Hoppe, “View-dependent refinement of progressive meshes”, In SIGGRAPH'97, Computer Graphics Annual Conference Series, 1997, pp. 189–198. [12] J.F. Ramos, and M. Chover, “Lodstrips: level of detail strips”, In International conference on computational science,2004, pp. 107–114. [13] O. Ripolles, and M. Chover, “Optimizing the management of continuous level of detail models on GPU”, Computers & Graphics, 2008, 32:307-319. [14] F. Evans, S. Skiena, and A. Varshney, “Stripe: a software tool for efficient triangle strips”, In SIGGRAPH'96: Visual proceedings, Annual conference series, 1996, pp. 153.