Sloooowly

Hello,

On my University we have got 3d programming (OpenGL) and we must write 3d application.
Because Java is my favorite language, I’m thinking about use some kind of OpenGL2Java binding.

I downloaded JOGL and want to make some performance tests.
I lunched JGears … and … I have got ~40fps (without transparency) … on glxgears I have got ~500fps !
Yes, my hardware is old … but … is >10 times slowly :frowning:

Do all OpenGL2Java bindings are slowly like this ?
Maybe I do something wrong … but what ?

/ fl

(Linux)
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce4 MX 440/AGP/3DNOW!
GL_VERSION: 1.5.5 NVIDIA 81.78

JGears uses a GL drawable, that implements a 100% java swing compatible GUI component, which involves pixel copying in Java 1.5 (this limitation will go away in 1.6). Try the Gears demo instead and you will notice the difference. The Gears demo creates a “heavyweight” component, which is more suitable for realtime rendering. Note that even the heavyweight GL component can be used in GUI applications, but you may have some problems (such as popup menues vanishing behind the GL area). There are however workarounds, like setting popups to also be heavyweight, for most of this problems.

Thank You for answer.

I didn’t see Gears demon before :slight_smile:
Later, I check JGears src, and modify to use GLCanvas. Then I have got about 85fps.

Few minutes ago, I check Gears demo, and … I have got about 85fps too.
But … what is interesting … when I resize window to about 700x700px … it was still 85fps and on glxgears with the same window size I have got ~95fps too :slight_smile:
Another things is that CPU load is about 15% … when with glxgears is 100%.
I don’t know what exactly work Animator, but in docs is:
“After each drawable has been redrawn, a brief pause is performed to avoid swamping the CPU, unless setRunAsFastAsPossible(boolean) has been called.”
So I set RunAsFastAsPossible to true, but without effect :slight_smile:

/ fl

ps. I have got problem with fullscreen on my Linux(xorg 6.9.0, nvidia), maybe You will be know somethings about this ?
java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().isFullScreenSupported() == false :frowning:

Hi, seems that you haven’t disabled vertical refresh rate sync… which may be 85 fps

Try the setSwapInterval(int) method.

Full-screen is only supported on Linux in the Java SE 6 (Mustang) JDK. Try downloading one of the weekly builds from http://mustang.dev.java.net/ .

Hello,

I change SwapInterval and now I have got results like in glxgears or even faster :slight_smile:
(btw. vertical refresh rate sync seems reasonable for me)

Thanks for help.

/ fl

ps. Thanks Ken.