JavaFX embedded in jme3

Erm did you accidentially posted the same screenshot twice? both look kinda black to me.
Or is the problem that the elements are not drawn at all?

Transparency should work, I use it in my editor and weapon hud all the time.

@Empire Phoenix said: Erm did you accidentially posted the same screenshot twice? both look kinda black to me. Or is the problem that the elements are not drawn at all?

Transparency should work, I use it in my editor and weapon hud all the time.


Opacity works, but in one situation it works incorrect, thats why part of translucent elements were lost

What difference?

Or if I want to be funny… in one image your black is the wrong color black? :slight_smile:

Hi

Does any one have a quick example on how to set this up and use it? I have a limited knowledge of java and no experience with jme3. But I do have years of programming behind me, and I learn best by playing around.

So what I am hopping for is a quick and dirty example that opens a window that I can use as a starting point for experimenting?

Hi,

there are several ways. (assuming you have a running jme)

-> For the test you can add jme3 to the classpath, then the tests can be directly used.

-> You can add to your project jme3 + jme3-jfx, but the provided jme3 stuff in the jme3jfx stuff is only enough for compiling, you would need to copy the examples then to your own project.

-> You can (if you use eclipse I don’t know how for netbeans) gradle eclipse, then a eclipse porject is generated in the folder, wich you can directly import. And use as Dependency for other projects.

-> last but not least gradle is able to compile you a jar (gradle jar) that you can use as a lib in your own project.

For real development i suggest the last option as it will reduce the complexity of your own project structure.
For testing the first is probably the easiest.

@Empire Phoenix said:

-> You can (if you use eclipse I don’t know how for netbeans) gradle eclipse, then a eclipse porject is generated in the folder, wich you can directly import. And use as Dependency for other projects.

-> last but not least gradle is able to compile you a jar (gradle jar) that you can use as a lib in your own project.

For real development i suggest the last option as it will reduce the complexity of your own project structure.
For testing the first is probably the easiest.

Thanks for the quick reply. I am using eclipse, but not sure about gradle so will look into it and try the last option.

cheers,

@Empire Phoenix said:

For testing the first is probably the easiest.

I got the test running, but it looks pretty bad, a bit like your previous post (http://hub.jmonkeyengine.org/forum/topic/javafx-embedded-in-jme3/page/6/#post-263623) except it’s in black and white and much granier.

I am guessing it’s supposed to look a lot better?

Did you start the custom material test? The posted one has quite lost some quality due to gif constraints. Still it should have color. The other examples work correctly?

@Empire Phoenix said: Did you start the custom material test? The posted one has quite lost some quality due to gif constraints. Still it should have color. The other examples work correctly?

Actually all of the tests fail with some variant of this error:

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.Error: Unresolved compilation problems:
ARGB8 cannot be resolved or is not a field
ARGB8 cannot be resolved or is not a field

I also tried adding all of the jme3 jars from the 2014-06-12 version of JME3. Is it not compatible with this release of JME3?

@robbb

I also tried adding all of the jme3 jars from the 2014-06-12 version of JME3. Is it not compatible with this release of JME3?

I just answered that question by using the libs provided in jfx, so yes it’s not compatible with the most recent release of JME3.

You need this patch
http://hub.jmonkeyengine.org/forum/topic/support-for-argb8-and-bgra8-textures/
It was applied in February, so I would thought it is already there - but maybe it is different branch.

@abies said: You need this patch http://hub.jmonkeyengine.org/forum/topic/support-for-argb8-and-bgra8-textures/ It was applied in February, so I would thought it is already there - but maybe it is different branch.

Ok, I didn’t realise there was a patch required. Thanks

@robbb said: Ok, I didn't realise there was a patch required. Thanks

I’m using

and it is already contained there.

Yes, if you use the git version of jme, it should already be there.

The provided librarys are just to allow a stand alone compiling, they are not meant to be used for anything else.

Hi,

I would like to share some code to display jme’s Application into a javafx’s ImageView. I know it’s not the main goal of JME3-JFX, but do you accept it as PR ? else I’ll publish it as a gist.

screenshot of my sample / test app :

2 Likes

I think it will fit, if we propably should add something like jfxSimpleApplication, wich kinda is a simpleapplication just in a jfx window, as a drop in replacement.

I think it is only logical to also offer the integration in the other direction as well, as this would fit better for non game applications.
How is the performance? comparable to jfx to jmetexture?

@david.bernard.31 said: Hi,

I would like to share some code to display jme’s Application into a javafx’s ImageView. I know it’s not the main goal of JME3-JFX, but do you accept it as PR ? else I’ll publish it as a gist.

I would like to see it…

I didn’t mesure the performance. The update of the ImageView is sync (no throttle), so from my experiment :

  • AppSettings.setFramerate(0) => freeze, unresponsive JavaFX application (eg resize, …)
  • AppSettings.setFramerate(60) => no freeze

I use setFramerate(30) like the SceneViewer of SDK (my code is based on its source).

I suggest to do the converting work in the other thread however:

JFX in JME -> Work done in JFX Thread -> If JFX lags the rest still renders fluent and it can ofte be ignored
JME in JFX -> Work done in JME Thread -> If JME lags the rest of the gui still works fluent, ect.

Anyhow if you have something ready, you can just make a pull request for me on github.

I made the pull request. It always need some refactor to fix the issue (sync of raw image between Threads) but it’s usage.

I tried to provide :

  • a readable and complete test sample.
  • a wrapper/helper to hide config for common cases, it’s used by the sample, and I’ll use it for my own app.

a screenshot of the sample :

3 Likes