Search Unity

GI pop in after scene load

Discussion in 'Global Illumination' started by Spabbage, Jan 24, 2018.

  1. Spabbage

    Spabbage

    Joined:
    Feb 15, 2015
    Posts:
    37
    I'm experiencing an issue where GI seems to apply a few seconds after my scene has loaded, resulting in a very noticeable pop in. The time it takes for the GI to apply depends on the complexity of the scene and the number of lights in it.

    I can hide the pop in behind a loading screen if I can get a callback when the GI has finished loading but I can't seem to find one in the docs. Has anyone experienced anything similar/have a workaround for it?

    If it helps, I'm loading the scene from an asset bundle within play mode of the editor.
     
  2. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Hey @Spabbage

    I guess you're using precomputed realtime GI for your lighting? If so, you can use DynamicGI.isConverged API to load the scene when GI data is loaded. So you can do something like:

    If (DynamicGI.isConverged == true) { SceneManager.LoadSceneAsync(scenename); }

    Thanks
     
    Spabbage and BonsaTech like this.
  3. Spabbage

    Spabbage

    Joined:
    Feb 15, 2015
    Posts:
    37
    That's just what I was looking for. Thanks!
     
  4. jomasan

    jomasan

    Joined:
    Dec 6, 2012
    Posts:
    4
    Hey @kemalakay
    We are having the same issue but the DynamicGI.isConverged is not affecting anything.

    The game loads without the GI and after 2 seconds or so, we see a strong pop that brings the scene to a normal state.
    Is there a way to query when is this process done loading?

    Thanks
     
  5. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    I have the same question, We would to remove our loading screen after scene is fully loaded, and that light gi pop up is showing 1-2 seconds after scene is loaded. It would be great if we could check it and then remove loading scree.
     
  6. Kuba

    Kuba

    Moderator

    Joined:
    Jan 13, 2009
    Posts:
    416
    Hey @Jakub_Machowski,

    do you happen to have a simple repro handy that we could check to see what are you exactly attempting and why doesn't it work?

    Cheers,
    Kuba

    P.S. Sorry for missing your message, @jomasan.
     
  7. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Now everything is ok I just thought that DynamicGI.isConverged works only before scene is loaded, according to kemalakay code, but it also works after loading scene, so that works for me, Thanks for reply! :)
     
    Kuba likes this.
  8. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    @Kuba

    I make a little bit more test, and it seems like DynamicGI.isConverged is going to true much later than actual GI pop up is shows, What I mean that GI seems to be already loaded but GI.os Coverged is still waiting for some reasons not true, it sometimes takes even 10 seconds... And I see that light is already loaded but that DynamicGI.isConverged seems to dont see it or check in some intervals? Do you know why it is like that? I will just add that I at first load my scene asynch way, then allow it for activation and then check if DynamicGI Coverged is true and if it is then I remove my loading screen
     
    Last edited: Jun 5, 2019
  9. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    @Kuba @kemalakay

    It seems like Gi is Coverged dont work proper , I mean I'm waiting and checking it every frame and turn off my load screen if everything is loaded, but it seems like even if everything is loaded it waits sometimes even few minutes before Gi covereged is true. Why is like that? Could you please explain more how it works? That situation seems to be every time in biuilded version of the game, and sometimes in editor playmode too.
     
  10. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    In noticed that If in playmode when gi coverage take a lot of time to be true, if I just Pause playmode and unpause it check it and work. It seems like DynamicGI.isConverged isnt checked every frame, and thats a problem.
     
  11. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    Have you tried increasing the Realtime Global Illumination CPU Usage via "Project Settings" => "Graphics"? It's part of the "Tier" settings.
     
  12. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    No I didnt I coudl test but I dont thing it is good idea for contant use to increase cpu only to check if GI is Loaded? It seems like DynamicGI.isConverged is changed in some interval or something, and thats a problem. Cause I see that GI is loaded (there is visible that pop up of light) but DynamicGI.isConverged stays fals even few minutes after that, what is interesting that it waits more in builded game than in editor, in editor it works better but still have some additional seconds hangs
     
  13. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    I'm using playmaker action to check if its true and if is go to next step:
    upload_2019-6-6_16-29-54.png
     
  14. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    The call goes directly into the enlighten runtime, so if it returns false, Enlighten is still doing something. Convergence is also iterative, so the initial changes will look rather drastic, with subsequent changes being subtle and less obvious.
     
  15. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    OK I understand that further change could be more subtle, but the situation is that If I'm loading scene one time it takes like 5 seconds to do other time it takes 5 minutes, this is why I dont understand why it is happening like that, With the same scene and situation totall different times of Convergence true
     
  16. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    I increased CPU usage to High in Tier 3 and still the same problem. As I said what is strange that If I pause and unpause editor playmode it seems like it makes in some way that is.Convergence is set to true. Maybe then editor is invoking it some way ?
     
  17. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    Also I have dont destroy on load object then, If thats a problem. Maybe Could I before REset In any way Loading GI? Like load it again? Is there function to reset GI loading? Or maybe because before that I iuse Resources Unload unused assetes?
     
    Last edited: Jun 6, 2019
  18. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    FIXED -
    I think I found fixed, the problem was that on my scene I have lights that are point lights with strengh property animation that simulates fire, It seems that because of that Global GI was all the time calculating Dynamic GI, this is why Convergence was always false. I have to find a way to decrease threashold of dynamic GI calculation, on time of loading or disable my point light on time of loading
     
    thefranke and halley like this.
  19. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    The indirect multiplier on lights can be set to 0 to kill bounce lighting. You can try setting that on the animated fire, if you don't need bounce lighting from it. Alternatively, you could probably freeze the animation while loading, so you quickly reach a converged state, and then animate the fire. If its indirect lighting is not 0, enlighten will have to run all the time, though, while it's animating.
     
    hippocoder likes this.
  20. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    647
    I disabled lights during loading :) Thanks for help, I was fighting with that by long time. I hope that topic will help other developers too ;)
    Thanks!