I hope this reduces the CPU overhead a bit on the main thread with some time. Quite a few games that ported from DX11 to 12 and openGL to Vulkan didn't just gain performance from the API swap it required taking advantage of the new higher parallel draw call capabilities. #
The main thread is often the limiting factor in minecraft. Minecraft just can't go as fast as the GPU could render the scene and even with quite a lot of shaders things are CPU bottlenecked. Hopefully this changes with time as modding minecraft could certainly do with a bit more CPU time free.
I use Unigine Heaven to benchmark Linux systems. A colleague's friend has an epic spreadsheet of Heaven benchmarks across many configurations, and he submitted a few I've done. I ran it at home on my Linux desktop. For shits and giggles, I also downloaded the Windows version and ran it in Proton, and got a 30% performance boost! I suspect that a lot of that is due to the dxvk library that Proton uses, and the multithreading that it introduces translating D3D11 calls to Vulkan.
Vulkan more or less also has that goal, but for then-current hardware 24 years later (2016). In this case (Intel HD Graphics 4400, Haswell?), there is unofficial support on Linux that can be enabled with some hacks, and it may or may not work. Similar support for my previous (desktop) AMD GPU generally worked fine. The situation for Haswell seems more iffy, though.
Not a bad choice... since Minecraft Java edition only supports desktops, they don't have to deal with the abysmal Vulkan drivers on mobile.
Though I thought a company large as Microsoft would have the resources to build a cross-platform RHI with the most stable API available for each platform (DX12 for Windows and Metal for macOS)...
A company as large as Microsoft has resources to do a lot of things, but you’re not borrowing resources from the Office team to help on this project.
The relevant measurement is the resources Mojang has as a studio. And I expect the decision here is that they don’t want to commit to the long term maintenance of three renderer implementations on the Java side.
Another concern is that modding is a major part of why Java Edition is so popular, and that includes shaders specifically. This is already going to cause chaos in the modding world as it is, no need to compound that by making shader mods that much more burdensome to maintain.
This is such a gold mine project! thanks for sharing it.
I suppose, if someone in future might want to create their own godot-alternative. Why not just use bgfx with the language bindings instead.
I Love Godot from my time tinkering with it but one of the reasons why Godot is so hopeful in future compared to other engines is imo the fact that they support many many platforms.
I have seen some blogposts on HN where someone used godot to prototype an android GUI application (and not a game) and how the whole process actually makes sense when you think about where they talked about it in the blog post.
Actually there were discussions about even integrating bgfx into raylib (the goat) but looks like that its not getting integrated but it was interesting to read the discussion and maybe anyone more experienced than me could even contribute to the discussion below
Honestly pick between Vulkan and DX12 is very superficial.
But you can easily make Vulkan run on macOS. Not sure what would be the reason to use DX12 in the new project today given free choice of technology, especially when team comes from OpenGL.
As far as I remember the original plan was to only maintain both in a transitional phase, with the aim of fully replacing the Java edition. A simple plan: bring Bedrock to feature parity with Java, add a modding API that satisfies 95% of use cases, then force everyone onto Bedrock. The feature parity is mostly there, but modding in Bedrock seems to have become a non-goal, and Bedrock has so many bugs that if your platform offers the choice between both Java is still preferred even if you don't care about modding.
Java is for the modding user-base. If they would kill that, there is a good chance that the whole Youtube/Twitch creator ecosystem around the game dies, and with that it's popularity.
Bedrock is more performant and more portable across platforms (e.g. on consoles where you couldn't mod anyways).
Who would have thought that Microsoft would end up getting cosier with Khronos standards than Apple. This is after they adopted SPIR-V both as a target in their shader compiler and as an ingest format in DirectX, smoothing over interop with Vulkan in both directions.
Microsoft has already been there before as well, they are adopting SPIR-V only to cut down their fork, and because Google already did part of the work for them.
Apple apparently got very pissed on how Khronos took care of OpenCL.
Then Sony and Nintendo couldn't care less about Khronos, people keep forgetting about game consoles when discussing the portability of Khronos APIs, or ignoring the fact that in reality they aren't really that portable due to the extension spaghetti.
Most mods don't even touch the rendering system, they just supply models in json format. If you do need custom rendering, Minecraft has the Blaze3D api, and that should be mostly unchanged. There are relatively few mods like Sodium and Iris that make extensive use of direct opengl calls.
I wasn’t aware Java had Vulkan bindings. So this is JNI I’m guessing?
This makes sense. I guess I’m a bit surprised they were still OpenGL anywhere.
I never really got into Minecraft though, so I can’t pretend I know much about its current state. I didn’t even realize there was a non-Java version for desktops.
To elaborate on the other comment about the Foreign Function & Memory API: JNI is effectively dead/deprecated, and has been replaced by the aforementioned API. It is orders of magnitude more developer friendly to use. It handles memory much more cleanly. It's way easier to create bindings to talk to foreign functions (e.g. Vulkan).
Probably the most underappreciated great feature in recent Java releases.
I don't think Minecraft's renderer will be PSO-heavy enough to have stuttering issues. It's not a state-of-the-art compute-driven renderer that supports artist-driven workflows with custom materials and shaders... it's just a voxel renderer with very primitive lighting.
Vulkan gives all the tools to avoid any "lag spikes" from shader compiling. In fact, causing them is much more difficult than OpenGL where they could happen in surprising places (and only on certain hardware).
The issue is two fold:
1. Some engines produce a lot of shader permutations. Some AAA titles can have 60000 different shaders compiled.
2. Some GPU rasterizer states (such as color blending) are implemented as shader epilogues.
In Vulkan 1.0 almost all of the pipeline state had to be pre-baked into a pipeline state object compiled ahead of time. This lead to a "shader permutation explosion" where different states need different pipelines.
This requires the game engine to either a) compile all the pipeline combinations ahead of time (slow loading time) or b) compile them as needed (lag spikes).
The core issue for this was solved years ago and now most of the pipeline states can be added to the command buffers ("dynamic states"). This solves the permutation explosion. But at the same time it opens the door for issue 2: some states (blending in particular) can cause a state-based recompile (like ye olde OpenGL days) at runtime.
The only solution to the second problem is not to use the dynamic states that trigger recompiling. That's basically only blending as far as I know. You can't even have dynamic blend state on all GPUs.
For maximum developer flexibility there's the shader object extension that allows mixing and matching shaders and pipeline states any way you want. This will cause state based recompiles at unpredictable times but it's an opt-in feature and easy to avoid if lag spikes are not wanted.
tl;dr: shader recompilation is easy to avoid in Vulkan but porting legacy engine code or art content may take you off the happy path.
Honestly, this is either a game developer skill issue or laziness issue, not Vulkan's fault. Most big game developers have been notoriously negligent at any form of technical optimization in recent years.
For Vulkan you already ship "pre-compiled" shaders in SPIR-V form. The SPIR-V needs to be compiled to GPU ISA before it can run.
You can't, in general, pre-compile the SPIR-V to GPU ISA because you don't know the target device you're running on until the app launches. You would have to precompile ISA for every GPU you ever plan to run on, for every platform, for every driver version they've ever released that you will run on. Also you need to know when new hardware and drivers come out and have pre-compiled ISA ready for them.
Steam tries to do this. They store pre-compiled ISA tagged with the GPU+Driver+Platform, then ship it to you. Kinda works if they have the shaders for a game compiled for your GPU/Driver/Platform. In reality your cache hit rate will be spotty and plenty of people are going to stutter.
OpenGL/DirectX11 still has this problem too, but it's all hidden in the driver. Drivers would do a lot of heroics to hide compilation stutter. They'd still often fail though and developers had no way to really manage it out outside of some truly disgusting hacks.
Can't precompile for all the combinations of hardware, driver version, operating systems, etc... It's not really a vulkan specific problem and it's hard to solve. (for desktops anyways)
This is great news. I was super disappointed when Rainbow Six Siege dropped the Vulkan version of their game. They cited the support burden as the reason they dropped it, as nearly every game in the studio defaulted to DX11/12. For at least two years after that they received non-stop complaints of frame stutters on DX12. I do not know if the situation has gotten much better since then.
Slightly off-topic too, but I would love for Minecraft Java Edition to have a safer and more robust modding API. For the past decade modding efforts have mostly just been patching on top of a reverse engineering mod framework which exposes some of the game to mods. Factorio is practically the Platonic Ideal in this regard with its Lua sandboxing and restricted API. This is a huge security and stability issue, but Microsoft have no real incentive to fix it.
Java is the original version from Mojang/Notch. There’s always been enough of a community that killing it off to move away from Java would break so many extensions and servers would see an active revolt.
There is the non-Java version (Bedrock), but that’s not nearly as extensible.
Microsoft seems to be doing anything they can to get rid of Minecraft Java users having bought a Mojang license in the past. Either they are conspiring against their users, or they just don't care.
The dubious Mojang account migration. Their lack of support for kids who got their accounts phished recently. Migrating to Vulkan breaking old hardware.
Sad story, but it was to be expected MS bought Mojang.
I'm not super worried that this transition is cutting off hardware too soon.
- Vulkan requirement raises the baseline to 2016-2017 hardware. 2017 was 9 years ago.
- They're not cutting off OpenGL right away, according to the announcement they will release 26.1 as OpenGL-only, and then at least one more full release where you can choose between the two options. Based on their usual schedule it will probably be at least a year from now before they cut off OpenGL support, if not longer.
- All previous versions of the game are still available to play, including the oldest versions that run on Java 6, x86-32, OpenGL 1.2, Debian 5, Windows XP. Can still do multiplayer sessions on versions released in mid 2010.
- The community can fill in the gaps in multiple ways. Translation layers are available to connect to newer servers with older clients (ViaVersion), as well as with Bedrock clients (GeyserMC). Mods will almost certainly be released to reimplement the rendering engine in OpenGL or GLES. Renewed interest may mean OpenGL 2.0 compatibility mods could come back. Also, Mojang recently liberated Minecraft from variable name obfuscation, so modding will be easier than ever before.
- As a last resort, software rendering for Vulkan has gotten relatively mature, though obviously this means single digit FPS in many scenarios
Java Edition has taken an extremely conservative path, practically nothing else in the gaming industry held on to legacy hardware this long.
Why not move comments to source? https://news.ycombinator.com/item?id=47061529
I hope this reduces the CPU overhead a bit on the main thread with some time. Quite a few games that ported from DX11 to 12 and openGL to Vulkan didn't just gain performance from the API swap it required taking advantage of the new higher parallel draw call capabilities. #
The main thread is often the limiting factor in minecraft. Minecraft just can't go as fast as the GPU could render the scene and even with quite a lot of shaders things are CPU bottlenecked. Hopefully this changes with time as modding minecraft could certainly do with a bit more CPU time free.
I use Unigine Heaven to benchmark Linux systems. A colleague's friend has an epic spreadsheet of Heaven benchmarks across many configurations, and he submitted a few I've done. I ran it at home on my Linux desktop. For shits and giggles, I also downloaded the Windows version and ran it in Proton, and got a 30% performance boost! I suspect that a lot of that is due to the dxvk library that Proton uses, and the multithreading that it introduces translating D3D11 calls to Vulkan.
https://benchmark.unigine.com/heaven
https://github.com/doitsujin/dxvk
Maybe they can implement some of the calculations in GPU, as vulkan has feature to support that. This means voxel rendering could be accelerated
Does it actually use voxels? I thought it was just a low poly, "voxel like" art style.
1 reply →
Damn, this will break Minecraft on my original machine, an Acer C720 Chromebook modded to run Linux. The Intel HD4400 iGPU doesn’t support Vulcan!
I always appreciated that MC would run on virtually any hardware, especially as a kid without access to anything nice.
> Once this happens, players will be able to switch between OpenGL rendering and Vulkan rendering
I think this means you'll be able to continue using Minecraft with OpenGL.
In the following paragraph:
> Once we’re happy with the performance and stability of Vulkan across devices we will remove the OpenGL implementation.
So not for long.
It depends what features they use but under Mesa that chip does have some Vulkan support.
It's pretty interesting that OpenGL achieved its stated goal and is the graphics API with the highest degree of compatibility across many devices.
Vulkan more or less also has that goal, but for then-current hardware 24 years later (2016). In this case (Intel HD Graphics 4400, Haswell?), there is unofficial support on Linux that can be enabled with some hacks, and it may or may not work. Similar support for my previous (desktop) AMD GPU generally worked fine. The situation for Haswell seems more iffy, though.
Not a bad choice... since Minecraft Java edition only supports desktops, they don't have to deal with the abysmal Vulkan drivers on mobile.
Though I thought a company large as Microsoft would have the resources to build a cross-platform RHI with the most stable API available for each platform (DX12 for Windows and Metal for macOS)...
A company as large as Microsoft has resources to do a lot of things, but you’re not borrowing resources from the Office team to help on this project.
The relevant measurement is the resources Mojang has as a studio. And I expect the decision here is that they don’t want to commit to the long term maintenance of three renderer implementations on the Java side.
Another concern is that modding is a major part of why Java Edition is so popular, and that includes shaders specifically. This is already going to cause chaos in the modding world as it is, no need to compound that by making shader mods that much more burdensome to maintain.
TBH Mojang should have the resources to do that on his own, Minecraft is the best selling game of all times btw.
14 replies →
They use bgfx for bedrock edition.
https://github.com/bkaradzic/bgfx
https://www.minecraft.net/en-us/attribution
An aside, but out of five links for Java edition one is 404 and the next one is an HTTP-only site seemingly not updated since 2009.
Funny to contrast with Bedrock edition, for which they paid for FMOD Studio to cover the audio features of those two (and more).
This is such a gold mine project! thanks for sharing it.
I suppose, if someone in future might want to create their own godot-alternative. Why not just use bgfx with the language bindings instead.
I Love Godot from my time tinkering with it but one of the reasons why Godot is so hopeful in future compared to other engines is imo the fact that they support many many platforms.
I have seen some blogposts on HN where someone used godot to prototype an android GUI application (and not a game) and how the whole process actually makes sense when you think about where they talked about it in the blog post.
Actually there were discussions about even integrating bgfx into raylib (the goat) but looks like that its not getting integrated but it was interesting to read the discussion and maybe anyone more experienced than me could even contribute to the discussion below
https://github.com/raysan5/raylib/discussions/1699
1 reply →
On mobile 3rd party launchers use ANGLE to use EGL or Metal drivers.
Honestly pick between Vulkan and DX12 is very superficial.
But you can easily make Vulkan run on macOS. Not sure what would be the reason to use DX12 in the new project today given free choice of technology, especially when team comes from OpenGL.
The reason you use DX12 in a new project is so that you can get good linux support.
I'm making a joke, but it's also true.
7 replies →
but why would you pick the worst API?
Why are they even maintaining two versions of the same game?
As far as I remember the original plan was to only maintain both in a transitional phase, with the aim of fully replacing the Java edition. A simple plan: bring Bedrock to feature parity with Java, add a modding API that satisfies 95% of use cases, then force everyone onto Bedrock. The feature parity is mostly there, but modding in Bedrock seems to have become a non-goal, and Bedrock has so many bugs that if your platform offers the choice between both Java is still preferred even if you don't care about modding.
Such a colossal waste..
Java is for the modding user-base. If they would kill that, there is a good chance that the whole Youtube/Twitch creator ecosystem around the game dies, and with that it's popularity.
Bedrock is more performant and more portable across platforms (e.g. on consoles where you couldn't mod anyways).
Because they aren't the same, Bedrock is more limited in modding capabilities, and the Java community doesn't care about it.
Microsoft logically wants to keep sales from both.
Discontinuing Java would make a lot of players stop playing (including me).
Who would have thought that Microsoft would end up getting cosier with Khronos standards than Apple. This is after they adopted SPIR-V both as a target in their shader compiler and as an ingest format in DirectX, smoothing over interop with Vulkan in both directions.
Microsoft has already been there before as well, they are adopting SPIR-V only to cut down their fork, and because Google already did part of the work for them.
Apple apparently got very pissed on how Khronos took care of OpenCL.
Then Sony and Nintendo couldn't care less about Khronos, people keep forgetting about game consoles when discussing the portability of Khronos APIs, or ignoring the fact that in reality they aren't really that portable due to the extension spaghetti.
I bet they will lose most of the mods, as I don't see many wanting to learn Vulkan only to port their mods.
They better make use of Zink/Angle or similar approaches.
Most mods don't even touch the rendering system, they just supply models in json format. If you do need custom rendering, Minecraft has the Blaze3D api, and that should be mostly unchanged. There are relatively few mods like Sodium and Iris that make extensive use of direct opengl calls.
I feel like paid shaders will be ported fine haha ;)
I hope Vibrant Visuals comes to Minecraft Java Edition quickly, it's a shame you need mods to have shaders on Java.
It seems kind of odd to play Java edition without mods at all. Wouldn't you have a simpler time on Bedrock?
I wasn’t aware Java had Vulkan bindings. So this is JNI I’m guessing?
This makes sense. I guess I’m a bit surprised they were still OpenGL anywhere.
I never really got into Minecraft though, so I can’t pretend I know much about its current state. I didn’t even realize there was a non-Java version for desktops.
To elaborate on the other comment about the Foreign Function & Memory API: JNI is effectively dead/deprecated, and has been replaced by the aforementioned API. It is orders of magnitude more developer friendly to use. It handles memory much more cleanly. It's way easier to create bindings to talk to foreign functions (e.g. Vulkan).
Probably the most underappreciated great feature in recent Java releases.
Hopefully it would use the Foreign Function and Memory API instead of JNI.
I'm pretty sure Mojang will just use the Vulkan bindings provided by LWJGL, considering that Minecraft uses LWJGL
I hope they have a solution to the notorious Vulkan shader compilation lag spikes.
I don't think Minecraft's renderer will be PSO-heavy enough to have stuttering issues. It's not a state-of-the-art compute-driven renderer that supports artist-driven workflows with custom materials and shaders... it's just a voxel renderer with very primitive lighting.
I wouldn't trust them to not implement the next version of Minecraft in UE5 with nanite and lumen
And by voxels you mean triangles
1 reply →
> notorious Vulkan shader compilation lag spikes.
Vulkan gives all the tools to avoid any "lag spikes" from shader compiling. In fact, causing them is much more difficult than OpenGL where they could happen in surprising places (and only on certain hardware).
The issue is two fold: 1. Some engines produce a lot of shader permutations. Some AAA titles can have 60000 different shaders compiled. 2. Some GPU rasterizer states (such as color blending) are implemented as shader epilogues.
In Vulkan 1.0 almost all of the pipeline state had to be pre-baked into a pipeline state object compiled ahead of time. This lead to a "shader permutation explosion" where different states need different pipelines.
This requires the game engine to either a) compile all the pipeline combinations ahead of time (slow loading time) or b) compile them as needed (lag spikes).
The core issue for this was solved years ago and now most of the pipeline states can be added to the command buffers ("dynamic states"). This solves the permutation explosion. But at the same time it opens the door for issue 2: some states (blending in particular) can cause a state-based recompile (like ye olde OpenGL days) at runtime.
The only solution to the second problem is not to use the dynamic states that trigger recompiling. That's basically only blending as far as I know. You can't even have dynamic blend state on all GPUs.
For maximum developer flexibility there's the shader object extension that allows mixing and matching shaders and pipeline states any way you want. This will cause state based recompiles at unpredictable times but it's an opt-in feature and easy to avoid if lag spikes are not wanted.
tl;dr: shader recompilation is easy to avoid in Vulkan but porting legacy engine code or art content may take you off the happy path.
Honestly, this is either a game developer skill issue or laziness issue, not Vulkan's fault. Most big game developers have been notoriously negligent at any form of technical optimization in recent years.
I’m not even a neophyte here but why don’t precompiled shaders solve that?
It kinda does. Kinda. Steam constantly downloads precompiled shaders for your games. Especially on Linux.
Depends what you're precompiling.
For Vulkan you already ship "pre-compiled" shaders in SPIR-V form. The SPIR-V needs to be compiled to GPU ISA before it can run.
You can't, in general, pre-compile the SPIR-V to GPU ISA because you don't know the target device you're running on until the app launches. You would have to precompile ISA for every GPU you ever plan to run on, for every platform, for every driver version they've ever released that you will run on. Also you need to know when new hardware and drivers come out and have pre-compiled ISA ready for them.
Steam tries to do this. They store pre-compiled ISA tagged with the GPU+Driver+Platform, then ship it to you. Kinda works if they have the shaders for a game compiled for your GPU/Driver/Platform. In reality your cache hit rate will be spotty and plenty of people are going to stutter.
OpenGL/DirectX11 still has this problem too, but it's all hidden in the driver. Drivers would do a lot of heroics to hide compilation stutter. They'd still often fail though and developers had no way to really manage it out outside of some truly disgusting hacks.
6 replies →
Can't precompile for all the combinations of hardware, driver version, operating systems, etc... It's not really a vulkan specific problem and it's hard to solve. (for desktops anyways)
This is great news. I was super disappointed when Rainbow Six Siege dropped the Vulkan version of their game. They cited the support burden as the reason they dropped it, as nearly every game in the studio defaulted to DX11/12. For at least two years after that they received non-stop complaints of frame stutters on DX12. I do not know if the situation has gotten much better since then.
Slightly off-topic too, but I would love for Minecraft Java Edition to have a safer and more robust modding API. For the past decade modding efforts have mostly just been patching on top of a reverse engineering mod framework which exposes some of the game to mods. Factorio is practically the Platonic Ideal in this regard with its Lua sandboxing and restricted API. This is a huge security and stability issue, but Microsoft have no real incentive to fix it.
For modding, Minecraft Java has data packs. You can't do everything you can do with mods with that though.
We have one for Bedrock fwiw. JavaScript based (via QuickJS).
https://learn.microsoft.com/en-us/minecraft/creator/scriptap...
That's the least of R6's problems!
> For the macOS side of things, they'll use a translation layer since Apple don't support Vulkan directly (they made their own API with Metal)
Where does it say that? Why not use MoltenVK?
I think MoltenVK probably is the translation layer they're using.
I'm frankly shocked microsoft has a java implementation. I thought they were the type of organization to pretend it didn't exist!
Java is the original version from Mojang/Notch. There’s always been enough of a community that killing it off to move away from Java would break so many extensions and servers would see an active revolt.
There is the non-Java version (Bedrock), but that’s not nearly as extensible.
Switching to vulkan breaks all the extensions too
2 replies →
Ah, I had misread "minecraft" as "microsoft". I wasn't aware minecraft java was a thing. Crazy they have their own java implementation!
10 replies →
Microsoft is open about how much Java they use
https://cdn.graph.office.net/prod/media/java/how-microsoft-a...
While you meant Minecraft here, to shock you further, please enjoy this:
https://en.wikipedia.org/wiki/Microsoft_Java_Virtual_Machine
They also currently release their own build of OpenJDK.
https://www.microsoft.com/openjdk
Microsoft seems to be doing anything they can to get rid of Minecraft Java users having bought a Mojang license in the past. Either they are conspiring against their users, or they just don't care.
The dubious Mojang account migration. Their lack of support for kids who got their accounts phished recently. Migrating to Vulkan breaking old hardware.
Sad story, but it was to be expected MS bought Mojang.
I'm not super worried that this transition is cutting off hardware too soon.
- Vulkan requirement raises the baseline to 2016-2017 hardware. 2017 was 9 years ago.
- They're not cutting off OpenGL right away, according to the announcement they will release 26.1 as OpenGL-only, and then at least one more full release where you can choose between the two options. Based on their usual schedule it will probably be at least a year from now before they cut off OpenGL support, if not longer.
- All previous versions of the game are still available to play, including the oldest versions that run on Java 6, x86-32, OpenGL 1.2, Debian 5, Windows XP. Can still do multiplayer sessions on versions released in mid 2010.
- The community can fill in the gaps in multiple ways. Translation layers are available to connect to newer servers with older clients (ViaVersion), as well as with Bedrock clients (GeyserMC). Mods will almost certainly be released to reimplement the rendering engine in OpenGL or GLES. Renewed interest may mean OpenGL 2.0 compatibility mods could come back. Also, Mojang recently liberated Minecraft from variable name obfuscation, so modding will be easier than ever before.
- As a last resort, software rendering for Vulkan has gotten relatively mature, though obviously this means single digit FPS in many scenarios
Java Edition has taken an extremely conservative path, practically nothing else in the gaming industry held on to legacy hardware this long.