Epic Games Addresses Stuttering Issues in Unreal Engine with New Solutions
Epic Games has detailed the problem of stuttering in games using its Unreal Engine and introduced a new solution to mitigate it.
When discussing Unreal Engine, many PC gaming enthusiasts refer to its stunning graphics, as seen in titles like Black Myth: Wukong, Hellblade II, and A Plague Tale: Requiem. However, the association often extends to stuttering issues. Epic Games has shared insights into the reasons for these problems and proposed solutions through a recent blog post.
Understanding Shader Compilation
Shaders are snippets of code essential for graphics rendering, performing tasks such as rendering objects or calculating pixel colors based on various factors. The Unreal Engine, which enables game development through C++ or visual coding with blueprints, relies on APIs like Direct3D and Vulkan. These APIs translate simplified commands into complex operations for the GPU.
To achieve optimal performance, the GPU drivers must compile the shader code into a processable format. This necessity is particularly evident in modern 3D games, where numerous shaders require compilation. When this process happens during gameplay, it can lead to significant frame rate drops, causing the stuttering effect players experience.
Epic’s Explanation
Epic describes it this way:
“Rendering an object typically involves multiple shaders and various GPU settings. The driver may only start compiling shaders once processing a draw command, which can take significant time. This delay leads to long frames when a shader is used for the first time—a situation gamers recognize as hitching or stuttering.”
With Unreal Engine versions prior to 5.2, Epic recommended bundling frequently used Pipeline State Objects (PSOs) into a cache that would initialize when the game started or when a level was loaded. However, this method proved resource-intensive, requiring constant updates in games with dynamic content.
The New Approach: PSO Precaching
Epic has since introduced PSO precaching as a more effective solution.
“When an object is loaded, the system analyzes its materials while factoring in mesh details and overall state to compute a limited set of PSOs needed for rendering. This method allows for a more manageable compilation process during loading than before, ultimately streamlining the gameplay experience.”
While the PSO precaching system effectively eliminates much stuttering related to materials, certain types of global shaders still pose challenges. Epic recognizes these limitations and is working on further enhancements to manage this aspect more effectively.
In summary, Epic acknowledges the AI challenges related to shader compilation in games developed with Unreal Engine. The company is proactively developing solutions to minimize stuttering problems, ultimately improving the performance of future big-budget titles.