[vtk-developers] (no subject)

Ken Martin ken.martin at kitware.com
Tue Oct 30 16:58:33 EST 2001


Hello Folk,

I just bumped into a significant performance change for some cases. I
added a new test called TimeRenderer2 that creates lighted triangle
strips and renders them. I was getting about 3 million triangles per
second which seemed a bit slow. I made a very small change to
OpenGLPolyDataMapper. We were doing

      glNewList(this->ListId,GL_COMPILE_AND_EXECUTE);
      this->Draw(ren,act);
      glEndList();

which I changed to

      glNewList(this->ListId,GL_COMPILE);
      this->Draw(ren,act);
      glEndList();
      glCallList(this->ListId);

this simple change resulted in building the display list faster which
I expected. What suprised me is that the subsequent renders ran at 35
million triangles per second on an old gforce256. Apparently the
display list generated is different if it is created in GL_COMPILE
versus GL_COMPILE_AND_EXECUTE even though I would think they would be
the same. I have checked in this change so we will see if everything
works with it. Hopefully other folks will see faster rendering
startups and rates. I have no idea if similar sppedups will happenon
UNIX systems but it is quite possible. Hank Childs suggested that the
display list building was too slow and www.opengl.org said... (note
the last item)


16.070 I've converted my program to use display lists, and it doesn't
run any faster. Why not?

Achieving the highest performance from display lists is highly
dependent on the OpenGL implementation, but here are a few pointers:

First, make sure that your application's process size isn't becoming
so large that it's causing memory thrashing. Using display lists
generally takes more memory than immediate mode, so it's possible that
your program is spending more time thrashing memory blocks than
rendering OpenGL calls.

Display lists won't improve the performance of a fill-limited
application. Try rendering to a smaller window, and if your
application runs faster, it's likely that it's fill-limited.

Stay away from GL_COMPILE_AND_EXECUTE mode. Instead, create the list
using GL_COMPILE mode, then execute it with glCallList().

Ken

--------------------------
Ken Martin, PhD
Kitware Inc.
518 371-3971 x101
469 Clifton Corporate Pkwy.
Clifton Park, NY 12065




More information about the vtk-developers mailing list