Efficient handling of animated models out of view
Blitz3D Forums/Blitz3D Programming/Efficient handling of animated models out of view
| ||
Looking for ideas on handling animated models that are far away or off camera. Does EntityAutoFade work for animated models once they are further than the max distance? Seems I should be only animating them if they are in view. I have seen models in games skip frames at a distance and animate fully up close. Is it worth worrying with the animations off-camera as far as saving FPS goes? |
| ||
Is it worth worrying with the animations off-camera as far as saving FPS goes? It depends on several things : - How many joints (bones) have an influence over the vertices of the mesh ? The fewer joints, the faster to calculate the new pose. - How many vertices are there in the skinned animated mesh ? The fewer vertices, the faster to calculate the new pose. - For each vertex, is the vertex influenced by one joint or by two joints or by more ? The fewer joints which influence a vertex, the faster to calculate the new pose. - How many identical/different animated meshes are there in a scene ? Maybe copyentity can decrease the animation calculation ? (<- not sure about this) From my past tests, if the animated meshes have not too many joints, not too many vertices, and the influences are 0% 100% or 50% 50%, it does not seem to take many ms to calculate... So i don't really care about this. I just use hideentity(AnimatedMesh) for the animated meshes which can't be seen (after the calculation of which entities can be seen and which can't be seen), and i only animate those which can be seen. What you can do is to remove the colliders/collidables/collisions from your game and calculate how much ms the calculation of animation poses takes : Remove all colliders/collidables/collisions (or don't create any), then : AnimationMsStart% = millisecs() Updateworld() AnimationMsTime% = millisecs() - AnimationMsStart Text(0,0,AnimationMsTime = "+AnimationMsTime) |
| ||
Thanks RemiD. I'm still curious as to whether models continue animating if they are past their EntityAutoFade maximum. Will dig into that. |