Hi,
here are some results on rendering 131kpolys. I just simply put it out (see code below):
tnt2
triangles : 3.44 fps
v_triangles: 4.43 fps
tristrips1 : 11.53 fps
tristrips3: 14.32fps
geforce2
triangles : 12.65 fps
v_triangles: 17.56 fps
tristrips1 : 33.64 fps
tristrips3: 46.9fps
voodoo5
triangles : 2.97 fps
v_triangles: 8.72 fps
tristrips1 : 7.33 fps
tristrips3: 14.32fps
Here’s the code I use to render this. I know one of the strip generators is buggy, but I left it in:
float * vertexek=NULL; //vertex coordinates
float * szinek =NULL; //color values (r,g,b,a)
…
void display(int type)
{
int a=0,b=0;
switch(type)
{
case DISP_TRIANGLES:
for(x=0; x<255; x++)
for(z=0; z<255; z++)
{
glBegin(GL_TRIANGLES);
glColor3fv(&szinek[(x*256+z)*3+0]);
glVertex3fv(&vertexek[(x*256+z)*3+0]);
glColor3fv(&szinek[((x+1)*256+z)*3+0]);
glVertex3fv(&vertexek[((x+1)*256+z)*3+0]);
glColor3fv(&szinek[(x*256+(z+1))*3+0]);
glVertex3fv(&vertexek[(x*256+(z+1))*3+0]);
glColor3fv(&szinek[((x+1)*256+z)*3+0]);
glVertex3fv(&vertexek[((x+1)*256+z)*3+0]);
glColor3fv(&szinek[((x+1)*256+(z+1))*3+0]);
glVertex3fv(&vertexek[((x+1)*256+(z+1))*3+0]);
glColor3fv(&szinek[((x)*256+(z+1))*3+0]);
glVertex3fv(&vertexek[((x)*256+(z+1))*3+0]);
glEnd();
}
break;
case DISP_TRISTRIPS:
for(x=0; x<255; x++)
{
glBegin(GL_TRIANGLE_STRIP);
for(z=0; z<256; z++)
{
glColor3fv(&szinek[(x*256+z)*3+0]);
glVertex3fv(&vertexek[(x*256+z)*3+0]);
glColor3fv(&szinek[((x+1)*256+z)*3+0]);
glVertex3fv(&vertexek[((x+1)*256+z)*3+0]);
}
glEnd();
}
break;
case DISP_TRISTRIPS1:
glBegin(GL_TRIANGLE_STRIP);
x=0;
while(x<256)
{
for(z=0; z<256; z++)
{
glColor3fv(&szinek[(x*256+z)*3+0]);
glVertex3fv(&vertexek[(x*256+z)*3+0]);
glColor3fv(&szinek[((x+1)*256+z)*3+0]);
glVertex3fv(&vertexek[((x+1)*256+z)*3+0]);
}
x++;
for(z=0; z<256; z++)
{
if(z!=0)
{
glColor3fv(&szinek[(x*256+(255-z))*3+0]);
glVertex3fv(&vertexek[(x*256+(255-z))*3+0]);
}
if(z!=255)
{
glColor3fv(&szinek[((x+1)*256+(255-z))*3+0]);
glVertex3fv(&vertexek[((x+1)*256+(255-z))*3+0]);
}
}
x++;
}
glEnd();
break;
case DISP_TRIANGLES_V:
glDrawElements (GL_TRIANGLES,elementnum,GL_UNSIGNED_INT,indices1);
break;
//this is what I use
case DISP_TRIANGLESTRIPS_V:
for(int x=0; x<255; x++)
{
glDrawElements (GL_TRIANGLE_STRIP,512,GL_UNSIGNED_INT,&indices2[x*512]);
}
break;
}
}