Search Unity

Loading light probes with 5.2

Discussion in 'Global Illumination' started by rstorm000, Sep 9, 2015.

Thread Status:
Not open for further replies.
  1. rstorm000

    rstorm000

    Joined:
    Aug 19, 2010
    Posts:
    229
    There is references in the change notes about being able to load lighting data additively but as far as I can tell loading light probes is broken. Right now I am storing a scene in an asset bundle and trying to load that scene with it's light probes, but it just will not work. Objects in the level will only use real time lights on objects. I even tried manually setting the lightmap snap shot to be that of the level that is being loaded additively and it still will not work. I have also tried straight LoadLevel on the asset bundled level and it will still not work.

    Running on OSX
     
  2. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
  3. rstorm000

    rstorm000

    Joined:
    Aug 19, 2010
    Posts:
    229
    That appears to not because the case if you load the level from an asset bundle.

    Here is a screenshot loaded with LoadLevel


    And here is one with LoadLevelAdditive



    In both cases they are not using light probes (and checking or rechecking Use Light Probes has no effect) but for some reason in the load additive they take on some color of light from somewhere. It's extremely odd behavior. There is one directional light in the scene set to Mixed. Going to try again with just "Baked" now, but I believe I tried that before.

    Also if I change that directional light to baked or realtime at run time, the objects just turn black:


    edit: appears to be same results when light is just set to baked
     
    Last edited: Sep 10, 2015
  4. rstorm000

    rstorm000

    Joined:
    Aug 19, 2010
    Posts:
    229
    Even stranger. When loading the level additively NOT from an asset bundle, the light probes are being added, (which I thought you said should not work as it doesn't include the light probe / light map snapshot info)
     
    Last edited: Sep 10, 2015
  5. rstorm000

    rstorm000

    Joined:
    Aug 19, 2010
    Posts:
    229
    I've tried this with a much simpler scene and it appears to be loading the lightprobes, but it is triggering some errors about loading GI and light probe data sets. (Note: this is loading from an asset bundle, non-additive)

    Failed opening GI file: 'ad/ad69cfd66f388507f379521a92df1f8d.rpc.sse'.

    Failed loading probe set data for hash: 0xad69cfd66f388507f379521a92df1f8d

     
  6. rstorm000

    rstorm000

    Joined:
    Aug 19, 2010
    Posts:
    229
    Running more tests. Just loaded a level additively and the lightprobes loaded...


    The level it loaded on top of had no lightmaps or light probes in it yet. So maybe it will load them if there is none there? Also one time I ran the test parts of the lightmaps were not included but the probes were. It seems to be possibly randomly bugging out when trying to retrieve data.
     
  7. WarArm

    WarArm

    Joined:
    Dec 4, 2015
    Posts:
    4
    We have the same problem while loading our map with light probes from an asset bundle!
     
    guoyonghong likes this.
  8. kimsama

    kimsama

    Joined:
    Jan 2, 2009
    Posts:
    166
    Same on here, Unity 5.3.3f1. I have multiple scene files which are dynamically loaded as assetbundles.

    Fine on windows platform within Unity editor but it has the error 'Failed loading probe set data for hash' on Mac machine.

    On iOS, it crashes.


    -Kim
     
  9. sanmn19

    sanmn19

    Joined:
    Jun 30, 2013
    Posts:
    56
    Can confirm this issue with 5.5.0b5. Light probes loaded with LoadScene with additive parameter seem to have the data from Scene 1. Attached pics for clarity.
     

    Attached Files:

  10. Hanoble

    Hanoble

    Joined:
    Apr 18, 2013
    Posts:
    28
    This still appears to be an issue when loading scenes out of asset bundles on 5.5.0f3. Anyone have a fix for this or workaround?
     
  11. kemalakay

    kemalakay

    Unity Technologies

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

    This should be fix if you try the latest patch of 5.5.

    Thanks
     
  12. geroppo

    geroppo

    Joined:
    Dec 24, 2012
    Posts:
    140
    Sorry I'm a bit lost here, I've the latest patch (5.5.1p3) but when loading additive scene the lightprobes data isn''t loaded. Is there a way to load and setup up lighting data by myself (I'm using realtime GI only)?
    Currently I just have a loading scene that loads levels as needed, having only one at the same time. What is the usual way people go around this?
     
    Last edited: Feb 13, 2017
  13. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Hi @geroppo

    Additive loading with light probe group data is not fixed yet but loading GI with assetbundles is (https://issuetracker.unity3d.com/issues/global-illumination-doesnt-work-in-build-if-scene-is-loaded). Additive loading is still broken, lighting team didn't have the time to fix it as lately, the primary focus was on "fixing" lightmapping, mixed lighting and providing better and more artist friendly tools for them.

    I'm afraid there is no proper way until it is fixed. You should directly load scenes (without additively loading) and use DontDestroyOnLoad() if you want to keep some objects while switching scenes as a workaround. Besides that, you can try unloading light probes data before loading another scene so that current scene's light probe data doesn't overwrite the data of loaded scene.

    Code (CSharp):
    1. SphericalHarmonicsL2[] bakedProbes = LightmapSettings.lightProbes.bakedProbes;
    2. int probeCount = LightmapSettings.lightProbes.count;
    3.      
    4. // Clear all probes
    5. for (int i = 0; i < probeCount; i++)
    6.     bakedProbes[i].Clear();
    I hope this helps and clarifies the issue.

    Thanks,
    QA Team
     
  14. geroppo

    geroppo

    Joined:
    Dec 24, 2012
    Posts:
    140
    Alright, DontDestroyOnLoad will have to do for now, thank you!
     
  15. MikkoK-HS

    MikkoK-HS

    Joined:
    Sep 26, 2017
    Posts:
    53
    Has this been fixed? I'm loading scenes from asset bundles and everything that is not static in my scene and is supposed to use light probes doesn't seem to do so. Everything looks fine in editor but in build the objects are too bright.
     
  16. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Hey!

    The issue with additive scene loading and light probes is not fixed yet but what you describe sounds like a different issue related to AssetBundles and somehow specific to standalone players? Could you provide more information about this? Which version are you using? A reproducible would be nice to have. Thanks!
     
  17. MikkoK-HS

    MikkoK-HS

    Joined:
    Sep 26, 2017
    Posts:
    53
    Hi

    I'm using Unity 5.6.1. The scene is loaded asynchronously from an asset bundle using the AssetbundleManager I got from the docs on asset bundles. The scene is in a bundle with a few other scenes and the scene assets are in separate bundles.

    Here's what it looks like in editor with asset bundle simulation mode on:
    https://www.dropbox.com/s/b01e80hgikjzjs6/editor.jpg?dl=0

    And here's the same scene in the standalone build:
    https://www.dropbox.com/s/1z8ifp3n1owkw7x/standalone.jpg?dl=0

    This is my lightprobe setup:
    https://www.dropbox.com/s/1z8ifp3n1owkw7x/standalone.jpg?dl=0

    Everything else is static and using lightmaps, the doors are the only thing that moves. If I remove the light probes in the editor it will look exactly the same as in the standalone build, so apparently it's not using the probes in the standalone. This is the first scene that is loaded after a menu scene with nothing in it but a UI. The same problem happens in all other scenes as well.
     
  18. MikkoK-HS

    MikkoK-HS

    Joined:
    Sep 26, 2017
    Posts:
    53
  19. sheenaeon

    sheenaeon

    Joined:
    May 3, 2013
    Posts:
    8
    any update about this issue?
     
  20. mowax74

    mowax74

    Joined:
    Mar 3, 2015
    Posts:
    97
    So, 3,5 years later, it still seems that the lighting team had no time to fix this!

    When i load a scene from asset bundle additively, light probes are not working at all. not when testing in the editor and not in the build.

    The scene is only lit by emissive materials. Most of the lighing is baked in lightmaps. When i load the scene separately in the editor, the non-static objects are lit by the light probes. When i load the scene in play mode additively from the asset bundles, all non-static objects are black (since they should only be lit from light probes). Unity 2020.1.6f1 here.

    EDIT: Ok, nevermind. Somehow the LightProbes.TetraHedralize () was removed from our code.
     
    Last edited: Sep 22, 2020
Thread Status:
Not open for further replies.