• Advertisement

Archived

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

Display lists vs. Vertex Arrays?

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

Advertisement
They are used for different purposes. Generally, vertex arrays are faster, but OpenGL tends to be pretty good with Display list too. The big difference is the way the data is gathered. Vertex arrays are generally loaded from an outside file, while display list are hard-coded models.

Share this post


Link to post
Share on other sites
quote:
Vertex arrays are generally loaded from an outside file, while display list are hard-coded models.



I wouldn''t agree with that there.

I find for the most part vertex arrays are faster and have less limitations. I did notice display lists preform better when drawing the same object, many, many times.

Share this post


Link to post
Share on other sites
I have a better anwser for both->Use Vertex Arrays in Display Lists
The performance at high poly-counts is almost double
->Also lesser objects, better performance, can`t seem to know why... probably the lesser function calls

Share this post


Link to post
Share on other sites
quote:
Original post by cippyboy
I have a better anwser for both->Use Vertex Arrays in Display Lists
The performance at high poly-counts is almost double
->Also lesser objects, better performance, can`t seem to know why... probably the lesser function calls


I second that, the performance in many cases has been similar to VBOs when you put a Vertex Array into a Display List.

quote:

They are used for different purposes. Generally, vertex arrays are faster, but OpenGL tends to be pretty good with Display list too. The big difference is the way the data is gathered. Vertex arrays are generally loaded from an outside file, while display list are hard-coded models.



None of this is true.
You can load data from files for use with Display Lists by using glBegin()/glEnd(). But a better way would be to use Vertex Arrays in Display Lists as mentioned above.

Also, the way i look at it is this

Static Objects = Vertex Arrays in Display Lists/VBOs
Dynamic Objects = Vertex Arrays Only



Share this post


Link to post
Share on other sites
Regarding vertex arrays in display lists, would it be something like this?


CheckExtension(etc);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, etc, etc);
glNewList(i, GL_COMPILE);
glDrawElements(GL_TRIANGLE, 100, etc, etc);
glEndList();


You simply toss in the vertex array calls into the display list? Also, clearly you can''t modify data in a display list, but are you allowed to modify the vertex array data? Do you modify data as necessary, lock arrays, draw, then unlock? I notice people saying that they use vertex arrays for dynamic data, so I''m wondering at which point in the program flow to modify the data. I don''t have a lot of experience using vertex arrays, so I''m unsure how to use them efficiently.

Thanks.

Share this post


Link to post
Share on other sites
Ok, if i have understood this correctly, this is correct:

- begin the display list
- place the vbo function into memory using a pointer like pVERT
- end display list

- change the data in pVERT
- call the display list:
- calls the vbo function
- refers to the pointer in system memory

Is this correct?

Share this post


Link to post
Share on other sites
quote:
Original post by chawk
Regarding vertex arrays in display lists, would it be something like this?


CheckExtension(etc);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, etc, etc);
glNewList(i, GL_COMPILE);
glDrawElements(GL_TRIANGLE, 100, etc, etc);
glEndList();


You simply toss in the vertex array calls into the display list? Also, clearly you can''t modify data in a display list, but are you allowed to modify the vertex array data? Do you modify data as necessary, lock arrays, draw, then unlock?


When you compile a display list from a vertex array, the vertex array is dereferenced at compile time, and the data is copied into the display list. Once the list is compiled, you can do whatever you want with the vertex array, it won''t affect the display list.

Share this post


Link to post
Share on other sites
Hi,

If you go down to 16.100, putting vertex arrays in a display list may not necessarily give you an increase in performance but quite the opposite.

http://www.opengl.org/resources/faq/technical/displaylist.htm

Share this post


Link to post
Share on other sites
quote:
Original post by GamerSg
Also, the way i look at it is this

Static Objects = Vertex Arrays in Display Lists/VBOs
Dynamic Objects = Vertex Arrays Only



With the correct use of streaming VBOs are also a better choice for dynamic objects as well

Share this post


Link to post
Share on other sites
quote:
Original post by CRACK123
Hi,

If you go down to 16.100, putting vertex arrays in a display list may not necessarily give you an increase in performance but quite the opposite.

http://www.opengl.org/resources/faq/technical/displaylist.htm

