Font Size: a A A

Complicated-Cloth Simulation On GPUs

Posted on:2011-01-02Degree:MasterType:Thesis
Country:ChinaCandidate:X T RongFull Text:PDF
GTID:2178360305497949Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
Among all the applications of virtual reality demanding real scene and human animation, cloth simulation is very important, whose speed and effect usually decide the efficiency and the reality of entire application. Nevertheless, two critical phases of cloth simulation, physically-based simulating and collision detection, are time-consuming, real-time simulation is therefore hard to achieve on CPUs. Recently, as GPU's excellent parallel computing capability gets more and more attention and is developed very fast, 'CPU+GPU' has been taken as a revolutionary direction of computer architecture. Therefore, in this master thesis, the author presents cloth simulating algorithm and collision detection algorithm on GPUs, and further implements an interactive cloth simulation system.In the thesis, mass-spring model is used to represent cloth, and explicit Euler method to update system state as time evolves. In the proposed parallel algorithm, each particle is mapped onto one GPU thread. Therefore, velocities and positions of all the particles are updated in parallel. By using CUDA's texture from linear memory, over-bound accessing is avoided. For reducing access of global memory, the algorithm employs CUDA's shared memory. And nPass method is given to fill shared memory in a load-balancing way.In the collision detection phase, a hierarchical 4-ary AABB tree is used to decrease the size of potential colliding set, which is built and updated in parallel on GPUs. The 4-ary AABB tree is built and rebuilt in the preprocessing phase of the algorithm, in which each leaf node is mapped onto one GPU thread. With two different representations of hierarchical 4-ary tree, array and B+ tree, the updated algorithms are proposed respectively. In both algorithms, the 4-ary tree is updated bottom-up. On each hierarchy of the 4-ary tree, all the nodes are updated in parallel. After constructed, the 4-ary tree is used to detect the collisions with all the primitives in parallel. Thus the complexity the algorithm is very low.In the developed cloth simulation system, the entire simulation flow is done on the GPU after some initialization work on the CPU, which avoids extra cost of data transfer between the CPU and the GPU. The experimental results show that the parallel simulating algorithm is about 30 times faster than the one on CPUs and 20 times faster when parallel collision detection is included.
Keywords/Search Tags:Cloth Simulation, Collision Detection, GPGPU, CUDA
PDF Full Text Request
Related items