用户名: 密码: 验证码:
GPU优化的3D游戏室外大场景的渲染
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
在金融危机的背景下,很多产业出现了大滑坡。而游戏产业仍然保持着连续快速的增长,发展游戏产业对抵御金融危机具有一定的积极作用。目前国内的2D游戏技术已经比较成熟,而3D游戏正在蓬勃发展。在大型的3D网络游戏中,室外场景的渲染占据重要的地位。本文结合GPU的特点,从室外场景地形渲染、室外场景物体管理和室外场景的光影仿真这三个方面来研究室外场景的渲染技术。
     1.室外大地形渲染
     本文在几何裁剪图(Geometry Clipmaps)算法的基础上,结合现代游戏的特点,提出了更适合游戏室外地形的Geometry Clipmaps算法。该算法通过改善Geometry Clipmaps网格和索引组织结构,实现了一次绘制调用渲染整个地形,减少了渲染批次,充分利用了GPU批量渲染能力;并通过在相邻的粗糙层次中增加顶点索引解决裂缝和跳跃问题。采用alpha混合纹理控制地面贴图的位置和权重,使得纹理控制更加灵活。
     2.室外大场景物体管理
     利用场景图算法对场景物体进行管理,并使用四叉树算法对场景进行空间剖分,同时结合轴对称包围盒(AABB),实现场景物体快速裁剪和碰撞检测。在渲染时,对可见物体以渲染状态和材质属性进行分组,从而减少GPU的渲染状态切换,增加渲染速度。对于一些数量极多,但属性类似的物体,采用instancing实例化技术,大大的减少了渲染批次,实现一次GPU绘制调用,渲染一大批物体。
     3.室外场景光影仿真
     对于场景仿真方面,本文主要研究了光影方面的仿真。在充分比较阴影体和Shadow Maps阴影的基础上,采用了Shadow Maps阴影作为基础阴影算法,通过改善Shadow Maps算法,使用CSM (Cascaded Shadow Maps)和VSM (Variance Shadow Maps)结合,完美的解决了大规模场景动态阴影走样的问题。利用Bloom技术模拟HDR效果,加强场景的柔和和高亮效果。通过光影方面的仿真,场景真实感有了较大的提高。
In the context of the financial crisis, many industries are in recession。The game industry is still maintained rapid growth, so the development of the game industry has some positive effects to resist the financial crisis. Currently the 2D games are already quite mature, however the 3D gaming is booming development. In the massively multiplayer online 3D game, the rendering for outdoor scene is very important. In this paper, combined the characteristics of GPU, the main study was focused on the terrain rendering of outdoor scenes, the management of the outdoor scene objects and the simulation of light and shadow。
     1. Rendering for terrain
     In this paper, a more suitable algorithm for 3D game terrain real-time rendering is put forward based on Geometry Clipmaps algorithm and combined with 3D games. In this algorithm, the entire terrain can be rendered through only one Draw Call by improving the structure of grid and the organizational structure of the index, which can take full advantage of GPU. And by increasing the index of vertices in the rougher adjacent level, the issue of crack and jumping can be resolved. Using alpha blend texture to control the location and weight of the texture of terrain, it makes the control of color texture more flexible.
     2. Management of the outdoor scenes'objects
     The scene graph algorithms are used to manage the scene object. Combined with Axis Aligned Bounding Box (AABB), the quad-tree algorithm is used to subdivide the space of the scene, which can faster cull non-visible objects and speed collision detection. When rendering for the visible objects, the objects are sorted and grouped by their render state and material properties, in order to reduce the switch of rendering state and increase the rendering speed. For those objects with many quantity and similar properties, such as grass, instancing technology is used to render these objects. Instancing technology can render these objects only with one Draw Call, and save the graphics memory and the system memory.
     3. The simulation of the light and shadow
     For the simulation of scene, this paper's study is focused on the shadows and bloom effects. Compared with the shadow volumes, shadow maps have been adopted as a basis for shadow rendering. By improving the Shadow Maps algorithm, a perfect combination of CSM and the VSM is to solve large-scale scene dynamic shadows aliasing problem。The technique of blooming used to simulate HDR effects to make the scene brighter.
