PDA

View Full Version : Performance Test 1



nik_bg
06-27-2004, 09:04 PM
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.

Jan
06-28-2004, 12:26 AM
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.

nik_bg
06-28-2004, 12:49 AM
Oh, sorry :)

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

Relic
06-28-2004, 01:29 AM
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.