Search Unity

Mesh switching and baked lighting

Discussion in 'Global Illumination' started by josh_s_dev, Mar 16, 2016.

  1. josh_s_dev

    josh_s_dev

    Joined:
    Oct 20, 2015
    Posts:
    15
    I have tiled walls in my games. Each wall tile has 3 versions of the mesh to display, depending on how damaged it is. The undamaged version starts enabled and the others start disabled. When I bake my scene, only the enabled mesh gets baked lighting information. They're all static (never move) and they switch on and off. I'm wondering how I'm going to be able to get baked lighting data for all of them. I can't turn them all on because they're on top of each other which would clearly distort the lighting data.

    In pictures, I want this to be what happens at runtime:

    switches to

    etc.

    But I can only have one of them baked into the lightmap at a time using my current understanding of the system. Whichever of them starts enabled is the only one that has any baked lighting.

    Any ideas about how to force objects to be included in the light baking?

    Cross-post: http://answers.unity3d.com/questions/1155679/mesh-switching-and-baked-lighting.html
     
  2. josh_s_dev

    josh_s_dev

    Joined:
    Oct 20, 2015
    Posts:
    15
    Does the lack of response mean that what I'm looking for isn't possible? :oops:

    Seems like a pretty reasonable thing to expect the baked lighting to be able to handle, doesn't it?
     
  3. josh_s_dev

    josh_s_dev

    Joined:
    Oct 20, 2015
    Posts:
    15
    So... Apparently you can just leave them all turned on and they won't occlude each other? That seems to be working for me now.
     
  4. spryx

    spryx

    Joined:
    Jul 23, 2013
    Posts:
    557
    ...cant see your pics
     
  5. ChayChay

    ChayChay

    Joined:
    Sep 10, 2014
    Posts:
    12
    I have had similar issues and questions. Its good to know that you were able to bake them all, but I do feel like for some people that is not an option (especially if you want to turn an object on that has cast shadows on it but doesn't leave a spot when turned off). The only other solution that seems to be the new work around for enlighten is to bake things out in separate scenes and load in scenes rather than using prefabs or objects. Has anyone had any better solutions? Just curious if there is a more optimal way now that we can no longer bake individual objects in a scene.
     
  6. josh_s_dev

    josh_s_dev

    Joined:
    Oct 20, 2015
    Posts:
    15
    I hadn't even considered using multiple scenes. That sounds like a nightmare for designers.
     
    ChayChay likes this.