Game Engines & Shader Stuttering: Unreal Engine’s Solution | Inside Unreal

  Рет қаралды 16,357

Unreal Engine

Unreal Engine

Күн бұрын

Recently, there have been a number of conversations taking place in the Epic community around shader stuttering and its impact on game developer projects.
This week, we’re going to dive into why the phenomenon occurs, explain how PSO precaching can help solve the issue, and explore some development best practices that will help you minimize shader stuttering. We’ll also share our future plans for the PSO precaching system with you.
Interested in learning more? We have a whole tech blog available to dive into the details here ahead of time: www.unrealengi...

Пікірлер: 71
@JenAnty_JA
@JenAnty_JA 2 күн бұрын
Ari, I can't wait to see your next presentation about PSO.
@cosmotect
@cosmotect Күн бұрын
I am glad this has been properly communicated now. Looking forward to the mentioned fixes as well as better in-engine communication for shader costs
@Navhkrin
@Navhkrin 5 күн бұрын
You know it is going to be a good one when Ari is onboard
@Navhkrin
@Navhkrin 4 күн бұрын
I feel like Unreal is suffering from same problem DX11 suffered with not-knowing when what shader will be used. Essentially, we just moved the compilation problem from driver to game engine. What is more ideal is that this should be moved to the hands of developers with a nice API to work with. It can be difficult for Unreal to predict when I'm going to spawn an effect, but I know exactly when I'm going to do that. So, give us an API that allows us to set high-priority compilation targets for assets and even query whether asset is compiled and ready to go. IMO this should be priority because this is a deterministic solution that guarantees results whereas in automatic pre caching puts more load on CPU by generating 5x PSO's than what is needed and likely won't have 100% coverage for some time yet.
@jerobarraco
@jerobarraco 4 күн бұрын
Ari mentioned you can change the strategy for PSO miss to hide the object instead of hitching, how to do this? What's the settings?
@ciprianstanciu7
@ciprianstanciu7 4 күн бұрын
I think it may be r.PSOPrecache.ProxyCreationDelayStrategy -> Control the component proxy creation strategy when the requested PSOs for precaching are still compiling. Ignored if r.PSOPrecache.ProxyCreationWhenPSOReady = 0. 0: delay creation until PSOs are ready (default) 1: create a proxy using the default material until PSOs are ready. Currently implemented for static and skinned meshes - Niagara components will delay creation instead r.PSOPrecache.ProxyCreationWhenPSOReady -> Delay the component proxy creation when the requested PSOs for precaching are still compiling. 0: always create regardless of PSOs status (default) 1: delay the creation of the render proxy depending on the specific strategy controlled by r.PSOPrecache.ProxyCreationDelayStrategy
@flassari
@flassari 4 күн бұрын
This property: "r.PSOPrecache.ProxyCreationDelayStrategy" It's in the PSO Precaching documentation. Although it only seems to support "Default Material" and not the hiding right now, not sure why.
@ciprianstanciu7
@ciprianstanciu7 4 күн бұрын
Wow, youtube hid my long comment :) Search for r.PSOPrecache.ProxyCreationDelayStrategy
@ThiagoJaqueta
@ThiagoJaqueta 3 күн бұрын
This should be the default behavior afaik, but it can be changed by setting r.PSOPrecache.ProxyCreationDelayStrategy. You can find more info about it on the documentation under PSO Precaching / Proxy Creation Delay Strategy.
@kettenotter
@kettenotter Күн бұрын
I think either hide it or render it with a default Material should be possible.
@Fr3akyFrapz
@Fr3akyFrapz 5 күн бұрын
finally some work to fix the stuttering would love a completely smooth frametime stable fps.
@RYRY1002
@RYRY1002 4 күн бұрын
these features have been a part of unreal since 5.2
@JetpackBattle-lc7ob
@JetpackBattle-lc7ob 4 күн бұрын
@@RYRY1002 It really REALLY should be automated though, and not fall on the developers to manually generate them. There is no excuse for that... hopefully that will change though
@dracofells5390
@dracofells5390 4 күн бұрын
​@@JetpackBattle-lc7ob I'm sorry to tell you that unfortunately you have to actually do some game development to develop a game and they arent just gonna do it all for you with a couple button pushes
@keygamedev
@keygamedev 4 күн бұрын
Thanks for hard working on PSO.
@gihanrx
@gihanrx 4 күн бұрын
at last, something worth, thanks for explaining ❤
@pimeine
@pimeine 4 күн бұрын
That's already my favourite video, just from its title xD
@OriginRow
@OriginRow 4 күн бұрын
Great times ahead. Long waiting fix.
@Galent41
@Galent41 Күн бұрын
Is it possible to activate automatic Subtiles ? It would help quite a lot since it's not my first language
@DevGods
@DevGods 4 күн бұрын
I wonder if you create a shader that doesn’t have any static switches, but has a bunch of parameters to make it dynamic would that cause an issue. Take a customizable characters hair shader for instance. Will changing things like the hair color or roughness at runtime require everyone to compile a new shader?
@Blap7
@Blap7 4 күн бұрын
sounds similar to an ubershader
@ErichToven
@ErichToven 4 күн бұрын
​​@@Blap7Yea op just described the Uber shader. And no parameters don't need new pso its compiled with parameters. Its already compiled. But complex shaders have a higher cost.
@cosmotect
@cosmotect 4 күн бұрын
You'll be doing a lot more computations per pixel, so its a tradeoff
@philzan3627
@philzan3627 4 күн бұрын
36:00 how do i prerender it? You said to make a loading screen, how do i evaluate when it's done or not? It's a huge peeve that these presentations talk about what to do without ever showing it or documenting it anywhere and users have to dig dig dig
@philzan3627
@philzan3627 4 күн бұрын
50:00 where!!!!!! it's a video, put a link somewhere! what is it called!? Which documentation?!
@RYRY1002
@RYRY1002 4 күн бұрын
Yep. A lot of the time with essential features like this, you have to wait for a sample from Epic to come out and then reverse engineer it.
@RYRY1002
@RYRY1002 4 күн бұрын
I can't post the link sadly as KZbin will shadow-delete the comment
@pro.giciel9084
@pro.giciel9084 4 күн бұрын
at around 1:28:00 there is the documentation link in the chat
@philzan3627
@philzan3627 2 күн бұрын
@@RYRY1002 gosh darn it, what are the terms? I keep looking for it and the best I can find is an async loader plugin video whereas everything else doesn't say anything.
@kazioo2
@kazioo2 3 күн бұрын
"Security risk to allow anyone to upload shaders to run on other player's machines" - VRChat says hi 😅
@flassari
@flassari Күн бұрын
Compiled shaders specifically 😄
@OREYG
@OREYG 3 күн бұрын
Unreal stutters not only because of shader compilation, but also because it does all instantiation logic in the game thread. And even if you moved everything to workers, you still pay for a lot of functionality, that you don't use. And then the data layout of instantiated objects is suboptimal, and decreases performance. Good thing is that gameplay framework would eventually be phased out in favor of the new object model, and those problems could potentially disappear.
@plinyvicgames
@plinyvicgames 3 күн бұрын
unless you design your game logic like a toddler, it shouldn't have any impact on performance.
@OREYG
@OREYG 3 күн бұрын
​​@@plinyvicgames bad take, that's only if your game lacks ambition. Compare Frostpunk 1 and 2. Frostpunk 1 had a good looking simulation of thousands of NPCs, all skeletal meshes. Frostpunk 2, because of the technical limitations was forced to show static prebaked vertex animation. The amount of dynamic elements on the scene was reduced drastically.
@virtualfilmer
@virtualfilmer 4 күн бұрын
I would love love Unreal to do a video like this, except for MetaHuman hair with shallow depth of field. It just looks awful unless we use path tracing (!).
@MikeLeed
@MikeLeed 12 сағат бұрын
Why are the captions disabled? The audio is not very good and the captions can be auto generated, this is not optimization!
@GameDevAraz
@GameDevAraz 2 күн бұрын
3 minutes in im watching someone design a level? i thought we addres lag issue
@morglod
@morglod 4 күн бұрын
how to compile shader before draw call? glCompileShader - i dont know, we need PSO of course! how to compile glCompileShader before draw call! oh its impossible glCompileShader without PSO! how to load compiled shader? glShaderBinary - I dont know too. its some antient unknown technology!
@charlieking7600
@charlieking7600 4 күн бұрын
The funniest thing is that shader specialisation constant were meant to optimize rendering, but they generate several shaders from one, so shader stuttering is more present. Everything is wrong with modern software, and rendering is not an exception.
@morglod
@morglod 4 күн бұрын
@charlieking7600 facts. I'm still laughing from "async" rendering api by default. OpenGL's even wrapped update/read methods without memory mapping still 10x times faster that io through memory mapping which is now default. It's just a joke
@лионтийфамильяров
@лионтийфамильяров 4 күн бұрын
why need its pink pig?
@SurviveOnlyStrong
@SurviveOnlyStrong 5 күн бұрын
guys just add native precompilation method of all possible shaders in game content folders. So we can use it like in stalker 2, tlou and many other games
@Shunkan26
@Shunkan26 5 күн бұрын
That already exists in Unreal, it's the Bundled PSOs.
@TheQubert
@TheQubert 4 күн бұрын
So until 5.6 my game will be made with the nine shades of grey 😊
@morglod
@morglod 4 күн бұрын
@@Shunkan26 you dont need PSO or anything for this. all graphics api 10+ years already have methods to compile shader when you want and save and LOAD ALREADY COMPILED SHADERS without no one needed PSOs and without draw calls at all the problem is unreals materials system, and because of that architecture they dont know end shader without drawing object with material. cringe
@burretploof
@burretploof 4 күн бұрын
@@morglod They key difference is that modern graphics APIs like DX12 and Vulkan use shaders compiled for each specific hardware & driver combination instead of pre-compiled generic packages - and that issue is not exclusive to UE and can be observed in other, modern games that run on other engines. (Starfield, Call of Duty, Horizon ZD/FW, Uncharted, etc.) And once the shaders are compiled locally, they are indeed loaded whenever they're used again. Shader compilation stutter when using modern APIs can only be solved by devs spending more time to tweak *when* they compile shaders, but time is a costly resource.
@morglod
@morglod 4 күн бұрын
@burretploof so what. You can't precompile shaders one time and prevent stutters now? Most games on ue5 precompile shaders on EVERY run, not just one time. It means there is no save/load for already compiled shaders
@OOsevenAlpha
@OOsevenAlpha 4 күн бұрын
Performance of almost every new UE5 game is trash. People automatically know its going to be a terrible experience when they see a new game with unreal logo lol. Please focus more on improving game development instead of putting everything on virtual production and filmmaking.
@Doshi_Gaming
@Doshi_Gaming 4 күн бұрын
Thats not an engine problem that’s a developer problem. It’s not like if UE was perfect every game made on it will always run smoothly.
@OOsevenAlpha
@OOsevenAlpha 4 күн бұрын
@@Doshi_Gaming Tell me a good game made using ue5 with realistic graphics and well optimized
@Doshi_Gaming
@Doshi_Gaming 4 күн бұрын
@@OOsevenAlphathat’s my point most teams stop don’t prioritize optimizing their games but it’s not like UE doesn’t provide tools to help you find issues and solve them shader stuttering. And also a lot of people were using nanite wrong since it was new. I’m not an expert but I have been researching and working on unreal engine myself. I do see that Epic really puts so much effort into improving an engine that anyone can work on for free
@SeanBires
@SeanBires 4 күн бұрын
​@@OOsevenAlpha Hellblade 2. The problem with Wukong & Stalker 2 is they launched on early versions of UE5 instead of upgrading to current.
@Vioxtar
@Vioxtar 4 күн бұрын
So Lyra, which runs awfully, is also a developer problem?
@abdulshabazz8597
@abdulshabazz8597 2 күн бұрын
Erm. Huh?? Given Unreal Engine is marketed as a ready-to-use, high-end game engine, it should take a more proactive role in shader compilation optimization...
Myth-Busting “Best Practices” in Unreal Engine | Unreal Fest 2024
49:46
Don’t try this trick with a Squid Game Soldier 😉 #squidgame
00:15
Andrey Grechka
Рет қаралды 179 МЛН
And what’s your height? 😁 @karina-kola
00:10
Andrey Grechka
Рет қаралды 52 МЛН
It's the natural ones that are the most beautiful#Harley Quinn #joker
01:00
Harley Quinn with the Joker
Рет қаралды 22 МЛН
How do Graphics Cards Work?  Exploring GPU Architecture
28:30
Branch Education
Рет қаралды 3,5 МЛН
Shader Basics, Blending & Textures • Shaders for Game Devs [Part 1]
3:53:11
Breaking Into The Games Industry in 2025: Environment Artists
2:05:34
Sierra Division
Рет қаралды 1 М.
What if all the world's biggest problems have the same solution?
24:52
How I Won The GMTK Game Jam
25:09
JimmyGameDev
Рет қаралды 684 М.
Coding Adventure: Rendering Fluids
58:41
Sebastian Lague
Рет қаралды 624 М.
An in-depth look at Space Exploration in video games
1:35:56
NeverKnowsBest
Рет қаралды 855 М.
5.1 Release Overview | Inside Unreal
2:12:28
Unreal Engine
Рет қаралды 42 М.
Don’t try this trick with a Squid Game Soldier 😉 #squidgame
00:15
Andrey Grechka
Рет қаралды 179 МЛН