基于GPU优化的三维实时渲染技术的研究
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
科学计算可视化、计算机动画及虚拟现实是最近几年来在计算机图形学领域内三大发展方向,其技术核心均为三维真实感图形。当前三维实时渲染技术在军事、航天、航空、医学、地质、勘探、三维游戏和工业计算机辅助设计等方面有着十分广泛的应用。
     中央处理单元CPU(Central Processing Unit)作为一种通用处理器,要兼顾程序执行和数据运算的并行性、通用性以及它们的平衡性,因此CPU内部大多数的晶体管都用于制造庞大的缓存和复杂的逻辑控制单元,运算单元所占有的比例较小,虽然近年来CPU也出现了多核的产品,不过这样并没有提高晶体管的利用率。与此同时,在游戏产业的推动下,计算机图形处理器(Graphics Processing Unit) GPU的性能正以每年翻倍的速度发展,为了实现更逼真的图形效果,GPU支持越来越复杂的运算,而且在性能上,主流GPU的单精度浮点运算可达到同期CPU的十倍左右,外部存储器带宽为CPU的五倍左右,采用基于GPU计算的构架,所需要的成本和功耗都要优于CPU。而CUDA的问世更克服了许多传统上基于GPU的光线追踪算法所遇到的困难。
     本文对基于GPU优化的三维实时渲染问题进行了详细的分析,并提出了相应的解决思路和解决方法。主要研究内容包括:GPU三维实时渲染管线的优化处理和并行计算性能优化处理;传统阴影算法及其不足,并对比了光栅化和光线追踪的优缺点。主要工作包括:
     介绍了GPU的技术框架及其图形渲染管线,包括超长流水线、并行计算、顶点处理器、片元处理器等。并针对GPU与CPU的不同,重点分析和讨论了GPU的加速原理以及当前比较成熟的CUDA通用计算模型构架及其特点。
     从渲染管线和并行计算两个方面研究了三维实时渲染的优化。在渲染管线方面,分别对渲染管线中常易出现瓶颈的阶段进行了分析,并相应地提出了各个阶段的优化方法。在并行计算方面,以最短时间,在允许误差范围内完成既定的计算任务为优化目标,将重点放在计算的密度和吞吐量上,并总结出在CUDA构架下,并行计算性能优化的三个原则,为实现三维实时渲染系统打下了坚实的理论基础。
     介绍了阴影的概念及分类,分析了传统基于光栅化的阴影渲染方法和策略,总结了各种阴影算法的不足。采用光线追踪的渲染方式能反映现实世界中光线的多次传播,但其缺点是计算量非常大的,处理计算的时间也较长。为了解决这一不足,本文提出一种基于GPU可并行的PKD-Tree构造算法对三维场景进行划分,以检测光线与场景中物体相交的情况并表现出实时阴影,并给出了与传统KD-Tree计算的比较结果。
     针对实时三维渲染的重要瓶颈——图形生成速度,本文实现了一个基于GPU的三维实时渲染系统。该系统根据目前图形处理的软硬件体系结构,特别是硬件加速器的图形处理能力,以及图形生成所采用的各种技术对实时渲染进行加速。除此以外,还根据虚拟场景的组织结构和图形生成所需的真实感程度(例如是否产生反射或折射,反射的次数)等因素分析了各种PKD-Tree遍历方法,并详细分析了各种光线二次处理的方法,最后利用递归的方式实现了逼真光效的渲染结果。
     最后,文章针对未来三维实时渲染技术研究趋势以及研究方向进行了探讨。
