Search Unity

Baking lights feature goes uncontrolled. Why will I get such baking result?

Discussion in 'Global Illumination' started by UnityXP7, Aug 6, 2020.

  1. UnityXP7

    UnityXP7

    Joined:
    Aug 6, 2020
    Posts:
    4
    I'm trying to know more about baking lights feature so for the testing purposes I set random colors to my scene. So I started from this scene:


    Then I tried to bake lights:


    But why do I get so different result from my start point of view?

    All my cubes are static objects. They are all have this material:


    My light settings are:


    Camera settings:


    Why do I get so different result after baking? I expect absolutely the same output as it was before the baking process. If not then it's too hard to control the colors after baking.

    Unity 2020.1.1f1.
     
    Last edited: Aug 6, 2020
  2. UnityXP7

    UnityXP7

    Joined:
    Aug 6, 2020
    Posts:
    4
    If I add a point light:


    Then it gives me completely different view after the baking process:
     
  3. UnityXP7

    UnityXP7

    Joined:
    Aug 6, 2020
    Posts:
    4
    I think the problem is in shaders. If you use Mobile/Diffuse shader - it can't get the lights to itself from point lights so you will not see what the result you will have. However you can use the baking feature and then you can use your baked textures.
    Then I've found that Standart-shader and Mobile/Diffuse shaders show slightly different results from one baked texture.

    However, after the baking process all the lights have much more intensity value then in preview mode in editor.
     
  4. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    The biggest difference I see in your project is that everything is much more blurry after baking, because of a very low lightmap resolution. If you want to learn more about lightmapping, I recommend this as a starting point https://docs.unity3d.com/Manual/LightingOverview.html
     
  5. UnityXP7

    UnityXP7

    Joined:
    Aug 6, 2020
    Posts:
    4
    But what about different colors of the scenes before and after baking?
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792
    You have pink ambient color, which makes the sky throw pink light at your objects. Plus your directional light bounces around, which doesn't happen in realtime.
     
    Pema-Malling likes this.