s&box has a new renderer: Borealis is an open-source GPU-driven Vulkan renderer with Slang shaders. This fully replaces Source 2's renderer, the game, editor and even Hammer are now drawn through it.
I'll go over more fuller benchmarks and improvements in the upcoming blog post. But the TLDR is CPU performance bottlenecks are gone and on average large maps like Construct or RP Downtown are going to perform 2-3x better.
Results will be different across levels of hardware, but for me I went from 116fps -> 336fps on Construct. As usual our metrics are public: https://sbox.game/metrics/game/performance so everyone will be able to see what it was like before/after (once it's fully released to the public)
Why
It's been obvious to everyone that our performance has never been great, we've made strides in every area of the engine but the Source 2 renderer has always been our bottleneck. This isn't through fault of Valve, it works great for their games, they know how to use it precisely for their needs and are able to fine tune it per game.
We don't have that luxury for a UGC platform, we have to make it easy to create anything in any way and get a reasonable amount of performance from it.
We couldn't achieve this goal through modifying and improving Source 2, we'd been trying for years, but fundamentally it's a DX11-style renderer with a traditional CPU driven binding model, we can't transform this without starting from the ground up.
Borealis is GPU-driven. The scene lives on the GPU, and the GPU decides what to draw. Owning the renderer also means we can fix things ourselves better and add what you need.
And finally - it's all open source. The current licensing on our standalone game exports sucks, everyone knows it, we can't achieve our "no bullshit" promise for publishing your own games for free with Valve as a gatekeeper. So this is one more (huge) step to removing those shackles and opening it all up for everyone.
What's new
GPU-driven drawing - the GPU decides what to draw. big scenes with lots of props cost much less on the CPU.
Visibility buffer - the depth prepass has transformed into a visibility buffer, this means the forward pass only draws what can be seen.
Hi-Z occlusion culling - things hidden behind walls get culled on the GPU, with no frame of lag and no pop-in.
Meshlet culling and automatic LODs - meshes are culled in small chunks, and map props without LODs get them generated automatically.
Fully open-source - everyone can contribute, take it and use it in their own games or engines for free.
What it means for players
Hopefully nothing, except that things run faster. Your games, maps and saved content keep working. If something looks wrong or broken that didn't before, please report it.
What it means for creators
- Existing content keeps working. Published maps, models, materials and packages load as they are.
- Shaders are now Slang. All of our own shaders have been rewritten in Slang. Your existing `.shader` files are converted when they're loaded, so they should keep working.
- Writing new shaders is simpler. A material can now be a short Slang surface: declare its parameters and write one `Evaluate` function. The engine handles lighting, shadows, fog and every render pass.
The shader format has changed, and there is an upgrader, it's probably not going to be perfect if you've got really complicated shit.There are templates for the new shaders, here's an example of an entire surface shader now:
Materials do not render whilst the shader compiles on the player side - there is meant to be a fallback that is not working properly yet.
Shader upgrading fails due to the compatibility layer not shipping properly on Steam.
Reporting problems
If something renders wrong, crashes, or runs worse than before, tell us here or on GitHub (please not Discord). Include a screenshot, the game or map, and your GPU and driver version. Comparing against the old renderer is the fastest way for us to find the cause, so the more specific the better.
This is a huge change, and we expect a rough edge or two, but know that we'll fix it quickly.