Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Graphics Real-time GI not working any more

Discussion in '5.2 Beta' started by TomasRiker, Aug 11, 2015.

  1. TomasRiker

    TomasRiker

    Joined:
    Jan 26, 2012
    Posts:
    48
    Hi,

    after upgrading to 5.2 Beta (I tried it with all releases so far, up to Beta 6), I can't get my scene baked for real-time GI any more. After hours of calculation, I find the following error message repeated hundreds of times (which is about the number of static objects that should be baked) in the console:

    (int)indices[kDynamicLightmap] + realtimeOffset >= 0 && indices[kDynamicLightmap] + realtimeOffset < kLightmapIndexInfluenceOnly

    Real-time GI doesn't work properly. Many objects just stay black, and the editor often crashes after returning from play mode.

    Any ideas what might be the cause? It used to work fine with 5.1.

    I already re-imported all assets and played with the real-time GI baking settings, like disabling directional light maps, but without success.

    Best regards,
    David
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    This assert is related to some changes we did for MultiLevel lightmap bake. Can you file a bug with the repro project so we can better understand the situation in which these assert happens?
     
  3. TomasRiker

    TomasRiker

    Joined:
    Jan 26, 2012
    Posts:
    48
    I will try to strip the scene/project down to the minimum for you guys to reproduce it. Could take some time.
     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    It may be related to scaleInLightmap = 0? Can you try that?
     
  5. TomasRiker

    TomasRiker

    Joined:
    Jan 26, 2012
    Posts:
    48
    How exactly do you mean that?
    The tooltip says that if I set scaleInLightmap to zero, it will disable lightmapping for that object. It is set to one for the objects to be baked.

    Upgrading to release candidate 1 did not fix the problem.

    My colleague and me did some more experiments to further narrow down the problem. Our scene is a virtual city that consists of a terrain (grass and street surface), several meshes on top of the terrain for pedestrian walks, around 300 buildings and additional objects like traffic signs and traffic lights.

    The funny thing is that real-time GI baking works fine if we remove either the terrain or the pedestrian walk or the buildings. Only when we include all of it together, we experience the problems described before.

    Two more observations we made:
    • The errors appear in one of the final stages of baking, after all the expensive calculations have been done. I can't tell you exactly in which stage, because in the end, they finish very quickly.
    • After the errors have been generated, the entire scene seems fine in the editor's scene view. It looks like the baking did work and the result is in memory, but somehow Unity has trouble saving it. Because as soon as I start the game, half of the objects are just black, and after stopping the game, the editor crashes.
    I'm still trying to create a smaller version of the scene so that you can reproduce it. I don't want to upload several gigabytes of data ...
     
    Last edited: Aug 19, 2015
  6. TomasRiker

    TomasRiker

    Joined:
    Jan 26, 2012
    Posts:
    48
    OK, I was now able to reproduce the problem with an easy scene.

    All you need is a large number of objects that you bake. I have filed a bug report with an example project. The case number is 722655.
     
    Last edited: Aug 26, 2015
  7. SpiriTx

    SpiriTx

    Graphics QA

    Joined:
    Apr 12, 2012
    Posts:
    252
    Thanks for the great bug report!

    Managed to repro it and passed it on to the dev team.
     
  8. TomasRiker

    TomasRiker

    Joined:
    Jan 26, 2012
    Posts:
    48
    Thank you.

    In the meantime, if anyone encounters this "limitation": I managed to bake my scene by reducing the real-time GI resolution from its default value of 1 to 0.5.
     
  9. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    It was a snafu introduced with the multi-scene lighting build. It will happen with large scenes that end up using more than 1 uber atlas for realtime GI. I have a fix in 5.2p1 which is going out mid september. There is no real workaround other than using 5.1 as it is due to ordering in a set of hashes, sometimes it will work sometimes not so much.
     
  10. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    232
    Nice repro BTW ;-) cubes.png