摘要
直接体绘制技术是科学计算可视化的重要研究内容,目前在许多科学领域得到了广泛应用。传统直接体绘制技术存在绘制速度慢、交互性差的缺点,但应用领域对数据可视化结果的真实感、可视化过程的实时交互性要求却越来越高。
本文在系统地研究与分析直接体绘制的基本原理、典型绘制方法以及相关加速绘制技术的基础上,针对目前直接体绘制技术存在的问题,结合GPU的特点,对基于GPU的体绘制流水线以及体绘制预处理加速技术、基于GPU的光线投射绘制、基于GPU的混合数据场绘制技术进行了深入研究,并完成了相关算法与原型系统实现。本文的主要工作和取得的主要研究成果包括:
(1)提出一种基于GPU的体数据预处理加速算法。本文对目前GPU体绘制流水线结构进行了深入地分析,为消除流水线速度瓶颈,采用自适应数据划分剔除算法对体数据进行子划分,剔除空白子块后将子数据块定义成子纹理块,然后使用体纹理打包算法VTP将子纹理块打包成适合GPU纹理内存的纹理,再依次传输至GPU纹理内存中。实验结果表明加速算法有效地提高了流水线实际吞吐率,与原始算法相比,加速算法节省了40%~60%的绘制时间。
(2)提出一种基于GPU的单遍光线投射体绘制算法。本文在深入研究经典光线投射算法以及基于三维纹理切片算法的基础上,针对已有算法存在预先计算梯度耗时、存储空间需求大的问题,将传统基于CPU的光线投射算法映射到GPU上执行,通过片元程序动态计算梯度插值来节省存储空间和提高图像质量。与传统三维纹理切片体绘制算法相比,本文算法无需回读数据和回写颜色缓冲区即可在GPU上的一个通道内完成绘制,达到了实时交互的绘制要求。
(3)提出一种基于GPU的混合数据场绘制方法。本文在研究已有混合数据场绘制算法的基础上,针对混合数据场求交复杂、绘制效果不理想的问题,结合改进的混合光照模型,提出了一种等值面快速求交算法。实验结果证明采用混合光线跟踪算法绘制混合数据场时,新算法比经典光线跟踪求交算法绘制速度快20%。
(4)在对上述算法进行分析设计与实现的基础上,本文构建了基于GPU的光线投射体绘制系统框架GRV。实验结果表明,该框架通过采取本文提出的基于GPU的体数据预处理加速算法、单遍光线投射体绘制算法以及混合光线跟踪绘制算法,充分发挥了GPU性能、有效减少了CPU负担并显著提高了场景绘制速度,是一个简单、快速、易于实现和扩展的直接体绘制实时交互绘制框架。
Direct Volume Rendering is an important research content of Visualization in Scientific Computing, it has been widely applied in many scientific filed at present. Traditional Volume Rendering limited to its low rendering speed, poor interactive shortcomings, however, the demand for the realistic and interactive of visualization is growing fast to the application areas.
Based on the systematic research of basic principle, classical rendering methods and some accelerate technology of Direct Volume Rendering, aimed at the limitation of Direct Volume Rendering, we have researched the volume rendering pipeline and pre-process accelerate technology, ray casting and hybrid volume rendering based on GPU. The contributions and relevant work in this paper are as follows:
Firstly, an accelerated pre-process algorithm based on GPU is presented. We have analyzed the volume rendering pipeline based on GPU, to solve the bottleneck of the speed of pipeline, the new algorithm first partition the volume data adaptively and eliminate the empty region of sub-data, then convert the sub data to sub-textures, finally, it use the algorithm called VTP to packing the sub-textures to volume textures, which fits the texture memory of GPU. The results show that the proposed method improves the pipeline and accelerates the rendering speed.
Secondly, a single pass ray casting of volume rendering based on GPU is presented. We have analyzed classical ray casting and texture mapping of volume rendering, to solve the problems of large memory requirement and time costing of pre-compute gradient, we map the ray casting based on CPU into GPU, compute the gradient use fragment shader on the fly. Compared to the traditional ones, the proposed single pass algorithm do the rendering in one pass without re-read data or re-write the color buffer, and the proposed algorithm can meet the requirements of the interactive rendering.
Thirdly, a hybrid volume rendering based on GPU is proposed. Based on the research of the existed hybrid algorithms, to solve the complex of intersections between ray and hybrid data and poor rendering effects, we present a new first intersection algorithm between ray and isosurface. The results show that when rendering hybrid data, the speed of the proposed algorithm is faster than the old ones.
Finally, we have developed a framework named GRV based on analyses and implementation of algorithms above. The results demonstrate that the framework develops GPU performance, reduces CPU overhead and improves the rendering frame rate significantly. It is a simple, fast and flexible framework for real-time and interactive of Direct Volume Rendering.
引文
[1]McCormick BH,DeFanti T A,Brown M D.Visualization in Scientific Computing.Computer Graphics,1987,1(2):99-108
[2]唐泽圣等,三维数据场可视化,北京:清华大学出版社,1999
[3]Lorensen W E,Cline H E.Marching Cube:a High-resolution 3D Surface Construction Algorithm.Computer Graphics,1987.21(4):163-169
[4]http://www.nvidia.cn/page/home.html
[5]Michael M.The GPU Enters Computing's Mainstream.IEEE Computer Society,2003.36(10):106-108
[6]Richard S.Wright,Benjamin Lipchak.OpenGL Super Bible.Architecture Review Board.2004
[7]John Montrym.The GeForce 6800.IEEE Computer Society,25(2):41-51,2005
[8]彭延军,石教英,体绘制技术在医学可视化中的新发展,中图图像图形学报,2002.12
[9]Levoy M.Volume Rendering by Adaptive.Visual Computer.1990,6(1):2-7
[10]Cheng L,Yu C.An efficient volume-rendering algorithm with an analytic approach.The Visual Computer,1996.515-526
[11]Jung A,Sung M,Jong B.Efficient Multi Resolution Volume Rendering scheme.Image Display and Visualization.SHE Press,2000:134-140
[12]Milos S.Fast Surface Rendering From Raster Data by Voxel Traversal using Chessboard Distance.Proceedings of Visualization'94,1994.188-195
[13]Yagel R,Shi Z.Accelerate Volume Animation by Space Leaping.IEEE Visulization'93:IEEE Computer Society Press.1993,166-168
[14]Levoy M.Efficient Ray Tracing for Volume Data.Computer Graphics,1990,9(3):245-261
[15]Agate M,Grinsd L.The HERO Algorithm for Ray Tracing Octrees.Advance in Computer Graphics Hardware,1997,12(3):61-73
[16]Glassner A.Space Subdivision for Fast Ray Tracing.IEEE CG&A,1984,4(1):15-22
[17]Wihelms J,Golder A.Octrees for Faster Isosurface Generation.Computer Graphics,1998,11(3):134-145
[18]Sungup C,Hngeongdo K.Efficient Space Leaping Method for Volume Rendering.Medical Imaging 1999,SHE Conference on Visual Data Exploration and Analysis,Munich:SPIE Press,1999,263-270
[19]Etrl T,Westermann R,Grsso R.Multi Resolution and Hierarchical Methods for the Visualization of Volume Data.Future Generation.Computer System,1999,1 5(1):31-42
[20]Kim T Y,Shin YG.An Efficient Wavelet-based Compression Method for Volume Rendering.Computer Graphics and Applications,Proceedings 7th Pacific Conference Singapore:IEEE Computer Society Press,1999:147-156
[21]Michel A W,Jos B T.X-ray Volume Rendering by Hierarchical Wavelet Splatting.Pattern Recognition,Proceedings,15th International Conference.Washington:IEEE Computer Society Press,2000,159-163
[22]Pfister H.,Kaufman A.and Chiuch T..Cube-3:A Real-Time Architecture for High-Resolution Volume Visualization.Proceeding of 1994 Symposium on Volume Visualization,Washington D.C.,1994.75-82
[23]Pfister H..Kaufman A..Cube-4:A Scalable Architecture for Real-Time Volume Rendering,Proceeding of 1996 Symposium on Volume Visualization,San Francisco,C.A,Oct.,1996,47-54
[24]Kreeger,K.and Kaufman A.Hybrid Volume and Polygon Rendering with Cube hardware.Proceedings of the ACM SIGGRAPH/EUROGRAPHICS workshop on Graphics hardware,1999:15-24
[25]Knittel.G.,A Compact Volume Rendering Accelerator.Proceedings of 1994Symposium on Volume Visualization.1994:67-74
[26]Pfister.H.,et al.The VolumePro Real-time Ray-casting System.Proceedings of the 26th annual conference on Computer graphics and interactive techniques 1999.Los Angeles,CA.USA
[27]Knittel,G.and W.Strasser,Vizard-Visualization Accelerator for Realtime Display.Proceedings of the ACM SIGGRAPH/EUROGRAPHICS workshop on Graphics hardware 1997:139-146
[28]T Gunther,C Poliwoda,C Reinhart,J Hesser.A Massively Parallel Processor for Realtime Volume Visualization in Medicine.Proc.Euro graphics Workshop,Oslo,Norway,1994:103-108
[29]夏放怀,沈振康等,一种用于实时体绘制系统的自适应采样算法,电子学报,2002.3
[30]Cullip,T.J.,Accelerating Volume Reconstruction with 3D Texture Hardware.Technical Report.1994.TR93-027
[31]Westermann,R,T.Ertl,Efficiently using Graphics Hardware in Volume Rendering Applications.Computer Graphics(SIGGRAPH 98 Proceedings),1998:291-294
[32]Meiβner,M.,S.Guthe,W.Strasser,Interactive Lighting Models and Pre-integration for Volume Rendering on PC Graphics Accelerators.Proc Graphics Interface'02,2002:209-218
[33]Kruger.J.,R.Westermann.Acceleration Techniques for GPU-based Volume Rendering.Proceedings of the 14th IEEE Visualization 2003(VIS'03) 2003
[34]Roettger,S.,S.Guthe.Smart Hardware Accelerated Volume Rendering.Proceedings of EG/IEEE TCVG Symposium on Visualization VisSym'03.2003
[35]Stegmaier,S.,et al.,A Simple and Flexible Volume Rendering Framework for Graphics-Hardware-based Ray Casting.Proceedings of the International Workshop on Volume Graphics'05,2005:187-195
[36]Klein,T.,et al.,Exploiting Frame-to-Frame Coherence for Accelerating High-Quality Volume Ray Casting on Graphics Hardware.Proceedings of IEEE Visualization'05,2005:123-230
[37]陈为,彭群生,鲍虎军,视点相关的层次采样:一种新的硬件加速体光线投射算法,软件学报(JOURNAL OF SOFTWARE),2006.17(3):p.587-601
[38]Woop,S.,J.Schmittler.RPU:A Programmable Ray Processing Unit for Real Time Ray Tracing.Proceedings of ACM SIGGRAPH 2005
[39]Goodsell,D.,Mian,s.,et al.,Rendering Volumetric Data in Molecular Systems.Mol.Graphics,7(3),1989
[40]Gordan,D.,Reynolds,R.,Image Space Shading of 3D Objects.CVGIP.Vol.29,1985
[41]Elisa,A.,F.Schmidt,Combined 3D Visualization of Volume Data and Polygonal Models using a Shear-Warp Algorithm.Computer& Graphics,2000,583-601
[42]Enhua,W.,Wencheng,W.,An efficient algrithm for rendering volume data with geometric objects.Journal of Computer-Aided Design & Computer Graphics,1998.28-32
[43]Kreeger,K,et al.Mixing Translucent Polygons with Volumes.Proceedings of Conference on Visualization'99.1999
[44]Kajihara,K.,et al.A Method of Rendering Scenes including Volumetric Objects using Ray-Volume Buffers-Exanding to Render Scenes including Overlapped Volumetric Objects.Proceedings of the Computer Graphics International(CGI'03),2003
[45]Levoy M.,A Hybrid Ray Tracer for Volume and Polygon Data.IEEE Computer Graphics & Applications,1990,10[2],33-40
[46]Guthe S,Ward M,Gonser J,Strasser W.Interactive Rendering of Large Volume Data Sets.IEEE Visualization 2002,IEEE Press,2002,53-60
[47]Wei L,Kaufman AE.Accelerating Volume Rendering with Texture Hulls.IEEE symposium on Volume Visualization,IEEE Press,2002,115-122
[48]C.Zeller.Balancing the Graphics Pipeline for Optimal Performance,Graphics Developer Conference 2002,http://developer.nvidia.com/,2002
[49]童欣,唐泽圣,基于空间跳跃的三维纹理硬件体绘制算法,计算机学报,1998,21(9),807-812
[50]Yagel R.Towards Real Time Volume Rendering.Proceedings of Graphics'96,1996.230-241
[51]Manfred W,Rudiger W,et al.Level-of-Detail Volume Rendering via 3D textures.Proceedings of the 2000 IEEE symposium on Volume visualization,2000,7-13.
[52]Wei L,Kaufman AE.Texture Partitioning and Packing for Accelerating Texture-based Volume Rendering
[53]Weiler M.,Kraus M.,Hardware-Based Ray Casting for Tetrahedral Meshes.Procceedings of IEEE Visualization'03(2003).333.340
[54]Wilson O.Van Gelder,Wilhelms Direct volume rendering via 3D textures.Santa Cruz:University of California,UC2 SC2CRL294219.1994
[55]Sobierajski L.M,Kaufman A.,Volumetric Ray Tracing.Proceedings of 1994symposium on Volume Visualization,1994.11-18
[56]Christian R,Frank Z,.Reconstruction of Volume Data with Quadratic Super Splines.IEEE Transactions on Visualization and Computer Graphics,2004,10(4),397-409
[57]Gerd M,Andreas K,et al.Fast and Accurate Ray-Voxel Intersection Techniques for Iso-Surface Ray Tracing.VMV 2004.16-18