We need to talk about UE4 Shader compilation issues

Discussion in 'Videocards - NVIDIA GeForce Drivers Section' started by snight01, Mar 12, 2022.

  1. snight01

    snight01 Master Guru

    Messages:
    404
    Likes Received:
    67
    GPU:
    GB RTX 4090gamingOC
    Why is there so much stutters with these games on pc? It seems there is a big issue here with games made with that engine. Is nvidia doing anything about this?

    I know most game dev solve this by having a pre compile before start but its abit ridiculous now. whats your thoughts peeps?
     
    Kolt, Smough and BlindBison like this.
  2. Spets

    Spets Ancient Guru

    Messages:
    3,435
    Likes Received:
    592
    GPU:
    RTX 4090
    Only really notice it at the start of a new level/area or when the game is precaching at menus. Tbh it doesn't feel like a big issue.
    In saying that though I'd imagine it'll be a lot worse when not using an m.2
     
  3. snight01

    snight01 Master Guru

    Messages:
    404
    Likes Received:
    67
    GPU:
    GB RTX 4090gamingOC
    True but the pre caching is not present on the consoles
     
  4. Horus-Anhur

    Horus-Anhur Ancient Guru

    Messages:
    5,916
    Likes Received:
    7,221
    GPU:
    RX 6800 XT
    Consoles have fixed hardware and drivers. So devs can precompile shaders and package them with the game.
    On PC there are different architectures, and different makers, and different drivers. So it's impossible to pre-compile shaders without risking compatibility issues and graphics bugs.
     
    Maddness and BlindBison like this.

  5. tsunami231

    tsunami231 Ancient Guru

    Messages:
    13,385
    Likes Received:
    1,310
    GPU:
    EVGA 1070Ti Black
    they can also do compiling BEFORE the game loads up the game. last i checked games that actual do dont suffer from the issue? and by that I mean before gameplay starts
     
    BlindBison likes this.
  6. BlindBison

    BlindBison Ancient Guru

    Messages:
    1,797
    Likes Received:
    729
    GPU:
    RTX 3070
    It's more than just shader compilation -- a lot of UE4 titles also have genuine asset streaming stutter that occurs like clockwork regardless of whether the shaders are compiled are not. E.g. Outer Worlds, Jedi Fallen Order, Final Fantasy 7 Remake.

    For context my rig has a 3900X + 2080S + 32 Gigs of 3200 cl16 RAM + NVMe Drive and G-Sync -- not bleeding edge anymore, but no slouch either.

    It baffles me that devs (and the UE team for that matter since it's so common with their engine) don't take hitching/stuttering more seriously, it's an awful problem that plagues too many games on PC. Sadly it's not just limited to UE games either, I was very bummed to see that Elden Ring exhibited these issues too on PC.
     
    Last edited: Mar 13, 2022
    Smough and Cave Waverider like this.
  7. BlindBison

    BlindBison Ancient Guru

    Messages:
    1,797
    Likes Received:
    729
    GPU:
    RTX 3070
    Surely it can't be hard for them to do the Horizon Zero Dawn/Modern Warfare 2019 way where they just compile the shaders at game launch no? I don't mind that approach at all and I'd be surprised if that was all that difficult to do.
     
  8. tsunami231

    tsunami231 Ancient Guru

    Messages:
    13,385
    Likes Received:
    1,310
    GPU:
    EVGA 1070Ti Black
    This is what shouldshould be done for shaders period. do it before game launchs, then to my understanding there no need to do again less drivers change or game was patched? this should solve at one of reason why it so bad on pc
     
    Smough and BlindBison like this.
  9. Horus-Anhur

    Horus-Anhur Ancient Guru

    Messages:
    5,916
    Likes Received:
    7,221
    GPU:
    RX 6800 XT
    Yes, there are games that do that. And avoid most stuttering.
     
    BlindBison likes this.
  10. haste

    haste Ancient Guru

    Messages:
    2,082
    Likes Received:
    1,004
    GPU:
    GTX 1080 @ 2.1GHz
    UE's stuttering is not caused by shader compilation.
     

  11. Horus-Anhur

    Horus-Anhur Ancient Guru

    Messages:
    5,916
    Likes Received:
    7,221
    GPU:
    RX 6800 XT
    Part is caused by asset streaming. Part is caused by shader compilation, especially in DX12.
     
    BlindBison likes this.
  12. snight01

    snight01 Master Guru

    Messages:
    404
    Likes Received:
    67
    GPU:
    GB RTX 4090gamingOC
    but there’s just two graphic card companies, can’t they pre compile shaders for nvidia and amd. Have the drivers read them universally
     
    BlindBison likes this.
  13. snight01

    snight01 Master Guru

    Messages:
    404
    Likes Received:
    67
    GPU:
    GB RTX 4090gamingOC
    So much this, it takes two is virtually UNPLAYABLE ON PC due to ue4 stuttering
     
    BlindBison likes this.
  14. Horus-Anhur

    Horus-Anhur Ancient Guru

    Messages:
    5,916
    Likes Received:
    7,221
    GPU:
    RX 6800 XT
    You seem to forget the biggest of all: Intel and their IGPs. And soon, also discrete GPUs.
    And each of these companies has several archs in the market at the same time. And different driver versions.
     
    BlindBison likes this.
  15. haste

    haste Ancient Guru

    Messages:
    2,082
    Likes Received:
    1,004
    GPU:
    GTX 1080 @ 2.1GHz
    No it isn't. UE has very robust systems to prevent shader recompilation in release builds. If the game is properly cooked via Unreal Frontend (release versions always are), then all shaders are precompiled and stored in unreal's shader cache, which is always loaded either on game start or when a specific package is loaded.
     

  16. PhazDelta

    PhazDelta Master Guru

    Messages:
    609
    Likes Received:
    546
    GPU:
    RX6900XT Strix LC
    every game now with this DX12 crap API have this problem Elden ring Call of duty pacific map Shadow warrior 3 God of war ......ect i have 6900XT with 16GB vram LOL ..........
     
  17. Astyanax

    Astyanax Ancient Guru

    Messages:
    14,998
    Likes Received:
    6,147
    GPU:
    GTX 1080ti
    you can ship precompiled shaders with pc as well, but they'll still end up being converted again as the driver reinterprets it into a driver optimal format.

    GTAIV did this. heh.
     
    Sajittarius likes this.
  18. Horus-Anhur

    Horus-Anhur Ancient Guru

    Messages:
    5,916
    Likes Received:
    7,221
    GPU:
    RX 6800 XT
    You said it well: "If the game is properly cooked"

    I kwon some games like Gears 5 are so well optimized, that I barely saw any stutter.
    Then there are other games, where it is a stutter fest....
    UE4, being a widely game engine, has devs that know what they are doing and some that don't.
     
    BlindBison likes this.
  19. haste

    haste Ancient Guru

    Messages:
    2,082
    Likes Received:
    1,004
    GPU:
    GTX 1080 @ 2.1GHz
    Yes, driver's internal compiler can optimize given shaders, but it's not necessary. If there are some slowdowns caused by improperly implemented recompilation on driver-level, that is not engine's fault.
     
  20. Horus-Anhur

    Horus-Anhur Ancient Guru

    Messages:
    5,916
    Likes Received:
    7,221
    GPU:
    RX 6800 XT
    Just an example.
     
    BlindBison likes this.

Share This Page