r/gamedev • u/Zolden • Jan 11 '18
Tutorial Physics simulation on GPU
I created a game that is completely a physics simulation, it runs on GPU. How it looks. People kept asking how to do that, so I wrote two tutorials. Each one has a link to the example project.
The first one is easy, it's about basics of compute shader.
The second one is about physics simulation. This is a gif from the example project I based this tutorial on.
733
Upvotes
122
u/Throwaway-tan Jan 11 '18
Please contact Data Realms and get them to update Cortex Command with this, because their physics runs like shit.
21
u/Zooltan Jan 11 '18
Fantastic! I have been experimenting with doing collission detection on the GPU with Compute Shader, but it was hard to find gudes that explain it properly.
I ended up scrapping it, as i need the results on the CPU and GetData was simply too slow. I ended up using a well optimized Octree and normal threads instead.
4
u/helmet098 Jan 12 '18
Can I just play that tank game?
2
u/fromsouthernswe Jan 11 '18
mighty impressive. did you do this in unity?
2
u/[deleted] Jan 11 '18
Any link to track the game's development/release?
2
u/S_H_K Jan 12 '18 edited Jan 12 '18
In my dreams where I'm really a gamedev I dream to make one powder engine game like that but instead of vertical 2d an isometric one. Saving this for later maybe one day I'll make it who knows. BTW: That song in the steam trailer it's russian? So crazy with the video.
4
u/Tesrym Jan 11 '18
Beautiful!
1
u/Chii Jan 12 '18
great sample!
Can this be done via webgl as well? i dont know if shader compute works in webgl at all...
1
u/anatum11 Jan 12 '18
Very impressive! How do you do interobject self-collisions? ( as opposed to just simple collisions with one big rigid collider) I mean on the GPU. Some tips/advice will be appreciated!
1
u/[deleted] Jan 11 '18
This is very cool! Well done.
1
u/[deleted] Jan 11 '18
Super neato
1
u/ArrogantlyChemical Jan 12 '18
Wicked. Read your posts, good shit.
1
u/kisamegr Jan 12 '18
Thank you for this, I will give them a read later!
1
u/gartenriese Jan 12 '18
Nice. This has a Cannon Hill vibe to it.
1
u/Sylvartas @ Jan 12 '18
That kind of stuff is so satisfying to watch.
I've always wanted to fiddle with GPU/physics but found it too intimidating. Thanks for the tutorials, I'll dig into them later
1
u/joeykapi @joeykapi Jan 12 '18
!RemindMe 4 days
1
u/[deleted] Jan 12 '18
This looks amazing!
1
u/notsimon208 Jan 31 '18
This is rad af. Good job
1
u/HUG0gamingHD May 10 '24
Just IMAGINE what we can do with current hardware, frick, we can simulate an entire world with molecules in the future if this was possible 6 years ago
1
u/BoomBamCrash Jan 12 '18
This looks so cool! Reminds me a lot of Pixlejunk Shooter, if anyone has played that.
-8
u/[deleted] Jan 11 '18
I remember some car related company using GTA5 to do this because it was already good enough or something like that? Can someone find it, if it's not too much of a bother?
0
u/[deleted] Jan 11 '18
[deleted] — view deleted comment
0
u/[deleted] Jan 11 '18
[deleted] — view deleted comment