Vulkan for JMonkey

If i would ever want to make a vulkan bridge for Java, would it be hard and how would i have to make it so it work with the actual JMonkeyEngine? Would i need to redo the whole engine or could i just replace the core with a new core?

Edit: If i wanted to make jmonkey Vulkan capable, wouldn’t it be extremely fast to make both API (OpenGL and Vulkan) enables(switch from one to the other, depending on Hardware compatibility) using LWJGL?
source: Vulkan Bindings For Java Are Also Available Via LWJGL - Phoronix

1 Like

Well, first of all with vulcan you get one step nearer to the metal. This implies the api complexitiy itself is much higher. Just compare a hello triangle from opengl and vulcan.
After your first shock, you will notice that you will not get any help from the driver. Memory management, synchronizing buffer transfers drawcalls, its now all up to you.

That said it is clearly not an easy task, and will take months to implement.
Now, even if you manage that all, you will notice that you wont gain that much. Jme is designed around a single rendering context, while the main vulcan perfirmance increase comes from the ability to have many reusable commandqueues.
So the main question is, why do you need vulcan in the first place?

@n3cr0 :
I agree with the things that @zzuegg has written.

However, I think it’s the right time to make a start with Vulkan, because the drivers look more optimised now.

Also LWJGL 3.1 is out now which also has better Vulkan support.

If we have a basic implementation for jME - Vulkan we can later look if we can change jME to make better use of it.

jME - Vulkan should be implemented as another rendering backend (e.g. LWJGL 2, LWJGL 3, JOGL, Vulkan).

I think for now you should implement it as 1 rendering context = 1 command queue.

I still hope you want to make a start with it.

Then there is no reason to do it as you will basically be re-implementing the OpenGL API.

It’s like rewriting a library in raw assembly language. Unless you change the library itself you won’t be able to take advantage of any of the lower level stuff because you will still be calling higher level functions.

So, start on JME4 built from the ground up around Vulkan. Let us know how it goes.

1 Like

In my honest opinion,time to talk about implementing Vulkan has not come yet. Let’s wait to see how to harmonize it with older layers because building JMonkey on top of Vulkan requires to rethink a big part of the engine.

I can’t do this by my self, even if i wanted to make jme4, i would need supervision from someone in the jme3 team. The way i would do this would be to make jme3-jme4 give the exact same functionality available. Ending with no refactoring/rework of anyone game. And yet provide the new way to any upgrade on existing game would be possible!

And the reason i m planing on going forward with Vulkan is to provide latest technologies for the community in general. Making new game available for OpenGL/Vulkan at the sametime would give a boost at JMonkey Popularity, thus more Plugin and Talent people helping in maintaining the Engine.

We could even get help from Khronos Groups, Oracle, Google or AMD/Nvidia to maintain the project of a free engine available to everyone.

Anyway for now i will read about LWJGL 3.1 and it Vulkan implementation.

You can find the examples for LWJGL 3.1 and Vulkan here:

Alright i will Build with the full package around LWJGL 3.1.0 for now.
Don’t put too many hope in this project. I will create a Github named JME4.

1 Like

Lwjgl3.1 is already working…

IMHO:

If you want that jme supports state of the art tech, go for gl4+ features and implement those (UBOs, SSBOs, Computing …)

If you still want to go for Vulcan,i honestly suggest that you start from scratch and design your engine around the new concepts that come with vulcan. Starting from the core, and not at the renderer backend

1 Like

If a Vulkan backend was implemented for jME 3.x there would be many breaking changes from a user’s point of view. For example, everything in Vulkan is immutable by default for efficiency. This and other constraints would need to be enforced in various parts of the engine, which means breaking existing code that does not take them into account.

Also, we use integer IDs reference native objects. Those would need to be changed to using Object instead, which would reference a Vulkan native peer / struct when using Vulkan and an Integer (like before) for OpenGL.

1 Like

Yes i still want to go for Vulkan, There is so much to gain and from my point of view Jmonkey would suffer in the long term if it doesn’t get an Implementation.
I’m probably not the most qualify for this but I will still give it a try.

Edit: Android base device run on Vulkan already so giving this opportunity would be perfect in the long term to make the community bigger.