What are shaders and why are they needed

The Last Of Us game scene

When we launch Atomic Heart, The Last of Us Part I, or S.T.A.L.K.E.R. 2: Heart of Chornobyl, the game asks us to wait for shader compilation. On some computers, this process takes 5 minutes, while on others, it can take from half an hour to several hours. In most games, there is no shader compilation option in the menu, and this process starts during gameplay, reducing FPS and causing constant freezes and stutters.

So what exactly are shaders? How do they affect performance, and why do gamers have to wait for compilation right in the main menu? Today, we will answer these questions.


Shader technology

What are shaders

Shaders are small programs, short lines of code. They tell the graphics card how to correctly render textures, 3D objects, and special effects in the game.

Shaders are divided into several types:

  • Pixel and ray tracing shaders. Used for correct calculations of lighting, shading, transparency, explosions, fire, and other physical effects.
  • Compute shaders. Used to speed up game rendering and perform complex mathematical calculations.
  • Vertex, geometry, surface, and domain shaders. Used to shape the boundaries of 3D objects.
Shader Technology

How Shaders Affect FPS in Games

Thousands of shaders are used in modern games to create beautiful visuals. Many of them are simple and have little to no impact on performance. For example, shaders that apply textures to 3D models belong to this category. This is why the "texture quality" setting in graphics options hardly affects FPS (only if the game has enough RAM and VRAM from a gaming computer).

However, there are very complex shaders that significantly impact performance, such as ray tracing shaders. They handle a large amount of data and are used for properly rendering ray tracing effects. This is one of the reasons why enabling RTX drastically reduces FPS in games.

Shaders not only lower frame rates but also cause freezes and stutters (short micro-freezes). While FPS drops may still be tolerable, constant stutters severely disrupt the gaming experience.

How Shaders Affect Freezes and Stutters in Games

Shaders are written in a high-level programming language, which graphics cards do not understand. They can only process binary machine code. To translate shaders into a language that GPUs can comprehend, they must be compiled.

This task is handled by the central processor. Compiling one or a few shaders is not an issue, but modern games use thousands of shaders. When they need to be loaded in batches of dozens or even hundreds instantly, even the most powerful processors may struggle. This results in freezes.

How Developers Optimize Shader Compilation

Developers are aware that shaders negatively impact performance. There are three ways to address this issue:

  • Compiling all shaders on the first game launch. In this case, gamers have to wait in the main menu while the game compiles all shaders.
  • Loading and compiling shaders during gameplay. This can cause stuttering, and FPS may drop due to continuous compilations.
  • Compiling some shaders on the first game launch and loading the rest during gameplay. This is the most common approach used by most developers.

The impact of shaders on performance largely depends on the experience, skills, and qualifications of programmers. Skilled developers can predict which shaders will be needed and when. For example, if programmers know that certain shaders are unnecessary in a specific location, they can configure the game to avoid compiling those shaders. This reduces CPU load and helps eliminate freezes and stutters.

Unfortunately, not all programmers have high qualifications, which results in games like The Callisto Protocol or S.T.A.L.K.E.R. 2: Heart of Chornobyl. These projects run poorly even on high-end PCs.

Shader Technology

Why Shaders Cannot Be Compiled During Game Installation

On Xbox and PlayStation consoles, shader compilation is not an issue because they are compiled during game installation. However, this is not possible on PCs. Shaders are compiled specifically for each individual PC configuration. If you change your processor, graphics card, or RAM, the game will need to recompile all shaders. Given the vast variety of PC components, developers simply cannot precompile shaders for all possible configurations.

How to Solve the Freezing Issue Caused by Shader Compilation

The problem of freezing due to shader compilation should be addressed by developers. As gamers who pay for games, we expect polished products. However, the industry is not perfect. There are several ways to reduce the number of freezes caused by shader compilation:

  • Installing the game on an SSD. Avoid using hard drives for modern games. Their speed is insufficient for quickly loading a large number of small files. This helps resolve issues with freezing and long loading times.
  • Using a more powerful processor. Shader compilation is handled by the processor. Upgrading to a more powerful CPU will speed up compilation, reducing freezes and FPS drops.
  • Closing all programs before launching the game. This ensures that all CPU resources are dedicated to the game, freeing up additional power for shader compilation. It is also recommended to optimize Windows.
  • Limiting the frame rate in game settings. If the maximum FPS is capped, the processor will not operate at full load. The freed-up performance can be used for faster shader compilation and eliminating freezes.

These methods will not completely eliminate the problem, but they will significantly help reduce the number of freezes and FPS drops.


Conclusion

To summarize:

  • A shader is a small program that tells the graphics card how to properly render a graphical effect in the game.
  • Modern games use thousands of shaders, which significantly impact performance and cause freezes.
  • Not all developers effectively manage shader libraries, which is why some games run smoothly while others experience freezes even on high-end PCs.

The issue of freezes caused by shader compilation can be partially mitigated by:

  • installing the game on an SSD;
  • upgrading to a more powerful processor in the PC;
  • closing all unnecessary programs before launching the game;
  • limiting the maximum frame rate in the settings.

Shader Compilation on HYPERPC Computers

We understand that shader compilation negatively affects performance in modern games. To solve this problem, we use in our PCs:

  • High-speed SSDs with NVMe data transfer protocol;
  • High-frequency DDR4 and DDR5 RAM modules;
  • Multi-core Intel and AMD processors of the latest generations.

These components significantly reduce the number of freezes and FPS drops in games due to shader compilation, ensuring smooth and stable gameplay.

Select your monitor resolution
  • Black
  • White
The optimal choice for FullHD gaming in an impressive case without unnecessary details.
from AED 5,005
or from AED 187 per month
  • Black
  • White
Your perfect start in the world of gaming: smooth gameplay, stylish design, and everything you need to win.
from AED 5,080
or from AED 189 per month
  • Black
  • White
The best gaming PC with an optimal configuration for FullHD and 2K.
from AED 5,880
or from AED 219 per month
  • Black
  • White
Perfect for 2K gaming. Maximum power in a stylish transparent case.
from AED 9,320
or from AED 347 per month
  • Black
  • White
Compactness, style, and power – all in one device.
from AED 11,020
or from AED 410 per month
  • Black
  • White
Built for 4K gaming. Power, style, and flawless graphics in every detail.
from AED 12,695
or from AED 472 per month

  • White
Ready for the future. Aggressive futuristic design, made for true cyber warriors.
from AED 24,520
or from AED 912 per month

Need something special? Build your own PC or choose from stock.

In Stock

PCs with delivery today
 

Configurator

Build a high-performance computer
 

Selection

Select by parameters
 
Contact Us
Every HYPERPC computer is the result of 15 years of experience and expertise. Our experts know exactly what a gaming PC, workstation, or server should be like.
To get started, we just need to talk. Tell us about your tasks, timelines, and budget, and we will offer the best solution.
Call us or request a callback:
Message us:
Send an email:
sales@hyperpc.ae
Need to quickly know the cost?
Working hours: Daily from 10 AM to 7 PM.
Contact Us
English
+971 4 526 3600
Dayly from AM 10:00 to 7:00 PM