RuneNation
Discord — users online
OSRS raid characters

Learn OSRS Raids, ToA & ToB in our OSRS PvM Discord.

Apply in our Discord now.

Apply >>

Discuss this News in Discord:  OSRS News Discord

 

TekTalk: Vulkan beta is nearly here!

Written by developer on . Posted in RuneScape News

RuneNation Join our Discord for weekly events & prizes!

Vulkan is Coming!

With the upcoming RuneScape Engine September update, you will finally get a chance to try our new Vulkan rendering backend in open beta form, which has been several years in the making!

We'll share more about how to get involved later, but before we get there, we wanted to dive into what Vulkan actually is, along with all the great benefits it will bring to RuneScape, both now and in the future!

And just so you know: To make this blog as accessible to as many readers as possible, we've simplified a lot of nuanced or complex information here, but have also kept (and called out) certain "tech heavy insight" sections for those of you in the know.

With that being said, Mod Lordgit is here to take it away on behalf of the Runetek team, who have all put in a lot of effort on this very significant engine release!

What is Vulkan?

The RuneScape engine currently uses a rendering technology (API) that is called OpenGL. A rendering API, in simple terms, is the thing that allows our RuneTek engine to communicate directly with the GPU on your device and tell it precisely how to render all the graphics in both RuneScape and OldSchool RuneScape.

Vulkan, which is a much more modern technology compared to OpenGL, is a cross platform rendering and compute API developed by the Khronos Group. Compared to OpenGL, Vulkan is a much lower level API. "Low-level API" in this context means that our engineers are able to have more direct control over the GPU. Generally speaking, Vulkan requires a much greater degree of engineering expertise and precision to wield it successfully to reap all the benefits... but the improvements that can be made are significant.

To use an analogy: OpenGL is a bit like an automatic car, whereas Vulkan is more like a manual (stick-shift) car. Both of them can get you to where you want to go, but the manual car gives you a greater control over certain aspects like when to change gears (performance) and how to improve fuel economy (efficiencies).

Vulkan was introduced around 2016 with the goal of being the evolutionary replacement to OpenGL, which had its last major update with version 4.6 back in 2017 and has essentially been put out to pasture.

Some of the biggest issues that Vulkan set out to solve with OpenGL were its lack of control over performance, bloaty complex drivers due to a myriad of legacy versions and extensions and poor multi-threading support. Multi-threading is the ability for hardware to distribute computing tasks across multiple CPU "threads" in parallel rather than being bottlenecked by a single CPU thread.

The low level nature of Vulkan therefore allows for fine-grained control over performance and rendering synchronization, along with lightweight drivers that have a very low CPU overhead when compared to legacy APIs such as OpenGL.

Here are just some of high-level benefits on offer:

  • Improved CPU side driver performance.
  • Much improved multi-threaded support for deferred and asynchronous rendering.
  • Access to the latest GPU features (i.e. DLSS, hardware ray/path tracing, variable rate shading, mesh shaders, etc…).
  • Reduced memory overhead.
  • Improved shader compilation times.
  • Continued support for current and future platforms.

Why Vulkan?

OpenGL is mature, relatively stable and performing well enough for most of our players... so why not just stick with it you might ask? The biggest risk with OpenGL is that it is no longer being actively developed and is essentially deprecated now. Support for it is rapidly diminishing in various ways, but more on this later…

What about DirectX we hear you clamour? Sadly, DX12 is Windows only while RuneScape requires a cross-platform rendering API... such as Vulkan! Vulkan is therefore the best choice and was ultimately designed to replace OpenGL as the new cross platform rendering API for the foreseeable future.

Why the wait, why Now?

The timing of this has a two-fold answer:

Firstly, even though Vulkan was released way back in 2016, we needed to be confident enough that it's GPU driver and platform support (especially Android) was mature enough to guarantee the type of reliability and performance our players expect. Apple also requires an additional "Vulkan" → "Metal" translation layer, which we needed to ensure was mature enough that no significant issues would occur there either (more on this later).

