Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Mixed mode lights aren't casting shadows of dynamic to static object (forward or deferred) (5.4.0f2)

Discussion in '5.4 Beta' started by plmx, Jul 21, 2016.

  1. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    I have an entirely indoor scene with a single point light (soft shadows) plus ambient light illuminating it. Within the scene there are some objects which don't move and are set to static (walls, floor, cupboards) and some objects which move and which are not set to static and which I call dynamic from now on (in particular, the hands the user waves around with his Vive controllers). This is a SteamVR Vive project.

    In lighting, both "Precomputed Realtime GI" and "Baked GI" are enabled. Linear color space. I am using a Windows PC, Core i7, GTX980Ti, HTC Vive.

    If I set the light to "realtime", all shadows (static and dynamic) are displayed properly by all objects, static to static, dynamic to dynamic, dynamic to static, and static to dynamic. As expected. Quality of the shadows is bad (jaggy, pixely) if I move away from the light source (this seems to be normal though?).

    If I set the light to "baked", only static shadows (between static objects) are displayed. All dynamic objects are completely ignored. As expected. Shadows look nice.

    If I set the light to "mixed", I see the static-to-static shadows from baking, and I get realtime dynamic-to-dynamic shadows, but there is no effect of dynamic objects on static objects. Not as expected: Dynamic objects should cast shadows on static objects in this mode (right?).

    This is the case in both forward and deferred rendering. It doesn't matter if Baking mode is set to auto or if I do it manually after each change. It also doesn't matter if I set "General GI Directional Mode" to "Non-Directional", "Directional", or "Directional Specular". The result is also independent of using light probes or not using light probes.

    This isn't listed in the release notes. I looked through the tracker and found three bugs but none seems to be directly about this problem. The closest seems to be this (there isn't enough information for me to decide if this is the same problem). Then there is this (which is about shadow mixing, though), as well as this (which seems to be about an editor bug and is only talking about deferred mode).

    Am I missing something? Is this a known bug? Can you add it as a bug in the tracker? Will this be addressed in 5.4? What is the recommended workaround?

    Thanks!
     
    Last edited: Jul 21, 2016
    shkar-noori likes this.
  2. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    Mixed lights don't work as expected since unity 5 release iirc. It has been mentioned many times before both on the forum and the bug tracker, but it seems that its a low priority issue :(
     
    plmx and MrEsquire like this.
  3. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    Thanks for your answer. I am quite new to Unity so I may have missed past discussions. I was looking for an "authoritative" issue or acknowledgement.

    Is there an official acknowledgement of this issue somewhere? Seem to me like (for VR development) this is a must-have feature. Would you consider one of the three bugs I linked to be the authoritative report of this issue? If not, can you link to the correct bug#?

    What would you recommend as a workaround?

    Thanks!
     
  4. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    I have no idea to tell you the truth. A couple of months ago some "fixes" about mixed lighting came out and they marked the main issue on the bug tracker as fixed even though that is clearly not the case. The last time i saw it mentioned at least on the forums is on this thread where one of the devs says

    So they are surely aware of the situation of the mixed lighting but its not a release stopper for them. It will get fixed eventually. For the time being you are probably limited to realtime gi baking (if you need to bake gi) or go to a full realtime solution without baking anything. If you are developing for VR you can also take a look at the Lab Renderer which was released by Valve (free and opensource) which is a custom renderer, light and shaders package that valve used in their own vr demos.
     
    plmx likes this.
  5. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    Interesting quote. If mixed lights are broken for the entire 5.X release, plus this quote, I probably shouldn't hold my breath.

    Yes, I am using The Lab Renderer now, and the shadows are much better. I just feel that replacing the render pipeline just for proper shadows is the wrong approach and this should be possible in Unity itself. That I have to use The Lab Renderer, plus the missing authoritative info on the status of mixed lights, is... worrisome.

    Thanks for your answer and your time.
     
    Last edited: Jul 22, 2016
    HaruLee932001 likes this.
  6. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    It's a known bug, but it has been delayed from 5.3 to 5.4, and apparently to 5.4+.