Cloth Simulation was the second assignment for the graphics module in the masters year of my degree. It consists of simulating a particle lattice using forces and constraints that results in a cloth-like material when rendered. The normal method of simulating cloth - such as Nvidia's method found here - uses the geometry shader, however for this implementation I used a new feature in DirectX 11 called the compute shader.
- Language: C++,
- IDE: Visual Studio 2012,
- Graphics API: DirectX 11.
A great deal of research went into the DirectX 11 pipeline, how to use the compute shader, general cloth simulation and verlet integration in order to get the cloth rendering using the GPU at a good framerate.
This was a fairly small project and so the design was already readily available within the Nvidia paper linked above and other resources on the internet. I created a new class to encapsulate all of the cloth properties and setup.
The above image shows the program running alongside the debug window showing the force controls and the time taken for the class to setup the cloth. During university I would often time my code and attempt to speed it up as much as possible.
The full project and code can be downloaded from my Github account. The write up is also available, it contains a more in-depth explanation of the research, design and implementation phases of this project and can be found here.