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. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    The Directional libraries brings NGSS shadows to non cascaded directional and denoiser. If you have cascaded shadows enabled the library does a denoiser pass. If you don't have cascaded shadows enabled it's just the same thing as with the screen space filter but directly into the shader. With Unity shadows, if you don't have cascaded shadows enabled there's no soft-shadows at all as the screen space filter only works with Cascaded Shadows and for the first enabled Directional light. This is how built-in renderer works. NGSS only reuses these states/passes to do it's filtering and denoising.
    The basic setup to have shadows like Unity is to remove NGSS directional libraries (not the NGSS_Directional component). Then set the test sampling to 16 and filter sampling to 24 and reduce the softness till you get the same amount of softness as with default Unity shadows.
    Note: If you have soft shadows even with fewer sampling still more taxing on the GPU than more sampling and less softness (because of some of the driver optimizations using the GPU cache). So for speed, sampling and softness size are important.

    What is your developing computer specs and target platform?
     
    macish likes this.
  2. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    I'm very interested in buying this. Does it work with omni lights two?
     
  3. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    All light types yes and all render modes. Currently built-in renderer and in the near future HDRP and LWRP (Universal Render Pipeline).
     
    florianalexandru05 likes this.
  4. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    Thanks for the fast answer. Currently using unity 2017 standard pipeline and I want to use it with screen space ray tracing and voxel GI, I don't care about performance so I want the maximum quality it can offer. It also does contact shadows am I right, judging from the screenshots?
     
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Yes, FrustumShadows does both far away and nearby depending how you set the ray properties world space or screen space will give you one or the other (or both). :)
     
    florianalexandru05 likes this.
  6. macish

    macish

    Joined:
    Oct 29, 2018
    Posts:
    55
    Thnx for some insight. It would be good if such information would end up in the manual you supply with the download.
    Maybe even going into some more detail what is what and where to optimize things best. I know there are mouseover popups but they are well .. minimaly that, descriptive.
    I don't have yet proper target specs that is something i am still trying to find out. A lot of moving parts yet to determined what ends up in the project and not and whats still missing , what kind of performance budget is still open etc.. In general the low end would be something like a 1030, optimal something in the range of a 1060 and above that its cherry on top.

    Is it by design that frustrum shadows ignore shadow settings of objects?
     
    Last edited: Nov 13, 2019
  7. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    @tatoforever I haven't been using shadow casting point lights for a while so I didn't notice this before, but it looks like NGSS makes point light shadows completely filled for me. Every single pixel of a point light shadow is completely shaded for me - as soon as I enable shadows, the light effectively disappears until I start to lower its shadow strength. What specific shader or component could be at fault there?
     
  8. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    Bought it and I have this problem! Using 2017.1

    Screenshot_3.png

    Works on 2019, trying to install but I don't think I should be getting that message on 2017 tow? Yah I want to use it for 2017.1 and I get this issue, doesn't even want to install, don't see the "tools" tab.
     
    Last edited: Nov 13, 2019
  9. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    NVM I got it to work on 2017.1! It all works now happy customer here! :cool: All I had to do is remove the broken line of code.
     
    tatoforever likes this.
  10. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    That's probably because you don't have any NGSS_Local component on your scene. You need at least one in any of your local lights so NGSS libraries can be feed properly.
     
    hopeful likes this.
  11. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    That was my first thought as well, but all the lights in question do have NGSS_Local component, so unfortunately that didn't help. Are there any other possible explanations? If that helps, this only seems to be the problem with point lights - directional work as perfectly as ever, and spot light shadows work normally as well.
     
  12. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    You probably installed a new Unity version and need to re-install NGSS libraries again?
    Or you are using custom shaders that has their own re-implementation of Unity default shadows...
     
  13. macish

    macish

    Joined:
    Oct 29, 2018
    Posts:
    55
    Is it by design that frustrum shadows ignore shadow settings of objects?
     
  14. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Do you mean local shadows do not affect FrustumShadows? If so, that's a bug and it got fixed in the next version but if you want the fix, I've posted the fix (two lines of code change). Look for it on this page or page 50th (can't remember exactly).
     
    Last edited: Nov 16, 2019
  15. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    I think he means that Frustum Shadows ignores Cast Shadows or Receive Shadows on MeshRenderers.
    Which is the thing that is not possible with post-processing shadows, i think? Corrent me if i'm wrong :)
     
    Last edited: Nov 16, 2019
  16. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Frustum shadows are not post processed. They are computed after depth map as any shadowmap technique (before post processing passes). The resulting raytraced shadowmap is then combined the same way shadows are computed. So yeah they can be affected by local light but I forgot to combine it in the correct location and are currently not affected by local lights. Fixed for the next version.
     
    alternativevisual likes this.
  17. macish

    macish

    Joined:
    Oct 29, 2018
    Posts:
    55
  18. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I see now what you mean, it's a limitation of FrustumShadows because shadows are computed using the screen depth buffer. Anything that writes to depth (the grass you are using btw) will cast FrustumShadows. There's some ways to remove it by applying extra translucent passes or material IDs but it has to be done manually and is kinda different for every asset provider.
    Although you have couple of options with FrustumShadows that can help with that, the Start distance and the blackface opacity (Deferred mode).
     
    macish likes this.
  19. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    Good stuff I love it! I combined it with screen-space ray tracing and it makes Unity look half decent now!

    RHEV2_01.jpg
    Screenshot_7.jpg
     

    Attached Files:

  20. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @florianalexandru05,
    Do you mind me borrowing that image? Gotta post it on twitter! ;)
    EDIT: Done, also gave credits to you! :)
     
    Last edited: Nov 24, 2019
    florianalexandru05 likes this.
  21. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,811
    No problem, I'm actually happy if you used it! :)
     
  22. Justin_Wingfall

    Justin_Wingfall

    Joined:
    May 15, 2014
    Posts:
    125
    wait, doesn't screen-space ray tracing only work with hdrp? I thought ngs doesn't support hdrp?
     
  23. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Florian is talking about NGSS FrustumShadows which is a form of screen space raytracing (more specifically ray stepping) that does not requires any RTX and is very cheap to compute.
    HDRP & URP soon. Need to finish my ultra fast point shadows implementation on URP and will start to roll over pre-releases. ;)
     
    Lars-Steenhoff and id0 like this.
  24. Justin_Wingfall

    Justin_Wingfall

    Joined:
    May 15, 2014
    Posts:
    125
    interesting. is FrustumShadows a componet that can be added to any light source?

    also will hdrp be avalible 2019 or 2020? thx
     
  25. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Currently works with Directional and Local lights but local lights requires fall off and some minor tweaks. All that is coming in v2.3.
     
  26. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Guys,
    NGSS 2 is featured now on the Asset Store black Friday list and is 50% off for a limited time only! Hurry up! :)
     
    johaswe likes this.
  27. TheFalconeerDev

    TheFalconeerDev

    Joined:
    Sep 18, 2019
    Posts:
    95
    I have this problem., that If I try to uninstall the package, return the includes etc etc.
    I then can't set the quality of the built-in unity shadows. even If I update to a new version of the editor.
    Quite weird. deleted shadercache, and entire library as well.
    Any clue?
     
  28. TheFalconeerDev

    TheFalconeerDev

    Joined:
    Sep 18, 2019
    Posts:
    95
    I mean I can set the quality, but nothing changes;)

    Love the asset, but working on xbox one and need to evaluate many different options to find the fastest directional shadows possible ;)

    also strangely with cascaded shadows turned off in the graphics settings, the asset doesn't work in editor anymore, providing no blurring etc. but still works on xbox one .
     
    Last edited: Nov 26, 2019
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    If you want to delete NGSS make sure before deletion to uninstall the libraries using the provided tool.
    If you turn off cascaded shadows without NGSS directional library installed you won't have any NGSS shadows because non cascaded shadows default to built-in included files.
    Sounds a bit confusing but that's how built-in shadows work, I'm just replacing files internally. :D
     
  30. TheFalconeerDev

    TheFalconeerDev

    Joined:
    Sep 18, 2019
    Posts:
    95
    I can't use the provided tool it keeps not having acces to the folder, I've started as admin, made the folders readable as admin, nothing works. Could it be that unity hub is interfering?

    I've manually followed the steps from the manual, returned the old .bak files, uninstalled etc and even installed a new editor, and I can still not edit the shadow resolution on the old lights , not in quality not on the light component itself. its mega weird

    With regards to non cascaded, I have turned of cascades, But NGSS directional libraries are still there, and it works on xbox still and not in editor. is there a logical reason for that. this is a seperate issue to the uninstall by the way;)
     
  31. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    On windows, you need to launch the editor (not Unity hub) with admin rights to avoid manual installation. You can locate each of your Unity install with the Unity Hub -> Install tab, then click on the three dots button and select "Show in Explorer". The hub will open the location of the editor and then right click on Unity.exe and select run as administrator.
    I'm going to update the tutorial video to add this step (till I find a way to run the tool automatically with the required privileges to install libraries).
    As for cascades, just re-install Unity and you should have a clean version without NGSS libraries on it.
     
  32. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    Aloha! How can i change Softness + enable/disable PCSS per Directional light?

    I need some very soft shadows on second light without PCSS, and on the main light i need sharp shadows with PCSS.
     
  33. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @alternativevisual,
    Multiple directional lights with soft-shadows is not recommended for performance reasons. Neither NGSS or built-in Unity shadows was made for this pourpose but here's some info that might help you out with that particular setup:
    The screen space shadows filter only works for the first directional light (when cascaded shadows are enabled), additional dir lights falls back to simplified bilinear shadows, which is the equivalent of disabling cascaded shadows on built-in renderer. However, with NGSS if you disable cascaded shadows (and you have the NGSS directional library installed) you'll have soft-shadows on non-cascaded directional lights (additional dir lights) but they will pickup your main directional NGSS settings because again neither the built-in shadows or NGSS was made for multiple directional lights casting soft-shadows.
    Hope it help.
     
  34. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    I don't care about performance in my situation, cause it's just pre-render.

    I've made it to work with command buffers, thanks. :)
     
    tatoforever likes this.
  35. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    After revisiting NGSS interface for the second time (=P)
    I've came to the conclusion:
    Maybe we should make a global NGSS class? Like QualitySettings, but specifically for shadows. :D
    That way we would't need "Manage Global Settings" option, and components would be used only to tweak local NGSS settings.
    ngss.png
    And yea, CommandBuffer settings control for directional lights actually needs to be a feature. =P
     
  36. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Yeah, It's already planned for the future, a sort of global manager that will feed basic global settings for all kind of lights, not just directional. ;)
    This also will avoid confusion and you won't have to add scripts to all your lights. It's already the case, you don't need more than one NGSS_Local script on your scene, but people gets a bit confused how to tweak shadows properties so I just let them add it to all lights. But yeah, QoL features are also being worked on. :cool:
     
    Lars-Steenhoff and hopeful like this.
  37. Justin_Wingfall

    Justin_Wingfall

    Joined:
    May 15, 2014
    Posts:
    125
    going to buy tommorow if still on sale.
     
  38. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    It's on sale until saturday December 1st.
     
  39. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Last edited: Nov 28, 2019
    Justin_Wingfall likes this.
  40. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    Hey there, just got it and trying to install for Unity 2019.2.13f1 and running Unity.exe as an administrator always opens the Hub, which I think is intended by Unity. Am I forced to do a manual install?

    I have a number of lights in prefabs and was wondering is there anything that will go wrong if I don't follow this step and add these components after?
    1 – Before closing Unity, add respective NGSS component to your scene lights. Spot and Point lights requires the NGSS_Local component and directional light requires the NGSS_Directional component (located at “Assets/Psychose Interactive/NGSS/Scripts”).
     
  41. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Little_Gorilla,
    If you can't run Unity with admin rights you have to do the manual install (copy the 3 files into CGIncludes folder in the Editor path and delete your project ShaderCache folder) yes.
    You need to have NGSS_Directional in your dir light but you don't need to add NGSS_Local to all your lights only to one light (it will act as local light manager). The remaining local lights soft-ness and shadows type will be tweaked directly in the Unity Light component using the "Strength" and "Shadows Type" properties.
    Im working on a solution to bypass the Unity 2019 admin rights override, so users will continue to use the automatic install tool and avoid the manual copy of the NGSS files. :)
    Let me know if you have any other question.
     
  42. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    Cheers this worked & thanks for the quick answer. Been busy admiring how much better the shadows look now, nice work!! It makes me realize how much jagged the default ones are.

    I'll be playing around with this today, not always you can buy an asset that looks better and is more performant!
     
    tatoforever likes this.
  43. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    I have a couple questions:
    1. I'm using HxVolumetric but I can't find this _LightShadowData file in my project or the Unity editor folder, is this ok for Unity 2019+?

    2. With spotlights, it seems they only work with hard shadows, is this correct?
     
  44. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Little_Gorilla,
    Open the file HxVolumetricPointLight.shader and before the line: return lerp(_LightShadowData.r, 1.0, shadow);
    add this:
    #if defined(NGSS_GLOBAL_OPACITY_DEFINED)
    _LightShadowData.r = NGSS_GLOBAL_OPACITY;
    #endif

    It works with all lights and shadows modes. NGSS internally uses shadows types property to switch between PCF and PCSS shadows. So if you only see soft-shadows with Hard-Shadows, it means your target rendering API doesn't support PCSS shadows.
     
    funselektor likes this.
  45. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    If you are targeting Desktop and you need performant directional shadows for very long range distances, use FrustumShadows in combination with a short directional distance (like 80-100m). You can even turn off Cascaded shadows, you don't really need it when you use FrustumShadows and it improves performance by around 30% or more. On top of that it gives you infinite view shadows. Something that is impossible to achieve with traditional cascaded shadows.
     
  46. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    Thanks for that shader edit! Now the spotlight shadows can be only none or Soft, setting it to hard immediately goes to Soft, so I think this is intended behaviour. PCSS settings also work with the spot light.
    The spotlight shadows look 10x better than the built-in ones :)
    upload_2019-11-29_17-46-50.png

    I'm targeting Windows with auto graphics API ticked.
    I was playing around with the frustrum shadows before and they're insanely performant, but my camera is very high so the frustrum shadows pop in when rotating, but it is useful for very far distances. Did turn off Cascaded shadows after reading through this thread too.

    One thing I'm stuck on is that for a NGSS_Directional I can only see changes for adjusting the Shadow Softness and ticking the Bias, but the other changes don't have any effect on shadows in the editor or play mode. Couldn't find anything from searching this thread, do you know what could be the issue?
    There are multiple disabled directional lights that cast shadows in my scene, but they all have the same NGSS_Directional settings.

    upload_2019-11-29_18-20-54.png
     
  47. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Ok I see,
    You are using the NGSS_Local on all your lights? If so, you have to change the filter through the NGSS_Local component. If your light doesn't have NGSS_Local component, you can change it the same way as NGSS 1, directly on the Unity Light component, Strength and Shadows Type.

    Enable PCSS before tweaking its properties. You should normally be able to tweak everything in the component.
    As for FrustumShadows depending on your scene you either want it to be visible after Directional shadows end or at the very near camera distance (if you also want a ContactShadows like effect on top of far view shadows).

    PS: Beautiful rendering and use of lighting and shadows btw! :)
     
    funselektor likes this.
  48. funselektor

    funselektor

    Joined:
    Oct 11, 2013
    Posts:
    105
    I'm only using NGSS_Local on my spot light, changing the values on these does work. I do need to have NGSS_MANAGE_GLOBAL_SETTINGS ticked for it to work in the scenes as it's attached to a prefab. Was wondering if that was causing issues with the directional light but it looks like it's not.

    Weird, I'm testing a NGSS_Directional directional light in a blank scene and still can't tweak anything but Soft and Bias.
    Thanks!
     
  49. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Yeah, NGSS_Local does affect only local lights.
    Do you have a video showing the NGSS_Directional inspector properties you are trying to tweak and the shadows next to it? What is the current rendering API you have?
    [EDIT] I'm out of town tomorrow but I can answer your questions and take a look at whatever you have for me at night. :)
     
    Last edited: Nov 30, 2019
  50. DiveshNaidoo

    DiveshNaidoo

    Joined:
    Apr 1, 2018
    Posts:
    23
    Hi there, If I purchase ngss right now will I get the URP update or is that a separate package?