#Compute Shaders
1 messages · Page 1 of 1 (latest)
If you can get away with minimal readbacks, great, but there are many things that are not optimal for GPU. I haven't done that myself but I would love to hear if you have some specific concerns or problems that you are wondering.
@amber mural yes, I have been building games with an architecture I am coming up with that works pretty good. I have a few different projects that I started on and they prove that it works. The project I am working on now is a falling sand game optimized for compute shaders.
@amber mural Yes there are things that are not optimal for compute shaders but with the new compute shaders there are actually a lot of things you can put on the GPU and they are a little more versatile than I think people realize, it just depends on how you break things up.
@amber mural I can answer any details, I'm just speaking generally right now. GPU compute actually works really well with 2D sim heavy games. Like falling sand games for example.
@amber mural In the long term I would like to keep developing my architecture to make using compute shaders in 2d games more accessible by building a bridge between traditional 2d workflows and compute shaders.
So you can have all the devs and 2d artists working in their comfort zone and the bridge allows the game to tap the power of the GPU for heavy sim stuff. Think millions of agents vs hundreds or a few thousand, richer systems, etc. I just need to learn more about traditional 2d workflows so I can try to understand what would be important to have. Stuff like pixel and sprite animation and how to best optimize those to render them with instanced rendering.
@amber mural the key is getting the sim and the rendering all on the GPU and allowing the sim side to be rendered without any GPU readback. Them just be frugal with CPU pings just use it for input and a few key things.
@amber mural especially nothing tied to every frame, buget the cpu ping and only use certain types that don't slow down the GPU as much.
It is very potent approach. I worked on a strategy game with very GPU-centrist approach. Custom terrain based on GPU quadtree, GPU animations, procedural indirect foliage rendering and culling. Compute based line-of-sight system implemented on GPU raycasts. Only AI was done on CPU which requires GPU readbacks from LOS system.
@raven dagger yeah in my experience a few readbacks can make a huge difference. I was able to do a bee colony sim and I put the state machines on the GPU and used flow fields for each state all on the GPU so it let the bees scream even with hundreds of thousands. One by one hunted down each CPU readback and switched to a compute shader approach. Once I got rid of them it's like a rocket ship took off.
@raven dagger I actually tried A* pathfinding on the GPU and it worked, I just liked the way flow field looked for bees better. I didn't like them waiting in line for flowers haha.