[PYTHON MATRIX-SIG] Speed of opengl

Jim Hugunin jjh@goldilocks.lcs.mit.edu
Tue, 23 Jul 1996 15:48:21 -0400


Michael McLay wrote:
> 
> Is openglmodule-0.33.c the most current version of the opengl module?
> There were a couple other modules available so I wasn't sure.

That's the most recent publically available version.  David Ascher, Tom
Schwaller and myself need to find the time to clean up and distribute a
final version sometime soon.

> I modified the glu, glut and opengl modules so the prefixes are no
> longer necessary.  They seemed redundent and C'ish.  I also had to
...
More reason to produce a clean version so each person doesn't have to do
this.

> The performance of the python OpenGL module on a Linux system isn't
> meeting my design objectives and I was wondering if I'm doing
> something wrong or if it's just slow software.  The system uses
> Mesa-1.2.8 on a Pentium 90 system with #9GXE 64Pro graphics card.
...
> This is pretty slow compared to an SGI.  I can live with it in the
> application but I'd like the drawing rate to be about 4x this speed.

Well, a P-90 is pretty slow compared to an SGI, and Mesa is not exactly
a speed demon.  

> I may even break down and buy a Acellerated-X OpenGL server for the
> PC, but that would be a last resort.

This is the price you'll have to pay if you want really great
performance (or switch over to NT 4.0 where they have a fairly nice
implementation distributed with the OS).
 
> The performance seems to drop below an acceptable speed when I use it
> with Python.  Here's a test that draws 500 random length lines.

Now this part I should be able to help with.

First, I'd advise using the idiom:

gl.Begin(GL_LINES)
gl.Vertex(array_of_vertices)
gl.End(GL_LINES)

its a much more general approach and Lines will probably be fading out
of future versions of the module.

As far as the speeds that you're noticing, this is completely counter to
my own experiences.  Could you send me the complete source (both python
and C) to your test programs so that I can look at them and run my own
tests?

-Jim

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================