Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Graphics Fantastic shadows not so fantastic (Unity 5.4.0F1 - release candidate!!)

Discussion in '5.4 Beta' started by Shushustorm, Jan 5, 2016.

  1. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    Case numbers:
    782331 (old case)
    805740 (new case)



    Hello everyone!
    After updating to 5.3.1, the shadows in my scenes have a terribly low resolution.
    I didn’t change the settings and I use "Fantastic" in Edit -> Project Settings -> Quality.

    Here are some screenshots of the different qualities when changing the settings:

    simple:
    01 simple.PNG

    good:
    02 good.PNG

    beautiful:
    03 beautiful.PNG

    fantastic:
    04 fantastic.PNG

    Any ideas? Anyone?
    Best wishes,
    Shu

    EDIT:
    Also, this appears when "fantastic" quality is chosen:
    screenshot.PNG
    This disappears when i uncheck "Receive Shadows" and changing the quality to lower settings will improve the fragments a bit.
     
    Last edited: Jul 16, 2016
  2. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    Due to a huge number of problems with 5.3.x, I downgraded to 5.2.2.
    Here are some screenshots of the shadows (fantastic quality) in 5.2.2:
    01.jpg
    02.jpg
    03.jpg
     
  3. TBone0xFF

    TBone0xFF

    Joined:
    Mar 13, 2015
    Posts:
    4
    After upgrading to 5.3.1, try restarting Unity. Shadows quality seems unresponsive just the first time after upgrade.
     
    Shushustorm likes this.
  4. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    @TBone0xFF
    Thanks for your reply! I will do that if Unity 5.3.x becomes stable at some point and I'm running into this again!
     
  5. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    Could somebody move this to the 5.4 beta forum? This problem is still present in 5.4.0B11.
     
  6. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    Seemed to be fixed around B25ish, but this is even happening now in the first release candidate!

    Case numbers:
    782331 (old case)
    805740 (new case)


    I just created a new project for some testing and this is what it looks like after switching to iOS:
    screenshot.jpg

    Quality is set to fantastic, right?
    I’m not sure what the green color in the "Quality Levels" indicates? Is this the recommendet setting?
    Because I can’t seem to be able to change that.

    Oh and some additional information:
    When I delete the project’s Library folder and restart the project, there will be a very weird shadow! (1-5 in the next screenshots attached)
    Then, when I restart the project, the quality will be fine again (6 in the screenshots).

    Here are the screenshots:
    screenshots2.jpg

    The problem with this workaround, though: When I delete the Library folder, Unity will switch back to Windows / OSX / Linux as build platforms.
    When I switch to iOS again afterwards, the shadow quality will be bad again. So I cannot escape this.

    Oh and unfortunately, restarting Unity without deleting the Library folder doesn't help either.
     
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Wrong forum, moved to beta (and added graphics tag). Point of beta forum is to post issues in that forum... :D
    But heck that's one hell of a ship stopper. Needs immediate love I think.
     
    Shushustorm likes this.
  8. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,591
    The green checkboxes represent the default quality level for a particular platform. In your case, Standalone is set to Fantastic and iOS to Simple.

    See the following link if you want to know how to switch the default quality level:
    https://docs.unity3d.com/Manual/class-QualitySettings.html
     
    theANMATOR2b and Shushustorm like this.
  9. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    @Peter77
    Thanks for pointing out!
    I didn't know about this! Is this new?
    While the shadow problem hasn't been solved by setting iOS's quality to fantastic, a different issue has been solved by doing so:
    The iOS normal map issue (
    http://forum.unity3d.com/threads/huge-normal-map-issues-f1.414635/
    ) was in fact related to low quality settings.
    I thought when clicking on the settings "what you see is what you get" on device also and I haven't had any normal map issues with doing so in previous versions of Unity.
    Anyway, normal map issue solved.
    Shadow issue persists.
    In fact, I get better shadows when using worse quality settings as you can see in the following images:

    iOS simple:
    ios simple.jpg

    Editor:
    editor.jpg

    iOS fantastic:
    ios fantastic_.jpg

    Also, kind of weird that the fantastic shadow on iOS is even worse than the bad fantastic shadow I am getting in the Editor.
     
    Last edited: Jul 17, 2016
  10. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hi Stefan,

    Thanks for your feedback. After investigation it appears that the root of the problem was in Unity 5.2 -> The shadow preview in this version of Unity was incorrectly using shadow cascades even if they are not supported on mobile for performance reason.
    Please see the doc for reference :
    - Unity 5.2 http://docs.unity3d.com/520/Documentation/Manual/DirLightShadows.html
    - Unity 5.4 http://docs.unity3d.com/540/Documentation/Manual/DirLightShadows.html
    look for : "Note: on mobile platforms, shadow cascades are not available for directional lights." in the "Shadow Cascades" section.
    This preview bug was fixed in unity 5.3.

    Shadow quality is heavily dependent on two settings :
    - shadow distance
    - number of shadow cascades
    Because on mobile shadow cascade is always forced to "none" and fantastic quality set the shadow distance to 150m -> we end up with really bad shadow in that case.
    A solution would be to set the shadow projection to "close fit" or to reduce the shadow distance (will save a lot of draw call, very valuable on mobile:))

    Clearly the UI is not helping here ! So i will keep that bug open so we add some feedback in that direction in the quality inspector.

    Finally a glimpse of the future : mobile hardware is evolving and it probably make sense to have shadow cascades on recent hardware, this is something we are working on :)

    Have a good day !

    Florent
     
  11. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Just as a tip: In one of our mobile projects we determined which object was most important for the shadow generation and changed the shadow distance accordingly. This led to a refinement in shadow quality when approaching important details and more granular shadows when not so important...
     
    Shushustorm likes this.
  12. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    @fguinier
    Hello Florent!

    If I understand your reasoning correctly, I have to disagree, though.
    In 5.2.2, even final iOS builds had much better shadow quality on the device (not just inside the editor) compared to what I get in the 5.4.0F1 editor and in 5.4.0F1 iOS builds.
    To me, it clearly seems to be a problem with the shadow's resolution. Even worse ( !! ) settings than fantastic look better in 5.4.0F1, which is weird as well.

    Please take a look at the screenshots of an iOS game that I released using Unity 5.2.2:

    https://itunes.apple.com/us/app/one-life/id1033007854?mt=8

    I made those screenshots on device.
    The shadow quality there is very nice.
    That project was also using just one directional light.

    If this really is a bug, which I'm pretty sure it is (in fact, I just cannot reproduce 5.2.2's shadow quality in 5.4.0F1's iOS editor and builds), I hope this can be fixed in time for 5.4.0's final build?
    It really has been rough developing with very buggy 5.x releases and as far as I can tell, 5.4.0F1 is pretty stable now, but I cannot work with shadows like these.

    @Metron
    Thank you for your reply!
    It's weird, though. In 5.2.2, I get very nice quality with shadow distance 150, which is the default fantastic setting. So basically, in 5.2.2 the shadows just work and look nice. I don't even need any optimizations there.

    EDIT:
    I cannot see any difference in the quality settings in 5.2.2.
    The shadow distance is 150, too. Cascades are set to four cascades and shadow projection is stable fit.

    Maybe in 5.2.2, shadow cascades weren't set to none for iOS?
    After reading Unity's documentation, I can say "Close fit" is not an option for me.
    Besides, it worked in 5.2.2, too. Why shouldn't it work now?
     
    Last edited: Jul 18, 2016
    theANMATOR2b likes this.
  13. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hi Shushustorm,

    Thanks for the follow up :)

    So i took the repro project from the bug case 805740 and compare Unity 5.2.5f1 and Unity 5.4.0f1 on an Ipad2 device here are the results :

    Unity 5.2.2f1
    Unity5.2.5f2-Ipad2-Shadows.png


    Unity 5.4.0f1 (same project upon automatic upgrade to 5.4)
    Unity5.4.0f1-Ipad2-Shadows.png

    Seems really comparable imho, so i'm probably not getting the point here?

    Would it be possible for you to provide a repro project (or repro steps) to pin point the trouble please.

    Thanks !

    Florent
     
    Shushustorm likes this.
  14. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    AFAIK fantastic also increases the shadow distance, which, without cascades, makes shadows look worse than any other setting.

    I don't think there's a bug here.
     
  15. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    @fguinier
    May I know what version of Xcode you have been using? I don't know if this changes anything, but just to be sure: I am using Xcode 7.3.
    It's weird.
    Your screenshots are not what I expected.
    When using 5.2.2, the quality I get is better than in your image for 5.2.2.
    And at the same time, when I use 5.4.0F1, the quality I get is worse than in your image for 5.4.0F1.
    This happens on iPhone 5S and iPad mini 2, but it is also shown like that in the editor.

    Could you try the following to reproduce?:

    1.: Open Unity 5.4.0F1
    2.: Start a new project
    3.: Create a cube
    4.: Duplicate the cube
    5.: Move duplicated cube above the original cube
    6.: Switch platform to iOS
    -> The shadow of the duplicated cube that is cast onto the original cube should be very bad
    (This is literally the way I can reproduce this issue every single time.)

    @AcidArrow
    I guess this would only make sense if there actually were shadow cascades being used in 5.2.2 and in 5.4.0F1 this is not the case anymore?
    Also, why would this happen exclusively on fantastic? If there are no shadow cascades, they aren't being used on lower quality settings either, right?
    This is very confusing.

    EDIT:
    Please, take a look:
    This is really simple and easily reproduced (well, at least on my machine):
    screenshots.jpg

    I did not change any shadow quality settings.
    I used completely new projects for all of the four screenshots.
    While the shadow quality for Windows / OSX / Linux in 5.4.0F1 seems a little bit better compared to 5.2.2 (probably due to anti aliasing in 5.4.0F1), the quality for iOS gets really bad. Also, please notice that besides the obviously bad shadow quality, there are weird shadow fragments the lower cube seems to be casting onto itself (on the left face of the cube, below the upper edge). In this scenario, they don't seem very prominent, but in other cases, those look really disturbing. (For this, take a look at the last images in my first post in this topic.)
     
    Last edited: Jul 19, 2016
    MrEsquire and AcidArrow like this.
  16. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Shadow distance is crucial to shadow quality. What's the shadow distance setting in "fantastic"? Is it higher than in other quality settings? Do the shadows improve if you reduce it?
     
    Shushustorm likes this.
  17. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    As I said, shadow distance is at 150. But that's the case in 5.2.2, too.
    And yes, shadow quality increases when I decrease the distance.
    But I shouldn't have to go that way in order to get the shadow quality like it used to be in 5.2.2, right?
    Because I don't actually want a smaller shadow distance.
     
    AcidArrow likes this.
  18. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hi Shushustorm,

    I'm abroad tomorrow and next week, however Tomas from QA will take a look into the repro and I will get on it when i'm back. We will go to the bottom of it ! :)

    Have a good day and thanks for the follow up !

    Florent
     
    Shushustorm likes this.
  19. ScottyB

    ScottyB

    Joined:
    Apr 4, 2011
    Posts:
    146
    fguinier mentioned that Unity fixed an Editor preview bug in 5.3 so doing a repo of 5.2 vs 5.4 only within the Editor isn't going to help Unity much here as the differences you are seeing within the Editor might just be caused by the fixing of that Editor bug.

    What they need is a screenshot of a 5.2 build set to Fantastic running on an actual iOS device versus a screenshot of a 5.4 build set to Fantastic running on an actual iOS device, which I know Unity will be grateful if you can provide.
     
    Last edited: Jul 20, 2016
    theANMATOR2b and Shushustorm like this.
  20. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    @fguinier
    Please also make sure to try the step by step instructions I provided in post #15 of this topic.
    It really should be easy like that to reproduce.

    @ScottyB
    I actually did take the iOS screenshots ("iOS simple" / "iOS fantastic") in post #9 of this topic on device.
     
  21. ScottyB

    ScottyB

    Joined:
    Apr 4, 2011
    Posts:
    146
    Yes, but that was only one 1 version of Unity, correct? If I'm following this thread correctly then the difference you showed between Simple and Fantastic on iOS is actually working as intended. On iOS there are no shadow cascades and because Fantastic has a super long shadow distance (150 by default), you will get worse looking shadows on Fantastic on iOS compared to Simple. That part is working as intended, its how shadows work.

    What Unity need is a screenshot of a 5.2 build set to Fantastic running on an actual iOS device versus a screenshot of a 5.4 build set to Fantastic running on an actual iOS device. Only this will help determine the actual state of this bug.
     
    Shushustorm likes this.
  22. Shushustorm

    Shushustorm

    Joined:
    Jan 6, 2014
    Posts:
    1,084
    @ScottyB
    No, as I mentioned, I have done builds with 5.2.2 and the shadows are much better than in 5.4.0F1 builds (on device).
    Just take a look at the game I made and linked in post #12.
    This game was made with 5.2.2 and the shadows look great.
    But now (in 5.4.0F1), it looks horrible. Both, in the editor and in builds.

    Screenshot from device, Unity 5.2.2, iOS build:
    screen640x640.jpeg

    Screenshot from device, Unity 5.4.0F1, iOS build:
    ios fantastic_.jpg

    EDIT:
    Alright, I just tried doing a new build (not the game that I linked) in 5.2.2 and take a look at the shadow quality, just in case.
    !! Turns out, I am not able to reproduce the awesome "One Life"'s shadow quality in 5.2.2 either. I used 5.2.2 for that game, though.

    I have no idea what's happening or why the shadows in "One Life" look so much better. I did not change any quality settings whatsoever. Shadow distance is 150, stable fit and everything just like in the new build.

    Personally, I am very confused and for the time being, I hereby give up.

    Thank you @ScottyB , though, for pointing out the whole build thing! I guess this issue is, to some extent, based on the editor not showing correct shadows as they will look like on device. And about the really good looking shadows, I have no idea how I achieved those. As I just stated, comparing the quality settings to the old project will not show me any differences.

    Also, here is another screenshot from "One Life" showing more shadow:
    screen480x480.jpeg
    I don't know. Looks better to me. Don't know why it's better, though.
     
    Last edited: Jul 21, 2016
  23. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146