Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Using Baked Lighting with Realtime lights

Discussion in 'Global Illumination' started by SuperUltraHyper, Aug 12, 2019.

  1. SuperUltraHyper

    SuperUltraHyper

    Joined:
    Sep 7, 2015
    Posts:
    86
    Overview:
    I have a large world that has a single sun source that is marked as real time. This light hits the entire world and is animated with a day / night cycle.

    I also have some small buildings with interiors. In addition to the sunlight they have small baked lights inside them to light them at night.

    The issue is that the baked light maps and the real time light maps seem to be linked. Thus creating HUGE black light maps for the entire world.

    Ideally, I want to disable the baked lightmaps or alter their resolution to a very small size on the exterior geo (99% of the surface area). This would only keep baked lights on the very small amount of interior geo.

    Can this be done?
     
    Last edited: Aug 12, 2019
  2. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    138
    Just don't mark the outside meshes with a lightmap static checkbox, then they won't be considered when baking. It seems that this will solve your issue.
     
  3. SuperUltraHyper

    SuperUltraHyper

    Joined:
    Sep 7, 2015
    Posts:
    86
    Sadly, it isn't that simple. Un-checking lightmap static also kills the realtime lightmap along with it's baked counterpart. :(
     
  4. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    138
    What version of unity are you using?

    Maybe what you are looking for is the setting in the mesh renderer, you can set the size in the lightmap to 0.



    And if this is what you need, i suggest using lightmap parameters asset for outside geometry, so that you won't need to go through all the meshes in the scene next time you need to change it, and instead change it in the asset which will already be assigned to the meshes you chose before.
     
    Last edited: Aug 12, 2019
  5. SuperUltraHyper

    SuperUltraHyper

    Joined:
    Sep 7, 2015
    Posts:
    86
    Sadly, it isn't that simple either. Setting "Scale in Lightmap" alters both real-time and baked lightmap sizes. Meaning a value of 0 removes baked AND real-time lightmaps :(
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,445
    What? No it doesn't. Maybe setting it to 0 has some hard coded side effects, but you could use really small values for everywhere except where you want the high quality baked lights to be.

    I'm assuming that by "real-time" you mean Enlighten's precomputed GI.
     
  7. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    138
    Realtime GI and baked GI have different settings for texels per unit. The setting in the mesh renderer controls the size in baked light maps.

    The settings in the lighting window look different in different versions of unity, and under some conditions you won't even see the Realtime GI texels per unit setting. This is why i asked what version of unity are you using.
     
  8. SuperUltraHyper

    SuperUltraHyper

    Joined:
    Sep 7, 2015
    Posts:
    86
    That was it. Thank you.
    Setting it to 0 removed both maps. Setting it to .01 made it the baked tiny and kept the realtime map unaltered, which is fine.

    Thanks for the help!
     
unityunity