Search Unity

Bug SceneManager.LoadSceneAsync lag spike on additive scene load / HDRP, unity 2021.2

Discussion in 'Scripting' started by PutridEx, Dec 27, 2021.

  1. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    I searched around and it seems to have been an issue forever. Unless this is a regression?
    or maybe it had to do with terrains in the scene?
    https://forum.unity.com/threads/scenemanager-loadsceneasync-additive-lag-spike.494874/
    Has it always been like this? any workarounds, need this to stream open world/large projects

    Loading 1 fairly small scene, includes 2 small terrains (300x300) next to each other, with some trees and grass.
    All in all, 4 tree types, and 1 grass, plus a single local volumetric fog object.

    There's quite a big spike, profiling I noticed the majority of the spike is caused by "QueuePrepareIntergrateMainThreadObjects" during loading. It's a 2-3 frame +13ms spike.
    Since it has to do with culling for some reason, makes me think it has to do with terrains, maybe?

    upload_2021-12-27_21-45-14.png

    using HDRP, unity 2021.2.4
    profiler data taken from a build
     
    Last edited: Dec 27, 2021