View Full Version : Another way of sending vertex data

02-14-2002, 12:15 AM
I've just read the specifications for the proposed Aux buffers in OGL 2 and I came across this idea.

When using vertex arrays or vertex buffers, the actual T&L is performed when the indices are sent and thus vertices can be T&Led more than once (thus the use of strips to lower that number). Wouldn't it be more efficient to T&L the vertices when they are sent, in a batch. Afterwards, the primitives or indices would directly use the T&Led version.

The sequence would look something like this (using the conventional vertex arrays):
glNormalPointer(bla, bla, bla)...
glColorPointer(bla, ...)
glVertexPointer(...) -> creation of the internal cached list of T&Led vertices in the OGL driver. Just like a call to glVertex triggers the T&L of the vertex, glVertexPointer would do the same on the lot.

Then glDrawElements(...) would use directly the T&Led version.

Of course that would imply that the current gl...Pointer() functions also send the number of elements in the arrays and not just the pointer. Also the vertices would have to be reT&Led each time a glDrawElement (or equivalent) is called and the matrix stacks have changed (or vertex program)...

What do you think?

02-14-2002, 04:49 PM
An implementation that does this will somehow have to feed vertex arrays into a vertex processor and read out the data into memory. Since vertex processors are built into the graphics pipeline, they aren't designed to do this, and therefore doing it will be slow.

02-14-2002, 05:56 PM
The GL_EXT_draw_range_elements extension does almost exactly this, from what I can tell. Supported on TNT, GeForce, and probably most ATI cards.


02-16-2002, 03:28 AM
DRE is a part of OpenGL 1.2, and thus has been available for a while.


02-18-2002, 01:06 AM
GL_EXT_draw_range_elements still relies on the indices to "pull" the vertices. As for the pipeline issue, if future graphic chips were to support the proposed GL 2.0 Aux buffers, they'd have to support that kind of feature anyway.