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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Baked and Real-time light creating huge GI differences

Discussion in 'Global Illumination' started by barrydineen, Aug 10, 2016.

  1. barrydineen

    barrydineen

    Joined:
    Jan 5, 2016
    Posts:
    9
    I'm fairly new to GI in Unity and have been testing settings and reading everything I can find to understand it better. However I have a couple of issues that I can't seem to find an exact answer for.

    The main issue is how direct lighting is treated in a baked GI solution.

    The Scene is really simple with a mid grey material applied to everything except the glass and the mesh balustrade. It has one direct light for the sun and a default sky.box for ambient light.

    First test is with a real-time direct light and baked GI:
    GlassOn_SunRealtime.jpg

    This created much darker shadows than expected. The glass material is completely transparent and I expected to have much lighter shadows and some ambient light from the sky. I turned off the glass and built it again to test:
    GlassOff_SunRealtime.jpg

    This result is much closer to what I was expecting with the glass on. Does anyone know why i'm not getting any ambient light with the glass turned on when the direct light is set to real-time?

    Next I set the direct light to baked and turned the glass back on:
    GlassOn_SunBaked.jpg

    This was much better as I am getting lighter shadows like the earlier version without the glass but I am not getting any of the blue ambient light coming through the glass. Also the shadows from the mesh balustrade have dramatically changed their scaling.

    To complete the test I turned off the glass again and left the direct light set to baked.
    GlassOff_SunBaked.jpg

    Again I get the blue ambient light that I was expecting but the mesh shadows are still at the wrong scale.

    Basically, based on everything i have read/watched, I was expecting these 4 conditions to give a pretty similar result and don't really understand the differences.

    Any ideas?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,024
    Don't have the glass as lightmap static.

    Or create a new lightmap parameters, set it to the glass object and tick "is transparent" in the lightmap parameters.
     
  3. barrydineen

    barrydineen

    Joined:
    Jan 5, 2016
    Posts:
    9
    Legend - turning off static does the trick. It still don't understand exactly why the previous versions end up the way they do but who cares - it does what I need it to! Thanks so much for the practically immediate response.

    GlassOn_SunBaked_noStatic.jpg
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,024
    Because marking the glass as lightmap static and without the "Is transparent", makes the glass appear as non-transparent to the GI (indirect) engine. The direct light knows it's transparent though, so that goes through.

    Unmarking from lightmap static tells the GI engine to assume there is nothing there and let all light through, which is more or less what you want from glass.