Search Unity

[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. anpd03

    anpd03

    Joined:
    Aug 7, 2013
    Posts:
    57
    I try to make to a Windows release build. The shadows works in editor. Screenspace shadows uses Custom Shader and NGSS_Directional in the Graphics Setting. See attached image for result in build.

    EDIT. Hm looks like I get a bit random result each time I build. Sometimes it works others not.
     

    Attached Files:

    • pink.png
      pink.png
      File size:
      128.6 KB
      Views:
      91
    Last edited: Mar 8, 2019
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    What do you mean by Screenspace shadows? You meant NGSS_ContactShadows?
    Did you installed the NGSS libraries and is NGSS_Directional on your directional light?
    Can you provide me more information about your issue? Do you have any console errors or a small project that reproduces the issue? If you, you can email the test project to support and I will take a look at.
    With a small image is hard to see where the problem can come from.
    Cheers,
     
  3. anpd03

    anpd03

    Joined:
    Aug 7, 2013
    Posts:
    57
    Can't share the project unfortunately will see if I can reproduce in a separate project. In Project Settings->Graphics->Built-in Shader Settings->Screen Space Shadows the NGSS_Directional Shader is assigned.
     
  4. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @andp03
    That's not enough. You need at least NGSS_Directional component to be on your directional light.
     
  5. anpd03

    anpd03

    Joined:
    Aug 7, 2013
    Posts:
    57
    Will investigate and see what I have missed.
     
  6. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @anpd03
    If can you provide me a small repro project (email to support) I will take a look at and tell you where the problem comes from really quick.
     
  7. anpd03

    anpd03

    Joined:
    Aug 7, 2013
    Posts:
    57
    Will see what I can do. Leaving the office soon so might have to wait until next week.
     
  8. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @anpd03
    No worries, let me know when you are ready. I always answer immediately (when I'm not sleeping at night). :)
     
    one_one likes this.
  9. anpd03

    anpd03

    Joined:
    Aug 7, 2013
    Posts:
    57
    Yes I noticed :) Thanks for the quick response.
     
    tatoforever likes this.
  10. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    492
    That made me literally laugh out loud.
     
    tatoforever likes this.
  11. jeremedia

    jeremedia

    Joined:
    Apr 21, 2015
    Posts:
    15
    @tatoforever
    My project procedurally creates all geometry and components at run time, including lights. It looks like I need to call the equivalent of the "SetProperties" method to set the global shaders properties? Since the v2 upgrade I've had to check the NGSS_MANAGAGE_GLOBAL_SETTINGS of any created light to get the NGSS_PCSS_ENABLED to take effect.
     
  12. lorddesu

    lorddesu

    Joined:
    Aug 20, 2014
    Posts:
    25
    Assuming NGSS works well with Aura 2. But can anyone provide some pics with good visual results?
     
  13. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @jeremedia
    For local shadows, you only need to check NGSS_MANAGE_GLOBAL_SETTINGS only in one of your scene lights. Local shadows settings are not affected by that.
    With your setup, you can have one gameObject with a light component disabled (disable the light, not the gameObject) and NGSS_Local component with NGSS_MANAGE_GLOBAL_SETTINGS enabled to act as manager for all local lights. In fact, your scene only requires one light with that component, the rest of lights don't need the NGSS_Local component at all. For lights without NGSS_Local component, you will tweak the shadow softness the same way as in V1, by tweaking the strength value in your shadowed light.
    PCSS is a global settings in v2. For performances and optimizations reasons you don't want to mix both algorithms in the same scene. It's either PCF or PCSS for all lights in your scene. That's why it's a global setting instead of per-light setting.
    In any case, the cost of PCSS for point lights are the same as PCF (PCF is slightly faster on spot shadows). In general, I recommends to enable PCSS if you are targeting consoles or PC and the visuals of shadows is appealing to your project. PCSS also improves the shadows acne by allowing you to lower the bias close to zero as the search algorithms reject visible pixels automatically. You can see this by enabling/disabling PCSS on the point light showcase scene.

    @lorddesu
    It works out of the box with Aura 2 and Hx Volumetrics.
    There's some rare cases where shadows opacity gets affected when you tweak NGSS_Local softness (for spot/point shadows) because I use that property internally to feed NGSS local shadows data but that is one line of code easy fix.
    Basically, if your custom renderer or shader uses the shadows opacity value (internally is called _LightShadowData.r) you just need to override _LightShadowData.r before is used and set it to 1.0. With NGSS you will control shadows opacity directly from the NGSS_Local for spot/point lights.
    It's also explained in the documentation how to do it. Though you can always email me your shader and I'll do it for you.
     
    Last edited: Mar 8, 2019
    lorddesu likes this.
  14. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,403
    Can the NGSS library setup have a feature for updating the asset (maybe just add a invoice number checker in it) but would make it easier to get the latest one and have that install things properly for unity's weekly beta/alpha version releases.

    Also getting Access Denied when trying to use the library setup installer
     
  15. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @Player7
    I'm not sure to understand your first question.
    Getting Access Denied happens when you try to install/uninstall the libraries with Unity in normal mode. Run Unity in Administrator mode and use the install libraries Tool again. After install you can restart the Editor in normal mode again.
    The latter is not a NGSS or Unity issue, is Windows enforcing security. This is not a problem with Mac though. :(
     
  16. paulojsam

    paulojsam

    Joined:
    Jul 2, 2012
    Posts:
    475
    do this work for webgl?
     
  17. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    Last edited: Mar 9, 2019
  18. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,403
    Maybe the asset could come with some another utility .exe that can be set with administrator privileges and do this process of setting up the library files..
     
  19. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,403
    Can Spot/Point libraries and Directional be installed at the same? what's the reason for them being split up?
     
  20. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @Player7
    I have plans to override the security settings using some Windows namespaces hackery for v2.1. An external C# app or .bat file is not that much elegant. Is much simpler to just run Unity in Admin mode.
    Spot and Directional libraries can be installed at the same time but quite often people don't need the two libraries. Some people just need Directional libraries. So that's why they are split.
     
  21. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,403
    2.1 sounds good.. what I mean earlier was having the libraries setup also have a built in NGSS autoupdate so it could notify you if a new version was out, and download itself/reinstall again
     
  22. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,403

    any performance reasons for that?
     
  23. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    Is not performance related, is more convenience and workflow related. Lot of users don't use local lights and just don't want to install any additional library. So I respect their decisions. :)
    In fact, you don't have to install any library at all if you only need NGSS directional shadows without denoiser.
     
  24. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,403
    oh .. I infact only needed directional shadows, not sure how much denoiser really helps :)
     
  25. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    Reduce the denoiser iterations and see how it looks (if 1 that's how NGSS directional looks without any libraries installed). ;)
     
  26. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,403
    the whole cascade direct shadow stuff seems broken in voxelplay (while using 2019.2.a7) applying ngss to the sun example scene with directional shadows and using the global override, only way to have shadows is not letting ngss take over global.. and then using 0 cascade in order to get a larger shadow draw distance...
     
  27. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    Send a test project showing the issue to support email, I will take a look at. If something is broken with other assets, big chances are they are doing some wicked stuff in a custom renderer or not using Standard based shaders the normal way.
     
  28. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,403
    Will send that demo scene later.. but seems like an issue with cascades and directional shadows not working can even be seen in the demo scene.. no cascades will show shadows in the game view(including play) and cascades>0 shows nothing in the game view.. is this normal?

    TRqgWFsQkZ.jpg ZGDhPb3hZS.jpg
     
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    Sure,
    Send me the test project and I will take a look at. I cannot speak for Unity alphas versions because we all know they are bugged as hell but I will take a look at and let you know what I find.
     
    Last edited: Mar 10, 2019
  30. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,403
    oh right.. well i sent you the email with a test project of both of them .. could be voxelplay or unity or ngss.. I dunno I haven't used this asset much to really know what should and shouldn't work.
     
  31. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @Player7
    Just tried the latest 2019.2.a7 alpha in an empty project and Cascaded Shadows dissapears in the game view in Forward mode (works fine in Deferred). It happens for Unity Shadows and NGSS Shadows, so yeah it's a Unity bug.
    That doesn't surprise me that much, it's a Unity alpha after all.
    I tried VoxelPlay with Unity 2019.1 and it works fine:
    upload_2019-3-10_15-38-29.png
    It's broken under 2019.2a because of the Unity cascaded issues in forward mode
    Both Unity and NGSS Shadows works normally with 2019.1.x betas.
    PS: If any of you folks can submit a bug repport to Unity (for the sake of priority) that would be awesome.
     
    Last edited: Mar 10, 2019
  32. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,403
    Ah well at least I know then.. I'm fine with falling back to 2019.1 if that will work
     
  33. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @Player7
    I will file a bug case for Unity, I think they aren't aware their own shadows are broken in 2019.2. xD
    If you can also file the same bug that will help prioritize it. I'm not surprised if they ship a beta like this.
     
  34. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    64
    Yes, i can
    upload_2019-3-12_8-52-38.png upload_2019-3-12_8-53-15.png upload_2019-3-12_8-53-55.png upload_2019-3-12_8-55-13.png
    upload_2019-3-12_9-3-41.png
     
    transat, Ruchir, ftejada and 5 others like this.
  35. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @alternativevisual
    That thick fog gave me insta-asma! :D
    Good lighting and nice use of NGSS shadows with Aura! ;)
     
  36. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,403
    So yeah things all work fine in 2019.1 I haven't filled a bug yet I assume they'll look into it with that project you sent in anyway. Though bringing it up on the 2019.2 alpha forum might help get some attention on it.
     
    tatoforever likes this.
  37. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @Player7
    I reported the bug already, but if you can bring it up to 2019.2 alpha forums for more attention cause it happens to everybody (you are not the first guy reporting the issue). I got couple other guys thinking it was NGSS. ^^

    (Case 1136301) Unity 2019.2a7 - Cascaded Shadows broken in-game view
    It's an one Scene empty project. Just tell them to open the CascadedShadowsBug scene at the root of the Asset folder and look at the GameView, they won't see any shadows in Forward mode.
    PS: Tested on Windows10, DX11.
    Cheers,
     
  38. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    384
  39. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @ceebeee
    Up the pdf, I'll take a look.
     
    ceebeee likes this.
  40. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    384
    yeah I goofed, post fixed. :)
     
    tatoforever likes this.
  41. jacot

    jacot

    Joined:
    Oct 19, 2017
    Posts:
    2
    Hey. This shadow asset is great. Is there a way to replace the HDRP shadows with this? It looks so much better than Unity's built in shadow cascades in HDRP.
    Thanks!
     
  42. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @jacot
    Yes, HDRP and LWRP support is planned for this year. Just not right now but is planned yes. :)
     
  43. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,024
    You're killing me with the wait for 2.1! You had mentioned that for my game (big open world, lots of trees) that using the 2.1 contact shadows would let me reduce the shadow distance. Am I right in assuming that this new contact shadow shader would do AO on the tree meshes in mid-distance? They look too flat without the Dir.Light shadows on them, so it would be really great if contact shadows would improve their appearance.....
     
  44. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @ceebeee
    Just read the paper, they seems to voxelize the scene from the light POV only once which indicates that only static meshes will be able to cast and receive such shadows (hence the pre-computed part in their algorithm). Dynamic meshes such as trees or characters will be able to receive such voxelized shadows but not cast it. So yeah It's kinda meh and you also need a cascaded shadows for dynamic objects.
    The idea I got in mind is completely different. What I want to do is to voxelize the view dynamically in a compute shader from the camera POV. Then use a cone trace method to step through voxels quickly.

    @gecko
    No, in v2.1 ContactShadows will be displayed up to camera view far distance and so you will be able to produce larger contact shadows at the expense of some extra bandwidth. It won't be a replacement for AO or shadows, it will just help with long range views to ground slightly better your scene.
    If my voxelized crazy idea came to life, that would be your high quality ultra long range view distance shadows. But not for v2.1. I will keep you updated on all that shiny stuff. :V
     
    ceebeee likes this.
  45. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,024
    Thanks -- I already have something to that effect with MicroSplat's shadow map (with Vegetation Studio Pro). Well, maybe I can keep my hopes up for voxelized someday.
     
    tatoforever likes this.
  46. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    I think Unity is working on the same light POV voxelized shadows, but it has some drawbacks. One, is only for HDRP, second it has the same exact mentioned limitations (static objects only, lights must not move/rotate). So why not a dynamic one that works on any renderer! ;)
     
    NeatWolf, ceebeee and Flurgle like this.
  47. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    384
    Yeah you're exactly right about the limitations of the implementation in that paper. What you propose sound a lot better. I hope you manage to pull it off :)
     
    tatoforever likes this.
  48. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    847
    Hi there @tatoforever !

    I recently upgraded to NGSS2 and I'm so glad it now installs automatically without the need of any file/folders replacement.
    Looking forward SRP support! ;)

    I was wondering if you could expose the "blending distance" among two different cascades. I ramped up the softness quite a bit and I believe a really seamless transition can't be achieved with my settings.
    Could you please point me to the right part of the code where it's getting handled? :)

    I'm prototyping something with AURA 2 as well.
    As you can see from the picture, it is still noticeable where the new cascade level kicks in. I know, it's not much, but, I'd love to get rid of it, without changing other parameters:


    These are the settings I'm using (I know, they're pretty extreme)


    I was also wondering if I could do something to improve blending between the far shadow of a building and the close shadow of the player, when they actually touch each other:

    before contact:


    after contact:


    Here's a quick video about it:
    https://drive.google.com/file/d/1MtIqHz9KfKGP0_gOZmt8GNOg4DFALv7s/view

    Is this somehow related on this particular tweak used by Bakery?
    (please note that I will have to bake the lights as well. Currently I can't because of an issue with Aura2 that is preventing volumetric shadows to be cast by a Mixed lighting sun in Subtractive mode)

    I'm talking about this, not sure if it has any effect in realtime as well.
     
    Last edited: Mar 14, 2019
    Flurgle likes this.
  49. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,869
    @NeatWolf
    Where exactly does the cascade blends in your first Image? I'm trying to find out. xD
    Your second question, that is a normal drawback of PCSS/CHS blockersearch based algorithms. I'm trying to find ways to avoid that but is kinda close to impossible because when blockingsearch runs also averages (blurs) everything and is made like that. Although, I'm going to double check for any hackish way to mitigate that in v2.1 and see how it goes.
    For your last question, I'll take a look at and do some tests with baked shadows. I also think is silly to do minimum compare with shadows, it should always be multiplied.
     
  50. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    847

    I almost eliminated it completely, but in motion I can always tell where the cascade change is happening, because it's denting to the right. Maybe I got a bit OCD about this, but I can't stop seeing that :p
    Also, changing the distance where the cascade change happens makes it even more evident.
    I'm unable to make it totally seamless with the exposed sliders, so I was wondering if it's because I'd need to push the boundaries of some slider even more, or if I could simply tweak some values to extend the blending range even more.

    Gif dithering really doesn't help, but I guess it's visible each and every of the 4 cascades as I tweak the GLOBAL_CASCADES_SPLIT_VALUE between 0,01 and 0,25:
    https://media.giphy.com/media/1rK8NYjjT0svdfXE1i/source.gif

    Yeah, I shouldn't be focusing on such details when prototyping, that's my OCD kicking in :p
    I tried to mask it as better as I could, but in fullscreen, in motion, it's definitely 4 times more evident than here.


    About mix/merging realtime NGSS shadow from Mixed lighting using an alternative method, as long as it works in Subtractive mode as well, I'm all for it :p
    Because, since you can choose the color and intensity of the shadows in such mixed realtime/baked mode, you could possibly make a realtime shadow darker than the baked shadow it's being rendered in. I sort of solved it by making it lean towards grey, so that realtime shadows don't popup in dimly shadowed areas that much.

    I know it's not high priority, I should have gotten in touch by PM or email, I'm not sure others could find it useful, apologies for that ^__^"
     
    Flurgle likes this.