PDA

View Full Version : Vertex Array Speed issue



satan
04-29-2002, 02:12 AM
Hi to all!

I have a Scene where I draw 10000 boxes (most of the time not all are visible and my frustum culling works nice). I used to draw them in immediate mode with generating the vertices on the fly (knowing upper left front corner and width, length, height - just some additions/subtractions) every frame. So i thought why not just put the vertices and normals in a vertex array and use this. After i have done this i realized that performance dropped. Not very much but it did (btw I know that going with DLs is the best solution - but this is a test for my box class and i thought about giving the user the possibility to decide if he wants to draw the boxes in immediate mode, as VA (perhaps later as CVS or VAR) and DL. Now the question is, is there a minimun ammount of vertices you have to use to gain performance by using VAs (my boxes only have 24 vertices of course)? And when generating the DL shall i use immediate mode or VA? And since I am not only going to have classes for boxes and cubes (torus, cone, etc. - all childclasses of my object base class) shall i only provide VA usability for more complex objects?

As you see i am writing a very generic unit/lib for my favorite language so that the user does not have to know all the opengl stuff but my unit will handle it for him. Therefor I want to provide many features, the user can then context sensitive decide what to use. But when VAs in some point are even slower than immediate mode, why shall i provide them (would be better to just use the array my vertexpointer is pointing at and use this values between a glBegin/glEnd).

btw i am using GL_QUADS as primitive since i cannot use strips/fans due to lighting issues and GL_TRIANGLES would need six input vertices for every plane.

very long post, but I want to make my point as clear as possible

thx in advance

[This message has been edited by satan (edited 04-29-2002).]

satan
04-29-2002, 11:36 PM
really noone on this?
thought it would be a very easy one with answers just like:

'QUADS are evil do not use' or 'man are you stupid, vertex arrays make sense when you have more than x vertices' or 'do not use standard vertex arrays, they are even slower than immediate mode use CVA, VAR' or something like that