Search Unity

Unlit part of objects are too dark

Discussion in 'General Graphics' started by MikeyJY, Apr 8, 2020.

  1. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    In the video below you will see if I adjust the strength of the shadows from Directional Light, the shadow that's projected on ground is modified, but the dark part of the cube is still very dark even is the strength of the shadows is 0.



    It is probable something in Window - Rendering - Lighting but I didn't find anything on web.
     
    adnanzmn97 and sarmanator3000 like this.
  2. toipi

    toipi

    Joined:
    Apr 7, 2020
    Posts:
    4
    Funny, someone else just posted about this too :D It should be your ambient light settings, see this thread for an explanation as to why.
     
    adnanzmn97 likes this.
  3. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    Thanks. I searched before posting, but I found threads about the shadows that are too dark(The shadows projected to ground)
     
  4. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    No solution in the thread
     
  5. sarmanator3000

    sarmanator3000

    Joined:
    May 18, 2020
    Posts:
    3
    Hey Mikey, did you manage to find a solution for this issue? I'm having the same problem, and can't find any real solutions on the net.
    I did find a semi-workaround, if you change the Environment Lightning source to Gradient instead of Skybox, and set the Sky color to white, it's much easier to see the objects (found the solution in this thread https://answers.unity.com/questions...h29L9brY6u128UwZ-nj_KSvzSXsuVjQYBiU4Afi5mr3Uk).

    However, the edges of objects on the sides that are not illuminated are not visible.
    Here are a few screenshots:
    Lightning source Skybox:
    upload_2020-5-24_12-53-38.png

    Lightning source Gradient:
    upload_2020-5-24_12-54-16.png


    I've also noticed that I don't have this problem in older versions of Unity (2018.4.19f1) so this might actually be a bug?
     
    kaushalJoshi and farahnajwa30 like this.
  6. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    Yes I find a solution:
    In the lightning tab (Window > Rendering > Lighting) In the enviorment tab I changed Source from skybox to color and I choose a color that fits to my enviorment(#4F4A4F) that's the code if you want to use it. And now I I create any mesh the unlit parts are not fully black:
    upload_2020-5-24_14-32-23.png

    As you can see the cube has shadows on it's own surface but not very storng shadows:
    I screen recorded to show you what does the change for me:
     
  7. sarmanator3000

    sarmanator3000

    Joined:
    May 18, 2020
    Posts:
    3
    Thanks for the detailed answer!
    I tried it your way, but I still have the same problem, and I think you might have it too, but I'm not sure.
    I'll post two clips, first from Unity 2019, second from 2018.

    Unity 2019:


    As you can see, the two sides that are in shadow are pitch black, and you can't see the divide between the two.

    Unity 2018:


    In old Unity, you can actually see the divide between the two cube sides, and their illumination slightly changes as you pan the view.


    My new Unity installation might have been faulty and that's why this issue occurs. I'll try to reinstall it and post an update if it helped or not.
    If not, I guess I'll just switch to the old Unity, as the differences between editors don't seem to be that large.
     
  8. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    Yea, maybe but that detail can be noticed at primitive meshes like cubes, etc. I have more complex meshed that the lighting delimitation is not so imaportant because the cube that has 6 surfaces and a 90 degrees angle between 2 of them the lighting of each surface should be sharp. but for a curved surface like a shpere or a mesh that has many triangles the lighting should be smooth like it is.

    I'm using unity 2020 and I have the same problem, but as I said it isn't cause any weird lighting behaviour in my project, but if you consider this a serious problem create a forum and use my thread as a reference.

    P.S: Are you using SRP(HDRP, LWRP, URP), or standard 3D project without any scriptable render pipeline?

    And if you create an thread please send me the URL of the forum because I want to know if it is a new 2019 lighting feature or just a lighting glitch
     
    Last edited: May 24, 2020
  9. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    And also try changing the shader from standard to another PBR, add normal maps, etc.
    There are a lot of lighting variables that may change a lot the render of objects
     
    Last edited: May 24, 2020
  10. sarmanator3000

    sarmanator3000

    Joined:
    May 18, 2020
    Posts:
    3
    I figured it out; in new Unity the lightning is not set to Auto Generate by default.
    Once you manually trigger Generate Lightning or turn on auto-generation, everything looks OK.

    So, if anyone else stumbles upon this problem, go to Window > Rendering > Lightning Settings, and then in the Scene tab click on Generate Lightning at the bottom of the window (or just check the checkbox next to Auto Generate).

    upload_2020-5-24_17-7-36.png

    @MikeyJY, not sure if this was your problem also? I'm a newcomer to the Unity scene, so this might have been obvious to people who spent more time with it.
     
    Last edited: May 24, 2020
  11. Gammabuffer

    Gammabuffer

    Joined:
    Jun 22, 2020
    Posts:
    1
    Thank you sarmanator3000, this fixes the issue...
    Cheers!..
     
    MAXGAMES030903 likes this.
  12. nitrox945

    nitrox945

    Joined:
    Jan 13, 2019
    Posts:
    4
    Thanks for the help sarmanator3000!
     
  13. kenossas

    kenossas

    Joined:
    Jan 24, 2021
    Posts:
    1
    Thanks! Helped me too.
     
  14. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    530
    I'm not quite sure, but I found another fix, this is quite complicate and I don't understand exactly how it works, I found a shader online that adds ambient light to existing lit objects and the transition between 2 sides of an object with the exact amount of light isn't seamless anymore.
     
  15. RMB1100

    RMB1100

    Joined:
    Jan 8, 2021
    Posts:
    3
    You can also try turning down the strength of the shadows (under Real Time Shadows in the main inspector). I found this helped a lot with my scene where trees looked very dark - Area Light shadows to zero, and Direction Light as required.
     
  16. norteconstrutorasp

    norteconstrutorasp

    Joined:
    Jan 12, 2022
    Posts:
    2
    thank you man, when i worked in editor, the shaders, and light were ok, but aways when i star the game simulation, its was all black, I set the configuration to auto generate as you did, and works very well.
     
  17. NinjaDanielYT

    NinjaDanielYT

    Joined:
    Jan 31, 2022
    Posts:
    1
    There is a solution to this: Every time I switched to another scene, the shadows are just pitch black. I recommend increasing the light bounces. If this doesn't work, try experimenting with the Intensity multiplier.
    Window - Rendering - Light - Environment - Environment Reflections - Bounces
    Screenshot 2022-02-07 205041.png
    Hope this helped
     
    Last edited: Feb 8, 2022
  18. Zapan15

    Zapan15

    Joined:
    Apr 11, 2011
    Posts:
    186
    We had also some issues with very dark shadows (dynamic levels, without baked lightmaps) and we solved it by calling
    Code (CSharp):
    1. DynamicGI.UpdateEnvironment();
    at some point (maybe after level load).
    https://docs.unity3d.com/ScriptReference/DynamicGI.UpdateEnvironment.html

    You could also play with
    Code (CSharp):
    1. DynamicGI.updateThreshold
    as it will trigger a recaluclation if there were enough changes for the lighting.

    https://docs.unity3d.com/ScriptReference/DynamicGI-updateThreshold.html
     
    Daloots and Barritico like this.
  19. Gosciu

    Gosciu

    Joined:
    Jan 2, 2016
    Posts:
    4
    This workaround also works for 2021.3.6f1 and URP.
    Only one invoke of this method, during starting application, is enough.

    When URP would be finished? Something with such an essential bug with real-time lightning shouldn't happen. Do you even open the engine before deploying the new version? xD