a pyramid has, what, 16 vertices (if not shared)?
you won’t see much of a performance gain for such a trivial amount of vertices. Try drawing a few thousand triangles and compare your render methods again.
i load a asc scene (10000 vertex) maked with 3dsmax and draw with diferent functions and the fps is equal, i use glut in gamemode i have pentium iii 1200 and gforce 2 mobile 16mb
// This use a basic glvertex and call for triangle
// Renderizar un triangulo
void CDraw::DrawTriangle( CTriangle *p )
{
// TODO: Mirar si se debe o no de dibujar este triangulo
// Incrementar el contador de dibujado de triangulos
AddCounterTriangle( 1 );
// Dibujar el triangulo
for( int iVertex = 0; iVertex < 3; iVertex++ )
{
// Obtener el vertice a renderizar
CVertex *pVertex = p->vertex[iVertex];
glColor3f( pVertex->color.x, pVertex->color.y, pVertex->color.z );
glVertex3f( pVertex->point.x, pVertex->point.y, pVertex->point.z );
}
}
This use the glDrawElements and no one call for mesh
// Renderizar toda una estructura surface
void CDraw::DrawSurface( CSurface *p )
{
AddCounterTriangle( p->GetNumTriangles() );
// Indicar buffers
glVertexPointer( 3, GL_FLOAT, sizeof(CVertex), &p->GetVertex(0)->point.x );
glColorPointer( 3, GL_FLOAT, sizeof(CVertex), &p->GetVertex(0)->color.x );
// Activar arrays
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientState( GL_COLOR_ARRAY );
// Renderizar surface
glDrawElements( GL_TRIANGLES, p->GetNumTriangles() *3,
GL_UNSIGNED_INT, p->GetIndexBuffer() );
// Desactivar arrays
glDisableClientState( GL_COLOR_ARRAY );
glDisableClientState( GL_VERTEX_ARRAY );
}