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.

Unity 5: Bake different objects in a scene with two different light settings

Discussion in 'Global Illumination' started by essimoon2, Mar 24, 2015.

  1. essimoon2

    essimoon2

    Joined:
    Nov 13, 2013
    Posts:
    195
    Hi,

    I wondered if it's possible to bake two sets of assets inside a scene with different light setups.
    In Unity 4 we used to do that using "Bake selected", but that seems to be gone.

    Is it still somehow possible to bake objects with different light setup in Unity 5?
     
  2. vegetablebread

    vegetablebread

    Joined:
    Dec 12, 2014
    Posts:
    1
    I am also having this problem. Did you find a work-around?
     
  3. govind007s

    govind007s

    Joined:
    Sep 9, 2014
    Posts:
    1
    I am also facing this problem.
     
  4. essimoon2

    essimoon2

    Joined:
    Nov 13, 2013
    Posts:
    195
    I'm currently trying a pretty annoying work-around:
    I manually unwrap the objects,
    place the unwrap inside second and third uv channel,
    place them in a seperate scene inside Unity and bake them with appropriate lighting,
    re-save the resulting lightmaps,
    and assign them to a self-made shader that reads uvs from the 3rd uv channel.

    Result: I have differently baked objects that can still use first uv channel for textures and second uv channel for a composite lightmap. Can change the shader if I want to change how the lightmaps blend.

    It's indeed pretty nasty but the best I came up with since the 'Bake selected' feature is no longer available.
     
  5. julienkay

    julienkay

    Joined:
    Nov 12, 2013
    Posts:
    161
    In theory that should be possible using the Culling Mask property of Unity's lights. You could put objects in your scenes to different layers, set the culling mask on each light appropriately and bake them.

    Unfortunately culling masks with lightmapping seems to be broken in Unity right now. At least it's (still) not working for me in 5.1.1f1

    Feel free to leave a vote for this bug in the issue tracker: http://issuetracker.unity3d.com/issues/cullingmask-lightmapping-ignores-lights-culling-mask

    Maybe a Unity dev can give us some information, whether this bug is being addressed at the moment?
     
    essimoon2 likes this.
  6. essimoon2

    essimoon2

    Joined:
    Nov 13, 2013
    Posts:
    195
    Afaik it never worked for baked lighting. Someone once said the culling masks are intended for realtime lighting only. :(
    Which doesn't change the fact that it would be an extremely useful feature. Gonna share its issue tracker to get it some more attention.
    Still I'd appreciate a dev statement on this or a possible workaround.
     
  7. essimoon2

    essimoon2

    Joined:
    Nov 13, 2013
    Posts:
    195
  8. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    999
    In the object panel you can apply different settings the the Advanced Parameters. I am able to fine tune things pretty well that way. Not having bake selected is devastating when you change one little piece of the scene and need to bake the entire thing. I would like to be able to use Baked GI selectively in a scene.