Best Java OpenGL Binding?

Hello all,

I am fairly new to the Java 3D Graphics environment and have a quick question:

What is the general consensus as to the best Java OpenGL Binding as far as efficiency and operations available?

I hear different opinions as to JOGL or Java3D. I would like something that meshes well with the Java Swing API.

Thanks.

The choice is between LWJGL and JOGL; Java3D is a scene graph. Functionally LWJGL and JOGL are more or less identical. I use LWJGL.

Cas :slight_smile:

[quote=“dinaharchery,post:1,topic:31181”]
If you want to mix Swing/Java2D with OpenGL I would recommend JOGL for you as low level binding. Just browse through https://jogl-demos.dev.java.net/ there should be a webstartable demo which demonstrates the interoperability between the APIs.

I have used both JOGL and LWJGL and have both of them working in my engine, what I can say is that JOGL forces you to have a particular class architecture because of the GLEventListener…

You might like JOGL’s GLEventListener as it interoperates with the AWT thread quite nicely if you want that stuff. It allows you to have Swing components and the like. LWJGL isn’t dependant on AWT’s thread for its rendering and hence its slightly more flexable, but doesnt have this Swing components (It does have an AWTGLCanvas)

You have parties for both, pick one, try it, change to the other, try it and see what API you like…

DP :slight_smile:

Has anyone actually released a commercial game with Jogl yet?

Wurm Online uses JOGL

I think most games use LWJGL, as LWJGL is designed with games in mind.

JOGL is more used when 3d-acceleration is required inside a GUI.

… I think …

I was about to say that they’re still a free game, but having a look they seem to be charging for stuff now, so they must be doing pretty well. ;D

It also uses LWJGL, you have a choice to use either one in the start-up settings which is awsome, and I guess means the game is coded well. I spoke to a few players last month and they’re split on which one they use, although some reported slightly faster frame rates with LWJGL. (I only spoke to 4-5 people.)

You’ll probably get better community support if using LWJGL, I have no experience with JOGL though.

Also, jME uses LWJGL, which is probably the best 3d game engine for java.

But fundamentally there is little difference, both provide GL access.

All I can say, I don’t regret that I’m using LWJGL instead of JOGL.

I like LWJGL as the community is very helpful especially on the lwjgl irc channel.

I’ve never used JOGL, so I’m quite biased.

But I really like LWJGL, it doesn’t get in the way at all, just nice clean access to OpenGL. I also find code samples from other languages (ie C) translate to Java/LWJGL very easily.

[quote=“JCrucio,post:9,topic:31181”]
LWJGL has some issues (can’t resize game window while playing) that some players find annoying, and refuses to work at all for very few people, but other than that, and only purely in my own humble experience, it’s better than JOGL these days. It’s the default option for wurm.
JOGL seems to play along slightly better with linux than LWJGL does, but that’s just based on pure guesswork from the comments I’ve received.

It isn’t an argument. Commercial gaming is not the only interesting part of gaming on the whole, you have a mercantile point of view.

JOGL is at least as well designed as LWJGL for games if we consider them only as OpenGL bindings. I refuse that LWJGL users try to make people believe that JOGL should not be used for gaming.

JME creators planned to use both JOGL and LWJGL, I suggested them to let me give them some help to make a JOGL version but they refused my help. I don’t know if they will finally do it but in the past, they didn’t exclude this possibility. Then, telling that LWJGL is better than JOGL because it is used in JME is not fair. There is a quite good community support for JOGL too, you don’t know what you’re talking about.

amen gouessej ;D

I even see no reason why someone should have a hard dependency to a specific GL binding. Except he has requirements like the initial creator of the topic -> swing interoperability.

[quote]It isn’t an argument. Commercial gaming is not the only interesting part of gaming on the whole, you have a mercantile point of view.
[/quote]
Hm, well just replace the word ‘commercial’ with ‘quality’ or ‘finished’ then, I know how sensitive you are to these things :slight_smile:

[quote]JOGL is at least as well designed as LWJGL for games if we consider them only as OpenGL bindings. I refuse that LWJGL users try to make people believe that JOGL should not be used for gaming.
[/quote]
You don’t have to: Nobody is trying to make people believe that JOGL shouldn’t be used for gaming, that’s just your perception.
It is only suggested that LWJGL was created purely with games in mind, and it has also been around a bit longer than JOGL which might explain why LWJGL has been used more for games. Of course that doesn’t necessarily exclude JOGL from being a good choice for gaming.

That said, LWJGL has an advantage that it doesn’t depend on AWT, which makes it easier to distribute the game without depending on (a certain version of) Java being installed (using native binaries or a small private VM without AWT).

Other than that, I think it’s mostly a matter of taste, really. I like how LWJGL (the OpenGL part) is really a straightforward binding to the OpenGL API without trying to make OpenGL look like it’s OO because it really just isn’t. And the last time I checked, LWJGL was a lot smaller than JOGL.
Other people prefer the JOGL way of doing things, so as always YMMV.