Scientific visualization, computer 3-D (Three dimension) animation and virtual reality are the three major research direction in computer graphics recently, and the core technology is 3D realistic graphics. Current 3D real-time rendering technology is commonly applied in many fields including military, aerospace, aviation, medicine, geology, exploration,3D games and CAD (Computer-aided design) industry etc.
     CPU (Central Processing Unit) is a general purpose processor, which needs to consider the balance among the program execution, data parallel computing and universality, so most of the transistors in CPU are used for the large cache and complex logic control unit, but the occupation probability of operation unit is very small. Although multi-core CPU products appear, it doesn't improve the utilization of the transistor. At the same time, propelled by the game industry, GPU (Graphics Processing Unit) performance rate is doubled per year. In order to achieve more realistic graphics effect, more and more complex operations are supported by CPU. The single-precision floating-point operations of the mainstream GPU can reach about ten times performance of CPU in the same period, and the external memory bandwidth is about five times the CPU. GPU computing architecture beats the CPU in the cost and power consumption. As CUDA comes out, it overcomes many difficulties that the traditional GPU-based ray tracing algorithms encountered.
     This dissertation gives a detailed analysis on 3-D real-time rendering optimization based on GPU and also proposes some effective solutions and suggestions. The main research includes:3-D real-time rendering GPU pipeline optimization methods and parallel computing performance optimization methods; the traditional shadows algorithm; the pluses and minuses of rasteration.The main work and contributions of this dissertation are listed as following:
     Firstly, a technical framework of GPU and its graphics rendering pipeline are introduced, which includes super pipelines, parallel computing, vertex processor, and fragment processors. For the difference between GPU and CPU, the acceleration principles of GPU are analyzed; and the general-purpose computing model of current mature framework CUDA and its characteristics are discussed.
     Secondly, parallel computing and rendering pipeline in 3-D real-time rendering optimization are studied. For the rendering pipeline, all the bottleneck stages that often occur in pipelines are analyzed and the optimization methods for all the stages are put forward accordingly. In parallel computing, the optimization goal is to complete the calculation within the allowable error in the shortest time, therefore, calculation density and throughput become the key points, and three parallel computing optimize principles which lay a solid theoretical foundation for 3-D real-time rendering system are summarized in the CUDA architecture.
     Thirdly, the concept and classification of shadow are introduced, then the strategies of traditional rasterization-based shadow rendering are analyzed and the deficiencies of a variety of shadow algorithms are summarized. Rendering using ray tracing method can reflect the real world, however, the drawback is that the computation is very huge and computing processing is quite long. Therefore, we propose a GPU-based parallel PKD-Tree can be constructed 3-D scene on the division algorithm to detect objects in the scene light and intersection of the situation and demonstrate real-time shadows, and make comparison with the traditional KD-Tree.
     For the 3-D real-time rendering bottleneck - graphics generation rate, a GPU-based 3-D real-time rendering system is implemented. The system is based on current graphics hardware and software architecture, in particular the graphics capabilities of the hardware accelerator and the graphics are generated by the variety of acceleration. In addition, according to the organizational structure of the virtual scene and graphics realistic levels, the PKD-Tree traversal methods and second light treatment methods are analyzed, after that, the results of realistic light effect using recursively rendering are realized.
     Eventually, research trends of 3-D real time rendering technology are discussed.
