Archived

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

compiled vertex arrays versus compiled gebegin-end blocks

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

compiled vertex arrays versus compiled gebegin-end blocks does it differ in speed if I compile a vertex array or compile the same vertices in the array using glbegin glend blocks?

Share this post


Link to post
Share on other sites
A compiled vertex array is basically a vertex array, but the transformed verticies MAY be cached, meaning repeated verticies (if you are indexing) may only be transformed once (compared to a normal vertex array). glBegin glEnd blocks send the same ammount of geometry as a normal vertex array (3 floats per vertex in general)... but they also require 1 opengl function call per vertex (plus a glbegin/end)... thus there is a much higher overhead in general for their use... and in general AFAIK a far lower chance of concurrency between the driver and your application. If however you compile your glVertex calls into a display list (ie glBegin/glEnd) then the verticies are presaved. This effectively means that the display list using glVertex calls should be just as fast, if not faster than a normal vertex array. This is not always the case however, but it is generally true. It is theoretically possible that compiled vertex arrays could go faster than display lists, but again.. they don''t usually. My tests have indicated that there is no advantage to specifying verticies within a Display list using vertex arrays. If there is an advantage... using compiled vertex arrays or not would almost certainly have no effect, as the verticies are stored in the display list in either case.

Share this post


Link to post
Share on other sites
I think I used the wrong statement "compiled vertex arrays". It should be vertex array compiled into a display list. your answer is not clear enough. I couldn''t understand I mean. do these differ?:

glNewList()...
.....
glDrawArrays(...
glEndList();

or

glNewList()...

for (i=1; iglbegin(gltriangles
glvertex3f...
glvertex3f..
..
glend
glEndList();

do these differ? the same vertexes are used. there are no vertex indices also.

also I want to ask: where is compiled display list data saved? video memory or not? what size the data is? for a 1000 vertex list example.

Share this post


Link to post
Share on other sites
1. Don''t know about performance, but it would probably be very simmilar.
2. I think it''s up to the driver to decide where to keep display lists
3. One vertex = 1 Position + 1 Normal + 2 TexCoords

Position and Normal are vectors, which means they contain 4 floats each and TexCoords are each 1 float - total: 10 floats

1 float is 32 bits = 4 bytes, thus one vertex (if it has a normal and texcoords) takes up 40 bytes of space so a 1000 vertex list is 40kbyte large

PS: I could be wrong (it''s 4:04 AM here...)

Share this post


Link to post
Share on other sites
I am almost certain that feeding the geometry into a display list via a vertex array, as opposed to in between glBegin/glEnd has no impact at all on performance.

Share this post


Link to post
Share on other sites