I want to create a day and night cycle in Unreal Engine 5 with the help of this tutorial
But at the very beginning, right after adding ‘Sun and Sky’ from the ‘Sun position calculation’ plugin to the level, the viewport and the game itself lags every half second or so. What could be the reason for this?
I notice your scalability is set to low, is it possible your hardware is being pushed to it’s limit? Do you find it still happens when packaged or via PIE
Sorry, it’s on low because I was trying to optimize foliage and I was testing some settings. The Foliage is the only thing that is set to low, rest of the settings is set to high and without ‘Sun and Sky’ component in level, I have ~80 fps in viewport.
The stutter every half second stops, when I change view in viewport to ‘Unlit’ but yep, when I hit play or set viewport to ‘Lit’ then the stutter comes back.
Important
I checked now and on Low, Medium settings this problem does not occur, but on High and up the problem occurs again… Is ‘Sun and Sky’ really that demanding for my computer?
Lumen is turned off, I use Nanite on Landscape.
The game uses 256x256 textures and low poly models so Lumen would kill the look of the game a bit.
So, now I’m wondering, what does the ‘Sun position calculation’ plugin have that it slows the game down so much on my PC and yet in such a weird way? It is very strange for me, like every half of second something big happens in logic.
Edit:
I played with scalability settings, and after X times setting scalability to Low and High, the stutter disappeared, but after restarting the engine, the stutter appears again
after some more testing, for me it turns out that reducing “Reflection View Sample Count Scale Value” (in VolumetricCloud Details->Cloud Tracing) to 0.05 solves the problems.
If it doesn’t help, for me, removing and adding Volumetric Clouds again manually with default values solved the problem - try what works for you.