Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
oh, I thought maybe you debugged the UE4 shader pipeline so that you knew when shaders were being assembled post-cache building and watched the file system for related new object creations.
Maybe your specific system has directstream issues. I don't have stutters going area to area so I can't agree on there being a shader issue at all.
That's not what shaders are or how you cache them shaders are lliterally little programs that run on your GPU.
When developers create games, the shaders they create change the GPU pipeline state to be set a certain way to execute, and that state data can be collected and precompiled so that when the shaders require the state to be switched the driver already knows exactly which state to set the pipeline to and the shader runs with no stutter.
Shader compilation stuttering happens because shaders are waiting for the driver to compile the right state code.. which in DX12 are called PSOs. It's literally switching the state of the GPU to execute the code which causes these stutters, because to switch the state, the driver has to compile it.
Luckily we can pre-compile these PS0s by collecting all the states during development, and then having the engine precompile all these states ahead without needing the shaders to be drawn first.
Developers do not sit there and play through the game to compile shaders as you said they compile the data during develpment.
A lot of Unreal's shaders come built in and just need pre-compiling.
Educate yourself.
God of War Ragnarok dev interview from Digital Foundry:
"Digital Foundry: Speaking of resources, DX12 has explicit compilation of PSOs, and it's my bugbear on PC. I hate it when it doesn't work and you get shader compilation stutter. I'm only early on, but I've noticed zero frame-time spikes during my playthrough, which is what you want to see. What exactly are you doing for PSOs?
Steve Tolin: Do we only have 30 minutes? [laughs] We're in the same camp as you - we use the #StutterStruggle hashtag the same as you and we take it to heart, because it's not something we want to see in our games.
The biggest issue and hurdle for a lot of that is that you need to have a full representation of all of your runtime render passes and everything offline, so that you can run all your materials through it to generate all the permutations for everything and then catch everything that's done.
Very early on we decided not to just have QA play the game and accumulate PSOs that way, then ship some pre-known set and hope in the wild that players don't look off into a corner. We did the full build offline and created the PSOs offline, so all of the data is known beforehand in the pipeline for us, and it took us a substantial amount of time to get that right."
"Digital Foundry: So you mentioned PSO compilation which is my bugbear as of late. I mention it everywhere, I cannot stop talking about it and won't stop talking about it. The game does not suffer from prolonged stutter from just-in-time shader compilation. How is PSO compilation done for this game on PC?
Michiel Roza: In our case, we simply asked QA to play the entire game. And we then generate a cache, which contains all the PSOs and we just put the cache next to the game [as a file you can find in the game directory]. So what that means is, we just know beforehand, which PSOs will be used in-game. And if we then load all those PSOs in the loading screens, we're golden. It also helps that Insomniac's material handling is very lean, so we don't have a gigantic amount of PSOs."
https://dev.epicgames.com/documentation/en-us/unreal-engine/optimizing-rendering-with-pso-caches-in-unreal-engine
The steps to collect PSOs in Unreal are:
Play the game.
Log what is actually drawn.
Include this information in the build.
After that, on subsequent playthroughs the game can create the necessary GPU states earlier than they are needed by the rendering code.
This document describes the available PSO types in UE and the detailed processes for generating PSO caches.
There's no issues on my end. The game simply doesn't precompile everything it needs to.