Crowd Animation

I have skeletal animation working on Optix 6.5 in the following way,
Cuda pre-processing - Transform vertices and normals with the appropriate bone transform using the device pointers from the optix buffers.
Mark the buffers dirty.
Dirty the acceleration.
Optix launch.

Unfortunately if the same person is instanced multiple times to simulate a crowd and he/she has different animations and animation time offsets it would mean I need to create the same Optix geometry instance equivalent to the number of people in the crowd which is clearly inefficient.

Is there a more efficient way to achieve this in Optix ?

HI @sukumar.srikanth,

OptiX doesn’t provide any features for animation aside from motion blur. The easiest thing to do is what you suspect - allow each character to be instanced as a separate copy.

Do you have targets or a budget for how much memory you can use, how many characters and animations you want to support, or how fast it needs to run? My general advice might be to at least try out evaluating separate instances before trying something trickier, unless you’re certain that it won’t fit in your budget.

I can imagine a couple of (probably obvious) general ideas that might help you, depending on what tradeoffs you can make-

  • If you have more characters than you have total animation frames, and if you have enough memory space, then you could pre-bake the animated pose for each frame into a separate GASes, and use the corresponding GAS each frame instead of evaluating your character rig. This would be very compute efficient, but is still memory inefficient.

  • If you have multiple characters animating at the same pose, you could evaluate the pose once, build a single GAS for that subset of characters, and instance it in your IAS. So basically, track all the groups of characters that are playing the same animation and share computation and GAS memory between them.


David.

Hi dhart

Thanks for the clarification, I am doing similar optimizations for crowd animations.
I had one more question related to the topic, when I launch a cuda kernel with the device pointers extracted from optix buffers why do I have to mark my buffer dirty to get the changes reflected ? Is optix maintaining two sets of the same data on the device ? Why is it not enough to just mark the acceleration dirty ?

Best Regards,
Sukumar