Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Light Mapping Question - Individual objects/prefabs

Discussion in 'Editor & General Support' started by Aaron_M, Aug 12, 2014.

  1. Aaron_M

    Aaron_M

    Joined:
    Apr 14, 2014
    Posts:
    18
    I have many small room prefabs that each contain point lights. I want to lightmap each individual room. Every time I save it as a prefab and delete it from the scene and try to re-instantiate the room, the light mapping either disappears or is extremely jumbled depending on the location I instantiate it at. To be clear, I simply want to lightmap everything inside the individual room and do not care about the exterior. Any suggestions?

    Thanks in advance.
     
  2. Aaron_M

    Aaron_M

    Joined:
    Apr 14, 2014
    Posts:
    18
    To clarify further, is there a way I can lightmap a prefab in once scene and instantiate it in another with the lightmap still on it?
     
  3. Fabutan

    Fabutan

    Joined:
    Jul 3, 2012
    Posts:
    12
    Thats tricky because Lightmap assignment is handled on a per scene basis, but you could have a script on the prefab load the lightmap into the correct lightmap index of the current scene when the prefab is instanced.
     
  4. Aaron_M

    Aaron_M

    Joined:
    Apr 14, 2014
    Posts:
    18
    Would you mind elaborating Fabutan? I have several of these small rooms I randomly instantiate so hopefully your suggestion is not too expensive.
     
  5. Aaron_M

    Aaron_M

    Joined:
    Apr 14, 2014
    Posts:
    18
  6. Aaron_M

    Aaron_M

    Joined:
    Apr 14, 2014
    Posts:
    18
    Anyone?
     
  7. Aaron_M

    Aaron_M

    Joined:
    Apr 14, 2014
    Posts:
    18
    Is it possible to lightmap the prefab and simply create a material? I know this can be done in other programs but is it possible inside unity?
     
  8. Aaron_M

    Aaron_M

    Joined:
    Apr 14, 2014
    Posts:
    18