https://github.com/demwafflez/cuda-2d-softbody-physics-simulation
Handcrafted from scratch! Felt and dealt with every single one of those thousand ACCESS_VIOLATION!
https://github.com/demwafflez/cuda-2d-softbody-physics-simulation
cpp cuda gpu-computing opengl physics-2d physics-simulation softbody-physics softbody-simulation verlet-physics
Last synced: 3 months ago
JSON representation
Handcrafted from scratch! Felt and dealt with every single one of those thousand ACCESS_VIOLATION!
- Host: GitHub
- URL: https://github.com/demwafflez/cuda-2d-softbody-physics-simulation
- Owner: DemWafflez
- License: agpl-3.0
- Created: 2025-02-28T04:08:21.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-02-28T19:25:44.000Z (3 months ago)
- Last Synced: 2025-02-28T22:59:04.862Z (3 months ago)
- Topics: cpp, cuda, gpu-computing, opengl, physics-2d, physics-simulation, softbody-physics, softbody-simulation, verlet-physics
- Language: C++
- Homepage:
- Size: 218 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
This is one of my longest projects I've ever worked on (2 months) and I think that this is it for now. Started out in Java, then to C++, then ported to CUDA. I barely even knew any C++ before this let alone CUDA! I was so disappointed in the Java performance which forced me to learn C++ to be able to scale more, then CUDA as the final boss (thanks Omise31 for the idea). CUDA was definitely overkill, but it exposed me to the world of gpu programming! I might even do a 3D version of this in the future (90-100%).
I rarely use github (3rd or 4th time) so I have no idea what I'm doing right now.
Scales up to 3-4M Particles at 6 substeps on my RTX 4070 before going under 60 fps so I think any NVIDIA gpu can handle this. Very memory bandwidth intensive!!!
Video:
https://www.youtube.com/watch?v=C_qEfIPdrrE&ab_channel=murk
**CONTROLS:**
E - Generate Softbody
R - Reset World
SPACE - Pause
G - Slow mo
LEFT CLICK - Particle mover
RIGHT CLICK - Move camera
**REQUIREMENTS TO COMPILE:**
GLEW
GLFW
Cuda Toolkit
**REQUIREMENTS TO RUN:**
NVIDIA GPU (Sucks to be an AMD user!!!!)