Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Realtime directional lights not working with LWRP?

Discussion in 'Global Illumination' started by wojwen, Aug 26, 2018.

  1. wojwen

    wojwen

    Joined:
    Feb 13, 2018
    Posts:
    38
    I was testing LWRP in the newest Unity build and I think I found a bug. Here is a gif of what it looks like:

    There is this sphere in the middle of the scene where lighting works properly and everything outside of that area is covered with stripes. The wierd thing is that the sphere doesn't move with the camera as you can see on the gif.
    I manadged to fix the stripes by cranking up the bias of the directional light, but the shadows still look weird outside of that sphere. Also I don't think you are supposed to have the bias set so high to get rid of these artifacts.
    It would be great if someone could help me recreate this on another PC.
     
    Last edited: Aug 26, 2018
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Hello. I could not repro your issue on my machine using Unity 2018.2.2f1 with LWRP 3.0.0 installed. Could you please more information about the Unity build and LWRP package version you are using?
     
  3. wojwen

    wojwen

    Joined:
    Feb 13, 2018
    Posts:
    38
    This project was created using Unity 2018.2.5f1 and LWRP 3.0.0, but it also happens with previous versions of LWRP. In Unity 2018.1.9f1 the "sphere" seems to follow the camera (but the lighting artifacts are still there).
    If you still can't recreate this issue I could upload my project somwhere so you can check it out.
     
  4. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    If you could attach a small repro project that would be a big help.
     
  5. wojwen

    wojwen

    Joined:
    Feb 13, 2018
    Posts:
    38
  6. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Thanks to your repro scene I've managed to successfully reproduce the issue you were having and have forwarded it to our LWRP team. Seems that there is an issue with realtime shadowmaps which become especially apparent when using large meshes.

    You can follow the progress of this bug via this link (it might take some time for the link to become publicly available) - https://issuetracker.unity3d.com/product/unity/issues/guid/1076285/

    Thank you for bringing this issue to light!
     
  7. wojwen

    wojwen

    Joined:
    Feb 13, 2018
    Posts:
    38
    Thanks for reporting the issue!

    Just to be sure, did you experience the shadow cascades not following the camera or only the lighting artifacts (stripes)? I'm asking because these stripes appear in all versions of Unity while the issue with shadow cascades only in the newest one.

    EDIT: On the issue tracker page it says that it's fixed in 3.3.0 (that was quick). Unfortunately it's not available yet so I guess we have to wait.
     
    Last edited: Aug 30, 2018
  8. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    No worries. Yes, the shadow cascades did follow the camera, alongside with shadow acne artifacts.

    Also, regarding the issue: I have just received an update from the LWRP team who had informed me that the issue should be mostly fixed in LWRP package version 3.3.0. Keep in mind that this version is only available for Unity 2018.3.

    If you happen to run into shadow issues after upgrading to LWRP 3.3.0, try the following settings for your directional light:

    Screen Shot 2018-08-30 at 13.18.06.png

    In addition, you can also mitigate the issue by switching to Hard Shadows and by tweaking Shadow Distance parameters.
     
  9. wojwen

    wojwen

    Joined:
    Feb 13, 2018
    Posts:
    38
    Did you ever experience them not following the camera (with centre in the middle of the scene)? That's what happens to me in 2018.2.5f1.

    That's awesome, thanks for help! Do you know when 2018.3 beta might be available? The newest version I can download is 2018.2.
     
  10. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Yes, that issue occurs in LWRP package version 3.3.0. It is expected. One way to mitigate that issue for now is to tweak the bias settings.


    No worries! Regarding, the beta; I do not know the exact date just yet. Hopefully, it will be available some time in September.
     
  11. wojwen

    wojwen

    Joined:
    Feb 13, 2018
    Posts:
    38
    Tweaking the bias settings mitigates only the self shadowing (i think that's what it is), but doesn't help with the rest. Anyway, thanks for help and hopefully it will work in future releases.