Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Vertex Arrays

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    Tokyo, Japan
    Posts
    3

    Vertex Arrays

    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

    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 ?

  2. #2
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    Slovakia
    Posts
    14

    Re: Vertex Arrays

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

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

  3. #3
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: Vertex Arrays

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •