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

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.

Look up NV_primitive_restart

I think it does what you want.

glDrawRangeElements could give a boost instead of mutliple calls to glArrayElement

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.

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

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.

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.

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/extsupport.php?extension=GL_NV_primitive_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.