LWJGL Forum

Programming => OpenGL => Topic started by: PhilSchoe on February 16, 2018, 13:19:30

Title: LWJGL 3 + JavaFX
Post by: PhilSchoe on February 16, 2018, 13:19:30
Hello,

we are developing an application that uses LWJGL 3 for rendering and want to build the UI with JavaFX.

In order to show the rendering in a JavaFX ImageView, we ported Spasi's LWJGL-FX project to LWJGL 3 (https://github.com/Spasi/LWJGL-FX). However there are mainly two performance issues with this:

1) The overall performance is lower than what we need. We need to run the application with 60 frames per seconds in full hd.

2) The performance is very unstable. This means when doing an animation for example, there are several, very short performance breakdowns noticeable during the animation. It feels like lag that occurs multiple times. This can be seen in Spasi's example project with the rotating gears as well.

For a comparison we implemented Kaj Burjack's lwjgl3-awt project, which is based on AWT (https://github.com/httpdigest/lwjgl3-awt). In regards to the aforementioned issues, we got the following results:

1) The overall performance is better. This was to be expected, as we do not have to transfer pixels back from the GPU to CPU.

2) There are some lags, but the overall performance is stable.


Did anyone try to port Spasi's project to LWJGL 3 as well and figured out, how to overcome the performance issues?

If you have different ideas for coupling OpenGL and JavaFX, we would like to hear them as well. We found some posts on retrieving the window handle of a JavaFX window, but do currently not know, if it is a feasible solution for our application, but if someone got this working with a good performance, please tell us and we will definitely give it a go.

We already did an extensive google search on this topic and searched for it in this forum as well, but the answers do not address our issues. Please tell us, if you have a solution or ran into similar problems. Maybe there is something new in Java 9, which we are not aware of.


Best regards,
Philipp :)
Title: Re: LWJGL 3 + JavaFX
Post by: spasi on February 16, 2018, 17:50:35
We made another attempt with LWJGL3FX (http://www.java-gaming.org/topics/lwjgl3fx-a-sneak-peek/38003/view.html), but it's currently abandoned. You should try JFXGL (https://bitbucket.org/cuchaz/jfxgl), a different approach by Jeff Martin.