Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Room with enclose ceiling gets no indirect light in bake

Discussion in 'Global Illumination' started by PrimeDerektive, Oct 3, 2018.

  1. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    So I assembled a dungeon room, and when I bake the scene with a ceiling on the dungeon room, it blocks all GI/indirect light on in the room (but if i clear the bake data and just use realtime lighting, the GI shows up fine).

    Scene with no baked data:

    upload_2018-10-3_11-16-59.png

    As soon as I bake:


    upload_2018-10-3_11-17-47.png

    If I remove the ceiling and bake:

    upload_2018-10-3_11-18-49.png

    Removing the ceiling is not really an option obviously... I've tried a bunch of things: setting the ceiling to lightmapsettings with transparency enabled, setting them to not cast shadows or receive shadows, boosting indirect intensity, but nothing helps.

    What can I do?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Do you actually ever see the ceiling? I'm not sure why removing it is not an option.

    You could just untick lightmap static from the ceiling, but it might look a bit weird.
     
  3. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    you do, its a first person vr experience.
     
  4. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    How have you set up your sky/environment? The purple lighting may be coming from the sky, so putting a ceiling on the scene would block that light. When you clear the bake data and everything is rendered using realtime lighting, you may be lighting the scene using the global ambient probe, hence the purple is visible again.
     
  5. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    These are my ambient settings:

    upload_2018-10-3_11-46-20.png

    It's definitely where the purple is coming from... so how do i get the baked scene to have similar ambient color to the realtime?
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    The best workaround I can think of is :

    Instead of using environment lighting, use a directional light pointing down (with that purple-ish color), that is fully baked and has a pretty big soft shadow angle (like 30 or something, experiment).

    Then select the ceiling and turn cast shadows off in the mesh renderer. That is assuming you are using the progressive lightmapper, I'm not sure if enlighten supports turning off cast shadows.
     
  7. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Its not really too comparable, doesn't hit some side walls at all and its uniform... but am understanding correctly then that the ambient settings basically do not apply to baked environments if they're enclosed?
     
  8. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Yes. Think of it more like "sky light". If an area can't see the sky, it can't be lit from it, right?

    Other way to fake it would be to place big area lights (even multiple ones?) instead of directional and use the same trick as I mentioned. (although I'm not 100% sure that area lights respect the cast shadows flag)