PDA

View Full Version : Compiled vertex array support in Rage128 drivers



Gribbley
08-24-2000, 04:12 AM
Morning,

I have some code which utilises the compiled vertex array extensions if your driver supports them and looks a little like this:

(... way earlier ...)
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);

(... ...)

glColorPointer(4, GL_UNSIGNED_BYTE, 0, colorsA);
glVertexPointer(3, GL_FLOAT, 0, vertexA);

if (compiledVertexArraySupport)
{
glLockArraysEXT(0, MAX_VERTEX);
}

...

for (int stripIterate=0; stripIterate<stripCount; stripIterate+=5)
{
glDrawElements(GL_TRIANGLE_STRIP, 5, GL_UNSIGNED_INT, &triangleStrip[stripIterate]);
}
for (int triangleIterate=0; triangleIterate<listCount; triangleIterate+=3)
{
glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_INT, &triangleList[triangleIterate]);
}

if (compiledVertexArraySupport)
{
glUnlockArraysEXT();
}

Now, this works beautifully on a whole range of nVidia cards running a variety of drivers, and I get perfectly acceptable performance, however when I test it on an ATI Rage128 running shipped drivers (or my friend tests it on an All in Wonder128 or whatever they're called with shipped drivers), both of which purport to support compiled vertex arrays, I get performance that would be indicitive of the driver not sharing vertices between my strips or triangles. Am I doing something wrong? Is this a known weakness with the drivers? Would I, as I suspect, have to restructure my geometry storage in some fashion for it to work properly?

Any help would be most appreciated

JBone
09-02-2000, 11:24 PM
It isn't just that card. I tried the same thing on my Voodoo3 and my program actually slowed down considerably. I then tried interleaved vertices and that runs poorly on the Voodoo3 as well.

But on my GeForce, the frame rates go up 46% with interleaved arrays.

Sylvain
09-03-2000, 02:11 AM
Of course using vertex arrays with the new generation of 3Dboards is a good choice.. If you are using some GeForce cards you should 'drop an eye' to the VertexArrayRange extension from Nvidia.. For older cards like Ati (i mean without t&l features) the vertex arrays are sent to the card through the bus after all the sofwtare transformations. So your problem is software dependent it depends on vendor routines optimisations. Remember that some older implementations prefer the use of compiled display list (why not use some vendor probing?) but it cost more memory than vertexArrays! I think that on older implementations vertexArrays translate your vertex format to the internal format on the fly and then transfert vertice through the bus, this operation could burn a lot of cycles.. Thus, i recomend ya to support nvidia with vertexArrays and don't forget that new boards are angry with primitives number.. Use band of strips instead of other primitives types and don't hesitate to duplicate some vertex (vertexSwap) to go 90 at the end of strip and to convert fans to strips to a single primitive.

Sylvain
09-03-2000, 02:13 AM
Of course using vertex arrays with the new generation of 3Dboards is a good choice.. If you are using some GeForce cards you should 'drop an eye' to the VertexArrayRange extension from Nvidia.. For older cards like Ati (i mean without t&l features) the vertex arrays are sent to the card through the bus after all the sofwtare transformations. So your problem is software dependent it depends on vendor routines optimisations. Remember that some older implementations prefer the use of compiled display list (why not use some vendor probing?) but it cost more memory than vertexArrays! I think that on older implementations vertexArrays translate your vertex format to the internal format on the fly and then transfert vertice through the bus, this operation could burn a lot of cycles.. Thus, i recomend ya to support nvidia with vertexArrays and don't forget that new boards are angry with primitives number.. Use band of strips instead of other primitives types and don't hesitate to duplicate some vertex (vertexSwap) to go 90 at the end of strip and to convert fans to strips to a single primitive.

Gribbley
09-03-2000, 04:40 AM
Originally posted by Sylvain:
Of course using vertex arrays with the new generation of 3Dboards is a good choice.. If you are using some GeForce cards you should 'drop an eye' to the VertexArrayRange extension from Nvidia.. For older cards like Ati (i mean without t&l features) the vertex arrays are sent to the card through the bus after all the sofwtare transformations. So your problem is software dependent it depends on vendor routines optimisations. Remember that some older implementations prefer the use of compiled display list (why not use some vendor probing?) but it cost more memory than vertexArrays! I think that on older implementations vertexArrays translate your vertex format to the internal format on the fly and then transfert vertice through the bus, this operation could burn a lot of cycles.. Thus, i recomend ya to support nvidia with vertexArrays and don't forget that new boards are angry with primitives number.. Use band of strips instead of other primitives types and don't hesitate to duplicate some vertex (vertexSwap) to go 90 at the end of strip and to convert fans to strips to a single primitive.

Thank you for the advice. I've found that disabling the use of compiled vertex arrays on the ATI card, even though it supports them, does actually cost framerate, so it's getting some advantage from it, it just looks like for some reason it's not combining all vertices into a unique list, which is irritating, given the nature of my geometry.
I can't use display lists, because, again, the nature of my gemoetry is such that it's _very_ dynamic. It would cost a lot more to build the lists every frame, making it somewhat pointless.
As for building larger strips, well, I'd like to http://www.opengl.org/discussion_boards/ubb/smile.gif However, again, the nature of my geometry generation, coupled with my poor maths means that thinking about doing so makes my head hurt. All I do is build smallish strips from the last level of tesselation of my icosahedral data because anything else caused severe neural trauma http://www.opengl.org/discussion_boards/ubb/smile.gif

If either a) you're feeling generous and fancy telling me what framerates you get on your hardware (particularly if you've got a Voodoo3 or above) or b) are just interested in finding out what the hell I'm waffling on about, feel free to visit http://www.darkwave.org.uk/~gribbley/
and install my WinAmp plugin, and have a look.

Again, thanks for the help

XBCT
09-04-2000, 01:47 AM
Hi!
I think you really need new drivers....After the release of Q3 all vendors optimized for the locked arrays\glDrawElements(GL_TRIANGLE,....) path. There are a lot of optimizations done in this direction and on my card with new drrivers I am very happy with the performance of glLockarrays\glDrawElements....

HTH, XBTC!