OBJ loader for OpenGLContext

Have been working on PyOpenGL and OpenGLContext all day.  Have redone the OpenGLContext loader module and ported the OBJ loader from pyglet over.  The OBJ loader seems to work fine, but I didn't find any OBJ files that include material information to test that.  I'm going to have to fix the face-culling, seems that the OBJ files are not always CCW.  Should add "group" support too.

Added Vertex Buffer Object support to the ArrayGeometry class in OpenGLContext.  Didn't seem to have all that much of an effect, so I tried profiling OpenGLContext rendering a big mesh (of a fish, incidentally)... and the actual rendering code (the OpenGL stuff) was totally drowned in the scenegraph overhead.  That is, the actually pushing of vertices across the bus was nothing compared to the overhead inside the scenegraph.  The scenegraph might be slow, but almost 99% of the total time?  That just didn't make sense.

So I pulled out wxProfile2 (a hacked up version of wxProfile, which seems to have disappeared) and actually dug into the data (I was using raw Stats objects before that).  Turns out that OpenGLContext's IndexedFaceSet object was re-compiling the array-based geometry for every frame, the recompilation is extremely expensive compared to redrawing (because it has to deal with the very general VRML97 model).  Fixed that and frame-rates jumped by a factor of 10 or so.

We also got PyOpenGL (and OpenGLContext) tested under Mac OSX 10.5 (Leopard) on a PowerPC Mac G4.  A few issues in OpenGLContext, but PyOpenGL seems fine.  All in all a very productive day.  There's going to be some work to do cleaning up client code that used OpenGLContext's old VRML-specific loading interface at some point, but that's not for today.

Comments

Comments are closed.

Pingbacks

Pingbacks are closed.