A lot of modern unreal engine games have has the issue of stuttering in game the first time a shader appears, if there an easy way to add a loading screen on first boot that compiles all the shaders for the player?
I’m pretty sure call of duty modern warfare/warzone has this feature for an example.
Most results on google when I try to find information on this relate to compile issues in the engine but no information on how to compile shaders in the full exported game.
You’re confusing what steam does. it doesn’t compile all the gpu shaders because it can’t access them all, especially with UE games where we use .pak files to store the files.
UE can’t compile all the shaders for PC either since there are so many different GPUs it would be impssible to compile for them all, If UE compiles for all current ones then that would just take up extra useless space for users that don’t run… literally every GPU in their system at once and it would also be useless for future hardware.
A lot of modern UE games(And PC games in general) have had shader stuttering recent for this exact reason. That’s why I’m asking for a way to achieve this since it is obviously needed.
This issue is not just prevalent in UE games but in modern PC gaming and without any actual knowledge on how to precompile shaders so they are compiled “Just in time” it will stay that way.
UE4 and 5 games already have pre game compilers for shaders, It’s already obviously a thing that can be done and is done in AAA and indie games alike.
I’m asking how to do last moment GPU shader comp on first launch which again is something people already do.
I’m not asking what is causing stuttering or how to have the game live compile from source like a game engine, I’m asking how to solve this specific problem with a solution that is already out there but just doesn’t have any documentation.
You may already know this, but PSO Caching seems to at least partially try to solve this issue.
The documentation homepage is here, and the part of the doc explaining how to use the data in order to do the computation when you want (ie. loading screen) is here.
Hope it will help.
Honestly, from my understanding, it seems to do what you are looking for: compiling the shaders on the target machine when you (the developer) want it. So, for instance, at first launch.
However, as I never used it myself, I cannot 100% confirm this.
Very interested by the question too
PS: another way to do this manually could be to fire up all the shaders you want to preload on an offscreen camera (render to texture) with very low resolution when in your loading screen.
Hello, have you tested PSO and pre loading? I’m also exploring the options. I know “Detroit: Become Human” would compile a lot of shaders when it first runs on my PC. I’m also looking for ways to do this in Unreal. Currently, PSO seems to be it but it seems the process to enable PSO is quite complicated and seems to be another cook process on PC. This is just first impression. I will get my hands dirty on the process and actually carry it out. Just hoping to hear your experience on this since your last replay was half a year before and you may now have some practical opinions on this.
I haven’t done anything eith PSO myself but from the leatest video on DigitalFoundy it seems it is the way to go for now but it is a pretty manual process for devs to first run through the game and grab the required shaders to pre-cache them
I’ve created plugin that adds shader compilation. It should also remove particle systems spawn delay. Yes, I’m advertising my own product, but it could help somebody.