Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

LoadLevelAdditive and Beast lightmapping

Discussion in 'Editor & General Support' started by Nilore, Jun 6, 2011.

  1. Nilore

    Nilore

    Joined:
    Jul 3, 2010
    Posts:
    18
    The game I'm working on is pretty big; a large, open world for exploration. Because of this, we've started using LoadLevelAdditive to load in a chunk of the world that's set as its own scene when the player gets close enough to it, and then that scene has a bigger boundary box that causes the level to delete itself (using Destroy (GameObject); ) if the player gets too far away. I set up the script to do this relatively easily, but upon testing to make sure I could move back and forth between zones, I noticed a hiccup.

    See, each zone has its own set of lightmaps, baked with Beast. When the player enters an area, that areas lightmaps are thus loaded up. But when that scene deletes itself, the lightmaps aren't removed. Then, when the player re-enters that area, the lightmaps are then loaded -again-, doubling the number of maps on the index. After a third or fourth time, it exceeds the 256 limit.

    My question is: Is it possible to, for example, before destroying the objects, remove their lightmaps from the index?
     
  2. Nilore

    Nilore

    Joined:
    Jul 3, 2010
    Posts:
    18
    Bump.

    I really need to figure this out. I read elsewhere in the forums that it should be possible to just delete the loaded level. That would be true if it weren't for this lightmap issue.

    I can't seem to find any other references to a problem like this, where lightmaps get duplicated in the index while using a load/unload system with LoadLevelAdditive.

    Isn't there a way to wipe an object's or a group of objects' lightmaps from the index before they get destroyed during runtime?
     
  3. mrekuc

    mrekuc

    Joined:
    Apr 17, 2009
    Posts:
    116