Why Games Have Stutters | Shader Compilation

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 มิ.ย. 2024
  • Stutters. Long loading screens. We are used to blaming game developers for this, but they are not always to blame.
    Shader compilation is the scourge of modern games. But what is it? How did it happen that a convenient piece of tech became an issue?
    00:00 - Introduction
    01:00 - What is a shader?
    02:55 - Compilation of shaders
    06:04 - Solving the stutter problem
    08:43 - Results
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 89

  • @loganwolfram4216
    @loganwolfram4216 ปีที่แล้ว +59

    Didn't realize this was such a huge advantage of consoles. Hardware is uniform, so of course you can pre-compile the shaders.

    • @GemayelDaniel
      @GemayelDaniel ปีที่แล้ว +7

      the biggest example of this way elden ring on launch.
      the performance was not bad, but it had constant stutter on pc, while on consoles there was none

    • @moonknightish
      @moonknightish 8 หลายเดือนก่อน +10

      They could offer to download pre compiled shaders based on your hardware of choice. But that would require actually caring about the PC gaming market

    • @GuyManley
      @GuyManley 8 หลายเดือนก่อน +2

      @@moonknightish This is exactly what Valve does for their Steam Deck. It's not really feasable for a game devoloper to do this for every GPU that their game might run on.

    • @pcgamingftw5694
      @pcgamingftw5694 8 หลายเดือนก่อน +2

      Agreed, but what is feasible and manditory is a comprehensive pre-compilation step offered by the game. I'm sick and tired of all my favorite games stuttering and this goes way back before dx12 which many people blame it on. Games like Ryse, Crysis 1 from 2007, Half-Life 2, Assassin's Creed 2, Mirror's Edge 1 and Catalyst, both Jedi games by Respawn, Witcher 3 and Metal Gear Solid 5 to name a few. You have everything from dx9, 10, 11 and 12 here which all exhibit minor to severe shader stutter both on my Radeon 6800 and my old GTX 1660 Super (though it's a tiny bit less noticable on it). Ihave done extensive testing and confirmed the difference between the traversal stutter some games have and shader stutter. Either somebody comes up with a solution for a shader standard that doesn't require compilation or you offer a pre-compilation step, anything else is unacceptable in the age of Digital Foundry and frametime graphs...@@GuyManley

    • @gameskyjumper1721
      @gameskyjumper1721 6 หลายเดือนก่อน

      On Switch I can put in the game Monster Hunter Rise. I press A to skip. bam. BAM. I am in the game. On pc, I need to wait for shader to compile every damn time. PC really is regression some time.

  • @chunkylover5367
    @chunkylover5367 ปีที่แล้ว +43

    Please just give us the option to wait 20 mins or so to compile shaders. I'd gladly wait.

    • @nutifafa_foli
      @nutifafa_foli 10 หลายเดือนก่อน +5

      My sentiment exactly. Just give players the choice.

    • @SunderMount
      @SunderMount 7 หลายเดือนก่อน +9

      I'd be willing to wait for 2 hours if it means no stuttering in gameplay.

    • @jonathaningram8157
      @jonathaningram8157 2 หลายเดือนก่อน

      Horgwart Legacy has shaders compilation at start but it still stutters like crazy ingame.

  • @pedro.alcatra
    @pedro.alcatra 6 หลายเดือนก่อน +14

    You guys may not agree. But I would wait for the full shadder pre compilation if it was a garanty for no sttutters in gameplay

  • @John117M63
    @John117M63 ปีที่แล้ว +41

    I would be cool waiting an hour for shaders to compile.

    • @hazelcrisp
      @hazelcrisp ปีที่แล้ว

      I know that Uncharted 4 and TLOU1 do shader compilation at the start.

    • @hazelcrisp
      @hazelcrisp ปีที่แล้ว +1

      I guess some people are just impatient

    • @nutifafa_foli
      @nutifafa_foli 10 หลายเดือนก่อน

      Yeah, mentally accommodate that as an extended download and allow it do it's thing, for your eventual benefit.

    • @pcgamingftw5694
      @pcgamingftw5694 8 หลายเดือนก่อน +2

      I agree, but with how complex shaders and game rendering in general is getting, for long term this might not be feasible. I think UE5 has multiple aids in development of which some are available now and they do a decent, though not comprehensive job of addressing the issue without a 1 hour pre-compilation. Let's hope they'll be successful in the future.
      I'd just prefer my drivers to be up to date, esp considering I'm using AMD which has buggy drivers and pumps out new ones every 2-4 weeks usually. I cannot deal with doing 1 hour for every game I own every 2-4 weeks, that seems mad. Although I'd prefer it over the stutter that most of my games, even older dx9, 10 and 11 ones exhibit...

  • @jonathaningram8157
    @jonathaningram8157 2 หลายเดือนก่อน +5

    Stutters is what makes me want to go back to console gaming. I have a beefy computer, 7800X3D with a RTX4090 but even with that, PC games are basically hit and miss. Some will work perfectly fine, for other, not at all. I had a lot of problems with Unreal Engine games (Lies of P, Hogwart even Sifu). And it's especially bad because I play at 120 fps, so I notice even the smallest stutter and it can ruin an otherwise extremely smooth experience. But I learnt that not everybody care about those or even notices it.

  • @taylor85345
    @taylor85345 2 หลายเดือนก่อน +1

    It would have been good to mention Valve's shader pre-compilation system for Steam Deck / Linux, where Shaders are pre-compiled by Steam in the background while your system is idle. Valve also basically crowdsources compiled shaders from their users, then distributes them to other users with similar hardware configurations.

  • @andrescampos5435
    @andrescampos5435 8 หลายเดือนก่อน +1

    Awesome video! I currently have a Ryzen 5 3600 paired with an RX 6700XT, so what I understood, switching to a CPU with better single core performance will improve stuttering issues? Stuttering in the latest releases is making me quit gaming on PC

  • @juno1597
    @juno1597 ปีที่แล้ว +8

    Excellent video, very informative. I'm curious, are you videos dubbed?

    • @Sybertek
      @Sybertek ปีที่แล้ว +10

      The videos on this channel are dubbed. This isn't his main channel. It's an English-friendly channel which seems to derive from Мой Компьютер. I believe he's Russian since that's the language used on his main channel.

    • @juno1597
      @juno1597 ปีที่แล้ว +1

      @@Sybertek ahh okay thanks!

  • @robertmyers6488
    @robertmyers6488 ปีที่แล้ว +6

    Very informative. Thank you.

  • @GemayelDaniel
    @GemayelDaniel ปีที่แล้ว +6

    this is incredibly informative. thank you

  • @OCPyrit
    @OCPyrit 15 วันที่ผ่านมา

    Just compile shaders on the fly and when the engine wants to draw an object whose shader is not yet ready, use a basic standard shader for the object until the high quality shader is done compiling.

  • @robertmyers6488
    @robertmyers6488 ปีที่แล้ว +2

    I wasn't aware of the cpu being needed for shader compiling. Is that independent of running game play? Most games don't take advantage of modern multithreaded cpus above 6 to 8 cores. Would moving to 12 and 16 core cpus help and if so why isn't it being done? Is there a way to by pass the cpu? Could the GPU be used in some way to do the compiling? Every move outside of the GPU results in a latency penalty.

    • @juno1597
      @juno1597 ปีที่แล้ว +3

      He said the GPU can communicate directly with a NVME SSD, but currently the software is immature. He also said developers currently are overloading the primary game thread this causing frame hitches, and that developers are not accustom to multi thread shader compiling, so having more threads wouldn't cause a benefit.

    • @sneakycactus8815
      @sneakycactus8815 ปีที่แล้ว +1

      @@juno1597 seems like incompetence at this point, especially given other glaring issues in the gaming industry. but i could be wrong. why havent devs gotten used to optimizing for multi core, multi thread, cpus in 2023? we've had quad core cpus since 2006, and multithreading on a mass scale since 2017 or so. that was 6 whole years ago

    • @juno1597
      @juno1597 ปีที่แล้ว +1

      @@sneakycactus8815 I don't know, this video mentions that part of the problem is because the consoles solved this problem many generations ago because they never had good CPUs up until now.

    • @juno1597
      @juno1597 ปีที่แล้ว +3

      @@sneakycactus8815 If I had to give you my educated guess, while Nvidia has pushed a lot of cool graphical technologies, they nor Microsoft has pushed for direct storage on PCs because PCS has had fast single core CPUs for a long time. The truth is, it's only up until now with the amount of shaders that are present that this has become a serious problem.

    • @gpsoftsk1
      @gpsoftsk1 ปีที่แล้ว +1

      @@sneakycactus8815 Most developers are not able to develop good multithreaded code. Generally, I think most companies will try to avoid multithreaded code as much as possible. Especially bugs are expensive to solve there. Also, there are not enough developers for this and the best are rather working in corporations where they are working on business problems. These pay more than gaming companies, even most non-gaming C++ jobs are not well paid (except finance, trading and similar fintech-related niches).

  • @InternationalLiaison
    @InternationalLiaison ปีที่แล้ว +3

    windows page filing/memory virtualization corrects most stuttering for 4 core 8 thread processors and higher core threads. optimizing the system in system ram instead of having an ssd/HD over work on the write cycle.

    • @DavidJonSpem
      @DavidJonSpem ปีที่แล้ว +1

      Meanwhile ISLC does a better job in managing memory than Windows itself. Why is this a separate program we can install to make Windows run better? I don't know.

  • @jonathaningram8157
    @jonathaningram8157 2 หลายเดือนก่อน

    I noticed steam has a shader cache option but it's only for vulkan game it seems. they already use that for the deck.

  • @alphaomega1969
    @alphaomega1969 8 หลายเดือนก่อน +1

    The problem is games are not optimed to use pagefile correctly

  • @jpbianchini
    @jpbianchini 7 หลายเดือนก่อน +1

    I'm a bit confused with 5:40
    Don't consoles have any 'equivalent' of driver updates, say with system software updates? Does none of that ever break the precompiled shaders?

    • @TheMaztercom
      @TheMaztercom ชั่วโมงที่ผ่านมา

      Nope, they dont update their gpu drivers, they dont need it.

  • @wain___614
    @wain___614 หลายเดือนก่อน

    So therefore the larger the game size,the more graphics it contains,and thus the more shaders that would have to be compilated for that game to be played???

  • @pcgamingftw5694
    @pcgamingftw5694 ปีที่แล้ว +7

    I wonder if it isn't possible to develop a sort of industry standard for shaders. Sure, it is nice to have great perfomance, but it is not worth it if the game stutters. I would rather have a game run at a stable 60 fps than 120 with 300 ms stutters...

    • @alphaomega1969
      @alphaomega1969 8 หลายเดือนก่อน

      It does exist for AMD called Surface Format in gpu setting, this is AMD optimised shader.

    • @pcgamingftw5694
      @pcgamingftw5694 8 หลายเดือนก่อน +2

      I don't think you understand what I was trying to say. I meant a standard for shaders that would get rid of the need to compile them. Also, I'm not sure if this setting even relates to shaders, as the description says it has to do with texture formats which is a different thing. Even if it does relate to shaders it doesn't seem to be doing a great job as it is always enabled by default and games like Rsye, Crysis 1 from 2007, Half-Life 2, Assassins's Creed 2, Mirror's Edge 1 and Catalyst, both Jedi games by Respawn, Witcher 3 and Metal Gear Solid 5 all have minor to severe shader stutter, ranging between 30 to 300 ms and higher on my 3700x with a 6800. And I tried it with my old GTX 1660 Super as well, which had the same shader stutter in the same spots, just a bit less noticable, as Nvidia's driver is probably using some of its CPU overhead for that and is a bit better optimised. This is why I'd prefer a global standard...@@alphaomega1969

    • @Longlius
      @Longlius 7 หลายเดือนก่อน

      We have an industry standard for shaders - they're called shaders. The idea is that you write your shaders in a higher-level shading language and your graphics drivers compile them for your specific hardware. The actual microarchitecture of graphics cards can differ wildly even one generation to the next which is why having good drivers is so important.

    • @pcgamingftw5694
      @pcgamingftw5694 7 หลายเดือนก่อน

      @@Longlius I don't understand your comment. I meant a standard that gets rid of the need to compile them, while still being efficient. Of course shaders are the standard, but it's clearly not an optimal one if developers do not have the time, resources or knowledge to provide pc versions without shader stutter, then we have to create a standard that circumvents these issues.
      Yes, you can say it is the dev's fault and I fully agree! However, knowing this will not provide us with better ports. Not buying bad ports won't either, because the higher ups will just argue that the pc market is dying again and not give us as many pc ports, just like they did during the ps3/360 era.
      As for your comment about the need for good drivers, well, both nvidia and amd have similar amounts of shader stutter, with nvidia only being slightly less intrusive, but still unplayable. Doesn't seem like they can fix that.
      So yeah, I don't see this changing anytime soon. Hence why I was thinking about a new standard, a complete rework of the way it works, because shaders are only getting more and more complex and our cpu's performance isn't improving to the point of getting rid of 300-500 ms stutters in the near future, be it on nvidia or amd drivers. I'm not an engineer but I know it has to do with optimisation for the different microarchitectures and creating a universal standard is impossible with the way things are currently handled. It was just wishful thinking I guess...

    • @drain7632
      @drain7632 6 หลายเดือนก่อน

      @@pcgamingftw5694 That's sort of how GPUs used to work when they had fixed-function pipelines instead of shader based ones, where the functionality of GPUs was fixed and not customizable, but also didn't need any compilation. Shaders were introduced to make GPUs more flexible but they introduced the whole notion of having to compile them beforehand.

  • @dandoran1313
    @dandoran1313 4 หลายเดือนก่อน

    There is a big advantage of using uniform hardware and tapping in to the depths of the system.

  • @SuperPotato316
    @SuperPotato316 3 หลายเดือนก่อน +1

    One of the biggest reasons why i prefer to buy my games on PS5. Sure, graphics are worse and i can't reach FPS like on PC, but i don't have to deal with shit like this.

  • @arianshahrokh1439
    @arianshahrokh1439 ปีที่แล้ว

    Great vid!!

  • @bravofoxtrott4390
    @bravofoxtrott4390 2 หลายเดือนก่อน +1

    I miss the Times, when pushing a Button and was in the game.

  • @MerchAlts
    @MerchAlts 11 หลายเดือนก่อน +4

    There are some games that compile the shader before launching to play that should be a standard in all games.

    • @BaghaShams
      @BaghaShams 4 หลายเดือนก่อน

      Did you watch the video? He talks about the pros and cons of that approach several times, and there are serious cons.

  • @izayoiigames3467
    @izayoiigames3467 2 หลายเดือนก่อน +1

    cmon, its ok to wait 1 hours for shader compilation than having stuttering in game :(

  • @mridiot8430
    @mridiot8430 ปีที่แล้ว +3

    Such a good video

  • @abcdoooabcd
    @abcdoooabcd 6 หลายเดือนก่อน

    i use pre shaders caheing on my steam deck but they are too frequent for my liking

  • @PHOBIAx57x
    @PHOBIAx57x 11 หลายเดือนก่อน +2

    I’d rather just wait. Hopefully there will be a way to brute force in the future so we can play games that never got fixed like Jedi Fallen Order

    • @yentis
      @yentis หลายเดือนก่อน

      Look into dxvk and its async variants dxvk-async & dxvk-gplasync

  • @PuppetTheClown
    @PuppetTheClown 9 หลายเดือนก่อน +1

    what game is at 6:25

  • @PuppetTheClown
    @PuppetTheClown 9 หลายเดือนก่อน

    What is the game at 1:53?

  • @knipsi22
    @knipsi22 5 หลายเดือนก่อน

    On Linux you can enable background shader precompilation and shader caching in Steam. Games will start instantly and not stutter

    • @hotelwalenca2557
      @hotelwalenca2557 5 หลายเดือนก่อน +1

      Maybe i change to linux , i want this

    • @SerdceDanko
      @SerdceDanko 4 หลายเดือนก่อน

      Yeah, but non-steam games will stutter as usual, so Linux users are enslaved by Steam.

    • @NabiYote
      @NabiYote 3 หลายเดือนก่อน

      @@SerdceDanko That's not really a concern anymore with the introduction of graphics pipeline library, if you play let's say overwatch 2 on lutris and have a capapable gpu it compiles shaders as they are being loaded by the game, like in windows. You can test this going to the range with DXVK_HUD=full on the envars, so in steam I wouldn't recommend enabling shader pre-caching anymore, even on valve games dxvk 2.0 and up behave better and are more consistent only really stalling if they have to suddenly pull something from slow storage like mechanical drives, the only real case for distributing shaders like this is if your gpu doesn't support gpl or you are doing esoteric testing of drivers.

  • @JellyJman
    @JellyJman ปีที่แล้ว +2

    Kinda funny the first game to use direct storage is Forspoken

  • @arnabpaul3829
    @arnabpaul3829 ปีที่แล้ว

    CAN I COMPILE SHADERS AND STORE IN ON DRIVE AND WHEN PLAY GAME BEFORE GAMING IN JUT PUT THE COMPILED SHADERS ON RAM????????

  • @sorbpen
    @sorbpen 15 วันที่ผ่านมา

    Is it only for me this video is out of sync with the audio?

  • @GrekkoGaming
    @GrekkoGaming 8 หลายเดือนก่อน

    I am reassured! My steam game takes on average 60 seconds to launch the level, if you tell me that The last of Us takes 2 hours to load shaders , I’m satisfied !

  • @nolimitza.j5063
    @nolimitza.j5063 10 วันที่ผ่านมา

    this channel is seriously underated, other dumb youtubers who dont even know what causes stutter flood the top videos and the real knowledge was down on this channel

  • @drxyd
    @drxyd 7 หลายเดือนก่อน

    The long term solution is for hardware manufacturers to standardize their architectures, eventually market forces will push them to do so as shaders become more complex, gaming on consoles remains simple and PC grows ever more janky.

  • @jonathaningram8157
    @jonathaningram8157 2 หลายเดือนก่อน

    is that a dubbed video ? Lips doesn't syncs.

  • @jakewolf079
    @jakewolf079 6 หลายเดือนก่อน

    WAIT SO IT'S NOT JUST ME????

    • @user-wj6bl1ie1z
      @user-wj6bl1ie1z 6 หลายเดือนก่อน

      No bro..
      All of games example they made of unreal engine they all stutter and have shaders..
      That make you annoying and hate the all games..

  • @olemangamesdesigns5497
    @olemangamesdesigns5497 ปีที่แล้ว +2

    The game Developers dropped the ball. Games should not leave the building in this condition. As a small Indy Game Developer for 8 years, even I Know that this situation should be resolved during development. This is why Game companies should have paid game testers who will test for bottlenecks, where the PC CPU is maxed out for long periods of time, and other bugs.
    At least they should have a loading screen with ambient music while game is compiling shaders. Games should be optimized before leaving the door. This is also the reason for Early release give the game away free to as many potential users as possible with rewards for submitting helpful feedback.
    if 1000 user try your game this mean it has been tested on at least that many different system configurations. I have seen these issues during development my first game is yet to go out the door, but it won't go out officially until these situations are resolved. it
    the Game must start out of the box ready to go within seconds no more than a minute. My project is over 100 gigabytes in development. I had issues with long starting time, but having a Good Programmer to attend to these issues took care of them real quick. I have a Ryzen 3, with 40 gigs of ram and 4 gig video Radeon 6500xt, 2 gigabyte Samsung NVME hard drive. I'm upgrading to Ryzen 7 - 3700x and 64 gig of ram. with 8 gigs of SATA SSD storage, and higher end Radeon 8 gig DDR6 graphic adapter
    Game Developer & Game Designer - OLE MAN GAME DESIGNS
    Creating Fun by Design -
    Project Imminent Dissolution - The Return of the Mother Auxesis

    • @JellyJman
      @JellyJman ปีที่แล้ว

      Yeah man but all that QA takes time and money lol they gotta get the game out NOW

  • @jamesmorris7844
    @jamesmorris7844 4 หลายเดือนก่อน

    Okay, but where was this issue in the PS3 and PS4, era, i mean look at Arkham Knight vs gotham Knights, the older game looks better.

  • @johanndaart7326
    @johanndaart7326 ปีที่แล้ว

    Your voice in this vid is very quiet. It's also about the way you talk, it's not as clear as it could be, a bit too fast, some words are mumbled. I'm not hating bro, but just letting you know - I needed to turn my speakers way up to hear you properly, while before watching your vid I've watched other guys at lower volume and I could hear them no problem.

  • @Alex_Morozov_
    @Alex_Morozov_ ปีที่แล้ว +1

    Hey!

  • @MrNo0p
    @MrNo0p ปีที่แล้ว +3

    Video and Audio are not in sync. By a lot. good video otherwise

    • @arthurviolin
      @arthurviolin ปีที่แล้ว +5

      It is a dubbed version from russian.

    • @LongerThanAverageUsername
      @LongerThanAverageUsername 8 หลายเดือนก่อน +3

      @@arthurviolinit’s so out of sync that it’s in a different language

  • @SerdceDanko
    @SerdceDanko 4 หลายเดือนก่อน +1

    This crap is ruining PC gaming.

  • @BlueLightningSky
    @BlueLightningSky 4 หลายเดือนก่อน

    Gamers can't wait for shaders to compile? If you're playing a game you have enough time and you gotta a phone. You've wasted more time in your life than waiting for shaders to compile.