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

Started by
5 comments, last by Jumpman 20 years, 4 months ago
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
Advertisement
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]

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]
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..
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
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.
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

This topic is closed to new replies.

Advertisement