If you're wondering what Metal is: Metal is the rendering API that Apple uses exclusively and that was introduced around about the same time that Vulkan launched.

Secondly, waiting this long has allowed our OpenGL backend to mature to the point where very little engineering time is now allocated to it. This allows us to support two rendering APIs in the live game simultaneously without significantly impacting the Runetek team’s resources.

And why now? As we alluded to before, the sun is setting on OpenGL and we’re already experiencing the early effects of this. Many platforms are stuck on older versions, which blocks the development of new features and requires us to use translation layers to convert rendering code to preferred APIs, which is becoming increasingly problematic for us. Apple and other platforms have also already warned developers that they may be completely removing OpenGL support altogether in future OS versions.

New platforms that are on the horizon will most certainly not support it. GPU vendors such as Nvidia and AMD are already winding down support for OpenGL in various ways and it’s inevitable that at some point they will want to remove driver support altogether as they streamline their driver development.

All these reasons combined amount to OpenGL posing a significant threat to the games future technical stability, a risk that we are not willing to take! By investing in Vulkan now we are ensuring that you can continue to receive an improved experience both on your existing and future hardware.

Immediate Benefits

For launch we’ll be initially focussing on the Vulkan backend being at least as good as or better than OpenGL in terms of stability and raw performance. However, that isn’t to say that there’ll be no immediate benefits beyond this.

The most immediate change you may notice is improved streaming performance (not the Twitch kind), which results in better loading times and decreased stuttering while moving around the game world. Streaming is the process by which a game (like RuneScape) continually loads and unloads game data as players move around the world - what you're moving towards is loaded in real time as you're playering while the things you move away from may be unloaded if far enough away. The opposite of streaming is a process where everything is loaded in up front when a player enters the world.

Unlike OpenGL, which has shaky multi-threading support at best, Vulkan is built for multi-threading from the ground up. Long time players will probably know that certain stuttering issues have somewhat plagued RuneScape over the years, and for the most part this is down to OpenGL’s threading model not being up to snuff. This should no longer be the case with Vulkan.

Future Benefits

Now for the exciting part! Let’s talk more in detail about all the great benefits Vulkan will bring to the RuneScape products over the next several years.

Improved GPU and CPU Performance

On the GPU side, we’ll finally have access to new features on all GPU devices that will enable us to make some significant under-the-hood improvements to our rendering tech! For example, we can move over to "clustered forward rendering", which is a fancy way of saying that the game can support more light sources and shadow casting lights (think of all the wall sconces we could have!) while simultaneously improving rendering performance.

For a bit more tech heavy insight: Forward clustered rendering reduces the amount of lighting computations needed per pixel while simultaneously allowing for many more light sources, shadow casting lights and light/environment probe lookups in the scene. This, combined with variable rate shading will dramatically reduce the amount of work needed per pixel during rasterization. Mesh shading and improved instancing are also features that open up even more performance possibilities in the future.

So yea, let there be light!

On the CPU side, Vulkan offers a myriad of ways to reduce CPU side driver submission, not only from having a much lighter weight driver than OpenGL. For context, the runetek graphics engine uses the Vulkan API to communicate with the Vulkan graphics driver, which in turn tells the GPU how to render Runescape.

For a bit more tech heavy insight: Additionally, features such as bindless rendering, finer grained synchronization, descriptor heaps and multi-threaded command buffer creation will all be taken advantage of in the fullness of time allowing us to continuously improve performance for players, something that is simply not possible with OpenGL.

Hardware Ray and Path Tracing

Unlike OpenGL, Vulkan has access to the latest hardware ray and path tracing capabilities available on modern GPUs, which will allow us to make major improvements to the indirect lighting in RuneScape (a.k.a. global illumination). Global illumination being all the lighting that indirectly bounces around the scene until its energy is completely absorbed.

You'll probably have heard of Raytracing already over the past years given all the hype in modern AAA games (i.e. more realistic lighting!) - Path tracing also takes it to the next level, and these are the techniques that movies use to produce ultra realistic images via global illumination. Let's shine a light on what this actually means for RuneScape.

