Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Baked Lighting and Reflections Location?

Discussion in 'General Graphics' started by cthomas1970, Jan 17, 2019.

  1. cthomas1970

    cthomas1970

    Joined:
    Sep 12, 2017
    Posts:
    75
    Hey, my project uses this approach for its UI and Levels. It has a Scene, called BASE, and this is where I have my game manager, as well as all of its UI and so on. Its ALWAYS loaded.

    Into this, I ADDITIVELY load my levels. And when a level is complete, or restarted, I can remove it, and reload it. To wipe/refresh it. It all works well.

    Problem is this. If I BAKE out my lighting, and this in-turn also bakes my BAKED Reflection Probes. The LightingData file, is written to a Folder in my project called BASE. And the Probe .exr's are also written there. This means, I can ONLY bake lighting and reflections for one level at a time. And that Baked lighting and ReflProbes, are used for ANY level that I load on top of BASE.

    Now... am I missing something here? Does this mean, that at least for this project, I will have to just forget about using baked lighting, and stick 100% with CUSTOM reflection probes, to avoid lighting and reflections baked for level A, being used on level B,C,D,E and so on :/

    This seems like a realy obvious limitation / issue. But I have read the Docs, and I cant see any indication there, of how this would be over-ridden / worked around?

    Any advice most appreciated.
     
  2. cthomas1970

    cthomas1970

    Joined:
    Sep 12, 2017
    Posts:
    75
    OK, Ill answer my own question. Isnt it always the case, you ask a question on a forum, and then immediately find the answer, even though before that point, the penny had not dropped.

    So it looks like Unity will create a sub-folder for Light-Data and Refl maps, base on your first loaded scenes name. But this folder is not used, per-se to locate the data.

    So I load one of my levels, WITHOUT my BASE scene loaded, so it is the ONLY scene loaded and bake its lighting. Unity NOW creates a new folder based on the scenes name in its Folder, and bakes the lighting data to it. It then links the scene to these assets.

    Now you can load your BASE scene, and whatever other scenes ADDITIVELY, and each of these scenes will use their own baked data, as they are linked to it in their respective data folders.

    I have yet to test that this works correctly for the Reflection maps as well. I assume it does, the same names are used in each sub folder, but I guess the names do not matter so much, as they are made unique by being in different sub-folders of my scene folder.
     
    AshwinTheGammer likes this.