Hello!
I'm currently working on an engine trying to implement animated mesh particles. Up until recently I only needed animated billboard particles and static mesh particles, which work fine. All our particles are simulated on the GPU using compute shaders.
To animated the mesh particles, we thought of using sub-meshes referenced using indices. As a proof of concept, I tried doing the animating on the CPU and setting the index properties for the indirect draw from the CPU. This works fine, but all the particles are then animated together rather than individually since they share one command.
This is where I am a little stuck. I dont know a whole lot about indirect drawing and I think what I want to do isn't a good use case for it. Ideally I'd be able to set the indirect draw index properties on a per particle basis so each particle animates separately.
As far as I can tell from reading online I have 2 options:
- Create one draw command PER particle - this would just defeat the purpose of using indirect drawing right?
- Sort the particles - if I have N frames, I'd just create N commands then increment the instance counts based on which particle is on which frame. Then I sort the particles by frame and render. This seems very complicated.
I guess 3rd option would be to not use indirect drawing for animated mesh particles, but that adds additional code to maintain.
I just wanted to know if anyone had any experience with this or any suggestions on how to approach the problem.
Thanks!