I don`t know about you but I went down to 45000 and I had 30 fps in arrays and about 50 din lists
I`m having a Duron 1.3Ghz and GeForceFx5200 by any means.

Share this post


Link to post
Share on other sites
What I''m still boggled by is how, in a few of the VBO tutorials I''ve seen, the data is allocated in normal system memory, the appropriate extension calls are made to generate a "buffer object" name, setup the parameters, and the programmer deletes the allocated system memory! How can you modify (dynamic?) the data once you upload it to the card? I''m having trouble understanding how people use a VBO for dynamic data -- data that you intend to modify, at least here and there.

!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Is this true:

Using vertex array(s) inside of a display list is only faster/slower when you create the display list, but whenever you use the display list in the future (like say every frame) its the same speed whether or not you used the vertex array(s) to create it???????

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Is it true?

Share this post


Link to post
Share on other sites
i found it to be a LOT faster

over 57.5k tri''s

I got 139fps with standard VA usage..

and 229fps with calling a Display List which set up the client state and fired off the VA..

that was on both Nvidia and ATI..

Share this post


Link to post
Share on other sites
One question:
Can VAs in display list be dynamic (is the data recalled from system memory) or do they have to be static (is the VA stored in graphics memory and called from there)?

Share this post


Link to post
Share on other sites
I just did a quick test and no they are not (on an Radeon but that could be driver independant)..

They only seem to be dynamic if you don''t put them into a display list.. this seems to suggest that the drivers are copying the data into the video card.. (much like a VBO)

another intesting note is that VA''s compiled into DL''s are faster than VBO''s (well on my system anyway..)

Jumpman - Under Construction

Share this post


Link to post
Share on other sites
The VBO spec states:

Additions to Chapter 5 of the 1.4 Specification (Special Functions)

Added to section 5.4, as part of the discussion of what commands
are compiled into display lists:

"Commands that are used to create, manage, and query buffer objects
are not included in display lists, but are executed immediately.
These commands are BindBufferARB, DeleteBuffersARB, GenBuffersARB,
IsBufferARB, BufferDataARB, BufferSubDataARB, MapBufferARB,
UnmapBufferARB, GetBufferParameterivARB, GetBufferSubDataARB,
and GetBufferPointervARB.

GL commands that source data from buffer objects dereference the
buffer object data in question at display list compile time, rather
than encoding the buffer ID and buffer offset into the display list.
Only GL commands that are executed immediately, rather than being
compiled into a display list, are permitted to use a buffer object as
a data sink."

So a display list built using a VBO will contain the vertex data that was in the VBO at display list compile time - the data cannot be dynamic.

Enigma

Share this post


Link to post
Share on other sites
I think Dynamic data is possible with display list GL_COMPILE_AND_EXECUTE. But that means everytime you will have to rebuild the list ? And I guess that means a performance hit by a long margin!

Share this post


Link to post
Share on other sites
So how do you render dynamic data without doing that repeated GL_COMPILE_AND_EXECUTE method, and not just storing it in system memory and calling glBegin() ? Surely there''s a way.

Share this post


Link to post
Share on other sites
chawk:

1. Use vertex arrays
2. Use VBO''s and streaming data (glBufferSubDataARB or glMap/UnmapBufferARB)
3. Use static data and a vertex program

Enigma

Share this post


Link to post
Share on other sites
For option 1, vertex arrays, would I:

define the data
setup the client state and pointers

loop:
modify data as necessary
lock the arrays
render
unlock the arrays
goto loop

A flow like that? As far as VBOs, I''ll have to look more into some tuts or something, but in the example I''ve seen on NeHe site, he deletes the system-allocated memory, so I was boggled how one could modify it As for vertex programs, my card can''t do those so I''ll leave that for later when I get a better card.

Thanks

Share this post


Link to post
Share on other sites
Yes that''s how you would use vertex arrays with dynamic data.

quote:
As for vertex programs, my card can''t do those so I''ll leave that for later when I get a better card.


Your card can''t do vertex programs?!?!?!?! I''m hoping you mean that it can''t do them in hardware. Your drivers should be able to do vertex programs in software. Even my old Geforce 256 can do vertex programs (albeit software emulated).

Enigma

Share this post


Link to post
Share on other sites

  • Advertisement