摘要
凡是需要真实场景和人物动画的图形应用场合,织物模拟都是必不可少的环节之一,其模拟速度和效果往往决定应用整体的效率和真实感。以实时织物模拟为目标,利用GPU(Graphics Processing Unit)并行编程语言CUDA,设计了一种基于弹簧-质点模型的显式织物模拟并行算法。该算法将模拟过程分为计算阶段和渲染阶段。在计算阶段,通过将质点与CUDA的线程一一对应,并行更新质点的速度和位置。算法利用线性存储器纹理解决了越界问题,并通过使用CUDA的共享内存减少对全局内存的访问。为了使各线程负载均衡地填充共享内存,提出nPass方法。在渲染阶段,算法利用CUDA与OpenGL的交互性,直接在GPU上渲染,避免了将数据回传到主存的额外开销。实验结果表明,与CPU算法和传统的GPU算法相比,该算法的模拟速度分别加快了30倍和5倍。
In all graphics applications demanding realistic scene and human animation,cloth simulation is the requisite link,the speed and effect of simulation usually determine the efficiency and the reality of entire application.To achieve real-time cloth simulation,we present the design of a novel spring-mass model based explicit cloth simulation parallel algorithm which uses GPU parallel programming language CUDA.This algorithm divides the simulation process into computing and rendering stages.In computing stage,each particle is mapped onto one CUDA's thread,therefore the velocities and positions of all particles are updated in parallel.By using CUDA′s shared memory,the access of global memory is reduced,and nPass method is proposed to fill the shared memory in a load-balancing way.In rendering stage,the interactivity between CUDA and OpenGL is used to directly render on GPU,so as to have avoided the extra-cost incurred from reading texture back to CPU′s memory.Experimental results show that our algorithm is over 30 times faster than the one on CPU,and 5 times faster than traditional GPGPU method,both at simulation speed.
出处
《计算机应用与软件》
CSCD
2011年第5期147-151,共5页
Computer Applications and Software