Floid Nov 26, 2024 @ 8:45am
Pre-Force ALL Shader Compilation to prevent stutter?
Shader comp is becoming an increasing issue now in all UE games, including UE5 and in games with other engines too.

So I was wondering since shader comp cease's to be an issue once you've done a play-through of a game (depending on the game) because all the shaders for all the assets in the game have been complied by that point.

Is there any way to force a game to kind of execute a render of all the assets that will require shader comp in said game, in one big block, in order to prompt the local shader completion for everything in the game ?

Like what I mean is, some games come with built in benchmarks now - and often you'll notice that the first time you run the benchmark framing timing will be crap (because of shader comp for all the assets that appear in the benchmark) but the 2nd or 3rd time you run the benchmark the frame timing will improve and become much more even compared to the first run of the benchmark.

So is there anyway to force a game to kind of run a giant benchmark that includes ALL the assets in the game, so as to effectively pre-compile everything, before you actually start a play-through of the game ?

PS - Yes I know that there are different approaches a dev can take to pre-compilation and shader optimisation during development of a game that can sometimes largely (if done right) pretty much completely eliminate shader comp stutters. However that is not the focus of my question. I'm curious specifically if there is anything we can do ourselves to address shader comp post release.

Thanks :steamthumbsup:
Date Posted: Nov 26, 2024 @ 8:45am
Posts: 0