so,we can use jme4 and javafx Together，and no performance reduction!
No, no and no.
JavaFX IS a performance reduction. And the current jfx jme bindings have almost zero impact on fps as the javafx loop is in its own thread and just rendered as an image in jme.
There are soooo many reason to use anything other than javafx.
Javafx has its own set of tools for handling many things that jme has. If you want to build a game on jfx, then build a game on jfx. If you want to have a jfx ui in jme, then have one. But there is absolutely no advantage to rebuilding jme on jfx. And there is a huge list of reasons not to, including but not limited to:
- No control over post processing, view ports, or shaders. (What’s the point anymore?)
- No support for mobile devices without graalvm, which supports almost no third party libraries (anything that includes reflection, including all major loggers, netty.io, lwjgl, etc…)
- No control over hardware acceleration or rendering = POOR FPS.
- Is already a scene graph based system with controls (it would be redundant to put jme ontop of it)
OK, sorry. My rant is over.
EDIT: It looks like if you are willing to use JavaFX 1 (from over 10 years ago) it supports custom shaders Custom GLSL/HLSL pixel shaders for Java2D, Swing & JavaFX - Lqd’s Journal (hybird.org)
Even using JavaFX as a UI for jME has its caveats (I use JavaFX with jME in the MyWorld client and love using it, but it’s not a “perfect” solution). JavaFX is fundamentally not intended for use as a maximally efficient hardware-accelerated UI. On its own, it makes great use of hardware acceleration, but as soon as you use it in conjunction with something like a game either the UI or the game has to do a GPU->CPU->GPU round-trip. In MyWorld (JavaFX embedded in jME) it’s always JavaFX that does that round trip because it adds a little barely noticeable latency to the UI but doesn’t cause issues with the main frame rate. If you go the other way, with jME embedded in JavaFX then your jME scene has to do that round trip (unless you use DriftFX, which is experimental and doesn’t seem to be moving past its experimental status very quickly at all).
can i use JavaFX make 3d game? performance？or other problem？ i dont need lwjgl3! i only need 3d api
I can’t vouch for the performance, but FXGL is a JavaFX game engine.
Translated: “I don’t need a 3D API I only need a 3D API.”
The statement makes no sense.
LWJGL3 isn’t something you typically use as a jME user - it’s the library jME uses to talk to the graphics driver. jME’s architecture (like any other modern game engine) consists of the following layers:
- GPU (hardware)
- Driver (software, controls GPU - exposes OpenGL/Vulkan/Metal/DirectX API for applications to use GPU)
- Low-level 3D graphics lib (talks to driver via OpenGL/Vulkan/Metal/DirectX, - in jME’s case, this is LWJGL3 with OpenGL)
- High-level 3D graphics lib (jME scenegraph)
JavaFX is using the same basic layer architecture, but unlike jME (which allows you to use the lower-level functions if needed), JavaFX goes to great lengths to stop you from using the lower-level libraries:
- JavaFX Glass
- JavaFX scenegraph
Depending on what you’re making, the access to Layer #3 may be a make-it-or-break-it deal. Also, keep in mind that JavaFX is optimized for UI not general purpose 3D rendering, which tends to have different needs. From the looks of FXGL it’s useable for some types of games, but for 3D intensive games you’ll find yourself hitting quite a few limits pretty quickly. If you want to use JavaFX to make a sidescroller or top-down view game you’ll probably be fine, but if you want to make 3D games with good graphics you’ll want jME or another similar engine.
javafx cant use user custom shader？
No - JavaFX is a UI library with a powerful 3D scenegraph and the ability to do some lightweight 3D graphics, but it hides the 3D APIs from the user as much as possible. Your JavaFX code will run the same on Linux, Mac, & Windows with OpenGL, DirectX & someday Metal, but to gain that you lose the ability to use low-level things like shaders.