Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Lighting looks darker on build

Discussion in 'General Graphics' started by aizuon, Mar 9, 2022.

  1. aizuon

    aizuon

    Joined:
    Jun 24, 2014
    Posts:
    7
    Hello. I am using 2021.2.14f with URP 12.1.5. I tune my lighting in the editor but standalone player produces noticeably darker lighting like so:

    upload_2022-3-9_15-45-40.png

    The scene contains 1 mixed directional light. Lightmaps are up to date on the build as well. Heres my lighting settings:

    upload_2022-3-9_15-48-33.png

    Does somebody know why would this happen? I initially thought it was because of lightmap compression but it's not. Settings->Player->Lightmap Encoding is also set to High Quality as with lighting settings. Please help.
     
    burningmime likes this.
  2. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    739
    Make sure to reimport your lightmaps if you recently changed the lightmap encoding
     
  3. aizuon

    aizuon

    Joined:
    Jun 24, 2014
    Posts:
    7
    Thanks, I already did a clean rebake since then(clear all + bake again) and that didnt fix it
     
    BrandyStarbrite likes this.
  4. NEMZAKI

    NEMZAKI

    Joined:
    Apr 29, 2022
    Posts:
    6
    Am having the same issue
    What’s fixed it was enabling Screen Space Ambient Occlusion
    Although the solution works, I still need other suggestions because SSAO can be too much for mobile
     
    PraveenBalu likes this.
  5. jeffomatic

    jeffomatic

    Joined:
    Jun 24, 2021
    Posts:
    15
    Elsewhere in this forum, it was suggested that disabling post-process shader stripping in URP global settings would solve the darkening effect. It didn't do it for us, but maybe you'll have better luck?
     
  6. hassanyawar

    hassanyawar

    Joined:
    Aug 27, 2015
    Posts:
    2
    I was also having the same issue. I was using URP and I migrated my project from Unity 2020.3 LTS to 2021.3 LTS and suddenly my builds were coming out with darker lighting.

    I just managed to fix this issue. In my universal renderer data, which is assigned to URP asset's renderer list I had Screen Space Ambient Occlusion added as a renderer feature. Now the thing is that it was disabled as I wasn't using it at all but somehow that was causing this issue in the build. The moment I removed it altogether from my renderer data and created build, the lights were fixed.

    I hope this helps someone.
     
  7. jeffomatic

    jeffomatic

    Joined:
    Jun 24, 2021
    Posts:
    15
    I can confirm that this change worked for us too. I posted a similar observation in the other thread but forgot to update this one.
     
  8. ejoflo

    ejoflo

    Joined:
    Sep 15, 2021
    Posts:
    43
    appreciate this solution! totally had my SSAO added but it was inactive, thus causing dark lighting in my build.
     
  9. yengNami

    yengNami

    Joined:
    Feb 14, 2021
    Posts:
    14
    Thank you for this. This is what solves my dark scene build too. when SSAO was removed from the renderer feature everything worked flawlessly.
     
    PraveenBalu likes this.
  10. PenProd

    PenProd

    Joined:
    Dec 17, 2022
    Posts:
    171
    I have the same problem, even though SSAO has not been added to my renderer:

    upload_2023-1-10_11-39-58.png

    So any other suggestions?
     
  11. survivorr9049

    survivorr9049

    Joined:
    Oct 1, 2021
    Posts:
    1
    if you don't have SSAO and it still appears try creating new renderer and assigning it instead of the old one
     
  12. wondermagic

    wondermagic

    Joined:
    Jul 14, 2017
    Posts:
    9
    I was experiencing this issue as well but I noticed that some of my scenes didn't have this problem. I realized that I had to use the lighting settings of the working scenes or create new lighting settings.

    Window -> Rendering -> Lighting to bring up the tab.

    The default settings worked for me. i.e Lighting became okay in builds.

    upload_2023-2-6_9-46-23.png
     
    Telhurin and Fimiam like this.
  13. Telhurin

    Telhurin

    Joined:
    Feb 8, 2015
    Posts:
    18
    Thank you kindly! This was blocking me from updating to 2021 for literally months.
     
    wondermagic likes this.
  14. TeddyGeorgeoff

    TeddyGeorgeoff

    Joined:
    Oct 21, 2012
    Posts:
    9
    Removing unused SSAO worked for me too, tyvm!
     
  15. RHSn

    RHSn

    Joined:
    Jan 27, 2023
    Posts:
    8
    Apparently it's not just disabled SSAO. For me it was caused by a disabled decal renderer! Looks like you shouldn't have any disabled components in the render pipeline asset!
     
  16. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    I also experience this issue, only without having disabled renderpipeline features. Adding/removing the SSAO feature also doesn't change anything.
    other workarounds are appreciated.

    Edit: It's triggered when the camera has PostProcessing enabled. Even with no volume or not effects in the scene, if it's enabled, the scene becomes darker.In my case, disabling PostFX is not a practical workaround as some effects are necessary.

    Edit 2: when i try to compensate the darkness by increasing gamma for example in the post effect, it just gets immensely darker again to the point where the image is almost black.

    Edit 3: interestingly it then stays that way (extremely dark) even when the postfx volume is deleted. Only disabling 'Post-Processing' on the camera helps. Edit4: But even then the image is still slightly darker, it's only fully normal if all post processing is disabled.
     
    Last edited: Jul 21, 2023
  17. OmarVector

    OmarVector

    Joined:
    Apr 18, 2018
    Posts:
    145
    Hey Hey,

    I had the same problem with Webgl build, and the idea of removing unused post processing data solved it, I had both Motion blur and panini projection added but disabled, removing them fixed the issue for me.

    Very weird.
     
  18. xeosD

    xeosD

    Joined:
    Apr 6, 2023
    Posts:
    16
    None of that helped me with my visually similar problem of things looking too dark, but

    DynamicGI.UpdateEnvironment();

    does. The intended purpose of this function ( https://docs.unity3d.com/ScriptReference/DynamicGI.UpdateEnvironment.html ) suggests that unity was not applying the the skybox or has an "invalid" cached result which is why my shadows are too dark. Maybe won't help anybody but since it's a single line fix I figured I would share.