节点文献
基于CUDA平台和粒子系统技术的实时烟花模拟
Real-time Simulation of Fireworks Based on CUDA Platform and Particle System Technology
【作者】 刘刚;
【导师】 刘福岩;
【作者基本信息】 上海大学 , 计算机应用技术, 2013, 硕士
【摘要】 在计算机图形学领域,人们一直试图利用计算机再现周围的真实世界,烟花就是其中之一。早在春秋战国时期中国就出现了烟花,如今烟花已经是人们节日欢庆中重要的组成部分。烟花场景具有丰富的表面纹理和不规则的外部轮廓,并且能够随时间的推移而动态地、随机地发生变化,因此很难使用传统计算机图形学的建模方法实时模拟。如何简化、有效的对烟花场景建模是需要解决的关键问题。粒子系统技术可以实现烟花场景模拟的动态性和随机性,是模拟边界模糊场景的最有效方法之一,其优点是通过控制烟花粒子的运动模型就可以构造出传统计算机图形学难以构造的复杂场景,所以场景建模方法简单。但是要获得逼真度高、实时性好的烟花场景,就需要使用大量的烟花粒子,这对计算机硬件提出了很高的要求。本文将CUDA平台应用于粒子系统的烟花模拟是因为CUDA平台能充分利用GPU的并行计算能力,把烟花粒子属性更新的计算放在GPU上,从而有效提高属性更新速度。并使用CUDA与OpenGL的互操作功能减少CPU与GPU之间的通信,具体实现过程是初始化后的粒子属性数据由CPU传输到GPU,通过CUDA平台下的kernel函数并行更新后直接发送到显卡驱动程序进行渲染而不需要传回CPU。本文还根据程序中运算数据的特征,结合CUDA存储器模型,使用CUDA函数将程序数据存储在显卡的不同存储器中来提高代码执行的效率。本文采取了优化策略,通过优化显存访问、指令流等,尽量减少冗余指令的执行以及存储器之间的数据交换,提高了代码的执行效率。实验表明,基于CUDA平台的烟花模拟达到了实时性要求,且当烟花粒子数目较多时,明显优于CPU平台下的模拟效果。
【Abstract】 In the field of Computer Graphics, firework is one reproduction of the realworld that people have been trying to use computer. Fireworks play an importantpart in people’s festival celebrating, which appeared in China as early as thespring and autumn Period. It is difficult to use a conventional computer graphicsmodeling methods to simulate fireworks scene, because it has an abundantsurface texture and an irregular outer contour, changes dynamically andrandomly with time. The key issues that need to be addressed are how to modelthe fireworks scene simplify and effective.Particle system technology can achieve the dynamic and randomness of thefireworks scene, so it’s one of the most effective methods of analog boundaryfuzzy scene, whose advantages is using simple fireworks particles to construct acomplex scene, and have strong element of truth and the real-time nature.However it is difficult for traditional computer graphics. To get the image of thetrue level of real-time rendering, we need to use a large number of particles in asimulation scenario, whose demands are high on computer hardware. CUDAplatform used in fireworks simulation based on particle system technology isbecause CUDA platform can take full advantage of the parallel computingpower of the GPU, put fireworks particle attributes updated calculation on theGPU to improve the speed of the attribute update effectively. Using CUDA andOpenGL interoperability functions to reduce the communication between theCPU and the GPU, the concrete realization of the process by the CPU isinitialized particle attribute data transferred to the GPU, and sent directly to thegraphics driver updated in parallel by CUDA platform kernel functionprocedures for rendering without the need to return the CPU. Also in accordancewith the procedures in operational characteristics of the data, the paper combined with the CUDA memory model program data stored in the graphicsmemory using CUDA function to improve the efficiency of code execution.Taken optimization strategy by optimizing memory access, the instructionstream, to minimize the exchange of data between the redundant execution ofthe instruction and a memory and improve the efficiency of the implementationof the code. The experiments shows that based the CUDA platform fireworksanalog to real-time requirements, and the simulation results significantly betterthan the CPU platform, when the particles are more.
【Key words】 CUDA; Particle Systems; Fireworks Simulation; GPU Programming;