Monday, September 13, 2010

Do you want 3D in Eclipse?

Unfortunately, we were informed that the JOGL library has failed to get IP approved just like LWJGL due to severe licensing problems (see CQ2817 and GQ2840 for further details; IPZilla account needed). To summarize, LWJGL cannot be approved as it contains non BSD code or code with unknown license or provenance and JOGL cannot be approved as “we have been unable to locate an individual within Sun/Oracle to help us with JOGL”, as Janet Campbell wrote when closing the CQ. In this context we'd like to thank Janet and Barb for all their hard work!

What this means for Eclipse is that, even though it is technically possible to use 3D / OpenGL within Eclipse, there is no way to create self-contained Eclipse plugins that require OpenGL. Such plugins would always have to rely on external update sites, which complicates the installation process. Such update sites also depend on third party support and may or may not be available in future releases. For GEF3D, this is really bad news, but it also is a problem for all other 3D related projects.

The only option appears to be to create a new Eclipse project for OpenGL bindings. Some work has been done in the SWT project itself, but the code has since been abandoned. Unfortunately, writing OpenGL bindings for Java is not a simple job due to inconsistencies and driver incompatibilities. Jens wrote GEF3D in the context of his Ph.D. thesis, and we both were paid by the FernUniversität in Hagen. Additionally, we spent a lot of our spare time on GEF3D. We both are still interested in GEF3D, but unfortunately our current work is not really 3D related. That is, we both are no longer paid for maintaining GEF3D. This would be OK to a certain degree, but frankly none of us is keen on writing a new OpenGL wrapper library on our own without any salary.

So, we'd like to know whether we are alone in our effort to bring 3D to Eclipse: Do you want 3D (i.e. OpenGL) in Eclipse? And if you do, what are your thoughts on this situation? As this is not a simple yes/no question, please leave us a comment.

Jens and Kristian

Technical Note: OpenGL is required for almost all 3D applications, and high-level libraries such as the JMonkeyEngine or Aviatrix3D use OpenGL (i.e. LWJGL or JOGL) under the hood. Technically, OpenGL can be easily used in SWT applications thanks to the GLCanvas class. However, a Java wrapper library is needed for calling OpenGL functions. As far as we know, only two such libraries are available: LWJGL and JOGL. At http://www.eclipse.org/swt/opengl/, gljava is listed as well, however, this project is no longer maintained. The same is true for the org.eclipse.opengl bindings. There exists a plugin for JOGL, and another for LWJGL. The plugin for LWJGL has been written in the context of GEF3D and has been maintained by the LWJGL team for quite a while (they have changed their build system, so the LWJGL plugin is no longer maintained at the moment, however the update site is still available).

11 comments:

  1. I am still curious why a project which was BSD since the beginning, stops being BSD since "foo can't reach bar" :)

    re: Ardor3D
    ... uses JOGL/LWJGL as binding

    ReplyDelete
  2. so the first step would be to open up the bugs and tell us what the problem actually is. (seriously) We can't fix not existing issues.

    ReplyDelete
  3. I've been working on 3D support for an RCP application I'm developing. I currently have LWJGL 2.5 packaged as a plugin for Win32, Win32_x64, Linux X86, and Linux X86_64, and have run a simple set of tests on all but the last (thanks to VBox).

    Knowing the status of LWJGL from a license perspective, I've also been wondering how to get an official set of OpenGL bindings into Eclipse.

    Assuming that the answer is to create a new project with known IP, some questions come to mind that I haven't followed up on yet:

    1) Since the Khronos Group owns the official language spec for OpenGL, and since they have their own license terms, are there any license compatibility issues between the specifications and the EPL that would cause problems for any possible implementation?

    2) Are there any issues with creating an SPI that supports LWJGL and/or JOGL in the short term, but is eventually implemented by the new plugin(s), allowing existing implementations to be easily migrated forward?

    Finally, before going to the effort, is there any possibility of contacting the JOGL maintainers via contacts at the Khronos Group?

    Steve Robenalt

    ReplyDelete
  4. Maybe I'm loosing something but, what's the problem with a Subversive-like approach? To use Subversive (which is an official Eclipse project) you need to install third party plugins hosted elsewhere. Can you do the same with OpenGL bindings?

    ReplyDelete
  5. @Michael "so the first step would be to open up the bugs and tell us what the problem actually is."

    I don't get what you mean..?

    BTW, the LWJGL update site could be maintained with just a bit more effort -- please see the link in the post above.

    ReplyDelete
  6. For those that don't know, Jens and Kristian have put a termendous amount

    ReplyDelete
  7. @Miles
    nobody of the JOGL devs (me included) can access the above mentioned bug reports. I suppose you agree when i say its kind of a suboptimal situation if only one party knows what the actual issue is.

    ReplyDelete
  8. You may have a look at the underlying 3D library from Jmol (http://www.jmol.org/). Miguel Howard, some 5-8 years ago, wrote a custom, pure-Java 3D engine because Java3D did not really plugin well on browsers, and Jmol used as applet more than as component (JOGL did not even exist at the time).

    Despite being pure Java, is has remarkable speed. It has many core types, but lacks many features a typical hardware-accelerated library has, like textures, etc. That said, I think Bob Hanson did extend it to plot an 'image' onto a plane, which may be just enough.

    License: LGPL.

    ReplyDelete
  9. @Egon
    Thanks for the link. Jmol looks really impressing. From the technical documentation: "There is no Java3D, OpenGL or any type of hardware acceleration. The graphics engine is a special purpose graphics engine, not a general purpose 3D graphics library." And indeed, watching the demos I cannot believe that it's pure Java and no hardware acceleration. Actually, GEF3D takes real benefit from hardware acceleration, and I don't think we can switch do pure software. GEF3D uses the data structure of Draw2D for compatibility reasons. Unfortunately, this structure is not optimized for 3D. So we do not have the ideal structure for 3D, and thus we have to compensate that negative effect somewhere else. Also, I doubt that a pure software solution would be able to render text in the quality and speed as we can do that at the moment using OpenGL. But thanks for the link, anyway.

    ReplyDelete
  10. Software rendering is not the way to go (jmol is far from JOGL in terms of performance especially on low end machines) and I find this situation really unfair because nobody has allowed me to give a look at the JOGL version of GEF3D, only the LWJGL version is available and despite our efforts to clarify the situation about the license of JOGL, nothing has changed.

    ReplyDelete
  11. @gouessej: Thanks for the JOGL reminder ;-) I have submitted the JOGL renderer contributed by Madhu Samuel into the GEF3D svn. However, this renderer is not working at the moment for two reasons: first, it is not adopted to the latest Draw3D API changes, and second, no JOGL library is provided. So, you can have a look at the JOGL renderer (from the GEF3D svn: trunk/org.eclipse.draw3d.jogl) now, however it is not running. As I do not have the time for maintaining two renderers, I will not fix the above mentioned problems with the JOGL renderer in the near future. Help would be highly appreciated!

    ReplyDelete