Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

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:
    523
    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:
    523
    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:
    523
    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?
     
    farahnajwa30 likes this.
  6. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    523
    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. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    523
    Of course I you have an weather cycle or day night cycle you can chance the Enviorment Lighting Source color by c# like this:
    Code (CSharp):
    1. RenderSettings.ambientLight = new Color(r, g, b, a);
     
  8. 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.
     
  9. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    523
    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
  10. MikeyJY

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    523
    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
  11. 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
  12. Gammabuffer

    Gammabuffer

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

    nitrox945

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

    kenossas

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

    MikeyJY

    Joined:
    Mar 2, 2018
    Posts:
    523
    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.
     
  16. RMB1100

    RMB1100

    Joined:
    Jan 8, 2021
    Posts:
    2
    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.
     
  17. 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.
     
  18. 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
unityunity