Skip to main content
gamedev.net
🔒 Locked

animated models problem

Started by ikslm 2 replies 900+ views
Original Post
ikslm
ikslm
hey! i wrote the ms3d importer that can import animated ms3d files. when i use this importer in application i can see the model, i can watch its animations... but the problem is that the model is cunstructed from 1000 triangles and the FPS get's really low if i put some number of this objects on the screen. the model currently gets drawn like this: - calculate the next frame - deform the vertices - draw every triangle
glBegin(GL_TRIANGLES); 
for (int i=0; i<n_Tris; i++)
{
//    draw_the_triangle
}
glEnd();
and i would like to accelerate the model drawing. what should i use? dynamic VBOs? cos i cant really use lists since the model is dynamic...
RobTheBloke
RobTheBloke
yeah, basically at the moment you are creating a vast amount of function cal overhead for each vertex/normal/tex coord you are specifying. VBO(or even just vertex arrays) will help to get a speed increase. I'd recommend splitting the VBO's though, your triangle indices and texture coords are unlikely to ever change, so you can make them static. It's normally just the normals & vertices that change.

There are other optimisations that can help, for example : staggering the update of the models, so that only half get deformed each frame. Strange as it sounds, this normally gives you about a 4x speed increase.... (assuming you are using VBO's)
ikslm
ikslm
this sounds interesting! i'll give it a try.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.