Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Trying to understand how to use Progressive Lightmapper with multi-scene support

Discussion in 'Global Illumination' started by mattnewport, Nov 28, 2017.

  1. mattnewport

    mattnewport

    Joined:
    Jan 29, 2016
    Posts:
    10
    I've seen some info on this scattered around the forums but I haven't been able to figure out if this is supposed to be fully supported in 2017.2 and if so how it's intended to work.

    Here's the scenario I'm trying to make work:

    My 'levels' consist of three scenes:
    • A 'base' scene containing a static environment (a single room) intended to be shared between different 'levels'.
    • A 'common' scene containing various GameObjects and associated components needed in every 'level'. This scene has no static geometry that needs to be baked.
    • A 'level' scene containing some additional static geometry that varies per level but is intended to be placed in the same base room from the 'base' scene along with a bunch of dynamic geometry and level-specific logic. I'm currently placing Light Probe Groups and Reflection Probes in this scene since they will depend on the static geometry in this scene as well as the static geometry from the 'base' scene.
    What I'd like to be able to achieve is to bake lighting for each 'level' and be able to keep all those light bakes around as separate sets of data to be loaded according to which 'level' scene is active.

    Currently I seem to almost but not quite be able to achieve this in 2017.2 by loading the three scenes in the editor in multi-scene mode and setting the 'level' scene to active and baking lighting. This creates a folder with the same name as the 'level' scene and stashes a bunch of baked lighting data in there. Unfortunately it also makes changes to the Lighting Asset references in the 'base' and 'common' scenes depending on which 'level' scene is active and deletes any other folders from previously baking other 'level' scenes. There doesn't appear to be any way to keep all the baked lighting for all the levels around at once and reuse the same 'base' and 'common' scenes with different 'level' scenes due to the light baking changing both the 'base' and 'common' .scene files as well as deleting any lighting data for other 'level' bakes than the currently active one.

    Is there any way to achieve what I want in 2017.2? If not, will a workflow like this be supported in future?

    Ideally I'd like to be able to go a step further and mix and match different combinations of 'base' and 'level' scenes and bake the lighting for each combination. This would allow me to easily support switching the room out for a level while getting proper baked lighting. This wouldn't work with the current system of storing the lighting data in a folder with the same name as the 'level' scene however even if the other issues were solved. Is this extended workflow something that will be supported in future (or is there a way to do it now that I'm not seeing?).
     
    WildStyle69 likes this.
  2. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    261
    Good question -- I'm also interested in understanding how this could work, would be great if a Unity person could respond and give some clarity here, thanks!
     
  3. Gizmoi

    Gizmoi

    Joined:
    Jan 9, 2013
    Posts:
    327
    I think I've understood your problem correctly, and what we've done is programmatically create scenes for each variant (base + level) and bake those as one, and then this is the scene we load and use (via asset bundles).
     
  4. mattnewport

    mattnewport

    Joined:
    Jan 29, 2016
    Posts:
    10
    l have considered workarounds involving duplicating scenes but the scenes are fairly large and I was hoping for a better / more efficient solution.