GLJPanel to BufferedImage?

Hello. I have tested the performance of GJPanel and JGears had about 110 FPS where Gears without GLPanel had about 150 FPS. My question is if it currently uses BufferedImage or some other intermediate image?

I would want to render GLJPanel into a buffered image, should I use FBO or is there a faster way if I use GLJPanel? If yes, how to do it?

Thanks,
Artur

By default the GLJPanel does use a BufferedImage internally, though if you’re running JDK 6 on Windows or X11 with -Dsun.java2d.opengl=true it renders directly to the hardware-accelerated Swing back buffer.

The easiest way for you to capture the GLJPanel’s output into a BufferedImage is to use the com.sun.opengl.util.Screenshot class.

I have found some code to render GLJPanel to Buffered image. I use GLJPane with JDK6/X11/-Dsun.java2d.opengl=true and the performance is still about 65% of JOGL without GLJPanel.