Archived

This topic is now archived and is closed to further replies.

jamessharpe

Where to store Vertices?

Recommended Posts

I am currently designing a model class to derive classes from to load files such as md2, md3 etc. I am wondering where would be the best place to store the vertices. Is it more efficient to have one big vertex array that contains all the vertices( this is what i am currently doing for my world geometry), or should I be storing the individual vertices within the class that uses them? The thing that worries me about using one large array is that for animation, this would mean a lot of extra verts, whereas if I had them locally I could reassign the vertex pointers to the correct array and then render them. Would this cause a large performance hit? James

Share this post


Link to post
Share on other sites
No, store the model verts in a big lump. You shouldn''t need to screw with them when you do animation... instead, build indices to the vertices and call glDrawElems(). This way, memory is conserved while still being fast enough (you still need an array of ints for each frame, tho)

Share this post


Link to post
Share on other sites