Being an almost open world streaming game, performing any type of pre-baked global illumination in RuneScape has never really been a practical solution for us. We’ve therefore been stuck with a single light probe in the sky that fakes the "diffuse global irradiance" (DGI). DGI is the scattered light that reaches a surface from bouncing around the scene. While this was a big improvement over the single ambient colour used by the old Java client, scenes are still missing most of the indirect lighting information.

Ray tracing changes all of that and will enable us to more accurately model light that bounces around the scene from both sunlight and local light sources. On top of this, local reflections from arbitrary surfaces, improved soft shadows and improved large scale ambient occlusion will now be possible with hardware ray/path tracing.

We also want to acknowledge that not everyone will have access to ray tracing via their hardware, but Vulkan makes features such as compute shaders and SSBOs (a much greater shader memory buffer) available to all our players. This will allow us to extend our light probe system to full fat irradiance volumes that can be baked and sampled at run-time, bridging the gap between what we have now and full ray traced lighting. The hope is that, in time, all players will experience better lighting as a result.

For a bit more technical insight: Full Fat meaning that we can have an entire map square volume filled with light probes to more accurately capture the diffuse global irradiance.

Future Platforms

With OpenGL no longer in active development, platform support will inevitably dry up over time, as we’ve previously discussed.

Vulkan will both continue and also enhance support for existing platforms for RuneScape. Vulkan is already the preferred API for:

  • SteamOS hardware
  • Android
  • Linux

While we don't currently have aspirations for bringing RuneScape to new platforms (sidenote - you should totally check out RuneScape: Dragonwilds which launches out of 1.0 in just a few weeks time), Vulkan does future-proof us for many years to come should we see new platform opportunities emerge.

What about Apple platforms?

As we alluded to earlier, Apple doesn’t officially support Vulkan and instead provides its own new low-level API (similar to Vulkan/DX12) called Metal.

The good news is that Metal is not too dissimilar from Vulkan and there exists an open source translation layer called Molten (shout-out to whoever comes up with these names) that will map our Vulkan API code into Metal code on the fly, with little additional overhead!

Molten is also maintained by the Khronos group itself, so future support is probably guaranteed at this point.

What will happen to OpenGL support?

Don't worry, it won’t disappear immediately! Once Vulkan becomes the default renderer (we're only now entering Vulkan's beta phase), OpenGL mode will become the new "compatibility" mode or fallback renderer if Vulkan isn’t available on a device. However, any min spec devices should theoretically guarantee Vulkan 1.1 support.

The longer term goal is to have one API to rule them all, which is the most cost and resource effective solution for the team. This will allow us to focus more on developing cool new engine and graphic features for our players as we continue to take advantage of all the benefits that Vulkan brings.

What Happens Next?

Due to the high risk nature of developing and deploying a new rendering backend, we’re going for a staggered rollout to minimize risk to our players. This will begin with a voluntary open beta on Windows that starts next week from Monday September 7th. This will give us a lot of data around any remaining crash, visual and performance issues. Only once we’re happy that those are resolved, will we begin to offer the Vulkan version of RuneScape as the default rendering API via the RuneScape launcher.

Mobile is always the riskiest platform in these matters as it has the largest spectrum of devices used by players, and we always planned to kick this off after the desktop release. Ironing out as many issues as possible on desktop first will give us the best fighting chance of success on mobile a little down the line.

Android will be first, followed by OSX/iOS, as the more issues we can fix on Android phones, the less problems we’re likely to encounter when throwing the Molten translation layer at our Vulkan code.

Once it launches you will be able to access the Vulkan open beta build of RuneScape via the Graphics Mode setting in the startup options menu: just switch it to "Vulkan". You can access this menu at startup by clicking on the options button in the bottom left corner, or via the RuneScape → Options shortcut from the menu bar at the login screen. You’ll have to restart your client after making the change so that that the launcher can download the new executable.

That's it for today - we look forward to hearing from you all and getting this new experience into everyone's hands!


- The RuneTek Team



Read full article on RuneScape.com news articles