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

[Next-Gen Soft-Shadows 2] Sophisticated dynamic penumbra Shadows for Unity

Discussion in 'Assets and Asset Store' started by tatoforever, Nov 8, 2016.

?

Would you like to buy this on the Asset Store? If so, how much?

Poll closed Jul 10, 2017.
  1. I like it to be priced between 20 to 10$.

    56.8%
  2. I like it to be priced between 10 to 5$.

    39.0%
  3. Zero $, I'm not interested, I love my Unity's default aliased, pixelated horrid-shadows.

    4.2%
  1. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi @tatoforever

    it seems, the screen space reflections disappeared after installing NGSS to 2019.2f1 and Post-Processing 2.1.7
    I just re-installed the editor and removed NGSS and they showed up.
    Could you please check if this is an issue and provide a fix because we need reflections !

    EDIT : when you get back from the vacation of course :)

    EDIT 2 : i think there might be an issue with Post-Processing because i am having issues properly toggle on/off Reflections even though NGSS is not installed - but please let me know if you think there is something related to NGSS.

    Thank You !
     
    Last edited: Aug 14, 2019
    tatoforever likes this.
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    I'm back folks! Will get on the desk later today and answers your questions! :)
     
  3. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @Cactus_on_Fire,
    Make sure your last instanced light is the one with FrustumShadows otherwise Unity will pickup the wrong one and FrustumShadows will be wrongly projected from it. Currently Frustum shadows only work with one dir light (the last indexed one) and one local light.
     
  4. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @Vagabond_,
    No worries, if you still have trouble with poke me out with a repro project on the support email and I'll investigate on my side too.
     
    Vagabond_ likes this.
  5. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Another issue is that when I open an old scene, the same visual issue occurs where everything is either completely black or white. It doesn't go away until I add a NGSS script and remove the script back. Got any idea how to solve this?

    Also is there a way to force a larger penumbra by editing the settings maybe? It would probably be noisy but I'd like to see how it looks.
     
  6. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @Cactus_on_Fire,
    What do you mean by the same visual? You got any video showing the issue?
    For larger penumbras you can edit NGSS components and force a larger value. Use it at your own risk (performance, noise, etc issues). :)
     
  7. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    I couldn't reproduce the issue, seems to have gone for now.

    btw have you tried utilizing the denoiser to create other image effects? I always wondered how a denoised transparency or depth of field in unity would work.
     
  8. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    The denoiser can denoise pretty much any color based image. Not just shadows. Is a sort of low pass filter.
     
  9. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    I switched to project and reopened and got the visual issue I was talking about. The scene starts out like this where everything looks black. When I add frustum shadows to the camera nothing happened so I removed the script, then I added NGSS directional shadows the light which turned it back to normal.

    ngss.jpg
     
  10. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @Cactus_on_Fire
    That is normal and it happens only in Editor, because the shaders still on memory and the frustum shadows still being feed as Enabled but there's no rendering of frustumshadows thus the frustum shadows texture is null = black pixels. You can avoid it by leaving the FrustumShadows in your camera at all times. In a build you shouldn't see this behavior because once the FrustumShadows dissapears from memory no null texture is sampled.
     
  11. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    There is another minor issue with scene view where no lights or shadows are initially rendered when you open a scene - however, that's very easy to fix by clicking the light and effect buttons on and off in the top left corner of scene view.

    upload_2019-8-16_12-7-4.png
     
    tatoforever likes this.
  12. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @bac9-flcl,
    That's probably what @Cactus_on_Fire was having though I had the one I posted so either one of those is the Editor acting funny. :cool:
    But whatever you find that you think is a NGSS issue/bug, please post a detailed repro, I can fix it instantly (if is NGSS related).
     
  13. BenWilles

    BenWilles

    Joined:
    Mar 9, 2018
    Posts:
    41
    Hi,
    i'm looking for a replacement of Unitys Shadow System and this looks so good. But we develop for mobile.
    Are there chances this will work well on modern iOS Devices? Is there any comparison of performance to Unitys Shadows?
     
  14. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @benjaminthorn,
    Hi, on mobile if you are looking for faster shadows keep using Unity at the minimum settings. If you are looking for prettier shadows and wants to sacrifice some bandwith then go with NGSS.
    On PC you can go wild with NGSS as the bandwith limit is less of a problem.
     
  15. BenWilles

    BenWilles

    Joined:
    Mar 9, 2018
    Posts:
    41
    Its not in general about being faster, we got a lot of trouble with unitys shadows as the system is poor and the shadows are ugly. (sorry) Actual problem is that they fade off when they get close to far clipping plane. An issue that many people have but no solution. Setting Clipping Plane to make the shadows work ok doubles the polycount and of cause the number of shadows too..
    And Shadows the Models casts on itself fade off earlier then those casted on other models..
    Thought about finding someone to do a own Shadowsystem but then have seen your asset.
    I'm not sure how much your assets depends on Unitys shadows system. Do you think it would solve the problems mentioned?
     
  16. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,910
    Can someone explain what these frustrum shadows are, as shown on the previous page? Are these some kind of cheap image effect shadows? Would it help keep draw calls low?
     
  17. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    675
    Frustum shadows are screenspace shadows that write the depth traced shadows in the lighting pass of the directional light. I don't think it would effect the draw calls but it helps with getting a great amount of sharp shadow detail without having to use very high shadow settings on your directional light.
     
    Stardog likes this.
  18. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @benjaminthorn,
    Out of the box NGSS uses the same rendering system (built-in) so it defaults to some of these drawbacks you mentioned. However it can be solved by modifying the built-in shadows system. You can contact me through support email (support AT psychozeinteractive DOT com) if you are interested in these customizations.

    @Stardog
    FrustumShadows are camera (or view) depth based ray step shadows they are not scene dependant and the cost is pretty much the same whether you have 2millions entities or 1 entity casting shadows. It improves performance considerably (specially if you are bandwidth limited) as it allows you to reduce your directional shadows distance, reduce shadowmap size, reduce shadow rendering drawcalls/culling, disable Cascaded shadows (thus avoid cascades overlaps/overdraws) and even avoid the screen space shadows filtering altogether. If you already had ContactShadows then switching to this method will improve performance while displaying infinite view shadows.
    PS: Frustum shadows currently work with any light but limited to one at time. In the next version I will provide an even faster one (Compute shader based) which will allow multiple lights (Dir and Local). :)
     
    Last edited: Aug 21, 2019
    Stardog and BenWilles like this.
  19. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    Is it normal that "use quality settings" does not work for me? The shadow resolution does not seem to change between settings at least in the view port.
     
  20. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @sacb0y
    Use quality settings does not change the Resolution it just leave it as what is set in the Quality Settings but indeed if you manually change the custom resolutions and go back to QualitySettings it won't do anything. Right now if "Use Quality Settings" is set you have to change it through QualitySettings panel. I forgot to fix it in the last version. I've added it to notes so it will be fixed for the next version. :)
     
    Last edited: Aug 21, 2019
  21. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    Ok cause it was causing per formance issues where it seems to be at ultra resolution even though it was set to very low :O
     
  22. Scarabay

    Scarabay

    Joined:
    Sep 7, 2013
    Posts:
    18
    How to fix it?
     
  23. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Temporary either leave the resolution at custom or if you set it back to Use Quality Settings then set it through QualitySettings panel.
     
  24. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Folks,
    Let me know if you want any other feature/fix for the next version. I'm adding them to the todo list.
     
  25. Onat-H

    Onat-H

    Joined:
    Mar 11, 2015
    Posts:
    195
    Hey tato, you know which feature I would like for the next version... ;) Haha
     
    tatoforever likes this.
  26. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,910
    I just added it to my project. It saves about 20fps compared to using actual shadows in the distance. It also works with Amplify Imposters (all trees in this screenshot are low-poly imposters). And because I can reduce my shadow distance to 200, I get sharper shadows up close too :)

    Capture.PNG

    I think 20k of the triangles are the four terrains, and the remaining 5k is trees/rocks.

    Maybe a toggle to lock the frustrum drawing to the Quality > Shadow Distance. It seems like it works well at ~50% of what the quality setting is, but it's easy to do on my own anyway in-game.

    Bug: In NGSS_Directional, choosing Use Quality Settings doesn't seem to do anything.
     
    Last edited: Aug 23, 2019
    Zyblade, hopeful and tatoforever like this.
  27. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,517
    Been using NGSS v1 and loved it. Any news on v2 supporting lwrp any time soon near future? what's the expected turn around on that?
     
  28. asdzxcv777

    asdzxcv777

    Joined:
    Jul 17, 2017
    Posts:
    29
    how will this asset remain relevant after hdrp comes out of preview ...
    Could someone tell me what features this has which hdrp will not have ??
     
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @asdzxcv777,
    HDRP still have a long shot to do, specially in the performance deparment. That's why most people still use built-in pipeline. NGSS offers a prettier & flexible shadows system.

    @castpr76,
    LWRP and HDRP support is planned later this year. LWRP will come first though.
     
  30. clagrens

    clagrens

    Joined:
    May 19, 2017
    Posts:
    96
    Hi!, My Project have this problem too.
    " Toony color shader " and " ShaderoSprite editor " is not supported In NGSS 2.2.5
    All white.
    Should I turn it back to 1.8.5?
    unity2017.4.30
     
  31. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @clagrens,
    If you are using the old v1.x is recommended to update to it's latest version that fixed all these issues which is 1.9.6. We don't provide support for Unity 5.5 or older only access to the compatible NGSS versions.
     
  32. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Folks,
    Starting in 2020, I'm going to open a live support channel on Discord for any shadows related question or any custom inquiry, renderer, integration, etc.
    We are now bouncing back and fort in between NGSS and our projects (which also uses NGSS), so I don't have much time for live support but once we are done updating our games I will have plenty of time for insta live support.
    The biggest reason for such idea is that NGSS is getting future expansions and we will have multiple products with multiple renderer versions. We will have few folks in the crew also that will help with support and the products. :)
     
  33. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    Thats the problem though the quality settings panel doesn't seem to work, even trying to set shadow quality manually.

    The resolution is always at whatever the last setting was if i changed it in the editor.
     
  34. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @sacb0y,
    You can look in the NGSS_Directional code that nothing is changed if resolution is set to Use Quality Settings. So you can manually change it through the Quality Settings panel.
     
  35. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867


    Yeah but it doesn't change, here's an example, the reason low and veyr low look so different is just shaodow distance which i show.

    I also have an issue where FPS drops from like 40-50 FPS to under 3FPS when shadows are enabled on android. Here's my settings.

    upload_2019-9-13_15-24-6.png
     
  36. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Leave NGSS with "Use Quality Settings" and either change the resolution through Quality Settings panel or directly on the light. If the resolution doesn't change, that's not NGSS, is Unity.
    You will have slowdown no matter what shadows you use on Android. Android devices are a lot weaker than iOS devices. Hardware and drivers are better on iOS. What is the device you are building/testing your game?
    Cheers,
     
  37. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    hmm, i'll experiment more, I've had this issue with shadow resolution for a long time even across versions. The version this issue is on is Unity 2018.4.4


    As for device the issue has occured on every device, Note 9, S10, S7, Tab S4, which are all Adreno GPU, the only device that didn't have the problem was a Mali-G72 GPU on a Mate 10.
     
  38. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Yeah, I have an Galaxy Tab S4 and our game with shadows FPS drops, also tested with Unity shadows and it drops similarly. With my iPhoneX it runs flawlessly at 60fps. Not a single FPS drop. Device is stronger and Metal is seriously optimized.
    If you have many objects being rendered into the depthmap, try reduce the number and see if the FPS improves. Your shadows settings should not make it slow, i think is the CPU that is slowing you down.
    Do you have profiled the game on your device and identified where the bottleneck is?
     
  39. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    So i upgraded to Unity 2018.4.9 and completely removed NGSS2 and now the performance on android is solid.

    I also figured out the quality issue thing after reinstalling it (using the latest version ofcourse).

    The NGSS directional script seems to break a directional light source quality if i change "NGSS_SHADOWS_RESOLUTION" to anything other than "use quality settings". If i change it to "Low" then back to "Use quality settings" the quality settings both in the light component and quality settings menu no longer work even if the NGSS_Directional component is removed.

    The only fix is to remake the light and copy the values, copying the component keeps the break.

    Things are fine so long as i don't change the resolution setting.

    I'm currently reinstalling the libraries to see if i still get the performance issues.
     
  40. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @sacb0y
    Forgot to mention that you have to disable Cascaded Shadows on your Graphics Panel (instead of Quality Settings), if you want to get the best performance on Mobile.
    If you really need Cascade Shadows, then don't install the NGSS libraries, just add NGSS_Directional on your dir light. Installing the libraries will install the Denoiser and is not recommended for Mobile.
    Give it a go and let me know how it goes.
     
  41. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    how do i make sure cascaded shadows is disabled on android?

    it seems to be done already in the defaults isn't it? I don't need cascaded shadows at all.

    upload_2019-9-13_22-21-51.png

    At the moment turning it on brought be back to the 1-3 FPS again lol
     
    Last edited: Sep 14, 2019
  42. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    So far turning on NGSS2 shadows with any settings results in the 1-3 FPS slowness, I feel like i didn't have this issue before on NGSS1...

    I tried turning every setting as low as possible.

    I haven't done android builds since i bought the new version.

    Removing the libraries returns the performance to good, but then i can't soften the shadows and stuff any more. :/

    Also makes going back for PC builds more difficult.
     
  43. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @sacb0y
    You can always go back to NGSS1 and do some compares with similar settings. I'm also curious if you find something?
    Yeah on mobile you should leave the libraries if you don't use Cascades, otherwise you will have default Unity hard shadows. The libraries install the NGSS for mobile (when cascades are off) and the denoiser (when cascades are on).
     
  44. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    Could you explain this more? Cascades should be off, so I would assume it would install for mobile. I'll experiment with ngss1 though soon.
     
    tatoforever likes this.
  45. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Sure, when you install the Directional Libraries, if Cascades are enabled, on top of the NGSS shadows you have the denoiser. If Cascades are disabled then you got the regular NGSS shadows. If you don't install the directional libraries, you won't have any NGSS shadows when cascades are disabled, because the NGSS cascaded shadows runs on the screen space filter.
    I know is a bit confusing but that's how Unity shadows works on the built-in renderer. You get hard shadows without Cascades and a screen space filter if Cascades are enabled. I'm following the same logic, with NGSS you get prettier shadows (Denoiser) when Cascades are enabled, and less pretty shadows when Cascades are disabled (denoiser disabled).
    It's an Unity optimization assuming that by default on mobile Unity does hard shadows, so yeah hard shadows vs NGSS soft-shadows there's a big difference there. On top of that, running soft-shadows on Android is not ideal.
    For your next build, un-install NGSS libraries, disable the NGSS_Directional shadows and try Unity Cascades shadows on your Android device. You'll see your FPS dropping again.
    Let me know if it's clear.
     
    Last edited: Sep 15, 2019
  46. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    How do I make sure cascades are disabled? Can you show me how the graphics setting should look like? Does the pc setting affect Android in this case?

    I'm trying to know the process to make sure the denoiser is not installed. That way I don't need to remove ngss when making an android build.
     
  47. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @sacb0y
    The Graphics Panel image you posted few messages back is fine, that's how you disable Cascaded Shadows (per platform).
    Next, install NGSS directional libraries and add the NGSS_Directional component to your Dir light. That it.
    Keep in mind that Unity mobile shadows are by default hard shadows, NGSS mobile shadows are soft-shadows (multiple sampling and other instructions running). There should be a noticeable performance difference in low-mid range mobile devices.
     
  48. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    I'm pretty sure thats what i did before but i still had very bad performance issues...

    I'll try disabling it for PC too to see if that helps.

    upload_2019-9-15_13-44-58.png

    I assume this indicates that the cascaded shadows are installed?

    (EDIT: And yes i always use soft shadows it performs well for my needs.)

    I really need to solve this problem cause without NGSS some devices get 60fps, but having it on tanks it down to 1-3FPS so hopefully we can figure this out.

    (Example image without NGSS)

     
    Last edited: Sep 15, 2019
  49. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    No, that indicates that you are using NGSS screen space shadows filter. What indicates that Cascaded Shadows are enabled is in your Editor - Graphics Panel (Platforms Settings).
     
  50. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    867
    Is there a way for me to determine if it's installed correctly? So far the only way i can tell is through performance in a build.
     
    Last edited: Sep 15, 2019