引文
1. 边馥苓 主编.空间信息导论[M].测绘出版社.2006.8
    2. 边馥苓 编著.数字工程的原理与方法[M].测绘出版社.2006.12
    3. 李德仁,刘强,朱庆.数码城市GIS中建筑物室外与室内三维一体化表示与漫游[J].武汉大学学报 信息科学版2003年6月第28卷第3期
    4.Philip J.Schneider David H.Eberly著,周长发译.计算机图形学几何工具算法详解[M].电子工业出版社.2005
    5. Dave Shreiner, Mason Woo,Jackie Neider, Tom Davis著,邓郑祥译.OpenGL编程指南(第四版)[M].北京:人民邮电出版社,2005.
    6.Donald Hearn, M. Pauline Baker著,蔡士杰,吴春镕,孙正兴等译.计算机图形学(第二版)[M].电子工业出版社.2002
    7. Owens J.D., Luebke D., Govindaraju, et al. A survey of general-purpose comutation on graphics hardware [C]. Computer Graphics Forum,80-113,2007.
    8. Moreland K. Angel E. The FFT on a GPU [C]. In proceedings of Graphics Hardware. San Diego. California.2003
    9. Akira Nukad, Yasuhiko Ogata, Toshio Endo, Satoshi Matsuok. Bandwidth intensive 3-D FFT kernel for GPUs using CUDA [C]. Conference on High Performance Networking and Computing. Austin, Texas.2008
    10. http://www.optitex.com/en/products/3DRunway_Tools [OL]
    11. http://www.scicomp.com/derivativesmodeling/benefits [OL]
    12. http://www.manifold.net/index.shtml [OL]
    13. Moreland K., Angel E.. The FFT on a GPU [C]. In proceedings of Graphics Hardware. San Diego. 112-119.2003
    14. Aaron Lefohn, Ross Whitaker. A GPU-Based Three-Dimensional Level Set Solver with Curvature Flow [R]. University of Utah tech report.2002.
    15. Aaron E. Lefohn, Joe M. Kniss, Charles D. Hansen, Ross T. Whitaker. Interactive Deformation and Visualization of Level Set Surfaces Using Graphics Hardware [C]. IEEE Visualization Proceedings of the 14th IEEE Visualization.2003.
    16. Nathan A. Carr, Jesse D. Hall, John C. Hart. The ray engine. SIGGRAPH/EUROGRAPHICS Conference On Graphics Hardware. Saarbrucken, Germany.37-46.2002
    17. Sven Woop, Jorg Schmittler, Philipp Slusallek. RPU:A Programmable Ray Processing Unit for Realtime Ray Tracing [C]. ACM Transactions on Graphics (TOG).434-444.2005
    18. Nathan A. Carr, Jesse D. Hall, John C. Hart. GPU Algorithms for Radiosity and Subsurface Scattering [C]. SIGGRAPH/EUROGRAPHICS Conference On Graphics Hardware.San Diego, California.51-59.2003
    19. Greg Coombe, Mark J. Harris, Anselmo Lastra. Radiosity on graphics hardware [C]. ACM International Conference Proceeding Series.161-168.2004
    20. Timothy J. Purcell, Craig Donner, Mike Cammarano, Henrik Warm Jensen, Pat Hanrahan. Photon mapping on programmable graphics hardware [C]. SIGGRAPH/EUROGRAPHICS Conference On Graphics Hardware. San Diego, California.41-50.2003
    21. Naga K. Govindaraju, Ming C. Lin, Dinesh Manocha. Quick-CULLIDE:Efficient inter-and intra-object collision culling using graphics hardware. In Proceedings of IEEE Virtual Reality.2005
    22. Jens Kruger, Peter Kipfer, Polina Kondratieva, Rudiger Westermann. A particle system for interactive visualization of 3D flows. IEEE Transaction on Visualization and Computer Graphics. 2005
    23. Naga K. Govindaraju, Brandon Lloyd, Wei Wang, Ming Lin, Dinesh Manocha. Fast computation of database operations using graphics processors. International Conference on Computer Graphics and Interactive Techniques. Los Angeles, California.2005
    24. Bingsheng He, Ke Yang, Rui Fang, Mian Lu,Naga K. Govindaraju, Qiong Luo, Pedro V. Sander Relational Joins on Graphics Processors.2008 ACM SIGMOD international conference on Management of data. Vancouver, Canada.511-524.2008
    25. Naga K. Govindaraju, Nikunj Raghuvanshi, Dinesh Manocha. Fast and approximate stream mining of quantiles and frequencies using graphics processor. Proceedings of the 2005 ACM SIGMOD international conference on Management of data. Baltimore, Maryland.611-622.2005
    26. S. Guha, S. Krisnan, S. Venkatasubramanian. Data visualization and mining using the GPU. Tutorial at 11th ACM International Conference on Knowledge Discovery and Data Mining.2005
    27. http://cuda.csdn.net/[OL]
    28.李博,刘国峰,刘洪.地震叠前时间偏移的一种图形处理器提速实现方法.地球物理学报.2009年第52卷第1期
    29.朱庆.对3维GIS技术进展的思考[J].地理信息世界.第02卷第3期.2004年6月
    30.罗岱,谢茂金,曹卫群,黄心渊.基于GPU编程的地形可视化[J].中国图象图形学报.2008年第13卷第11期
    31.史胜伟,姜昱明,朱新蕾.基于GPU的真实感地形绘制[J].电脑开发与应用2008年第21卷第 6期
    32.潘宏伟,李辉,廖昌阊,曾安祥.一种基于现代GPU的大地形可视化算法[J].系统仿真学报2007年第19卷第14期
    33.高辉.基于GPU的大规模地形快速渲染技术研究[D].国防科学技术大学.2006年
    34.石雄,朱毅.一种面向现代GPU的大规模地形渲染技术[J].成都信息工程学院学报.2009年第24卷第3期
    35.达来,曾亮,李思昆.基于GPU的地形遮挡剔除算法[J].系统仿真学报.2006年第18卷第11期
    36.高辉,张茂军,熊志辉.基于GPU编程的地形纹理快速渲染方法研究[J].小型微型计算机系统2009年第4期
    37.吴恩华.图形处理器用于通用计算的技术、现状及其挑战术[J].软件学报.2004年第15卷第10期
    38.吴恩华,柳有权.基于图形处理器GPU的通用计算[J].计算机辅助设计与图形学学报.2004年第16卷第5期
    39.黄敬磊.GPU通用计算中的数据结构组织与应用研究[D].中国人民解放军信息工程大学.2007年
    40.崔雪冰,张延红,王康平.基于GPU的通用计算模型[J].河南科技大学学报:自然科学版.2009年第30卷第3期
    41.左颢睿,张启衡,徐勇,赵汝进.基于GPU的并行优化技术[J].计算机应用研究.2009年第26卷第11期
    42.王磊,张春燕.基于图形处理器的通用计算模式[J].计算机应用研究.2009年第26卷第6期
    43.徐品,蓝善祯,刘兰兰.利用GPU进行通用数值计算的研究[J].中国传媒大学学报自然科学版.2009年第16卷第2期
    44.韩博,周秉锋.GPGPU性能模型及应用实例分析[J].计算机辅助设计与图形学学报.2009年第21卷第9期.
    45.赵改善.地球物理高性能计算的新选择:GPU计算技术[J].勘探地球物理进展.2007年第30卷第5期
    46.倪炜.GPU通用计算研究[J].黑龙江科技信息.2009年第16期
    47.魏紫,徐鹏.面向通用计算的GPU编程平台[J].中国科技博览.2009年第24期
    48.张健,陈瑞.图形处理器在通用计算中的应用[J].计算机工程与设计.2009年第30卷第14期
    49.Randi J. Rost著.天宏工作室译.OpenGL着色语言[M].人民邮电出版社.2006
    50. William R. Mark, R. Steven Glanville, Kurt Akeley, Mark J. Kilgard. Cg:A System for Programming Graphics Hardware in a C-like Language [C]. Proceedings of SIGGRAPH.2003
    51. Peeper C, Mitchell JL. Introduction to the DirectX 9 High-Level shader Language. http://ati.amd.com/developer/ShaderX2_IntroductionToHLSL.pdf [OL].2003
    52.张怡,张加万,孙济洲,柯永振.基于可编程图形加速硬件的实时光线投射算法[J].系统仿真学报.2007年第19卷第18期
    53.何晶,陈家新,黎蔚.基于GPU的实时光线投射算法[J].计算机工程与应用.2008年第44卷第9期
    54.梁承志,高新波,邹华,王向华.空间跳跃加速的GPU光线投射算法[J].中国图象图形学报2009年第14卷第8期
    55.储璟骏,杨新,高艳.使用GPU编程的光线投射体绘制算法[J].计算机辅助设计与图形学学报.2007年第19卷第2期
    56.郑杰.基于GPU的高质量交互式可视化技术研究[D].西安电子科技大学.2007年
    57.李冠华.基于GPU的三维医学图像处理算法研究[D].大连理工大学.2008年
    58.李胜,陈舒毅,汪国平,吴恩华.具有散射效果的室内外光束实时绘制[J].计算机辅助设计与图形学学.2007年第19卷第12期
    59.刘力,马利庄.基于GPU的水底阴影[J].计算机辅助设计与图形学学报.2008年第20卷第4期
    60.吕伟伟,孟维亮,薛盏超,吴恩华.基于GPU的近似软影实时绘制[J].计算机辅助设计与图形学学报.2009年第21卷第3期
    61.王京,王莉莉,李帅.一种基于GPU的预计算辐射度传递全频阴影算法[J].计算机研究与发展.2006年第43期第9卷
    62.严建林.真实感实时阴影绘制及其GPU加速[D].华中师范大学.2009年
    63.卢俊,张保明,黄麓,李二森.基于GPU的遥感影像数据融合IHs变换算法[J].计算机工程2009第35卷第7期
    64.徐少平,文喜,肖建,曾文.一种基于Cg语言在图形处理器GPU上实现加密的方法[J].计算机应用与软件.2008年第25卷第4期
    65.顾钦.基于GPU计算的虚拟现实仿真系统设计模型[J].微处理机.2005年第2期
    66.喻家龙,姜太平,汪光阳.在GPU上基于物体空间的碰撞检测[J].安徽工业大学学报.2009年第26卷第4期
    67.罗军,王玲.基于GPU的粒子系统的实现技术[J].微计算机信息.2008年第24卷第2-1期
    68.毛国超.基于GPU和粒子系统的水墨效果研究与实现[D].上海大学.2009年
    69.刘保权,刘学慧,吴恩华.基于GPU的实时深度图像前向映射绘制算法[J].软件学报.2007年第18卷第6期
    70.张嘉华,梁成,李桂清.GPU三维图元拾取[J].工程图学学报.2009年第1期.
    71.袁友伟.采用GPU加速的三维实体模型绘制[J].电子学报.2008年第12期
    72.田绪红,司徒志远,陈茂资,韩国强.基于GPU的3D距离变换[J].计算机应用研究.2008年第25卷第9期
    73.李苏军,杨冰,高宇,吴玲达.基于GPU的大规模海浪实时绘制[J].计算机仿真.2008年第25卷第5期
    74.李莉娅,陈福民,周海波.基于GPU的几何体实例化研究[J].计算机应用与软件.2008年第25卷第11期
    75.黄蓝枭,卢光辉,何明耘,蔡洪斌.基于GPU的实时景深模拟[J].计算机应用研究.2008年第25卷第10期
    76.李胜,黄鑫,汪国平.基于GPU的视点相关自适应细分[J].计算机辅助设计与图形学学报2007年第19卷第4期
    77.闯跃龙,贾金原,刘金义.基于GPU加速的TIP技术[J].计算机辅助工程.2008年第17卷第4期
    78.曲洋,黄永忠,王磊.流式缩减技术在GPU上的研究与应用[J].计算机工程与设计.2008年第29卷第5期
    79.刘世光,柴佳伟,闻嫒.三维动态云快速模拟的新方法[J].计算机研究与发展2009年第46卷第9期
    80.杨柏林,潘志庚.面向移动设备的各向异性纹理映射方法[J].计算机辅助设计与图形学学报2007年第19卷第5期
    81.李建明,万单领,何荣盛,钱昆明.一种基于GPU加速的图像颜色传递算法[J].大连理工大学学报.2008年第48卷第2期
    82.汤颖,张宏鑫,张美玉.基于图形硬件的纹理图像编码与实时绘制算法[J].计算机学报.2007年第30卷第2期
    83.刘耀林。邱飞岳,王丽萍.基于GPU的图像快速旋转算法的研究及实现[J].计算机工程与科学.2008年第30卷第6期
    84.周强,彭俊毅,戴树岭.基于可编程图形处理器的实时景深模拟.系统仿真学报.2006年第18卷第8期
    85.章忠杰.3D实时渲染技术的研究与应用[D].同济大学软件学院.2007年
    86.张彩云.基于GPU的3D水墨画效果的研究[D].成都电子科技大学.2009年
    87.陈志伟.基于统计模型和GPU的实时海浪模拟研究[D].苏州大学.2009年
    88.董朝.基于可编程图形硬件加速的若干技术研究[D].浙江大学.2005年
    89.候涛.三维仿真场景优化理论与算法研究—以北京奥林匹克公园为例[D].中国科学院研究生院2006年
    90.杨柏林.移动环境中三维图形传输机制与流水线优化算法研究[D].浙江大学计算机学院.2007年
    91.黄蓝枭.游戏引擎中特效的实时渲染技术研究[D].成都电子科技大学.2008年
    92.Randima Femando编著、姚勇,王小琴译、龚敏敏,黄东海审校.GPU精粹——实时图形编程技术、技巧和技艺[M].人民邮电大学出版社.2006年
    93.Matt Pharr编著,龚敏敏译.GPU精粹Ⅱ——高性能图形芯片和通用计算的编程技巧[M].清华大学出版社.2007年
    94.刘姚新.基于GPU的实时绘制算法研究[D].重庆大学.2007年
    95. H. Nguyen(ed.), GPU Gem 3-3D and General Programming Techniques for GPUs [M]. Addison Wesley,2007.
    96. T. Mattson, et al., Patterns for Parallel Programming, Addison Wesley,2005.
    97. Tim Foley, Jeremy Sugerman. Kd-tree acceleration structures for a gpu raytracer[C]. Proceedings of the ACM SIGGRAPH/EUROGRAPHICS conference on Graphics hardware.2005
    98. Daniel Reiter Horn, Jeremy Sugerman, Mike Houston, and Pat Hanrahan. Interactive k-d tree GPU raytracing [C]. Proceedings of the 2007 symposium on Interactive 3D graphics and games.2007
    99. Jon P. Ewins, Marcus D. Waller, Martin White, Paul F. Lister, Implementing an anisotropic texture filter, Computers & Graphics, Volume 24, Issue 2, April 2000, Pages 253-267
    100. Jacco Bikker. Real-time ray tracing through the eyes of a game developer [R]. Symposium on Interactive Ray Tracing.2007
    101. http://openrt.de/. [OL]
    102. Turner Whitted. An Improved Illumination Model for Shaded Display [J]. Graphics and Image Processing.1980
    103. Alexander Reshetov, Alexei Soupikov, Jim Hurley. Multi-level ray tracing algorithm[C]. ACM SIGGRAPH.2005
    104. Timothy J. Purcell, Ian Buck, William R. Mark, Pat Hanrahan. Ray Tracing on Programmable Graphics Hardware [C]. ACM Transactions on Graphics.2002
    105. NVIDIA Corporation. NVIDIA CUDA Compute Unified Device Architecture Programming Guide. Version 1.0.2007
    106. NVIDIA Corporation.GPU Programming Guide GeForce 8 and 9 Series.2008
    107. Khronos Group. OpenCL Parallel Computing for Heterogeneous Devices.2009
    108. http://cn.slizone.com/object/sli_cuda_learn_cn.html. [OL]
    109. http://www.amd.com/us/PRODUCTS/WORKSTATION/GRAPHICS/CROSSFIRE-PRO/Pages/cro ssfire-pro.aspx. [OL]
    110. http://www.microsoft.com/downloads/details.aspx?familyid=20735F91-5896-4A86-80DD-ADDB8 333DA61&displaylang=en. [OL]
    111. Christopher C. Tanner, Christopher J. Migdal, and Michael T. Jones. The Clipmap:A Virtual Mipmap[C]. International Conference on Computer Graphic.1998
    112. Lance Williams. Casting Curved Shadows on Cruved Surfaces. [C] SIGGRAPH 1978
    113. Franklin C. Crow, Shadow Algorithms for Computer Graphics. [C] SIGGRAPH 1977
    114. Philippe Bergeron. A General Version of Crow's Shadow Volumes. [J] IEEE Computer Graphics and Applications. vol.6, no.9, pp.17-28, Sept.1986
    115. http://www.caustic.com/index.php. [OL]
    116. Daniel Pohl. Ray Tracing and Gaming-Quake 4:Ray Traced Project. [OL] http://www.idfun.de/temp/q4rt/.2006
    117. Ingo Wald. Real-time Ray Tracing and Interactive Global Illumination. [D] Saarland University. 2004
    118. Stefan Popov, Johannes Gunther, Hans-Peter Seidel, and Philipp Slusallek. Stackless KD-Tree Traversal for High Performance GPU Ray Tracing. [C]Computer Graphics Forum 26(3), pp.415-424, 2007, (Proceedings of Eurographics)

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

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

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