Archived

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

what is a vertex array?

This topic is 5329 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

Ok guys, I have made engine, with octree, blablabla, model. I stored my models in display list. Put Lightning, and bla bla bla But.... what the hell is a vertex array????? I see several post on that in that forum, but never get stop on it. But now i''m asking myself, what you guys mean by "vertex array" ? Just a quick answer, dont what to read a entire tutorial about it. What is it, and what is his use. Thanks

Share this post


Link to post
Share on other sites
Its something you should use if you want performance.
In immediate mode you send vertices vertex per vertex to the gfx hardware which can be quite slow. Well with a vertex array you basically store an array of vertices in memory(ram) and instead of sending them one by one you send the whole buffer at once to the card. This greatly improves performance.

You should also look into Vertex Buffer Objects (VBO). They are new but from what I can tell them work the same way as a vertex array, but instead of storing the array on ram you store the array on the graphic card memory.

Share this post


Link to post
Share on other sites
But its the same thing that Display list?
With display list you dont have to draw vertex by vertex, you already done that and ogl compiled it in a display list.
So is it the same thing? But only with vertex?

Share this post


Link to post
Share on other sites
no its not the same thing. With a display list you can do a sequence of ogl calls and store them in a list but a vertex array is just a buffer of vertices.

As far as I know you cant use vertex arrays in a display list, so using vertex arrays is still faster.

Share this post


Link to post
Share on other sites
Vertex arrays are not necessarily faster than using display lists. If you really want to know about them i suggest checking out the red book, its free online although i don''t have the URL, i''m sure someone will post it for ya.

Share this post


Link to post
Share on other sites
Yes, but you can have only one display list active at a time IIRC, (Am I right? My engine can't really use this nifty OGL feature) so vertex arrays are best used to store the level data (assuming you're using the standard OpenGL primitives as your user level representation) and display lists I found useful in my engine when placing objects like pickups (ammo packs, weapons, keys, etc) as repeated calls can be (RAPIDLY) made to show a display list's contents.

[edited by - Al Gorithm on May 8, 2003 10:46:11 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Can you include things like color, texture & texture coordinates, normals, etc in a vertex array? Or are they just for position data?

Share this post


Link to post
Share on other sites
Display lists are useful in that it allows an OpenGL implementation (i.e. driver) to optimize the calls withing the list. For instance, a display list with just immediate mode calls *could* be translated by the driver into something even faster than using vertex arrays. In practice, display list optimizations are pretty rare. Often times only display lists used by particular benchmarks are optimized.

Vertex arrays are definately faster that display lists in most cases. However, the ARB_vertex_buffer_object extension is probably the fastest (standardized) way to set up your verticies.

[edited by - DannerGL on May 9, 2003 10:59:18 AM]

Share this post


Link to post
Share on other sites
you could also use interleaved arrays.. your limited in the way your vertices have to look like but there are a lot of options. in that case you wouldnt have an array for everything but one single array containing all that.

Share this post


Link to post
Share on other sites
I''ve had questions about vertex arrays as well: Al Gorithm said to use vertex arrays when dealing with something like level data. Should they only be used when dealing with static objects or is it wise to compile your own vertex array each time you want to draw everything? Also, when using vertex arrays, do the array rendering routines flush the buffer or do they still require you to do that, so you can call other immediate mode functions or display lists or whatever before finalizing everything?

Thanks,
Elijah

Share this post


Link to post
Share on other sites
quote:

I personally wouldn''t want to mess with Vertex Arrays and dynamic objects


Why not? Each frame, or each time the object changes (is animated) you change the values in the vertex array and/or normal array. As long as you don''t add or remove vertices, you can render the object the same way (glDrawElements or glDrawArrays) as your static objects.

Share this post


Link to post
Share on other sites