Performance Test 1

I am very new to computer graphics and if you don’t mind I would share some simple performance results.

The sample program displays 3DS objects.

The three objects (A, B, C) consist of triangles and each triangle has material properties and NO texture. The most naive way to displaying such object is

glBegin(GL_TRIANGLES)
loop all triangles
{
glMaterial(ambient, diffuse, specular, shininess)
loop all vertices in the current triangle
{
glNormal(), glVertex()
}
}
glEnd()

The results of this naive code are in row “BM”

Row “DL” is the same code implemented as display list.

Row “DLWM” is the same display list without glMaterial() functions.

Row “vert” is total number of vertices, “triang” is total number of triangles.

Measure is Frames per Second.

object A B C
vert 3726 7089 11781
triang 6885 10583 21692
BM 268 181 94
DL 349 242 124
DLWM 719 661 901

My conclusions:

  1. Display lists are really effective.
  2. glMaterial() is veeeery low. This means that polygons should be sorted by material and glMaterial() should be called only once when new materal replaces old one, not for every polygon.

Any comments, please??

P.S. As I go deeper in openGL, new tests will come - textures, multitextures, VBO, ets.

You should always tell us the hardware you use. Else the numbers don´t tell us so much.

Certainly you use an nVidia card. On ATI cards display lists are not very effective.

Jan.

Oh, sorry :slight_smile:

specs:
Barton 2.5GHz
256 MB DDR 333
Nvidia FX 5700

The material calls are not that slow, but that you issue them inside begin-end shoots down your performance even more. Still, sorting by material is good.