PDA

View Full Version : about measurement of different draw mode



skeleton
03-25-2003, 01:47 PM
when use quads and quad strip and triangle and triangle strip to draw window,the program is as following.I expect the triangle strip should be the fastest one,
quad strip is the second fastest and triangle
is the slowest,however i get the similar result,could you please tell me if i need
change the configuration of the hardware or
the openGL.
glBegin(GL_QUADS);
for(int k=0;k<=n/2-2;k++){
glVertex2fv(vertices[2*k]);
glVertex2fv(vertices[2*k+1]);
glVertex2fv(vertices[2*k+3]);
glVertex2fv(vertices[2*k+2]);

}
glEnd();
glFlush();

glBegin(GL_QUAD_STRIP);
for(k=0;k<n;k++){
glVertex2fv(vertices[k]);
}
glEnd();
glFlush();

mdog1234
03-25-2003, 02:34 PM
dont flush your buffers twice in your draw routine if that code is all in one function.

[This message has been edited by mdog1234 (edited 03-25-2003).]

HalcyonBlaze
03-26-2003, 07:53 AM
Actually, I think that quadstrips should be the slowest and triangles faster. Graphics hardware LOVES triangle because all points are ALWAYS going to be on the same plane. That saves it a good deal of work. However, if you take a look at a quadstrip, there is no garuntee that all four vertices that contruct one quad will be on the same plane. And if they are not I believe OpenGL breaks those into triangles in the pipline. Again, I'm not 100% sure about this, but I'm fairly sure.

Exactly how many vertices do you have? Just raw vertices with a single color should just be blazing. You might want to add lighting and texturing or something to add on some computation. Most video cards can handle an enormous amount of vertices per sec.

- Halcyon