PDA

View Full Version : are vertex arrays really faster



zed
09-26-2000, 10:12 PM
this is something thats been bugging me for a while , (heres a couple of posts that ive done to the comp.graphics.api.opengl newsgroup) , i have tried everything i know and frankly im at a lose

this is from 19 april this year
-----------
sorry bout harping on about this, (i wrote last week)

i found about 6 months ago using drawElements() i was getting bout a
20%increase of speed, but now im getting about a 30 decrease of speed vs
just drawing the vertices intermidiatly (i suck in spelling).

maybe (probably) i aint understanding how it works
but if i go

renderObject()
{ glVertexPointer(3, GL_FLOAT, 0, elements.verts);
glTexCoordPointer(2,GL_FLOAT,0, elements.texCoords);
glNormalPointer(GL_FLOAT,0, elements.normals);

glLockArraysEXT(0, elements.num_of_vertices);
glDrawElements(GL_TRIANGLES, elements.num_elements, GL_UNSIGNED_INT,
elements.indices);
glUnlockArraysEXT();
}

// draw the same object in 10 different places

change_elements(); // just sets 4 ptrs in struct elements to the objects
mesh data
for (i=0;i<10;i++)
{ translate3fv(obj[i].pos);
renderobject();
}

* im obvoiusly doing something wrong so if anyone knows of a good tutorial
on the net that explains drawEleements + how to use them efficiatly, i'ld be
wraped. (btw ive got the red book)

zed
------------
and this is from 19 august this year
------------
i kwno ive brought this subject up at least 5x over the last year on this group,
but ive done so much testing on it with various models, simple shapes etc. but im still yet to find a case where they are actually
render faster than drawing intermediatly. does anyone know of any code that actually runs faster with cvas. im thinking maybe its me
card/computer or maybe its just me http://www.opengl.org/discussion_boards/ubb/wink.gif
please can someone show me the proof and put me out of my misery (slight exageration)
---------------
and a couple of days later
--------------
another followup hope youre not getting bored http://www.opengl.org/discussion_boards/ubb/smile.gif, here is the spheremark demo from nvidia http://www.nvidia.com/marketing/developer/devrel.nsf/TechnicalDemosFrame?OpenPage 50kb download

heres my results on my vanta
vinilla
Vertex arrays 0.307
displaylist 0.348
immediate 0.400

with textures
Vertex arrays 0.282
displaylist 0.336
immediate 0.393

not using tristrips + no texture
Vertex arrays 0.153
displaylist 0.336
immediate 0.399

results are million tris a second

skw|d
09-26-2000, 11:02 PM
Your question isn't quite an OpenGL question, but a driver question. OpenGL states the specs of how vertex arrays work and such, but it is up to the hardware vendor to implement it.

I write drivers for work, and I have had to go through other people's source. I was able to fix a major logic error that was causing poor performance. I got 30% speed improvement just by changing the code and using the same hardware.

But there is a possibility that you are doing something that doesn't quite work with the OpenGL specs. However there are other issues you can try to test. Maybe for small sets of data one method is better than another.

What I would do is make sure you are doing it correctly by checking with someone's source. If all else fails you can always contact your hardware vendor and ask what condtions are required to get the max performace out of the driver.

Good Luck,
/skw|d

zed
09-27-2000, 01:16 AM
obviously i suspect that ive been doing something wrong but over the last few months ive tried all manner of ways i should of hit on the right combination by now .
notice also the sphere mark demo results from nvidia (i know its meant to show off the speed of the geforce) but there is nothing gforce specific in the code.
my results with my vanta (tnt2 based) are Vertex arrays 0.282
displaylist 0.336
immediate 0.393
(higher is better)

ive tried all manner of drivers 3.xx detonator2/3 but same ol' story.
could it be that me elcheapo card is not quite worth the $50 i paid for it