Realistic real-time rendering for large-scale forest scenes


of 8
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Realistic real-time rendering for large-scale forest scenes
  Realistic Real-time Rendering for Large-scale Forest Scenes Guanbo BAO Hongjun LI Xiaopeng ZHANG ∗ Wujun CHELIAMA-NLPR, Institute of Automation, CAS, ChinaMarc JAEGERCIRAD AMAP, INRIA, EPI DigiPlante, France A BSTRACT Fast rendering of a large-scale forest landscape scene is importantin several applications, like video games, Internet graphics applica-tions, landscape and cityscape scene design and visualization, andvirtual forestry. A challenge in virtual reality is realistic renderingof large scale scenes consisting of complex geometric plant models.A series of level of detail tree models are constructed to compressthe overall forest complexity in view-dependent forest navigation.Here a new leaf modeling method has been presented to have leaf models match well leaf textures, so that the visual effect and modelcomplexity can be balanced. In addition, vertex buffer objectsand tree clipping operation allow rendering large forests containingthousands of trees in real-time. Experiments show these techniquescan be easily applied to applications such as video games and inter-active navigation of landscapes. Walk-through and flyover a forestare both available using our techniques. Keywords:  real-time rendering, level of details, GPU, forest trees 1 I NTRODUCTION Rendering a realistic large forest scene in real-time plays an impor-tant role in virtual reality applications, e.g., virtual forestry, virtualtour and computer games. Since a forest consists of an extensivenumber of highly complex geometric models, real-time forest ren-dering is still a challenge.In this paper, we present techniques for realistically renderinghighly detailed forests with realtime shadows. Since a forest withthousands of plants contains a vast amount of geometry, we presentan efficient level of details (LOD) algorithm to generate multireso-lution (MR) models following forest features (Sec.3). We introducea new leaf modeling method to have leaf models match well leaf textures. In Sec.4, we introduce our techniques for realistic forestrendering. Weadoptparallel-splitshadowmapping(PSSM)[17,16]generation scheme in our rendering system. We organize the dataof tree models into vertex buffer objects to improve the renderingperformance. A tree clipping operation is presented and used bothin the view frustum and in the light frustum to avoid rendering mod-els outside the current frustum and remove the popping up and off effects. The combination of these techniques allows us to realisti-cally render large forests consisting of many highly detailed plantmodels in real-time. Finally we will present experiment results andconclude this paper. 2 R ELATED WORK Rendering forests in real-time has been intensively studied, andmany successful methods have been developed. The representativemethods are described as follows. Point/Line based rendering : Point models and line models areefficient for rendering small polygons. Point models were first used ∗ e-mail: in plant rendering by Reeves et al.[15]. Both points and lines usu-ally combine with polygons to construct hybrid models for trees.Polygonal geometry is used in close distance, but more points andlines are used to represent the trees by randomly sampling as theviewer moving away from the tree. Point-based rendering of treesis effective only for distant objects since it is visually unacceptablewhen coming up closely. Image based rendering : Image-Based Rendering (IBR) is ef-ficient and has been used to represent tree models for many years.Billboards are the simplest of the IBR techniques. They are tri-angles or quadrilaterals covered by a semi-transparent 2D texture.They allow efficient rendering of complex natural objects such asgrass. Their rendering is more efficient than polygon-based render-ing since a single primitive replaces a large amount of geometry,and they are still considered to be the best choice in many recent in-dustrial simulators. Several kinds of billboards have been designed.The simplest is a billboard which represents a whole model al-ways facing the camera. This method shows no parallax when thecamera is moving, but, if inspected closely, it looks unrealistic dueto weak geometry. Therefore it is often used in the background. Abetter approximation is the fixed crossed quadrilaterals of two orthree billboards crossing each other to represent trees to produce amore three-dimensional impression, resulting in a cardboard look.However, artifacts occur in the direction parallel to a billboard.Billboard Clouds, introduced by Decoret et al.[7], are the meansof extreme simplification. This method represents geometry by aset of arbitrarily oriented billboards. It can generate virtually pleas-ing results with smooth geometry models. However, it fails to work optimally for plant models of high complexity, mainly because theused plane-space transform does not provide significant viewingeffects due to the noncompact geometry of tree models. Manymethods have also been introduced dealing with the plant models,such as the methods by Fuhrmann et al.[11](Figure 1), Behrendtet al.[2](Figure 2), Candussi et al.[3], Ismael et al.[12] and Bao etal.[1]. These modified methods use billboard clouds to representmodels’ geometry by a set of arbitrarily oriented billboards, lead-ing a significant reduce in the number of polygons. Figure 1: A tree represented by Billboard Cloud. [11] But the simplified models lose much of the srcinal geometry in-formation. The simplified trees are not suitable for close-up viewbecause of the weak parallax artifacts and thus dynamic lighting for  Figure 2: A scene rendered using billboard cloud trees. [2] them is hard to achieve. Zhang et al.[18] proposed a representationfor a forest model, called hierarchical layered depth mosaics. Dis-crete textured quadrilaterals are generated from the sampled depthimages of the polygonal tree models and organized with a hierar-chy structure. This method realizes the fast display of a large-scaleforest. However, its storage cost is too high to achieve the real-timeshadow and dynamic lighting effects. Volume based rendering : A volume is a 3D reference, e.g. abox containing one or more instances of the object that will be ren-dered. A GPU-based lighting and shadowing of complex naturalscenes, proposed by Cohen et al.[4], add great realism for volumeencoded forest scenes; however, these visually pleasing effects areachieved by pre-computing the filtering textures and horizon maps.Decaudin et al.[5] utilize no periodic tiles of volumetric texturesto render vast and dense forests by using the texturing power of graphic hardware. These volumetric textures are generated by con-verting plants’ geometry into a series of parallel image slides andare tiled over the ground to represent forests. Volume representa-tion offers full parallax effect from any viewing direction: whenthe viewer is moving, objects are correctly rendered with no flat-ness impression in contrast to with billboards and it is good forflight simulation. However, walking-through into the forest is notavailable yet. Taking advantage of the GPU geometry shader, De-caudin et al. improved their method and introduced volumetricbillboards[6](Figure 3). The foliage of plant model is presented bya set of volumetric textures called volumetric billboards. Walking-through into the forest is possible, but the memory cost is so highthat only a small number of trees can be rendered. Figure 3: A tree rendered using volume billboard. [6] Polygon based rendering : Polygon is the primitive to repre-sent the geometric model of a plant. Many geometric simplificationmethods have been explored to eliminate minor geometric details.Multiresolution modeling and Levels of Detail (LOD) algorithmsare two frequently used methods to address polygon decimationand geometry compression. These methods are efficient in simpli-fying smooth objects, but cannot be applied to trees without chang-ing their overall appearances because of complex topology of trees.Deng et al.[9] proposed a simplification method based on LOD forconiferous leaves by using two representations, i.e. cylinder andline, to represent close and far coniferous leaves respectively, andlines can be merged for further simplification. Automatic genera-tion of multiple LOD for trees is a non-trivial task, and those meth-ods do not support plants naturally, for their foliage consists of agreat number of isolated surface patches. Shadows to enhance rendering realism : In 3D applications,shadow has the nice property of offering a better perception of the3D shape of the displayed objects. It can dramatically enhance thereality of virtual environments and computer generated images.Shadow map and shadow volumes are two popular techniquesto produce real-time shadows. The main advantage of shadow vol-umes is that they are accurate to the pixel, however, shadow map-ping is often faster than shadow volume in forest rendering, becauseshadow volume polygons are often very large in terms of screenspace and require a lot of fill time, whereas shadow maps do nothave this limitation.Shadows generated by one single shadow map usually sufferfrom the inherent aliasing artifact. This artifact appears more ob-viously for a large scale outdoor space. Parallel-split shadow map-ping (PSSM) introduced by Zhang et al. [16, 17] splits the viewfrustum into different depth ranges by using split planes parallel tothe view plane, and then renders multiple shadow maps for the splitparts. It is suitable for rendering large forest with anti-aliasing, thuswe adopt PSSM generation scheme in our rendering system Figure 4: PSSM camera frustum splits. [16, 17] With their impressive improvement of the performance, currentGraphics Process Units allow us to render much more complexscenes in real-time. Modern computer applications, especially thevideo games, increasingly raise the level of realism of forest in theirscenes and detailed models are more suitable for realistically ren-dering. We integrate PSSM with a LOD method to achieve real-time realistic forest rendering. 3 T REE MODELING AND MODEL PROCESSING Modeling of tree foliage and tree model processing are two keyaspects of this work, where special techniques on level of detailtree foliage models presented are here. And an extraction of treeLOD models is the key factor for fast rendering, since forest modelcompression is necessary. 3.1 Tree modeling and simplification A new technique on level of detail tree foliage models are presentedwith texture mapping considered here. 3.1.1 Branch model processing Tree skeleton models could be obtained either from plant mod-eling software AMAP, or from the work of Liu et al.[14] wheretree skeleton models can also be obtained by two input images:sketches of main branches and crown silhouette on one input im-age, and sketches of two boundary branches and crown silhouetteon anther input image. According to the work of [10], a series of   static multi-resolution models are constructed, which are used inreal-time scene rendering talked next section. We used this methodto construct branches only because it can generate continual LODmodels. Continual LOD models are useful not only for efficientmemory cost but also for model switching when we wander in aforest. 3.1.2 Leaf model processing From observation, most leaf’s curl degree depends on the vein. Bydefining a leaf vein quadratic interpolation function, leaf geometrycan be obtained and leave LOD models can be easily extracted [13].However, because two edges of a leaf are parallel lines, a slightdistortion of leaf may be caused(See Figure 5(a)). In order to avoidthe distortion, we adopt a new strategy to calculate the coordinatesof edge points. T SUHM    x     f(x)   AB   C   D   N   P   (a) Edge in line [13]. B M A T S U 1 T 1 S 1 N C D H (x) (b) Edge corresponding vein. Figure 5: Leaf modeling A leaf vein, call as an arc, can be seen as a part of a parabola.The arc length, that is the leaf length  L , and the arc height  D  canbe measured from an actual leaf. Leaf curl degree can be definedby the dihedral angle which can be represented by    AMB . Whena leaf need be drawn in a designated position, the coordinates of   A ,  B ,  M  ,  N   and the leaf normal direction −→ n  are known. For calcu-lating the interpolation points along the vein, we employ a parabolafunction  f  (  x ) =  4  D (  L −  x ) /  L 2 ,  0 ≤  x ≤  L  (1) (a) Peach leaf. (b) Lotus leaf. (c) Lotus flower. Figure 6: A Leaf model with different texture images. As for the geometric significance of the formula, we can under-stand from Figure 5(b). Point  T   is any a point in vein line and  H  is the projection point of   T   on the plane which contains point  M  and accompanies with a nonzero vector normal  −→ n  . Then  x  is thedistance from  H   to  M  , and  f  (  x )  is the distance from  T   to  H  . The in-terpolation points in vein and edge points are calculated in differentmethod from [13] in that −→ OT   = −−→ OM  +(  x / |  MN  | ) −−→  MN  +  f  (  x ) −→ n  (2)where,  O  is the srcin of any a global coordinate system, and theleaf normal direction −→ n  is unit vector. −→ OU   = −→ OT   + −→  MB  (3) −→ OS   = −→ OT   + −→  MA  (4)The edge points calculated with the method will not be parallellines, but keep pace with vein, which decreases the distortion of the leaf shape. Of course, random factor is to be used for eachparameter, which is not explicitly placed in above formulas.As for leaf texture coordinates, it is also easily to calculate.Let  m  be the number of points in vein,then corresponding to threecurves, the texture coordinate of the  ith  points respectively are S  ( 0 . 0  f  , i / m ) ,  T  ( 0 . 5  f  , i / m )  and  U  ( 1 . 0  f  , i / m ) , where  i  =  0 , 1 ,..., m .This kind of leaf geometry model in our opinion has an advantageoverothermodelsinthatwiththesameleafmodel, textureimage(inalpha format) can be conveniently changed, and the same time thevisual effect is kept. Figure 6 shows the same leaf model with dif-ferent texture images. (a) 4 polygons. (b) 1 polygon. (c) Union or split. Figure 7: Leaf models change base on quadric function Not only can these leaf models easily match many textures, butalso they can balance the visual effect and rendering speed when alarge forest or scene are to be shown. If a tree is closed to the viewpoint, the most detail leaf model can be adopted, and if a tree is faraway from the view point, the least detail one should be employed.Figure 7 shows a series of leaf models with different complex de-gree. Transition between the polygons model (see Figure 7(a)) andone quadrilateral model (see Figure 7(b) ) can be finished by usingthe function 1. If the distance between the tree and the view pointdecreases, the value of   D  decreases and the number of polygonsdecreases too. On the contrary is also true. Transition between theFigure 7(b) and Figure 7(c) is depend on the a method[8], becausethe method can simplify plant organ following the structure of leaf phyllotaxy and flower anthotaxy, we adopt this approach to man-age foliage in rendering for extreme simplification. In addition, thenumber and distribution of phyllotaxy in each branch are consid-ered. (a) 4 polygons (b) 1 polygon (c) union Figure 8: Rendering results when a leaf represented with differentpolygons. Phyllotaxy is basic information of the structure for the distribu-tion of leaves and flower, so we have to construct phyllotaxy ge-ometry with experience or by measuring a real phyllotaxy of a tree.Some indicators, such as the number of leaves in each node, the an-gle between two leave, the angle between axis and leaf, should betaken into account.The visual realism of a tree becomes lower and lower when thenumberofpolygonsrepresented aleaf decreases. Figure8(a) showsa part of a tree. Its leaf is represented with 4 polygons, and it getsgreat realism. In Figure 8(b), each leaf is represented with onerectangle, the visual realism decreases. And in Figure 8(c), severalleave with union strategy is represented by one quad. Its realism isthe weakest among these pictures.  3.2 Extraction of Plant LOD models A large forest often consists of thousands even millions of trees. If each tree is represented with the most detail information, memorywill be exhausted. In order to save memory meanwhile keep therealistic, LOD models often are used. However, for a large forest,too many LOD models also exhaust the memory. Therefore, we justuse 4 or 5 LOD models as a series to represent a tree instance. (a1)13546 (b1)6298 (c1)2874 (d1) 716 (e1) 282(a2)8473 (b2)6302 (c2)3668 (d2)2920 (e2) 538 Figure 9: LOD series of tree models Because occlusion is common in forest, the lower resolutionmodels can reduced to extreme case. With the simplification meth-ods introduced in section 3.1, five LOD models have been selectedaccording to rendering effect. The model is closer to view point,the size is larger. Figure 9 illustrates a LOD series which will beused in experiment in section 5. The number of polygons in eachmodel is shown in the subtitle of each sub-figure. 4 R EAL - TIME  F OREST  R ENDERING We employ PSSM to produce real-time and anti-aliasing shadows.Figure 10 shows the rendering results of different single trees usedin our system. (a) (b) (c) Figure 10: Some single trees rendered with real-time and anti-aliasing shadows. (a) A simple tree. (b) A black popular with complexbranching structure. (c) An apple tree with fruit and dense foliage. 4.1 Forest Scene Layout. With some LoD tree models created with the method presentedabove, a large forest scene can be constructed as follows. A dig-ital terrain model (DTM) covers an area of 262144 square meters.In the digital terrain model, there are 5 instances which produce7446 tree positions with uniform distribution. Each instance owns4 LOD models(from highest resolution to lowest one denoted as t  1 , t  2 , t  3 , t  4 )and one of them will be used according to the distance d  ct   between the view point and the tree position. The rule is t  ∗ =  t  1 ,  0 ≤ d  ct   <  d  1 t  2 ,  d  1 ≤ d  ct   <  d  2 t  3 ,  d  2 ≤ d  ct   <  d  3 t  4 ,  d  3 ≤ d  ct  (5)where 0 ≤ d  1 ≤ d  2 ≤ d  3 .  d  i  means the threshold distance to theview point.Figure 11(c) shows the result of experiment with real-timeshadow. In the scene, there are 7446 trees and 1671 in view portwhich displays 2162588 polygons, and the time costs about 0.083sper frame. Without LOD strategy, the forest costs more time, morethan 0.33s per frame, if only the detail models are used at all posi-tions ( Figure 11(a) ). If all tree are represented with the simplestmodel( Figure 11(b) ), it costs little time, about 0.0625s per frame,but the realism is poor. (a) Forest rendering with most detailed.(b) Forest rendering with simplified models.(c) Forest rendering with LOD models. Figure 11: Forest rendering with real time shadows.   Plant Geometric Models Generating LOD Series Specification of a Simplified Model The first pass rendering in the light’s post-perspective space The second pass rendering by using programmable GPU shaders Generating VBOs Generating Shadow Maps Rendering realistic images OfflineData preparation Figure 12: Data processing flow chat. 4.2 Forest Rendering We employed several techniques to improve the rendering perfor-mance, such as clipping trees operation, vertex buffer object.Since it is unnecessary to render trees outside the current camerafrustum, we take clipping operation for each tree to cull those out-side the frustum. We project eight corners of each model’s bound-ing box from the object coordinates to the viewport coordinates. If neither of the projected points is in the window’s viewport space,the tree will not be rendered. This approach is effective to cullingtrees far away from the camera. However, it will cause popping upand popping out artifact for trees near the viewer leading close-upviewing for the near trees unavailable.To fix these popping effects, we first check two additional pointswhile culling. One is the center of the front face of the bound-ing box and the other is the back face’s center. If any projectionof the four points (including the bounding box’s left bottom andthe right top points) is in the window’s viewport, the tree will berendered. Another restriction is the distance. We set a clippingdistance threshold  µ   which is not too large. Trees with distancesto the viewer less than  µ   will be rendered no matter whether theyare in the camera frustum or not. Although a few trees outside thecamera frustum could be rendered, it brings little overhead to theoverall performance. The clipping operation is employed in bothview frustum before rendering and the subdivided light frustumswhen generating the shadow maps. The clipping operation is basedon the bounding boxes of the trees.Takeing full advantage of the GPU capacity, we organize the treemodels’ the vertices, normals and texture coordinates into VertexBuffer Objects (VBOs). Vertex Buffer Object is an OpenGL ex-tension. It provides an interface that allows the array data to bestored in high-performance graphics memory, thereby promotingan efficient data transfer and avoiding repetitive calls of graphicsfunctions. This technique dramatically enhances the performance.LODs are used for tree rendering based on distances to theviewer. We make four levels of detail for each tree species to re-duce the rendering burden. In our implementation, the finest LODis made up of 6000 - 8000 triangles and the coarsest LOD consistsof 800 - 1100 triangles. The detailed data processing flow of ourrendering system is shown in Figure 12. 5 E XPERIMENTS AND  R ESULTS Our rendering technique has been implemented in the C++ lan-guage with OpenGL 2.0 library. All shaders are written in theOpenGL Shadering Language (GLSL). All experiments are imple-mented on a PC with an Intel Core(TM) i7 CPU at 2.66GHz with3G RAM, a NVIDIA GeForce GTX260 graphic card with 896Mvideo memory.In rendering, we set the distance threshold  µ   to 10 meters andrender all scenes with 4 shadow maps. The scene shown in Fig-ure 13, composed of 6350 highly detailed trees, was rendered inrealtime with realist shadow effects. 433 trees were rendered in theview frustum, containing more than one millions polygons, with anaverage frame rate of 13 . 91 fps. The scene in Figure 14 was an-other view of flying over the same scene on dawn with 443 trees inview frustum. The scene was rendered with an average frame rateof 11 . 85 fps. Both scenes contained 5 types of trees and each typewith 4 levels of details. Table 1 displays detail results of renderingperformance including FPS, tree number in current view frustum,the parameters to set LOD distances, tree and polygon numbers ineach LOD, polygon number in current view frustum. Figure 15shows another scene rendered in our rendering system with an av-erage FPS of 11.04. There are 7446 trees in the scene, 1216 treesin the viewfrustum. 6 C ONCLUSION AND FUTURE WORK The techniques presented in this paper make it possible to renderlarge forest scenes consisting of tens of thousands of highly detailedtrees at interactive frame rates, even with a realistic real-time shad-owing effect. Close-up viewing for trees, walk-through and flyovera forest are available. It can be applied easily in the video gamesand interactive visualization applications.In the future work, the following aspects should be considered toincrease rendering speed, quality and application areas.1. The rendering of terrain would be more efficient by using adynamic LOD algorithm.2. Navigation in the internet environment should more consid-ered in virtual reality. In order to make a progressive render-ing of the scene for web applications, LOD data should becarefully organized for data progressive transmission throughweb so that the forest can be rendered immediately when asimple model of each tree is obtained.3. Aliasing and light bleeding still exist in the shadow, filteringmethods should be employed to eliminate the artifacts.4. The strategy of shadow map generation scheme is another lineof promising research, where the the synthesis of shadow im-ages still consumes much computer resource, so it is neces-sary to reuse the shadows for more frames.5. As tree branches and trunks are irregular and complex, wetry to use techniques to enhance the realism of branches andtrunks, such as bump mapping or displacement mapping.6. Fast global illumination methods like ambient occlusionwould be integrated in our rendering system to give modelsa global illumination-like effect. A CKNOWLEDGEMENTS The apple tree model was created with the help Dr. Jiu Liu. Allother tree models in this paper are from the output of AMAPGenesis TM  software. This work is supported by National Nat-ural Science Foundation of China with projects No. 60970093,61072151, 60872120, and No. 60902078; and No. 60872120; in
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks