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. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Lighting data getting cleared in last pass

Discussion in 'Global Illumination' started by MvdLaar, Apr 29, 2016.

  1. MvdLaar

    MvdLaar

    Joined:
    Dec 27, 2012
    Posts:
    21
    Hi,

    Although it's probably not an entirely accurate title, something along those lines is happening when I bake my lighting.



    I have a simple terrain, a dynamic object and a couple of static ones. Nothing to worry about there (although, terrain, well...).

    It's probably not the last pass per se as much as it is loading the baked data, but something is making my scene go from "nice" to "what". My light is set on the doomed Mixed mode now, but I also have the same issue with baked lighting - everything seems fine during the bake, then screws up in the last few minutes.

    If I change an object in the scene, shadows return and everything seems to be good again, until it finishes baking.

    Has anyone experienced this?

    Thanks in advance!
     
  2. MvdLaar

    MvdLaar

    Joined:
    Dec 27, 2012
    Posts:
    21
    I found the solution, for those looking at the same problem: assuming the light is on mixed, giving realtime shadows, means that the baked surfaces are not receiving the realtime shadows. In other words, all objects except for the dynamic one are not getting any shadow info, and neither are the lightprobes.
     
    jonfinlay likes this.
  3. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hi, after looking at your screenshots and what you wrote, I believe I am having exactly the same problem as you. But I didn't entirely understand how to fix this. I have trees (set to static) which shadows cover most of the terrain like in your shot as well, but after baking all shadows become virtually invisible. Thanks.
     
  4. MvdLaar

    MvdLaar

    Joined:
    Dec 27, 2012
    Posts:
    21
    Hey! I believe it's because realtime shadows are not cast onto static objects in deferred rendering mode. My light was on mixed, which is not working in Unity, meaning that none of the shadows were actually cast onto the static objects.

    So it's probably that your light is set on Mixed Mode. Put it on Realtime and you'll have your shadows again - as Unity explains themselves, just use realtime for now, until they have proper lighting.
     
  5. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Thanks for your reply. After a fair few hours experimenting, I believe that it works if when you leave the skybox as the default. Once I changed it, even after reverting it back after, the mixed lighting didn't work. I started a new project, left the skybox as it was and it appears to work fine now. But I'm not at all an expert in this field, so I may be mistaken. Thanks for your response any way.
     
  6. MvdLaar

    MvdLaar

    Joined:
    Dec 27, 2012
    Posts:
    21
    Be wary that the mixed lighting mode is officially broken, so you might run into trouble later down the line. Check this topic out for more information: http://forum.unity3d.com/threads/when-is-mixed-mode-lighting-going-to-be-fixed.332250/

    Good luck!
     
    jonfinlay likes this.
  7. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Thanks! I'll use the real-time light. I read that the mixed light has problems, didn't realise it was completely broken! Makes you wonder why they don't just remove the option from the drop-down menu :)