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

Baking lighting in a room with a dynamic door.

Discussion in 'Global Illumination' started by Korno, Jun 26, 2015.

  1. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    Hey, I have a little issue and was wondering how I could work around it.

    I am baking lights in rooms in my level and the walls and floors are blocking the lights perfectly. However My door is a dynamic object that opens and closes.

    The problem I am having is when I am baking the lights, the baking process ignores the doors as they are not static and the next room receives lighting in its lightmap through the hole where to door is.


    Is it possible to use set dyanamic objects to block light during the baking process? I know this means when they move the lighting wont be updated, but that is not a concern in this situation as the door will move just a bit.

    All my doors start closed.
     
  2. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    This is easy to solve with the old 4.x Beast documentation, but the new lighting docs are all over the place (I couldn't find you a quick link).

    Basically, set your doors to Lightmap Static, and their lightmap scale to 0. They'll be seen the the lightmapper, but won't be assigned to lightmaps.
     
    Crazydadz and Korno like this.
  3. Crazydadz

    Crazydadz

    Joined:
    Mar 29, 2012
    Posts:
    50
    @Pix10 Big Thanks for the tip!
     
  4. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    I did have the same trouble, and i made the doors lightmap static, occluder static, occludee static and finally reflection probe static for the sake of nice reflections in the rooms on both sides of the door.
    Somehow it gave me the results i wanted but i have no idea what im doing anyways.
     
  5. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    625
    Your door is dynamic, if you set it to static you can't move it at runtime.
    Occluder static means that after baking occlusion culling, even when the door is open (however you managed to move a static object at runtime...) objects behind the spot where the door was, will disappear.
    Occludee static means that the door itself will disappear when any other occluder is between the camera and the initial position of the door.
    Reflection probe static means that the door will get rendered by reflection probes.
    And finally lightmap statoc means that it is visible to the lightmap-renderer. (not 100% sure about the last one, but everything else can be found on the docs)
     
    GoldPark likes this.
  6. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,864
    Oh, hello the man from the future, you are 5 years late though.
     
    John_Leorid likes this.
  7. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    625
    It's never too late for some clarification. I was actually searching for (LOD &) Lightning myself and stumbled onto this post.
    So if anyone else comes across, maybe this information is somewhat helpful ^^
     
    Melanzue, schala and GoldPark like this.
  8. DAWNY-1

    DAWNY-1

    Joined:
    Nov 8, 2017
    Posts:
    1
    changing camera view from one camera position to another with a click of a button . need help to help to set up a visual shopping mall