Add GPU_vs_CPU

Schaken 2025-01-23 12:22:45 -05:00
parent 2889a3e1b7
commit 42fa942142

25
GPU_vs_CPU.md Normal file

@ -0,0 +1,25 @@
# The power of the GPU
*Comparisons between CPU and GPU cloth
Tested on: Windows 10, i7-6500U @ 2.50GHz 12GB RAM, GeForce 940M 8GB (A Laptop)*
The timestep of the simulation determines how many times the entire algorithm is run per frame. A lower timestep is generally required as the resolution of the cloth increases, though the cloth will appear very stiff when the timestep is too low. In the below graph, we can see that the GPU version of the algorithm handles a decreasing timestep a lot better than the CPU. | ![https://i.imgur.com/1Gd72Yl.png](https://i.imgur.com/1Gd72Yl.png) |
| -------- | -------- |
| The iteration number controls the number of times the constraints are enforced. Similar to the timestep, a higher iteration number is usually required as the simulation gets more complex; an overly-high iteration number will also make the cloth seem stiff due to the over-enforcement of the constraints. The GPU version of the algorithm also does a much better job here than the CPU version. The framerate remained consistently over 60 and did not suffer any dips like it did with the timestep. This is probably because an decreased timestep increases the number of times the entire algorithm is run, while an increased iteration number only increases the number of times the constraint portion of the algorithm is run. | <a href="https://i.imgur.com/uEx8fCq.png"><img width="500px" src="https://i.imgur.com/uEx8fCq.png"></a> |
| -------- | -------- |
| Finally, the GPU and CPU versions of the algorithm were tested on different resolutions of the cloth. The resolution of the cloth is essential to how real the cloth simulation looks, as a low resolution will make the cloth look blocky. The CPU version proved unable to handle anything more than 10x10, while the GPU version could handle 30x30 at a reasonable framerate. | <a href="https://i.imgur.com/YhoA1YQ.png"><img width="500px" src="https://i.imgur.com/YhoA1YQ.png"></a> |
| -------- | -------- |