View Full Version : Display lists for MD2 models?

05-25-2005, 05:31 PM
Hey there!
I am adding md2 modelled characters to my game at the moment and I would like to optimise the code which moves them around the game world, so I have a couple of questions about display lists.

1. I am assuming that there is no point in storing the md2 vertex data in display lists because the vertex data is changing every frame to update the animation. Is this correct?

2. What is the best (most efficient) way to pass the vertex information to the card given that the vertices are dynamic.

Any help or comments appreciated as always.

05-25-2005, 10:37 PM
1. Correct. If you don't want to use multiple displaylists (one for each animation frame you want to be able to display), then don't use displaylists, since they're static.
Any gl command inside a displaylist is executed when you call the list. There's nothing dynamic about it.

2. Vertex arrays, with VBOs - you'll probably want to pick the VBO type that allows write-only access - since you update the data often, but probably don't need to read it back.

PS: if you measure time, be sure to place your measurement after the swapbuffers call.
The function call overhead of vertex arrays is virtually nil, but the swap overhead is large since the queue needs to be finished.
If you place it between rendering and swapping, you'll get smooth movement, but it'll be in slowmotion.

05-26-2005, 05:50 PM
Thankyou T101, I had suspected that was the way to go, but I just wanted to check.