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

5.4.3 lightmapping strange behavior

Discussion in 'General Graphics' started by samshosho, Oct 2, 2016.

  1. samshosho

    samshosho

    Joined:
    Apr 12, 2010
    Posts:
    370
    If I bake the scene with directional light shadows on, the scene becomes dark, I have to remove shadows from the directional light for it to look normal.
    In 5.4.0 it was fine, I had baked the same scene with directional light shadows on and after it was done, it looked good as it suppose to be and the directional light still had the shadows turned on.

    So I had my static objects baked, and none static receive real time shadows.
    I can't seem to be able to do that anymore!!!

    Any idea?
     
  2. PeteUnity3D

    PeteUnity3D

    Unity Technologies

    Joined:
    Jan 4, 2016
    Posts:
    68
    Unity 5.4.3?

    It sounds like this issue: ISSUE LINK

    It has been fixed but hasn't been put into a release yet. You can work around it for the moment by changing the line in UnityGlobalIllumination.cginc from:

    #define IMPROVED_BAKED_AND_REALTIME_SHADOW_MIXING 1

    to

    #define IMPROVED_BAKED_AND_REALTIME_SHADOW_MIXING 0
     
    Last edited: Oct 3, 2016
  3. samshosho

    samshosho

    Joined:
    Apr 12, 2010
    Posts:
    370
    sorry 5.4.03f
    Where is that file suppose to be found? (i searched my whole mac for it and can't find it!)
    Link provided gives error!
     
  4. PeteUnity3D

    PeteUnity3D

    Unity Technologies

    Joined:
    Jan 4, 2016
    Posts:
    68
    Corrected the link for you.

    The file can be found in:

    {unity install path}/Data/CGIncludes/Lighting.cginc on windows

    /Applications/Unity/Unity.app/Contents/CGIncludes/Lighting.cginc on Mac
     
  5. samshosho

    samshosho

    Joined:
    Apr 12, 2010
    Posts:
    370
    That didn't do anything, still in the scene after baking directional light is darkening the scene if it had the shows on.
    I tried to close Unity, reopen, rebake, nothing helped.

    corrected this;
    UnityGlobalIllumination.cginc from:

    #define IMPROVED_BAKED_AND_REALTIME_SHADOW_MIXING 1

    to

    #define IMPROVED_BAKED_AND_REALTIME_SHADOW_MIXING 0
     
  6. samshosho

    samshosho

    Joined:
    Apr 12, 2010
    Posts:
    370
  7. samshosho

    samshosho

    Joined:
    Apr 12, 2010
    Posts:
    370
    ah, today i loaded up another project , and it seems to work , so i think you have to open a another project first, then close it, open the project at hand, and the fix will be applied.

    So this workaround seems to be working.
     
  8. PeteUnity3D

    PeteUnity3D

    Unity Technologies

    Joined:
    Jan 4, 2016
    Posts:
    68
    Doing a Reimport on the whole project should also compile the shaders correctly if you don't want to switch projects.