JOGL Demos with Swing run too slow?

I noticed that the gears JOGL demo runs great but the jgears JOGL demo runs super slow. The two programs are almost line for line identical, except the fast one uses GLCanvas and the slow one used GLJPanel.

Has anyone seen this problem before? I went the the JOGL site and it told me to come here. Please excuse me if I have the wrong forum.

-Michel

GLJPanel will always be slower then GLCanvas. A GLCanvas draw directly to the screen. GLJPanel draw to an array which is probably copied a couple times before it reaches the screen. In the near term just don’t use GLJPanel if you are at all interested in frames per second.

Slower I would expect, but the GLCanvas version runs so fast you can’t see the teeth on the gears, and the GLJPanel version runs so slow I can go get a cup of coffee before it does one complete revolution.

I’m going to try compiling JOGL from CVS next.

-Michel

Compiling JOGL from CVS is not going to improve your speed. I am pretty sure that GLJPanel uses the software renderer, nothing you do will make it draw any faster.

The only time you need to use a GLJPanel is if you need to do any drawing on top of the 3d image (ie, draw stuff with Java2d or place a swing control). In that case you are better off to draw to a BufferedImage and use the OpenGL calls to draw a textured quad or something.

What are you doing that would require using the GLJPanel?

Michael

GLJPanel just isn’t going to be useful until, maybe, PCI-Express motherboard/videocards are available. 4GB’s in each direction would speed things up a lot. My best advice is don’t use GLJPanel unless you really, really have to.

GLCanvas is great if all you want is a single-graphics-window application (e.g. the typical computer game).

However, for a Swing-based multiple document type application where one wants to render an image in one window, and perhaps display data in another window, etc. then Swing prevents the use of GLCanvas :frowning:

Sure would be great to get decent graphics performance in a JOGL Swing app.