7 ms·
Minecraft Java is switching from OpenGL to Vulkan
- charcircuit 8mo agoI hope they have a solution to the notorious Vulkan shader compilation lag spikes.
- cyber_kinetist 8mo agoI 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.
- slopinthebag 8mo agoI wouldn't trust them to not implement the next version of Minecraft in UE5 with nanite and lumen
- direwolf20 8mo agoAnd by voxels you mean triangles
- Oxodao 8mo agoAre you the real direwolf20?
- jimbob45 8mo agoI’m not even a neophyte here but why don’t precompiled shaders solve that?
- ozarkerD 8mo agoCan'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)
- raincole 8mo agoIt kinda does. Kinda. Steam constantly downloads precompiled shaders for your games. Especially on Linux.
- MindSpunk 8mo agoDepends 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.
- Gigachad 8mo agoThere's two tiers of precompiled though. Even if you can't download them precompiled, you can compile before the game launches so there are no stutters after.
- MindSpunk 8mo agoYes, many games do that too. Depending on how many shaders the game uses and how fast the user's CPU is an exhaustive pre-compile could take half an hour or more. But in reality the exhaustive pre-compile will compile way more than will be used by any given game session (on average) and waste lots of time. Also you would have to recompile every time the user upgraded their driver version or changed hardware. And you're likely to churn a lot of customers if you smack them with a 30+ minute loading screen. Precisely which shaders get used by the game can only be correctly discovered at runtime in many games, it depends on the precise state of the game/renderer and the quality settings and often hardware vendor if there are vendor-specific code paths. Some games will get QA to play a bunch of the game, or maybe setup automated scripts to fly through all the levels and log which shaders get used. Then that log gets replayed in a startup pre-compile loading screen so you're at least pre-compiling shaders you know will be used.
- exDM69 8mo ago> 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.
- uyzstvqs 8mo agoHonestly, 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.
- jsheard 8mo agoWho 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.
- pjmlp 8mo agoMicrosoft 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.
- NekkoDroid 8mo ago> Nintendo couldn't care less about Khronos I wouldn't be so sure about Nintendo. From time to time you see them pop up as contributors for some extensions. https://github.com/search?q=repo%3AKhronosGroup%2FVulkan-Docs%20nintendo&type=code https://github.com/search?q=repo%3AKhronosGroup%2FVulkan-Doc...
- pjmlp 8mo agoIndeed, however OpenGL and Vulkan are mostly for porting purposes, if you want the real device goodies, it is either NVN, or extensions that are only available on Nintendo devices, hardly a difference.
- cyber_kinetist 8mo agoNot 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)...
- pdpi 8mo agoA 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.
- norman784 8mo agoTBH Mojang should have the resources to do that on his own, Minecraft is the best selling game of all times btw.
- throwaway27447 8mo agoI'm frankly shocked microsoft has a java implementation. I thought they were the type of organization to pretend it didn't exist!
- pridkett 8mo agoJava 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.
- throwaway27447 8mo agoAh, I had misread "minecraft" as "microsoft". I wasn't aware minecraft java was a thing. Crazy they have their own java implementation!
- muststopmyths 8mo agoIt’s the Java version of the game, not a game version of Java. There’s a native version called bedrock
- throwaway27447 8mo ago> It’s the Java version of the game, not a game version of Java. This would be termed "Java Minecraft", not "Minecraft Java"
- thundermuffin 8mo agoNo, the game's Java version's official title post-Microsoft acquisition of Mojang is Minecraft: Java Edition.
- vintermann 8mo ago
- PaulKeeble 8mo agoI 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.
- deafpolygon 8mo agoMaybe they can implement some of the calculations in GPU, as vulkan has feature to support that. This means voxel rendering could be accelerated
- josefx 8mo agoDoes it actually use voxels? I thought it was just a low poly, "voxel like" art style.
- jsheard 8mo agoThe underlying world representation is chunky voxels, but they get triangulated into meshes for rendering. Unlike say, Teardown, which renders voxels directly. Minecraft's non-world entities like players and enemies aren't voxels at any level though, those are directly authored as low poly meshes.
- theandrewbailey 8mo agoI 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://benchmark.unigine.com/heaven https://github.com/doitsujin/dxvk https://github.com/doitsujin/dxvk
- MBCook 8mo agoI 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.
- matt_heimer 8mo agoHopefully it would use the Foreign Function and Memory API instead of JNI.
- MrPowerGamerBR 8mo agoI'm pretty sure Mojang will just use the Vulkan bindings provided by LWJGL, considering that Minecraft uses LWJGL
- elric 8mo agoTo 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.
- creatonez 8mo agoIt will be a while before JNI itself is dead, because far too much stuff still relies on it. The unsafe helpers in the Java standard library will die first because they are fundamentally incompatible with Valhalla, but it's likely the simple cases will last a while as there are vast swaths of glue code that needs to be rewritten. IIRC Minecraft is still using entirely JNI and no FFM yet. That will probably start to change in the near future, though. Some modders have already been replacing their own natives with FFM versions.
- wps 8mo agoThis 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.
- darknavi 8mo agoWe have one for Bedrock fwiw. JavaScript based (via QuickJS). https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/?view=minecraft-bedrock-stable https://learn.microsoft.com/en-us/minecraft/creator/scriptap...
- PUSH_AX 8mo agoThat's the least of R6's problems!
- gps0 8mo agoFor modding, Minecraft Java has data packs. You can't do everything you can do with mods with that though.
- notenlish 8mo agoI hope Vibrant Visuals comes to Minecraft Java Edition quickly, it's a shame you need mods to have shaders on Java.
- potwinkle 8mo agoIt seems kind of odd to play Java edition without mods at all. Wouldn't you have a simpler time on Bedrock?
- NekkoDroid 8mo agoWell... people do call it Bugrock for a reason.
- permo-w 8mo agoAlso redstone is different, there's no F3 menu, generally far less vanilla customisability, far more micro-transaction prompting, far fewer commands and I'm sure 20 other things that someone who has actually played Bedrock recently could name This thread is quite weird to me. People are massively overstating how important modding is and understating the strength of vanilla Java. Minecraft is not Skyrim Speedrunning, anarchy servers, parkour, technical farming, server economy destruction videos and other primarily vanilla Java content forms are as popular as ever or more. Alongside the newer content creators, Hermitcraft is still growing somehow, as is Etho. Besides anarchy a little bit, none of this is reliant on modding There are significant updates every year and many people, including me, install them every time they come out and play them in vanilla.
- dzaima 8mo agoSpeedrunning is very much modded - ranked (the big content) is just flat out modded (not just the match setup, there are game tweaks too (guaranteed blaze drops after 20 or so iirc, guaranteed dragon perch in ≤3 mins)), and even RSG/SSG/AA/etc have a long list of allowed mods (much quicker seed rerolling, timer, perf improvement mods, etc). Many(/most/all? idk) Many (/most/all? idk) hermits use mods (esp. freecam, replaymod for creating timelapses / pretty camera perspectives). Never mind shaders sprinkled in a portion of everything.
- henning 8mo ago> 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?
- nmfisher 8mo agoI think MoltenVK probably is the translation layer they're using.
- throawayonthe 8mo agoit would be cool to use cosmickrisp instead at some point... in fact i saw someone run minecraft on macos using cosmickrisp -> zink to have modern opengl features that macos does not have
- smetannik 8mo agoMoltenVK was replaced by KosmicKrisp
- quailfarmer 8mo agoDamn, 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.
- imtringued 8mo agoIt's pretty interesting that OpenGL achieved its stated goal and is the graphics API with the highest degree of compatibility across many devices.
- ahartmetz 8mo agoVulkan 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.
- JBits 8mo ago> 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.
- m3Lith 8mo agoIn 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.
- hedgehog 8mo agoIt depends what features they use but under Mesa that chip does have some Vulkan support.
- 8mo ago
- codingbot3000 8mo agoMicrosoft 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.
- creatonez 8mo agoI'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.
- piperswe 8mo ago> - 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. And reimplementing the rendering engine for a different graphics API isn't even unprecedented, because there's a mod (VulkanMod) that reimplements the rendering engine for Vulkan already!
- hastily3114 8mo agoWhy are they even maintaining two versions of the same game?
- xigoi 8mo agoDiscontinuing Java would make a lot of players stop playing (including me).
- hobofan 8mo agoJava 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).
- NeveHanter 8mo agoIt won't die. Its not a problem to skip auth checking if at some point MS tries to use kill switch (hopefully EU would make that fully legal in EU if that's not provided by the company). As for feature parity, there are mods backporting modern features back to 1.7.10. Java is also portable to all the consoles, its just Microsoft did use that as an argument to try to kill the Java Edition. Nobody prevented Microsoft from adding bedrock like modding to Java Edition. The only thing that needs to happen is the one single stable mod API for Minecraft Java Edition. The incompatibility between Forge, NeoForge, Fabric, etc. is terrible, but from what I know about some of the folks involved this won't happen as they cannot constructively discuss the matters.
- CursedSilicon 8mo agoWrong kind of death. Taking mods away after a decade and a half of the game being modded inside out would massively reduce the creative scope of the game for players. It would become "boring" and die out
- pjmlp 8mo agoBecause 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.
- pjmlp 8mo agoI 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.
- deleted 8mo ago[deleted]
- yrxuthst 8mo agoMost 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.
- pjmlp 8mo agoI wasn't aware of Blaze3D, thanks.
- qiine 8mo agoI feel like paid shaders will be ported fine haha ;)
- HelloUsername 8mo agoWhy not move comments to source? https://news.ycombinator.com/item?id=47061529 https://news.ycombinator.com/item?id=47061529
- b40d-48b2-979e 8mo agoJust goes to show timing of your post matters more than the content.
- Wowfunhappy 8mo agoOr that it depends on luck.
- permo-w 8mo agoor potentially the account posting it
- piperswe 8mo agoExciting! VulkanMod gives such drastic performance improvements, but it isn't compatible with most other mods. It'll be great to be using Vulkan with a full modpack in the future
- Tiedye1 8mo agoMaybe smooth shading will finally work on water in Java edition!
- deleted 8mo ago[deleted]
- kaitlee 8mo agolol bye
- kaitlee 8mo agol love to play minecraft
- kaitlee 8mo agoI love to play minecraft
- kaitlee 8mo agolol
- tuuioku 8mo ago[flagged]