JavaFX integration with JOGL

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

JavaFX integration with JOGL

millerni456
Hello,

I have a few questions before I go diving into JavaFX.

First of all, does anyone know if JOGL can be implemented in a JavaFX application?
I'm aware that JavaFX has integration with Swing, and that JOGL has integration with Swing as well.
This leads me to believe that the two can be linked.

For my second and probably more important question, if JavaFX integration with JOGL is possible, then am I able to use JavaFX UI in place of my OpenGL render?

I'm creating a game, and I'm not looking forward to implementing all of the graphics/code for my own UI via OpenGL.  If I can use JavaFX to create a UI, this could simply things a lot.  Basically, I would like to grab the animation/components from JavaFX and put it into my game's menus.


If anyone knows about this, I'd be more than happy to hear what you have to say :)

Thanks for the help.
Reply | Threaded
Open this post in threaded view
|

Re: JavaFX integration with JOGL

jmaasing
Not easily.
http://forum.jogamp.org/Jogl-and-JavaFX-td4030720.html

But it can be done, although you will probably have to spend more time integrating them than writing the UI yourself :-)
There is for example an integration effort going on in the jMonkeyEngine: http://hub.jmonkeyengine.org/forum/topic/javafx-embedded-in-jme3/

Many projects/engines use Nifty to write UIs in games: http://nifty-gui.lessvoid.com so that may be an alternative to look at.

Reply | Threaded
Open this post in threaded view
|

Re: JavaFX integration with JOGL

gouessej
Administrator
In reply to this post by millerni456
Hi

There is already a bug report about that:
https://jogamp.org/bugzilla/show_bug.cgi?id=607

You can use a SwingNode with a GLJPanel, it works... somehow...

Supporting OpenJFX/JavaFX is so problematic that I advise you to stay away from it. JogAmp's Ardor3D Continuation has its own UI too, there are some UI libraries based on JOGL. If you read the thread quoted by jmaasing, you'll understand what I mean.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JavaFX integration with JOGL

millerni456
Thanks for the information.  Although I wish there was some easy integration, I guess I'll have to wait until JavaFX is changed.  I am still glad to know about these things before I go jumping into this technology.

I guess I'll have to continue to look at the other options still available.

Supposing I took the Ardor3D route, do you think there is a large learning curve before I can actually integrate it into my game?
Reply | Threaded
Open this post in threaded view
|

Re: JavaFX integration with JOGL

gouessej
Administrator
I'm sorry, I'm completely "late", I planned to implement the GLJFXPanel but I had no time to do it. In my humble opinion, Oracle must provide an equivalent of JAWT for OpenJFX and ship the ES-2 pipeline under Windows (otherwise it's not worth working on that). It won't happen before Java 1.9.

LibGDX Scene2D is nice too and LibGDX has a JOGL backend too :)

Don't use JogAmp's Ardor3D Continuation only for the UI. It's easy to use for someone who has already used a similar engine (JMonkeyEngine?). Which kind of UI do you need to implement in your game?
Julien Gouesse | Personal blog | Website
ul
Reply | Threaded
Open this post in threaded view
|

Re: JavaFX integration with JOGL

ul
In reply to this post by millerni456
Note that JavaFX has built-in 3D capabilities. I suspect it's is very similar to the old Java3D.
Reply | Threaded
Open this post in threaded view
|

Re: JavaFX integration with JOGL

gouessej
Administrator
JavaFX 3D API is a lot poorer than what offers most scenegraph especially in comparison with JMonkeyEngine, JogAmp's Ardor3D Continuation, LibGDX and Java3D. It's similar with the old Java3D in terms of design flaws :) It has inconsistent performance across platforms as it relies on several renderers (which is a pain in the a** to maintain like in Java3D 1.5.2), it has higher minimal requirements.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: JavaFX integration with JOGL

jdub1581
So has any and all progress stopped since '13?
I've been looking but everything is fairly old..
Reply | Threaded
Open this post in threaded view
|

Re: JavaFX integration with JOGL

Sven Gothel
Administrator
On 03/05/2015 02:17 AM, jdub1581 [via jogamp] wrote:
> So has any and all progress stopped since '13?
> I've been looking but everything is fairly old..

My analysis ..

<https://jogamp.org/bugzilla/show_bug.cgi?id=607#c20>

If you like, feel free to test the stable and slow-path
interoperability: [A] + [B].

~Sven


signature.asc (828 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JavaFX integration with JOGL

jdub1581
Gotcha, perhaps I'm not understanding something, but, would it not be easier to implement a JoglPipeline
similar to this:
        https://bitbucket.org/dejayberlin/joglfxpipeline/src
Granted this is old and many things have changed since .. I have tried to rebuild it, but a lot has changed in JOGL since as well.

I suppose my other question is:
Would it not also be easier to enhance the ES2Pipeline to use all the GL commands available for GLES2?
For example exposing the commands in the *Graphics class

All of you guys are much smarter than me in this department, and I am a novice with Jogl, so I'm sure I'm not accounting for something.
I'm just tired of waiting, and not being able to implement
what seems to be common features in all other scenegraphs ..
Reply | Threaded
Open this post in threaded view
|

Re: JavaFX integration with JOGL

Sven Gothel
Administrator
On 03/05/2015 03:37 AM, jdub1581 [via jogamp] wrote:

> Gotcha, perhaps I'm not understanding something, but, would it not be easier
> to implement a JoglPipeline
> similar to this:
>         https://bitbucket.org/dejayberlin/joglfxpipeline/src
> Granted this is old and many things have changed since .. I have tried to
> rebuild it, but a lot has changed in JOGL since as well.
>
> I suppose my other question is:
> Would it not also be easier to enhance the ES2Pipeline to use all the GL
> commands available for GLES2?
> For example exposing the commands in the *Graphics class
I am not familiar w/ above 'pipelines'.

All I have stated in the bug report are the difficulties
how to merge GL rendered artifacts into JavaFX,
whether it be the bitmap copy or native direct rendering.
Each has its merits and weakness, as noted in the bug report.

>
> All of you guys are much smarter than me in this department, and I am a novice
> with Jogl, so I'm sure I'm not accounting for something.
> I'm just tired of waiting, and not being able to implement
> what seems to be common features in all other scenegraphs ..

JOGL is not a scenegraph,
but merely a low and higher level tool
to utilize OpenGL across platforms.

The bug comment is still in discussion
and it has to be seen whether and how we implement it.

However, anybody is welcome to offer a git pull request w/
a unit test / demo-code to be merged. Of course!

~Sven



signature.asc (828 bytes) Download Attachment