Jump to content

  • Log In with Google      Sign In   
  • Create Account

vertex arrays


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 v71   Banned   -  Reputation: 100

Like
Likes
Like

Posted 26 June 2001 - 12:29 AM

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

Sponsor:

#2 Krippy2k   Members   -  Reputation: 134

Like
Likes
Like

Posted 26 June 2001 - 03:36 AM

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.

Seeya
Krippy

#3 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

Posted 26 June 2001 - 03:05 PM

this info will have changed a bit now with hardware t+l but for q3 stuff.

i assume by locking u mean CVA

glVertexPointer
..
..
glLockArrays(0,num_verts)
loop through the passes
{ set pass state
draw mesh
}
unlockARRays.

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


http://members.xoom.com/myBollux




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS