Search Unity

Enlighten starts up outside of the editor and turns the scene black

Discussion in 'Global Illumination' started by Innoraft, Jul 27, 2021.

  1. Innoraft

    Innoraft

    Joined:
    Dec 4, 2017
    Posts:
    3
    Hi!

    I've tried to fix this issue independently, but at this point I feel like I need to reach out for help. I have a game with 4 scenes in it so far, and they all light up fine in the editor (version 2021.1.7f1). I'm using URP, and I have the "Baked Global Illumination" setting unchecked in the Scene option under Window > Rendering > Lighting in all of the scenes.

    When I build it, the scenes are all lit up fine initially. But after a few scene changes, one scene in particular (a dark/evening one) suddenly goes black/completely dark, to the point where only the UI is visible.

    I've noticed that whenever this happens, the player log file shows "Setting up 8 worker threads for Enlighten." as the last message. I've tried importing to a new URP project, and most recently tried updating to the beta version to see if the problem goes away as I saw Enlighten support is being added back for URP. But this issue still happened.

    My understanding was that Enlighten is not supported in URP, but something is triggering it and I can't figure out what. I don't know why it's starting up. I'm wondering if there's something basic I've overlooked as I'm a beginner at unity, or if this is some sort of bug. Any help would be appreciated. Thank you!
     
  2. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Latest URP does support Enlighten, it was added here https://github.com/Unity-Technologies/Graphics/pull/3386 but since you are on 2021.1 you are likely using a version without it.
    The issue you are experiencing is likely unrelated to Enlighten - posting some screenshots can help diagnosing the issue.
     
    Innoraft likes this.
  3. Innoraft

    Innoraft

    Joined:
    Dec 4, 2017
    Posts:
    3
    Thank you for your reply!

    These screenshots show the issue:

    upload_2021-7-28_15-46-45.png

    The scene instantly goes dark 2-10 seconds after it gets loaded for a second time, except for the UI elements (just the test version of the UI :) )
    upload_2021-7-28_15-48-19.png

    The Player.log file shows this message whenever this happens:

    Setting up 8 worker threads for Enlighten.
    Thread -> id: 21c -> priority: 1
    Thread -> id: 9f0 -> priority: 1
    Thread -> id: dcec -> priority: 1
    Thread -> id: 97b0 -> priority: 1
    Thread -> id: a518 -> priority: 1
    Thread -> id: f148 -> priority: 1
    Thread -> id: 5a00 -> priority: 1
    Thread -> id: c980 -> priority: 1

    After this issue happens, any other scenes that get loaded after this one become black and white in a way:
    upload_2021-7-28_16-41-16.png upload_2021-7-28_16-41-52.png


    All of the lights in this scene are directional real-time lights, and the assets/map of this scene are all generated dynamically like the one before it. This one scene seems to trigger the problem. The main difference between this scene and the one before it is that this one has evening/night-time lighting.

    I'll work to use the version of URP you linked and try that. Thanks for your help!
     
  4. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Innoraft likes this.
  5. Innoraft

    Innoraft

    Joined:
    Dec 4, 2017
    Posts:
    3
    Thank you for your help and suggestions. I've unfortunately not been able to pin down the source of this problem.

    At first I had the lighting in the scene change, but the issue would come up. Having it appear after separating out the different lighting into two scenes was a surprise, and I'm still dealing with this issue now. It appears the only solution is to not have this scene get procedurally generated, even though the "day" version of the scene doesn't run into this issue.

    I tried upgrading again to the beta, and this time was able to get more control over Enlighten (I set all the scenes to real-time illumination), but the issue occurs, the only difference being Enlighten starts up as expected. When all the real-time GI is off, Enlighten still appears in the player.log right before this happens.

    I'm testing now with premade meshes for this level and I hope that'll fix the issue. It seems like it'll be potentially better to have the level generation be done outside of the game itself, but I was hoping to use it. I'm hoping that the new release might solve it, otherwise I'll keep looking for alternative solutions. Having the scene go black and white gave me an idea in itself so I guess there was something positive to come out of it :)

    Thanks again!