View Full Version : Vertex Arrays

04-21-2000, 01:55 AM
When I want to use glInterleavedArrays() and POLYGON mode for glDrawElements(),
how should I do ?
I think the arrays don't know how many vertices each polygon has http://www.opengl.org/discussion_boards/ubb/frown.gif

Is it really true that we can make our OpenGL programs faster, when we use Vertex Arrays ?

PS I heard that bluxxun and Cosmo VRML browers used Pentium III SIMD optimizations,
but how ?

04-21-2000, 02:23 AM
The OpenGL specification doesn't discuss this. I would say, that there is no way to
tell GL how many vertices each polygon has,
except multiple calls to glDrawArrays, or

Programs using vertex arrays surely run faster, because there is much time saved
that would be spent on many function calls.
Moreover, by using the EXT_compiled_vertex_array extension that seems to be widely available, you can save
time that would be spent on multiple processing (t&l) of vertices that are shared
by more primitives, such shared vertices will
be transformed only once, which can gain a
speed boost.

04-25-2000, 01:58 PM
Correct, the vertex arrays only know the pointers and offsets.
The glDrawElements() call has a "count" parameter which gives the size of the polygon.
You can use glDrawArrays() to give a "first" vertex and "count".

I personally would prefer glVertexPointer() etc. instead of interleaved arrays, because there are not all combinations possible with interleaved arrays and the structure doesn't matter (except for alignment) as long as the offsets are constant, and you can enable/disable single arrays.

>>PS: I heard that bluxxun and Cosmo VRML browers used Pentium III SIMD optimizations,
but how ?

That needs some serious ASM knowledge, lots of Katmai PDFs, an assembler with SIMD .include, or the Intel VTune package with the SSE intrinsics definitions for C.

Analogous for AMD 3Dnow!, but the SDK is downloadable from AMD's site for free, intrinsics work with MSVC, assembler needs a relatively new ML.exe.

Have fun.