Search Unity

Very low quality on tealtime shadows.

Discussion in 'Global Illumination' started by AndersMalmgren, Sep 12, 2016.

  1. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Hi, I must be doing something wrong because the quality of our real time shadows are really, really low, here is a video demonstrating it



    My light config
    light.png

    Bake config
    bake-settings.png

    What am i doing wrong?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    I don't think there's a lot you can do actually. Switching to spotlight generally looks better.
     
  3. Buhlaine

    Buhlaine

    Community Manager

    Joined:
    Feb 5, 2016
    Posts:
    348
    What does your current shadow quality settings look like under Edit->Project Settings-> Quality? Depending on your project and what you can spare, upping your shadow cascade and resolution might help.

    If you haven't taken a peek at our documentation for Directional Lighting you can see it here. :rolleyes:
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    I don't think cascades do anything for point lights though? (I could be mistaken)
     
    Buhlaine likes this.
  5. Buhlaine

    Buhlaine

    Community Manager

    Joined:
    Feb 5, 2016
    Posts:
    348
    Ooops. You're right, thought we were looking at directionals. Hadn't had my coffee yet.....
     
    AcidArrow likes this.
  6. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Thanks for getting backs guys,

    The projects setting is at Medium, but the light in question has Very high as you can see. Changing project to very high does not seem to change anything for this particular light.

    This is an indoor map so we dont have a directional, actually we use Mixed mode because this is a VR game and baked shadows are needed to reach constant 90 fps. But in this mixed mode its only Directional light that throws shadow from dynamic objects (bug?) so we have added some dynamic lights to keep the FPS high but add some shadows where they create a good atmosphere, like in this corridor when opening the door it casts a shadow out in the corridor. But the effect is totally destroyed by the ultra low resolution of the shadow, it must be possible to get it better? Btw, changing from medium res to high to very high does very little to the perceived resolution.
     
  7. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    This map is actually based on the demo scene included in the asset this is built on, I noticed that the author have lowered the realtime resultion, can this effect realtime shadows? The default is 2 and he uses 0.25

    realtime_gi.png
     
  8. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Realtime GI resolution doesn't affect the realtime shadowmap resolution.
     
  9. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Thanks for reply,
    So I am not doing anything wrong here? I cant get better quality than this (Very high and soft pointlight)?

    very-high.png
     
  10. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    Hi Anders,

    In my experience there is nothing you can do (at least with "Stock Unity"). Realtime point and spotlight shadows in Unity simply look that way (spotlight shadows being the slightly better variant, as AcidArrow has pointed out), even with "Fantastic" and "very high" settings. Shadow cascades, by the way, only work for directional lights. And yes, mixed mode point and spot lights ARE broken with regards to shadows.

    The only way to get really good (as in smooth, non-blocky, non-saw-tooth) shadows is to go baked, which (obviously) means losing all dynamic interaction. I would LOVE to be proven wrong on this, by the way, but nothing I've read or tried myself with stock Unity options has improved the shadows beyond the point you've shown in your video (which looks exactly like the shadows in my own Vive project).

    One alternative: If you want to try things away from stock Unity, you can use the "Shadow Softener" asset from the store. This doesn't work on point lights, but on spot lights the shadows will get softer. This comes with overhead as the shader needs to be changed. This only smoothes shadows after-the-fact, i.e. the shadow engine stays the same.

    There is a graphics alpha out which contains what seems to be a rather large change to the lighting UI and is supposed to fix mixed lights shadows. From the comments I assume that the shadows themselves are fixed but the quality stays the same. You can check it yourself, see the Graphics subsection of the beta forum.

    -plmx
     
  11. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    hey there.

    Thanks, yeah we will have to look into third party solutions then, must work well with SteamVR/OpenVR@90fps on a GTX 970 though. The asset you pointed out does support point lights it seems, "Softens Directional, Spot, and Pointshadows!".

    We looked into the lab renderer too, their realtime shadows look alot better, but the limitation on number of lights in the scene is hard to overcome.

    Nice, have missed that they are working on this, right now I have some lights set to realtime just to create some shadows in our baked scene (because of the mixed mode bug). Enlighten realtime does not work with VR, only a few lights that are seen by camera will start reprojection (< 90fps). So even with good oclussion culling its hard to get realime only
     
  12. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    308
    Hi,

    yeah, I'm targeting the same setup. Despite the fact that it's high-end hardware it's not easy to achieve good results. :(

    The asset I was talking about does "support" point lights, but it can't really do much to soften them, they are so blocky to begin with. They've admitted as much via email.

    Yes, the The Lab Renderer is truly amazing. Its realtime spot and point shadows "just work" exactly as one would expect them to (and as I would have expected Unity's, to be honest...). It is another beast on top, though, replaces the entire shadow pipeline, and parts of the lighting stuff, and as you said is limited in the number of lights. However, it is a very good choice within that limit.

    I hope Unity will someday integrate The Lab Renderer's shadows...

    -plmx
     
    Last edited: Sep 15, 2016
  13. ciprian_facerig

    ciprian_facerig

    Joined:
    Mar 25, 2015
    Posts:
    34
    Slight update for anyone looking at this. It seems world scale matters a lot for shadow quality. I just scaled all my objects to 7x and now my point light pixelated shadows look much smoother. It's not perfect but it is better. This is on 5.6.0
     
    shaaaaark likes this.
  14. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Always set scale of the your scene based on a unity Cube size. A cube has 1*1 meter scale
     
  15. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I quickly tried the new distance shadowmaks in 5.6 or later. In this mode everything is low res within the Realtime shadow distance, pretty useless to me :)
     
  16. twin_digital

    twin_digital

    Joined:
    Jul 26, 2018
    Posts:
    6
    i may dig some realy old thread but "Quality settings > shadow projection > close fit" just fixed my lowres realtime shadows problem
     
    shaaaaark likes this.
  17. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Can confirm that close fit fixed this - thank you very much!
     
  18. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Unity has come pretty far since I recorded that video

    unknown-8-1.png
     
  19. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    I'm guessing that a lot of this old information/best practice will become obsolete with HDRP and LWRP - which if you are starting a new product you should be starting with now.
     
  20. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I do not see a difference on point light quality with Close or stable fit

    Stable
    upload_2019-4-18_12-6-41.png

    Close
    upload_2019-4-18_12-6-55.png
     
  21. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Point lights are so bad in Unity that they sometimes look like you are trying to achive a blocky minecraft look or cartoonish. haha. Clash pretty bad with our realstic look take

    upload_2019-4-18_12-50-36.png
     
  22. KarolisO

    KarolisO

    Joined:
    Feb 2, 2014
    Posts:
    30
    If you want soft point light shadows, you'll need something like NGSS. Unitys built-in pipeline does not have a comparable solution. Do note that soft local light shadows are more expensive to render and might not be a good idea for a VR project.
     
    Last edited: Apr 19, 2019
  23. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Unity has come along way regarding enlighten and mixed mode lighting. But it havent happened alot to real time shadows :D This is with a low bias setting

     
    Rich_A likes this.
  24. OLGV

    OLGV

    Joined:
    Oct 4, 2012
    Posts:
    57
    What is the Project Settings > Quality > Shadow Projection type you are using?
    I experienced much better quality using 'Close Fit', rather than the default 'Stable Fit'
     
  25. ArinFaraj

    ArinFaraj

    Joined:
    Jan 5, 2014
    Posts:
    13
    i always loved how intuitive unity is but these things make me question my choices for using unity i even used new render pipelines and nothing still the worst realtime shadow ive seen in any games so far someone convinced me to use unreal and man the unreal shadows were like 100 times better but i still cant get my head around how to do stuff with unreal i will probably stick with unity for now but if this continues for the coming years i will switch to unreal even tho i dont like it
     
    maxizrin likes this.
  26. maxizrin

    maxizrin

    Joined:
    Apr 13, 2015
    Posts:
    20
    If you don't need anything unusual, like a HUD for a VR sim, that only shows in one eye, then you might consider switching to Unigine.

    It's also free for companies making under a certain amount of revenue,
    and the workflow is nearly identical, with components written in C# attached to objects in the scene.

    It's so similar in fact, you can probably import your code from Unity, and it will work with only a few tweaks (Node instead of Transform & GameObject).

    The UI system is currently a bit broken in Unigine, no editor, or anything, but you can build and import UI using 3rd party apps, as XML files.

    Again, if you need something fancy, no go, the UI in Unigine is purely 2D, unlike in Unity where it's 3D elements, allowing for some crazy things.

    Bottom line:

    Unigine is more performant overall, built on C++, with a better light engine that bakes lights in minutes, with far better results than Unity.

    Unity is the best for the versatility it offers, I don't have a choice but make some projects with it simply because other engines don't permit the things I need done.
     
  27. StormMuller

    StormMuller

    Joined:
    Jun 2, 2015
    Posts:
    17
    Yea this has worked for me too