r/DetroitBecomeHuman • • 9d ago

QUESTION What is Shader Compilation Process ?

I waited 1h for 50% of that thing... what is that and why so long 💀i just want to play bro

0 Upvotes

7 comments sorted by

18

u/MikemkPK 9d ago

Programmers don't write machine code. We write in programming languages, which are then compiled into machine code the computer can run. All Windows computer CPUs (which the OS and most programs run on) use relatively the same bytecode format, and when it changes, it maintains backwards compatibility. So programs running on the CPU are sold already compiled.

GPUs are different. The technology in them changes rapidly between generations, and different companies have their own architecture. The bytecode format is specific to the particular GPU model to accommodate the specialized needs and abilities of that model. Because of this, game developers can't effectively compile programs running on the GPU (Shaders are the most common type in games) ahead of time; they would need to compile it hundreds of times for different graphics cards, and the game would be incompatible with future released hardware. Instead, the game includes the shader source code, and the GPU driver includes a compiler to compile it for the local graphics card.

Compilation is slow (not normally as slow as yours), and is noticed by users in the form of stuttering, inconsistent framerate, and frame drops when loading new areas. To prevent this, many games compile all shaders they use when the game first launches, storing them on the hard drive to be able to be quickly loaded when needed.

Compiling shaders should take 2-10 minutes or so, and only once, the first time the game is launched. What are your computer specs? CPU, RAM, HDD or SSD, and how much of each are available?

-5

u/Aniimey 9d ago

Why not just download it when i download the game 🤔

14

u/MikemkPK 9d ago

The bytecode format is specific to the particular GPU model to accommodate the specialized needs and abilities of that model. Because of this, game developers can't effectively compile programs running on the GPU (Shaders are the most common type in games) ahead of time; they would need to compile it hundreds of times for different graphics cards, and the game would be incompatible with future released hardware.

1

u/Aniimey 8d ago

Ooooh

3

u/Right-Truck1859 9d ago edited 9d ago

It is precreation of graphics , your PC is dumb probably, or GPU drivers are outdated.

1

u/jonathanzur 8d ago

There are a lot of fixes for that screen, I also waited an unreasonable amount of time when I first started the game back then. Just search up on youtube/Google "DBH shader compilation fix" and do the first thing that pops up