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. Dismiss Notice

Bug Realtime shadows missing in addressable scene with Mixed lighting settings (>1.16.13)

Discussion in 'Addressables' started by mike6502, Dec 22, 2020.

  1. mike6502

    mike6502

    Joined:
    Oct 5, 2016
    Posts:
    42
    Our game uses Mixed lighting, with baked lightmaps for static lights and objects, and a single Directional light set to "Mixed" for casting shadows from non-static objects. All of our scenes are loaded via Addressables, along with their lightmaps.

    Starting in Addressables release 1.16.13, realtime shadows for non-static objects are usually missing in all scenes. Sometimes realtime shadows appear on random objects, but it is not consistent. Baked lightmaps appear normal. The issue still occurs in 1.16.15.

    We've rolled back to Addressables 1.16.10, and the shadows are working again correctly.

    Perhaps related to this issue with scenes? https://forum.unity.com/threads/scriptablebuildpipeline-type-cache-issue.1020262/
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,796
  3. mike6502

    mike6502

    Joined:
    Oct 5, 2016
    Posts:
    42
    Thanks @TreyK-47, I'm curious if anyone else is seeing the issue. (I'm not able to create a test project for filing a bug report at the moment.)
     
  4. LilMako17

    LilMako17

    Joined:
    Apr 10, 2019
    Posts:
    43
    My project uses the same setup. It loads successfully using addressables v1.16.15, and renders Unity shadows/lightmaps (I upgraded from v1.16.7, worked fine on that version too) (ios and android). The loading code loads scenes in single mode (not additive), and uses manual scene activation. Have you checked your quality settings shadow distance? That could affect shadows not appearing if the value is wrong. I set QualitySettings.shadowDistance at runtime after every scene load, not sure if that's affecting anything.
     
  5. mike6502

    mike6502

    Joined:
    Oct 5, 2016
    Posts:
    42
    Thanks @LilMako17. I also thought something might be fishy with the Shadow Distance settings, but the value is the same (20) when I use 1.16.15 as well as 1.16.10. The realtime shadows are there in 1.16.10, but not in 1.16.15. 100% repro for me on Mac, iOS, and Android. I suppose I could test if the value was stomped by something in 1.16.15, which would be weird if so.

    I'm glad you mentioned that you load your scenes Single. Mine are loaded Additive, with activateOnLoad default "true". I have a "main" scene with a game manager and UI that stays loaded, and it loads and unloads levels as needed. There is only one level loaded at any one time. There's a known issue in Unity that you need to regenerate Light Probes after loading scene in additive mode, and I do that, but AFAIK, that's unrelated to realtime shadows.
     
  6. pfdaniel

    pfdaniel

    Joined:
    May 3, 2020
    Posts:
    14
    Hey @mike6502 we are running into a similar issue, did you ever find a solution?
     
  7. mike6502

    mike6502

    Joined:
    Oct 5, 2016
    Posts:
    42
    I got lucky and the problem resolved itself after either an Addressables update or a Unity update. I'm afraid that I don't recall which update resolved the issue. I don't see the problem in Unity 2020.3.30f1 with Addressables 1.19.19.

    I'll note that I was not able to load scenes reliably until I changed the Internal Asset Naming Mode setting from Dynamic to Full Path. I have all of our scenes in their own addressable group, and this is the only group where I needed to change that setting.
     
  8. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
  9. mike6502

    mike6502

    Joined:
    Oct 5, 2016
    Posts:
    42
    Thanks for the info @pillakirsten. My project has Shader Stripping set to Automatic, and as I mentioned, the issue resolved itself at some point. I'll monitor this setting if the problem appears again.