Archived

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

Vertex Arrays. VBO's, Compiled Vertex Arrays ??

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

Hi. I am currently working on some test 3d stuff and am wondering what Compiled Vertex Arrays are (GL_EXT_compiled_vertex_array) as apposed to standard arrays and VBO''s I added functionality of my milkshape loader to generate Vertex Arrays which made quiet a nice speed increase (certainly when I added the enabling of the server side and execution of the array to a display list). I want to add in in support for VBO''s aswell but have read that they seem to be slower in the current nvidia driver set ?? all my objects (400 polys max) are resonably static and don''t animate so the arrays can be generated at start up.. (if they do animate its only a few frames and I will be building up different lists per frame of animation) Cheers Chris Jumpman - Under Construction

Share this post


Link to post
Share on other sites
I dunno, I saw no slow downs on my radeon 9100, geforce 256 ddr, a geforce 3 ti 500, or a geforce fx 5900... just speed increases in all the above mentioned. By the way, that was going from compiled vertex arrays -> VBO's. There was a slight increase using cva's over va's, but nothing major. I would recommend skipping CVA's, and just using VBO's if supported.


--- Edit ---
Just wanted to note, my engine tries VBO's, if not supported drops to compiled vertex arrays, if those aren't supported, uses normal vertex arrays.

[edited by - Ready4Dis on December 14, 2003 10:07:34 AM]

Share this post


Link to post
Share on other sites

well i've found out that CVA's allow for more driver optimizations because they are locked (ie not changing anymore)

however, the page i visited said that they really only shine under mutli pass rendering.

[edited by - code_evo on December 14, 2003 10:52:50 AM]

Share this post


Link to post
Share on other sites
just having a quick read of the VBO''s and they seem to be too simple.. basically you feed the same data you would feed into a standard vertex array into the extension and bind the buffers before calling glDrawArrays (along with the glEnableClientState stuff)..

if anybody is interested.. I can post some benchmarks on a fixed scene with 40K polys..

Share this post


Link to post
Share on other sites
added in VBO support and it seems to be running at the same speed as vertex arrays.. (though last night it seemed slower, but maybe I was slower :D)

I put the binding of the buffers into a display list so the only different is that the vertex /texture cord arrays are stored in the video ram and not system memory..

Jumpman - Under Construction

Share this post


Link to post
Share on other sites
errm, you can bind a VBO so its resident in VRAM if you dont plan on changing the values, take a look at the spec a bit closer

If you''ve only got the binding calls in a display list then it wont effect where the data ends up, the driver (probably) wont copy it until post bind anyways.

Share this post


Link to post
Share on other sites
when I buffer the data I am using the GL_STATIC_DRAW_ARB.

m_pgp->glBufferDataARB(GL_ARRAY_BUFFER_ARB, nVertexCount*3*sizeof(float), m_pvaVertices, GL_STATIC_DRAW_ARB);

the spec (a pdf from nvidia) is rather short so I think thats the one to use..

the generation of the display list is like this..


glNewList(m_vaDisplayList, GL_COMPILE);

// Enable all client states we are using.

glEnableClientState(GL_VERTEX_ARRAY);
#ifndef NO_NORMALS
glEnableClientState(GL_NORMAL_ARRAY);
#endif
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

// Load the data to each pointer type we need.

m_pgp->glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_nVBOVertices);
glVertexPointer(3, GL_FLOAT, 0, (char *)NULL);

#ifndef NO_NORMALS
m_pgp->glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_nVBONormals);
glNormalPointer(GL_FLOAT, 0, (char *)NULL);
#endif

m_pgp->glBindBufferARB(GL_ARRAY_BUFFER_ARB, m_nVBOTexCoords);
glTexCoordPointer(2, GL_FLOAT, 0, (char *)NULL);

// Draw the entire object.

glDrawArrays(GL_TRIANGLES, 0, m_numTriangles*3);

// Disable all the client states we enabled.

glDisableClientState(GL_VERTEX_ARRAY);
#ifndef NO_NORMALS
glDisableClientState(GL_NORMAL_ARRAY);
#endif
glDisableClientState(GL_TEXTURE_COORD_ARRAY);

// End the list creation.

glEndList();



Jumpman - Under Construction

Share this post


Link to post
Share on other sites