[Newbie] Java2D OpenGL Pipeline + JOGL: no visible performance difference

Hi -

I’m a newbie just getting into JOGL. I’m evaluating it to see if it fits in with our application needs (high performance 2D and 3D rendering; mainly images). I’ve downloaded the JOGL demos and gave them a try. I’m particularly interested in the JOGL + Swing interoperability. I’ve run the JRefract demo with and without the accelerated OpenGL pipeline. For the Gears demo, I don’t see any frame rate difference (~40fps).

OS: Windows XP
Gfx card: nvidia 8800 GTX
Driver: Forceware 169.09
JRE: jre6

java cmd line options: -Dsun.java2d.opengl=true -Dsun.java2d.noddraw=false -Dsun.java2d.opengl.fbobject=false

My questions:

  1. With hardware acceleration on, I would have expected a huge jump in FPS for the Gears demo (the standalone JGears demo runs at 300 fps). Am I doing something wrong or is the expected behavior of Swing + JOGL? So if you combine Swing and JOGL, does Swing limit the frame rate at which the JOGL portion can run?

  2. With the OpenGL pipeline enabled, for the Gears demo, the front faces of the gears are missing (looks like normals are inverted). Without the pipeline, it looks fine. Is this possible a driver problem?

  3. Since our app is more image based, is JOGL recommended or is Java2D more appropriate? (I’m an OpenGL programmer so JOGL would be easier). How does Java2D image rendering compare to JOGL?

Thanks very much,
Daren

I think the Gears demo uses GLCanvas so there shouldn’t be a significant performance gain. Unfortunately I cant’ look in the code right now.

With my Geforce 8800 GTS I always get black-artifacts in JRefract and XTrans. Did you experience any similar problems? Maybe I should give the 169.09 driver a try. Which exactly Java version do you use?

Update: Today I got a notebook with an ATI Radeon 2600 HD. The mentioned demos run significant better (concerning thoe artifacts) but there are still few block regions left.

Greets
Klemens

Hi Klemens,

Ah, thanks for the info about Gears and GLCanvas. So the Java2D OpenGL pipeline only effects GLJPanel? I still understand why in standalone for Gears I get 300fps but inside JRefract I only get 40fps. Does Swing turn on vsync or something similar?

The only artifacts I see with the OpenGL pipeline enabled is the inverted normals problem (front faces of gears not rendering). FYI, I had to use -Dsun.java2d.opengl.fboject=false to get anything to render at all. Without this flag, I just get a blank black window.

As for the java version:
java version “1.6.0_10-ea”
Java™ SE Runtime Environment (build 1.6.0_10-ea-b09)
Java HotSpot™ Client VM (build 11.0-b09, mixed mode, sharing)

Best,
Daren

I don’t think the problem comes from vsync. With GLJPanel alle the 3d content gets composed with the underlying swing contents. That has only to be done if you want to mix up or overlay your 3d-content with swing-contents (uses in JLayeredpane, use of leightweight tooltips, …). The pipeline accelerates this process. The fastest codepath I know is the one which uses FBO’s. So that’s the first indicator for the missing performance-gain (PBuffers are used instead).