Font Size: a A A

Real-Time Dynamic Cloth Simulation On GPUs

Posted on:2010-03-30Degree:MasterType:Thesis
Country:ChinaCandidate:C S JiFull Text:PDF
GTID:2178360275991460Subject:Computer software and theory
Abstract/Summary:PDF Full Text Request
Dynamic cloth simulation is widely used in many applications,including character animation,path planning,computer gaming,medical simulation,and human-computer interaction,Lots of applications show that accelerations of physically-based simulation and collision detection are critical to achieve real-time dynamic cloth simulation.However,the acceleration is limited through improving algorithms on CPUs.Interactive cloth simulation is thus hard to implement.As graphics hardware is developing rapidly,research on GPU-based parallel algorithms draws many attentions in the field of computer graphics.In this master thesis,we present parallel algorithms of physically-based simulation and self-collision detection by using GPU characteristics,and implement an interactive cloth simulation system on the GPU.In the algorithm of physically-based simulation,we use mass-spring system to model the cloth and explicit Euler method to update the system state.The algorithm maps each particle onto one CUDA thread.All the particles/threads are therefore computed in parallel.Since one spring connects two particles in the model,we design a matrix of spring forces to avoid computing each spring twice.Moreover,the number of springs connecting inner particles and boundary particles are different,so the weighting matrix is proposed to uniform the calculation formula of all the particles. The algorithm hereby conforms to GPU qualities,i.e.highly parallelism but low condition-branch capability.For collision detection,we also present a parallel algorithm on GPUs.It takes each particle(not traditional triangle) as a primitive,and bounds the particle-centered local region with a sphere,then encloses the trajectory of the sphere with an AABB. Intersection test of bounding boxes is then performed on GPUs.For balancing the computation on each thread,we propose an equalizing method making each thread do the same amount of intersection testing.The algorithm detects all the self-collisions through one-pass-rendering.When testing intersection,the algorithm only stores data of the first collision with current primitive,instead of computing all colliding pairs. After one-pass-rendering,each thread gets exact time and colliding primitive as the first collision happened,which is the input of collision response and rendering stage.We implement a dynamic cloth simulation system based on the above algorithms using CUDA on the GPU.After system initialization,all the computing work, including simulation computation,collision detection and response,and rendering, runs on the GPU.CPU only plays the role of scheduling and flow-control.We also do some optimization design to accelerate the system,e.g.hierarchical quad-tree,binding read-only data with textures,particle-based normal cone,etc.Experimental results show that our simulation algorithm on the GPU is up to 30 times faster than traditional algorithm on the CPU.And compared with CPU-based algorithm,more than 18 times speedup is observed of our self-collision detection algorithm.
Keywords/Search Tags:Cloth Simulation, Self-Collision Detection, parallel algorithm, GPU, CUDA
PDF Full Text Request
Related items