Epic Found a Way to Stop Stuttering in Unreal Engine 5 Titles

Epic Found a Way to Stop Stuttering in Unreal Engine 5 Titles
unreal engine 5
Listen to this article
0:00
Key points
  1. The stuttering is caused by modern games using too many shaders, which taxes the GPU. 
  2. Epic recommends games developers do precompilation to reduce runtime compilation. 
  3. Pipeline State Object caching is Epic’s solution.

Epic Games pinpointed the root cause of a widespread issue with stuttering affecting titles developed in Unreal Engine 5: there are too many shaders to load in real time, overwhelming the GPU.

When describing the reason for stuttering, Epic Games said, “a render engine discovers that it needs to compile a new shader right before it uses it for drawing something, so everything stops while waiting for the driver to finish compilation. To understand why this can happen we need to take a closer look at how shaders are translated into code that runs on the GPU.”

A GPU binary compiled for AMD is incompatible with NVIDIA, and even within the same vendor, instruction sets can vary between different hardware generations. In essence, Epic games cannot simply make a single code and distribute it out to fix the issue – if the problem was in relation to the CPU and not GPU, they could do that. 

Instead, Epic Games is introducing and recommending Pipeline State Objects precaching and Asynchronous compilation to resolve the issue. 

Pipeline State Object precaching is “a technique to determine potential PSOs at load time.” It essentially estimates a subset of possible, then attempts to precompile the necessary shaders in a cache, rather than relying solely on real time rendering alongside gameplay. 

If the game requires a previously compiled PSO (Pipeline State Object), the game pulls it from the cache rather than fully rendering it from scratch. 

This solution is limited in application, since the bundled cache is essentially useless if the environment changes according to the players’ actions. 

“Gathering it is resource-intensive and it must be kept up to date when content changes. The recording process might not be able to discover all the PSOs in games with very dynamic worlds: for example, if objects change materials based on player actions.

“The cache can become much larger than what’s needed during a play session if there’s a lot of variation between sessions, e.g. if there are many maps, or if players can choose one skin out of many,” said Epic Games’ representative.

Their workaround was to introduce PSO precaching, which determines potential PSOs at load time – this is not a perfect fix, as the subset is larger than what ends up being used, but it allows shaders to be compiled during loading. 

Next article
Unity Lays Off Entire Team Behind Behavior AI Tool

Related articles

  • Nival Makes 22-Year-Old Blitzkrieg Title Open Source
    Gaming Industry
    Nival Makes 22-Year-Old Blitzkrieg Title Open Source
    • By Mik Dzisko
    • 5 hours ago
    • 2 min
  • Sony’s Lost Soul Aside Gets Delayed Just One Month Before Release
    Gaming Industry
    Sony’s Lost Soul Aside Gets Delayed Just One Month Before Release
    • By Mik Dzisko
    • 7 hours ago
    • 2 min
  • Splitgate 2 Teases Infinite Maps Ahead of Open Beta
    Gaming Industry
    Splitgate 2 Teases Infinite Maps Ahead of Open Beta
    • By Mik Dzisko
    • 8 hours ago
    • 2 min
  • Season 2 Changes Continue to Drive Players Away from Tekken 8
    Gaming Industry
    Season 2 Changes Continue to Drive Players Away from Tekken 8
    • By Mik Dzisko
    • 9 hours ago
    • 2 min