Borealis - New Renderer

Started by matt · 23 hours ago · 15 replies · 2,044 views

matt
Facepunch
JoinedApr 2021 Posts276 Score2,690
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:
import sbox.surface.v1;

public struct NewMaterial : ISurface
{
	[Group( "Color" ), Opacity] Texture2D Color;
	[Group( "Color" ), Color] float3 Tint = 1;
	[Group( "Roughness" ), Range( 0, 1 )] float Roughness = 1;
	[Group( "Metalness" ), Range( 0, 1 )] float Metalness;

	public void Evaluate( SurfaceInput i, inout SurfaceOutput o )
	{
		float4 texel = i.Sample( Color, i.Uv );
		o.Albedo = texel.rgb * Tint * i.VertexTint.rgb;
		o.Opacity = texel.a;
		o.Roughness = Roughness;
		o.Metalness = Metalness;
	}
};

Known issues

  • 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.
Pol
Member
JoinedFeb 2023 Posts5 Score40
Huge for sbox! Probably the best update so far
ceitine
Member
JoinedMay 2021 Posts38 Score1,465
very nice!
Ambi
Member
JoinedAug 2026 Posts6 Score80
Dimmer
Member
JoinedMar 2023 Posts63 Score1,335
I would celebrate on the discord but shadowbrain timed me out for 24 hours
CSEliot
Member
JoinedMar 2026 Posts19 Score1,190
This is HUGE! Proud of y'all!
TubbyCustard™
Member
JoinedOct 2021 Posts29 Score370
 I celebrated on discord because shadowbrain didn't time me out for 24 hours 
J0e
Member
JoinedOct 2022 Posts5 Score1,175
HELL YEAH
Clemixo
Member
JoinedMay 2024 Posts13 Score5,874
KapiDranik
Member
JoinedJun 2023 Posts9 Score1,390
Best update ever
Doctor
Member
JoinedJan 2025 Posts54 Score6,745
niceeeee :)

SuperCoolNinja
Member
JoinedJan 2023 Posts9 Score1,290
Pol
Member
JoinedAug 2021 Posts31 Score3,235
Cool
ladiesman217
Member
JoinedApr 2026 Posts8 Score1,815
Hell yea
bloodycop
Member
JoinedJul 2023 Posts2 Score220
Oooo
Berry
Member
JoinedJul 2024 Posts2 Score22,461
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.