Forum Discussion
Dumiatis
4 years agoHonored Guest
Is there a way in Unreal Engine to pre cache shaders for a given level.
I made a Quest 2 VR experience for a client. There are points in the experience where there are negative framerate spikes. I found out that the spikes are when shaders are first seen in a given level. Is there a way to pre cache the shaders?
Thanks! Probably exactly what I wanted.
I followed the instructions to the letter in the video, but unfortunately it didn't create the PSO files. I saw in the comments that Vulcan seemed to be problematic with this, which is what I am using. But still storing this info away in case it's useful in the future.
3 Replies
Replies have been turned off for this discussion
- Anonymous
Yes there is something like that:
https://docs.unrealengine.com/4.26/en-US/ProgrammingAndScripting/Rendering/FShaderCache/
https://answers.unrealengine.com/questions/715197/using-fshadercache-on-gearvr.html
Also maybe this is relevant:
https://www.youtube.com/watch?v=0tzrsEm6V9Q
And this:
LET ME KNOW if it helped! - DumiatisHonored Guest
Thanks! Probably exactly what I wanted.
I followed the instructions to the letter in the video, but unfortunately it didn't create the PSO files. I saw in the comments that Vulcan seemed to be problematic with this, which is what I am using. But still storing this info away in case it's useful in the future. - CarpetFaceExpert Protege
I have not tried the PSO solution yet, thinking that I'd use that only for shipping builds. But what I still did anyways was to have a warmup phase during the initial load where I basically just put everything that caused a hitch while everything was still faded out black. This works pretty well and hasn't been too difficult to setup and maintain. I also now have the option to just not do the PSO step, as doing so will now only speed up the initial load. So unless my boot time gets too bad, I might just skip it.
It does make me wonder why UE doesn't just do that automatically by default. Is there some advantage to lazily creating the shader cache? If the alternative is a runtime hitch during gameplay, that seems like a very poor design decision, especially for VR apps, so there must be some downside that I am missing?
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 2 months ago
- 3 months ago