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 7 of 7

Thread: break point Index's

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2004
    Location
    utah
    Posts
    3

    break point Index's

    i think it would be usefull if their was an index value i could specifie that would break the current primative list and start anew...

    aka
    Code :
    glVertexPointer(3,GL_FLOAT,0,&somedata[0].x);
    glEnableClientState(GL_VERTEX_ARRAY);
    glBegin(GL_TRIANGLE_STRIP);
    glArrayElement(0x01);
    glArrayElement(0x02);
    glArrayElement(0x03);
    glArrayElement(0xff); // break value
    glArrayElement(0x04);
    glArrayElement(0x05);
    glArrayElement(0x06);
    glEnd();
    would draw 2 seperate polygons that dont share vertex's.
    such a feature would be greatly usefull for triangle fans and terrain geomipmapping, would speed things up greatly if i didnt have to call glEnd and glBegin everytime i want to draw a seperate fan or make it possiable to shove it all into the same index array and avoid more function calls.

  2. #2
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,421

    Re: break point Index's

    Look up NV_primitive_restart

    I think it does what you want.

    glDrawRangeElements could give a boost instead of mutliple calls to glArrayElement
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2004
    Location
    utah
    Posts
    3

    Re: break point Index's

    yea NV_primitive_restart will do what i want. however is this an nvidia only extension? is their something similar to this on ati cards? was able to find information about the exenstion on nvidia's site almost imediatly but was unable to find much anything usefull on ati's site on the subject of extensions.

  4. #4
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Cologne, Germany
    Posts
    27

    Re: break point Index's

    If you send your GL_TRIANGLE_STRIP as GL_TRIANGLES but keep the strip order, your performance should be almost the same as this results in the post-transform-cache being used.
    This for example the way, the quake3 engine renders it's models (I know it's old, but I guess, still a lot of drivers get optimised for this kind of path).

    Jan

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,768

    Re: break point Index's

    your performance should be almost the same as this results in the post-transform-cache being used.
    Indices take up bandwidth too. Granted, not that much, but they do take up memory as well. And that gets pretty significant.

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2004
    Location
    utah
    Posts
    3

    Re: break point Index's

    anyway can anyone tell me if NV_primitive_restart will work on other brand GPU's? or is it an nvidia only extension?...

    jeickmann I know I can do that, Their is a reason I posted this in the suggestions forum, Korval has a point yea know =p.

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Feb 2002
    Location
    Bonn, Germany
    Posts
    1,652

    Re: break point Index's

    Originally posted by luminus:
    anyway can anyone tell me if NV_primitive_restart will work on other brand GPU's? or is it an nvidia only extension?...
    NVIDIA only. Look here: http://www.delphi3d.net/hardware/ext...mitive_restart

    I love this extension. The problem is that it's pure nonsense to implement this without direct hardware support, so an in-driver "emulation" for the current generation (and hardware support on next gen) isn't feasible.

    But do have a look at EXT_multi_draw_arrays . This one accomplishes a similar goal, but has much wider support . Be aware though that it will not be hardware accelerated everywhere. It's just far easier to emulate inside the driver, at reasonable performance levels. May be useful to you.

Posting Permissions

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