Search Unity

About lightmap loading

Discussion in 'Global Illumination' started by unitymatrix, Aug 15, 2017.

  1. unitymatrix

    unitymatrix

    Joined:
    Dec 29, 2009
    Posts:
    120
    Since Unity has saved the lightmap data into *.unity file,this is a scene file. when you load lightmap,then you need to load the scene. while SceneManager.LoadScene only works when the scene is added in build setting dialog or editor mode code.
    if I have lots of scenes and I need to add the scene to the scene list in build-setting menu. this is not very convienient. Especially when we build the scene objects into assetbundle and load then in runtime.
    i dont know why unity do such things that save lightmap data into unity scene file. is there any special consideration?
    Anyway how to solve the problem?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,741
    That's not true. The lightmap data are saved in separate file(s) in a subfolder of the same name as your scene. The scene file only contains references to those assets, nothing more.
     
  3. kemalakay

    kemalakay

    Unity Technologies

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

    You need to generate your lighting manually to store the lightmap data locally, otherwise it's located in the cache. So you simply need to disable Auto mode in Lighting window and press `Generate Lighting` button. Then you'll see that a new folder with Scene's name will be created and you'll see the lightmap data stored in that folder.
     
  4. unitymatrix

    unitymatrix

    Joined:
    Dec 29, 2009
    Posts:
    120
    yes. I did it.
    while when I export the assets to another project,the lighting map not showing
     
  5. unitymatrix

    unitymatrix

    Joined:
    Dec 29, 2009
    Posts:
    120
    any help?