引文
[1]中国游戏年产业年会组委会2008年中国游戏产业调查报告[R]2009.1
    [2]D P Luebke. A developer's survey of polygonal simplification algorithms[J].IEEE Computer Graphics and Applications,2001,21(3):24-35
    [3]J Clark. Hierarchical geometric models for visible surface algorithms[J]. Communications of the ACM,1976,19(10):547-554
    [4]M Garland, P Heckbert. Surface simplification using quadric error metics[C]. ACM SIGGRAPH 97, Los Angeles, CA,1997
    [5]H Hoppe. View-dependent refinement of progressive meshes [C]. ACM SIGGRAPHA 97, Los Angeles, CA,1997
    [6]R Pajarola, C DeCoro. Efficient implementation of real-time view-dependent multiresolution meshing [J]. IEEE Trans on Visualization and Computer Graphics, 2004,10(3):353-368
    [7]Hugues Hoppe.Progressive meshes.ACM SIGGRAPH, Computer Graphics Proceedings,Annual Conference Series,pp.99-108,1996
    [8]Hugues Hoppe.Smooth view-dependent level-of-detail control and its application to terrain rendering.Proceedings of IEEE Visualization 98,pp.35-42,1998
    [9]Peter Lindstrom,David Koller,William Ribarsky,Larry Hodges,Nick Faust and Gregory Turner.Real-time, continuous level of detail rendering of height fields. ACM Computer Graphics(SIGGRAPH'96),30(3):109-118,1996
    [10]M.Duchaineau,M.Wolinsky,D.Sigeti,M.Miller,C.Aldrich,and M. Mineev-Weinstein.ROAMing terrain:Real-time optimally adapting meshes. Proceeding of IEEE Visualization 97,pp.81-88,1997
    [11]卓亚芬,赵友兵,石教英实时地形绘制算法综述[J]计算机仿真2005年
    [12]Losasso, Frank, and Hugues Hoppe.2004. "Geometry Clipmaps:Terrain Rendering Using Nested Regular Grids." ACM Transactions on Graphics (Proceedings of SIGGRAPH 2004)23(3), pp.769-776
    [13]Arul Asirvatham, Hugues Hoppe.Terrain Rendering Using GPU-Based Geometry Clipmaps. GPU Gems 2,ADDISON-WESLEY,2005,7
    [14]C Erikson, D Manocha, W Baxter. HLODS for fast display of large static and dynamic environments [C]. In:Proc of ACM Symp on Interactive 3D Graphics 2001. New York:ACM Press,2001
    [15]N Govindaraju, et al. Interactive visibility culling in complex environments using occlusion-switches [C]. In:Proc of the 2003 ACM SIGGRAPH Symp on Interacitve 3D Graphics. New York:ACM Press,2003.103-112.
    [16]魏迎梅,吴泉源,石教英.虚拟环境中的碰撞检测方法[J].计算机工程与科学,2001(2):23.
    [17]I Wald, et al. An interactive out-of-core rendering framework for visualizing massively complex models [C]. Eurographics Symp on Rendering, Norrkoeping, Sweden,2004
    [18]J Clark. Hierarchical geometric models for visible surface algorithms[J]. Communications of the ACM,1976,19(10):547-554
    [19]耿卫东,陈为.计算机游戏程序设计[M],电子工业出版社2009.1
    [20]John Owens. Streaming Architectures and Technology Trends GPU Gems 2, ADDISON-WESLEY,2005,7
    [21]Gregory Junker. Pro OGRE 3D programming[M], APress 2006
    [22]Harald Vistnes.GPU地形渲染,游戏编程精粹6中文版人民邮电出版社2007.1
    [23]Francesco Carucci, Lionhead Studios. Inside Geometry Instancing. GPU Gems 2,ADDISON-WESLEY,2005,7
    [24]Instancing Sample.DirectX SDK Document.2004.10
    [25]Gino van den Bergen G. Efficient collision detection of complex deformable models using AABB trees[J]. Journal of Graphics Tools, vol.2 Issue 4, pp.1-13. 1997(4)
    [26]Klosowski J T.Held M.Mitchell J S B Efficient Collision Detection Using Bounding Volume Hierarchies of k-DOPS 1998(1)
    [27]陈学文,丑武圣等.基于包围盒的碰撞检测算法研究[J].计算机工程与应用,2005(5)19.
    [28]Mkar Segal, Carl Korobkin, Rolf vanWideneflt, Jim Foran, and Paul Haeberli. Fast shadows and lighting effets using texture mapping. Conputer Graphics(Singgraph 1992),26(2):249-252, July1992.
    [29]Lnace Willimas.Casting curved shadows on cuvred surafces. Compuer Graphics (Singgraph 1978),12(3):270-274,1978.
    [30]William T.Reeves, David H.Salesin, and Robert L. Cook. Rendering antialiased Shadows with depth maps. Computer Graphics (Singgraph 1987),1(4):283-291, 1987.
    [31]Fnarklin C.Corw. Shadow algorithms for computer graphics. Computer Graphics(Singgraph 1977), 11(3):242-248,1977.
    [32]Tim Heidmann. Real shadows, real time. In Iris Universe, volmue18, Pages 23-31.Silieon Graphics,1991.
    [33]Cass Everit and Mark J.Kilgard.Practical and Robust Stenciled Shadow Volumesfor Hardware-Accelerated Rendering Published on-line at www.developer.nvidia.com
    [34]John Carmack.reverse on shadow volume.unpublished correspondence,2000
    [35]Marc Stamminger and George Drettakis.Perspective shadow maps.ACM Transactions on Graphics(SIGGRAPH 2002 Proceedings),2002,21(3):557-562
    [36]Tobias Martin and Tiow-Seng Tan.Anti-aliasing and continuity with trapezoidal shadow maps.In Proceedings of the Eurographics Symposium on Rendering, 2004:153-160
    [37]M.Wimmer, D.Scherzer and W.Purgathofer.Light space perspective shadow maps.In Eurographics Symposium on Rendering,2004
    [38]Annen T, Mertens T, Bekaert P, Siedel H-P, and Kautz, Convolution shadow maps[j]. In Proceedings of the Eurographics Symposium on Rendering.2007, pp: 51-60,.
    [39]Donnelly, W., and Lauritzen, A. Variance Shadow Maps. Symposium on Interactive 3D Graphics, Proceedings of the 2006 Symposium on Interactive 3D Graphics and Games.2006, pp.161-165.
    [40]Lauritzen, Andrew and McCool, Michael. Layered variance shadow maps. Proceedings of graphics interface 2008, May 28-30,2008, Windsor, Ontario, Canada
    [41]Engel, Woflgang F. Section 4. Cascaded Shadow Maps. ShaderX5, Advanced Rendering Techniques, Wolfgang F. Engel, Ed. Charles River Media, Boston, Massachusetts.2006. pp.197-206.
    [42]Cascaded Shadow Maps. DirectX SDK Document.2009.8
    [43]Common Techniques to Improve Shadow Depth Maps. DirectX SDK Document. 2009.8
    [44]邹志昴.实时阴影绘制算法研究及在城市仿真中的应用[硕士学位论文].华中科技大学2007.pp:16-1
    [45]ShadowMap. DirectX SDK Document.2004.7

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700