I'm gonna have about 1000 instances of the same animated model visible at the same time. Which approch would be best (read fastest), keyframed or skinned animation? They will not be syncronized and the model will only consist of around 500-1000 tris.
I'm pretty sure I will use imposters for some of the instances that's in the distance and update these ones less frequently. But I don't know which method I should use to do the animation.
Keyframed animation needs only this work each update: interpolation for vertices, interpolation for normals (or tangents if normal mapped). This will be roughly 2000 interpolations. But I need a VBO for each instance which is bad.
How much do skinning need? I've never implemented it on my own.
And lastly, is there any benefit to do the skinning or interpolation in the keyframed animation on the shader? I guess keyframed animation on the shader will consume too much memory right?
Bone animation needs to be done on CPU, skinning can be either CPU or GPU. If the scene is rendered multiple times each frames, then CPU skinning can be as fast as GPU skinning.
The benefit of GPU skinning is that its very simple to implement, and the whole geometry needs to be stored once in memory, and can be put into static VBO. GPU skinning wont work on older cards, either array access wont work, or there wont be enough uniforms to store all the bone matrices, unless the model has very few (say 20) bones only. Its an option to subdivide the models into smaller batches, so that each batch doesn't go over the bone limit. Either way, for wide graphics card support, both implementations are needed.
Have not implemented keyframe animation, but i guess it would be very fast on the GPU (single interpolation between vertex positions of the two keyframes), and well supported even on older cards. You could pass the second keyframe vertex positions instead of color or a texcoord. The drawback of this is that you need memory allocated for each keyframes vertex positions. But don't need 1000 buffers for the 1000 instances. My guess is, that doing keyframe animation on CPU is not much faster than doing bone animation with skinning on CPU.
I would vote for keyframe on GPU as the fastest.
Ok, thanks for your suggestions.
Yeah, your right. I don't need 1000 VBO's, one for each key frame (or less if packed together) should be enough. Maybe I can also skip interpolation on the models that's far away and only switch between frames for them…
I will probably render the (at least a part of) scene multiple times each frame (for shadows and maybe reflections) so there is no need to bother about learning GPU skinning I guess.