Jump to content
  • Advertisement


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


vertex arrays

This topic is 6259 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

A doubt, if i have to draw multyple objects using the vertex array extension, can i encounter a overhead in locking ad releasing the vertex buffer each time i have to draw a single object or its better to stick with triangle strips ??????? thanx

Share this post

Link to post
Share on other sites
Well it depends on how many triangles are in your objects. If you only have a few triangles per object and alot of objects, and must draw the individually, vertex arrays are probably not for you. Vertex arrays are meant to draw a large number of primitives with one call. But on some systems it is probably still faster than immediate mode. You don''t really lock and release the vertex arrays the same way you do with vertex buffers in D3D. You just give a pointer to your vertex array and the driver takes care of the locking and releasing in an efficient manner.

And if you are currently using triangle-strips you probably have a large number of shared vertices. This being the case you probably want to use indexed vertex arrays and eliminate all duplicate vertices to conserve bandwidth.

If you have alot of static objects (that don''t move) and then some dynamic objects you probably want to create 1 master vertex array for your static objects, decide which primitives need to be drawn each frame and create your array of indices on the fly. Then you can draw them all with 1 glDrawElements call. For the dynamic objects you might want to have them all in 1 other vertex array or each of them in its own vertex array if there is a large range of motion, and have a static array of indices.


Share this post

Link to post
Share on other sites
this info will have changed a bit now with hardware t+l but for q3 stuff.

i assume by locking u mean CVA

loop through the passes
{ set pass state
draw mesh

if you only do one pass of your mesh + the mesh doesnt share many vertices DONT use CVA''s it does come with a little overhead. though in the case of multiple passes you should use it


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!