JavaFX 2 + with LWJGL ( OpenGL )
Philipp Dörfler
phdoerfler at gmail.com
Sun Apr 6 14:48:18 UTC 2014
It is not possible to combine JavaFX and OpenGL as it is right now. This was discussed on this mailing list some time before as a _possible_ future addition, but I’d be very surprised if Oracle actually chose to implement this.
Starting with JavaFX 8 there is indeed some kind of „3D support“ but the 3D API allows only for the most basic operations. It is still completely scene graph based and you have to live with all restrictions that JavaFX imposes on you. Not wanting to say that the 3D API is completely useless, but I’m afraid that even WPF is more flexible when it comes to 3D than JavaFX is. For example: As far as I know you can not even change the shading model from GL_SMOOTH to GL_FLAT. You could work around that by setting the normals yourself though (Same for WPF). Also render quality is bad when you render an instance of Text in 3D and scale it down for example. At least it was when I tried that last time (few months ago).
Again, not to say that one can’t work with JavaFX’s 3D API, but it’s not raw OpenGL either. As far as I know the JavaFX team wants to be able to let the user use his own OpenGL context and let JavaFX render on top of that or add the possibility to ask JavaFX for the underlying context and mess with that but this is not even officially planned or included on any roadmap (AFAIK) so we can only keep our fingers crossed for that to happen. Like you I would absolutely LOVE to use JavaFX as a GUI on top of my OpenGL games.
Cheers
Philipp Dörfler
Am 06.04.2014 um 16:31 schrieb Exo Verse <toraktu at gmail.com>:
> Can you please explain what True 3D means in terms of Low Level API ?
> Because with LWJGL I can use Low Level API to talk directly to my Video
> Card. As a game dev, I need every ounce of umph from the card I can get,
> and using a browser or any other kind of wrapper hasn't proven very
> efficient. I love LWJGL because of its simplicity. Anything extra I need, I
> am allowed to make on my own. Example, my own Game Engine.
>
> And that is where I am at. So if your speaking about Nodes, I am aware
> there is a hierarchy to the JavaFX2 when setting up the GUI, but that is
> the only thing I knew existed. Could you please elaborate what makes
> JavaFX8 a True 3D Low Level interface API ? Because from the presentation,
> you have to go through two layers before you have to get to the OpenGL
> layer. Where as if I can use LWJGL, I can skip a level.
>
> If I am misinformed on something, please, explain. Because I am new to
> JavaFX.
>
> Cheers,
> Torak
>
>
> On Sun, Apr 6, 2014 at 10:24 AM, Hervé Girod <herve.girod at gmail.com> wrote:
>
>> With Java 8 (JavaFX 8), you now have true 3D Nodes, with camera,
>> texturing, etc... However it would still be very interesting to be able to
>> control the low-level rendering of JavaFX, such as using LWJGL for example.
>> This would allow to render JavaFx content in an external OpenGL context for
>> example.
>>
>> Hervé
>>
>> Sent from my iPad
>>
>>> On 6 avr. 2014, at 14:42, Exo Verse <toraktu at gmail.com> wrote:
>>>
>>> Hello, I have been working with OpenGL and LWJGL for over 5 years now. I
>>> want to switch over to using JavaFX 2, because of its GUI abilities and
>>> still use LWJGL with it. But I can't seem to find a way to do this. I
>> saw a
>>> 2 hour video that described the features of JavaFX 2 and it even shown
>> the
>>> layout.. OpenGL was there at the bottom with D3D with Prism above both
>> of
>>> them in the hierarchy. I have searched the web and I can't find prism, I
>>> can't find info on how to talk to opengl and I can't find any tutorials
>>> anywhere. So I am posting here to see what I can find. I do NOT like
>> JOGL.
>>> I prefer LWJGL. So far, the only thing related to 3D with regards to
>> JavaFX
>>> is the very resource intensive Canvas3D, which I can't stand. Any ideas ?
>>> Is it not implemented yet and its on its way ? I'm trying to find any
>> info
>>> I can about this. If there is nothing for LWJGL, then I can't use JavaFX.
>>>
>>> Thanks.
>>>
>>> Torak
>>
More information about the openjfx-dev
mailing list