سؤال

talking about the storage and loading of models and animations, which would be better for a Game Engine:

1 - Have a mesh and a bone for each model, both in the same file, each bone system with 10~15 animations. (so each model has its own animations)

2 - Have alot of meshes and a low number of bones, but the files are separated from each other and the same bone (animations too) can be used for more then one mesh, each bone set can have alot of animations. (notice that in this case, using the same boneset and the same animations will cause a loss of uniqueness).

And now, if I need to show 120~150 models in each frame (animated and skinned by the GPU), 40 of them are the same type, is better:

1 - Use a instancing system for all models in the game, even if I only need 1 model for each type.

2 - Detect wich model need instancing (if they repeat more then one time) and use a diferent render system (other shader programs), use a non-instancing for the other models.

3 - Dont use instancing because the "gain" would be very low for this number of models.

All the "models" talked here are animated models, currently I use the MD5 file with GPU skinning but without instancing, and I would know if there are better ways to do all the process of animating.

If someone know a good tutorial or can put me on the way... I dont know how I could create a interpolated skeleton and use instancing for it, let me explain..:

I can compress all the bone transformations (matrices) for all animation for all frames in a simple texture and send it to the vertex shader, then read for each vertex for each model the repective animation/frame transformation. This is ok, I can use instancing here because I will always send the same data for the same model type, but, when I need to use a interpolate skeleton, should I do this interpolation on vertex shader too? (more loads from the texture could cause some lost of performance). I would need calculate the interpolated skeleton on the CPU too anyway, because I need it for colision...

Any solutions/ideas?

  • Im using directX but I think this applies to other systems

=> Now I just need an answer for the first question, the second is solved (but if anyone wants to give any other suggestions its ok)

هل كانت مفيدة؟

المحلول

The best example I can think of and one I have personally used is one by NVidia called Skinned Instancing. The example describes a way to render many instances of the same bone mesh. There is code and a whitepaper available too :)

Skinned Instancing by NVidia

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top