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

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @xVergilx,
    It works with any standard (built-in) based package. LW and HD support planned for later this year.
    The problem you are having with over bright pixels can come from your shader or post-processing, default shadows or NGSS shadows don't do that and I'm afraid you will have the same problem with NGSS.
    Just curious, what Unity version and what GPU do you have?
     
    xVergilx likes this.
  3. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Well, thats a bummer.
    Anyways, these soft shadows look way better than standard. I might upgrade default ones to these in the future.
    Answered in the same thread above, just to avoid hard offtopic.
     
    tatoforever likes this.
  4. zagreekie

    zagreekie

    Joined:
    Nov 20, 2017
    Posts:
    29
    @tatoforever Thanks for the help, I realise I probably should have done the industry standard "mess with all the sliders before asking stupid questions" xD

    I got one more stupid question though,

    Does unity's shadow setting need to be set to "hard shadows" for NGSS to function? I was super confused as I was getting no shadows, then I noticed I put unity to hard shadows and then I get them, however, unity seems to always auto default back to soft, removing all shadows.

    So 2 questions I guess,
    A is NGSS only working on hard shadow setting how its meant to work?
    B If so, then is there a way to make unit stop defaulting back to soft shadows constantly?

    P.s. you mentioned raising the sampling, where/how do I do that?
     
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @zagreekie
    With NGSS the shadows type light property is internally used to switch between PCF (hard) and PCSS (soft) and the shadows strength value is used for softness. Those values can only be modified through NGSS_Local component. The sampling amount also is changed within the NGSS_Local component.

    Just in case, with your local shadows, you need one NGSS_Local component in one of your lights, that's where you set the global properties for local shadows (sampling, quality, etc). Local properties such as softness and shadows type can be set individually per light. The important part here (that confuses people) is that they don't need NGSS_Local component on every light because softness and shadows type can be tweak with Strength and Shadows Type properties directly in the Light. I'm adding visible tips to the NGSS_Local component in the next version (v2.2) to highlight these useful info.
     
    Last edited: Jul 4, 2019
  6. dooly123

    dooly123

    Joined:
    Jul 7, 2015
    Posts:
    51
    we use NGSS for last epoch it has worked wonders, however, we were noticing our character lights shadows where being forced on when we did not want them at that given time.
    we resolved the issue by just adding a check.
    https://imgur.com/a/zlaxjyC
     
    tatoforever likes this.
  7. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @dooly123,
    Thanks for the input, I'll look into it.
    [EDIT] I'm slightly changing the behaviour of NGSS_Local because we don't really need it on every light. Only in one light with the NGSS_MANAGE_GLOBAL_SETTINGS enabled. You can still change the shadows type and the softness directly on the Unity Light component using the Shadows Type and Shadows Strength property. In rare occasions you want some lights with a custom resolution or tweak some non default properties, for those cases yes you need the NGSS_Local component anything else can either be tweaked directly on the light or the main NGSS_Local light (the one that acts as manager).
    I'll add some notes in the documentation and update the tutorial.
     
    Last edited: Jul 9, 2019
  8. zagreekie

    zagreekie

    Joined:
    Nov 20, 2017
    Posts:
    29
    When more or less are you planning to have HDRI support?
     
  9. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @zagreekie
    When the pipeline is more stable (after it gets out of preview).
     
  10. f0ff886f

    f0ff886f

    Joined:
    Nov 1, 2015
    Posts:
    201
    Question, after applying the patches to the CGIncludes folder (I replaced all three shaders), what should the value of the built-in shaders be?

    I've got:
    upload_2019-7-13_20-49-12.png

    But sometimes (and I don't know why, I just notice it in my version control) the Screen Space Shadows shader reverts to default (I never commit that).

    Am I doing something wrong? If not, why would they sometimes revert?
     
  11. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @f0ff886f ,
    Make sure your ProjectSettings folder is under version control. Or you will loose that change every time.
    Btw, It's the NGSS_Directional component that install/uninstall the Screen Space Shadows Mask (Hidden/NGSS_Directional). That explains why you see it on/off in the Graphics Settings. Your version controls revert back to default Screen Space Shadows Mask and NGSS_Directional component re-install it.
     
  12. f0ff886f

    f0ff886f

    Joined:
    Nov 1, 2015
    Posts:
    201
    We do have our ProjectSettings under version control, but that makes sense why it disappears. So if I load a scene that doesn't have a directional light (but has spot/points with NGSS_Local), Unity will automatically remove the the shader?

    So I just need to make sure we don't ever revert that setting :D Because its checked in with NGSS_Directional now.
     
  13. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @f0ff886f
    NGSS_Local won't remove the NGSS directional screen space mask. You need to check "NGSS_KEEP_ONDISABLE" on NGSS_Directional component to avoid NGSS screen space shadow mask being removed when OnDisabled is called in the component.
     
    f0ff886f likes this.
  14. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Folks,
    Im finalizing couple of stuff for the new infinite frustum shadows (speedups, cleanups) and will be launched afterwards. Frustum traced shadows also comes with an experimental temporal AA to help with jagginess but you can disable it if your game already do TAA. Im also working on a compute shader version to improve speed and quality a lot more. Both versions will be available in case your GPU doesn't properly support CS (some Mac/Linux drivers for example).
    I should be submitting initial version this week or the next cause I also want to clean couple of stuff and finish the Point Shadows gradient bias. :)
     
  15. XaneFeather

    XaneFeather

    Joined:
    Sep 4, 2013
    Posts:
    97
    Just out of curiosity - what happened to the new inspector UI that was supposed to be collaborated with somebody on this forum? Haven't heard anything about it for quite a while.
     
  16. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    108
    Hi,

    I am having trouble installing.. I had previous version of this asset. Can't see button under "Tools" to install, just "Bolt" and "Ludiq" (visual scripting) tabs. Manual installation also doesn't work; I can't follow step 1, because I get "Can't add script" error and skipping this step makes all shadow receivers black.
    Followed uninstall steps of 1.9 version..

    Just terrible, what's happening?! :(

    Unity 2018.2.20
     

    Attached Files:

  17. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    108
    Setup button under "Tools" is there on a blank new project. Maybe Bolt is messing with NGSS? Will try again to manually install
     
  18. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    108
    UPDATED. No luck again. Looks like I will be using NGSS2 only for new project in the future. Old version is great for me except shadow blur based on distance from caster isn't working on OpenGL. Is it fixed in NGSS2?
     
    Last edited: Jul 16, 2019
  19. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @XaneFeather,
    We put it on hold because there's many stuff changing on NGSS and will get back in the future to it. But I'll keep improving the current inspectors, try to keep them small and self-descriptive as possible. My goal is to avoid people to check the documentation (cause most people don't like to read docs). xD
    But definitely is something we are working on and have plans for improvements.

    @Ignacii,
    If you can't see Psychose Interactive tab under Tools menu it means you are having Editor scripts errors and NGSS editor tools aren't yet compiled. You need to fix the Editor errors in order for all the tools to compile and being accessible.
    PCSS won't work on OpenGL cause Unity don't properly support inline sampling on it and is a requirement for PCSS shadows. Works fine on Vulkan, DX11+, Metal and consoles graphics APIs.
     
    Last edited: Jul 17, 2019
    Ignacii likes this.
  20. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    As promised,
    Improving point shadows bias:
    upload_2019-7-16_20-45-36.png
    I'm still working on a gradient-like derivative bias for point shadows. Not sure if it get into v2.2 update but the new macro improvements to bias are hugely welcome.
     
    OCASM likes this.
  21. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    The new bias guarantees the same offset no matter how far your shadows are:
    upload_2019-7-17_15-21-39.png
    Same plane but really close up shot:
    upload_2019-7-17_15-28-6.png
     
  22. DrInternet

    DrInternet

    Joined:
    Apr 6, 2014
    Posts:
    106
    Hello,

    I would like to report that contact shadows are broken in VR while using OpenVR and single pass. It works better in multipass, but generates some atrifacts. There was no problem with NGSS (neither v1 or v2) I'm aware of while using Oculus SDK and Oculus HMD

    To reproduce:
    1. Create new project, import NGSS v2
    2. Open contact shadow scene demo.
    3. Turn on VR and use single pass and OpenVR
     
  23. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
  24. DrInternet

    DrInternet

    Joined:
    Apr 6, 2014
    Posts:
    106
    Unity 20191.4
    Latest ver. of NGSS
    Latest ver. of SteamVR
    Valve Index HMD
    Win10x64
     
    tatoforever likes this.
  25. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I'm going to double check this out for the next update. Chances are it might be fixed as ContactShadows will be gone and replaced by FrustumShadows.
     
    DrInternet likes this.
  26. EHG_Unity

    EHG_Unity

    Joined:
    May 21, 2017
    Posts:
    20
  27. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @EHG_Unity
    That isn't normal. Do you have multiple directional lights casting shadows?
     
  28. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Folks,
    I just submitted for review v2.2, features & changes:
    - Frustum shadows (first iteration on Deferred only, supports all light types)
    - Macro improvements to point shadows bias
    - Removed Quality Settings global stuff on Directional component (only shadowmap size can be tweaked)
    - Updated documentation about Local shadows component

    Version 2.3 features:
    - Compute shader version for Frustum Shadows, multiple lights casting raytraced shadows
    - Shadows Cache
    - Slope bias for Point Light shadows (still in W.I.P/research mode though)
     
    Last edited: Jul 25, 2019
  29. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    upload_2019-7-25_15-9-54.png

    Is the new noise supposed to look like this?

    i feel like it looks different than previous versions and not right...
     
  30. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @sacb0y
    The white noise is because lack of test samplers. Rise the Test sampling a bit and see how it looks.
     
  31. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    Why does this happen in one scene but not another even with the same settings?

    Main Scene:
    upload_2019-7-25_15-31-58.png

    TestScene
    upload_2019-7-25_15-32-39.png
     
  32. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @sacboy,
    Hard to tell without any info about your lighting setup. Could you provide more information, screenshots of how your NGSS components are set?
     
  33. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    upload_2019-7-25_16-1-0.png
    upload_2019-7-25_16-1-13.png

    Here you go!

    Both images had the exact same settings cause i copied and pasted them before the screen cap.
     
  34. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I don't see anything wrong.
    In your first image your character doesn't cast any shadows because she's already in shadows and lit with indoor probes/ambient lighting. Maybe add dynamic shadows to your indoor lights?
    In your second image your characters cast shadows because she's in direct contact with the dir light.
     
  35. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874
    hmmm, i can kind of see the effect if i move the character close to the window, but it's still not as bad. :O

    How much does that test setting affect performance?
     
  36. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Can you post a video of your issue? Even with still images is hard to see as it looks normal to me. xD
    [EDIT] Performance is something you have to profile yourself. In general if you are targetting PC, you can do 24 test samplers and 48 filter samplers. If you are targetting low end PC or consoles start by disabling PCSS and lower your sampling to 8-16.
     
    Last edited: Jul 25, 2019
  37. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    874


    Ah ok :/

    I guess the fireflies thing is a given.
     
  38. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Yeah, low sampling test as expected. Rise the sampling test to something like 16 or higher, 8 is quite too low for PCSS. Try increasing shadowmap resolution. You can also disable PCSS and see if the results are pleasant.
     
  39. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hi. By porting all my old scenes to newer Unity 2019x releases there is following behaviour. All latest NGSS stuff is in place. I open a scene with NGSS scripts in the scene, ok.
    I open a scene without NGSS scripts , all is black.
    So i have to add NGSS scripts to scenes i don t want or need it to get a rendering in same project.
    Do you have an idea to correct this?
     
  40. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @keeponshading
    If you have NGSS installed your scenes with Spot or Point lights that has shadows requires at least 1 NGSS_Local component set to Manager. You don't have to add NGSS_Local script to all lights, only one. Same for Directional light with shadows, it requires one NGSS_Directional component.
     
  41. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Folks,
    I submitted a new patch version (v2.2.2) for FrustumShadows that fixed a dark lighting bug if NGSS_FrustumShadows script is not present in the scene.
    I also added the ability to select how you want your ray length to be treated (world space or screen space). I though some people might just want contact shadows like effect no matter what distance objects are from the camera, others might like full screen shadows coverage (infinite view shadows):
    upload_2019-7-27_13-3-45.png
    PS: Poke me through support email if you want immediate access to it.
     
    Last edited: Jul 27, 2019
  42. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @keeponshading
    If you are having the dark lighting issue since v2.2.0 then you might be affected by a bug I introduced in v2.2.0. I fixed the bug in v2.2.2 and is already sent for Asset Store review. You can get the fix right now if you send an email to support AT psychozinteractive DOT com with your invoice number.
     
  43. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I just submitted v2.2.3 for review.
    - Fixed an issue with frustum shadows blending with scene shadows
    - Fixed a small frustum shadows clipping bug that slipped in v2.2.0
    - Fixed the shadows displaying on top of a second camera (got re-introduced in v2.2.0)
    - Re-added the screen space / world space ray scale toggle to frustum shadows. It got disabled in v2.2.3 because a friend of mine was having a weird shader feature issue so I removed the shader_feature and instead im using a lerp to switch between the two
     
  44. Bzuco

    Bzuco

    Joined:
    Sep 6, 2015
    Posts:
    56
    @tatoforever Hi,
    can you please add an option to limit frustum shadows only from certain distance to infinite? I want to use shadow cascades from camera position to cca. 150-200m and from this distance use only frustum shadows. I tried change ray scale parameter to achieve this, but it is still not good...it creates visible diagonal line....and when I am trying to suppress this visual defect using ray thickness parameter, then distant frustum shadows starts to disapearing...
    Everything I mentioned is probably less noticable in nature environment where all visual artefacts are hidden in gras/shrubs, ... but in urban environment with objects like benches, lamps, billboards, ... it is problem :)
     

    Attached Files:

    tatoforever likes this.
  45. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Bzuco,
    Frustum shadows most important goal is to display shadows further away as directional shadows is already covering near-by distances although some people with open world natural environments will be pleased with near-by macro details. So yeah this will be added in the next version.
    What about a 0-1 float that represent the view depth? When the value is 0 nothing is clipped, if the value is .25 it means that frustum shadows will be clipped from 0-25% of view distance and so one.
     
    Last edited: Jul 30, 2019
    Bzuco likes this.
  46. Bzuco

    Bzuco

    Joined:
    Sep 6, 2015
    Posts:
    56
    @tatoforever
    yes, that float value would be nice to have and then we would be able to change it at runtime as needed when changing cameras (first/third person camera, vehicle, helicopter, ...) or when changing environment indoor/outdoor, ...;)
     
    tatoforever likes this.
  47. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Bzuco,
    Done, it works exactly the same as with unit distance (in meters) so it's simpler to use.
    I also added a fade value so they done abruptly cut:
    upload_2019-7-30_18-21-7.png
     
    Last edited: Jul 30, 2019
  48. joshua_42

    joshua_42

    Joined:
    Jun 23, 2016
    Posts:
    104
    Hi there,
    I'm i need of a translucent shader that can handle shadows cast upon it (clouds around a planet). Can this asset achieve this?
    Cheers!
     
  49. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Bzuco likes this.
  50. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Just submitted v2.2.5. Features and Changes:
    - Added Frustum Shadows near distance property. Allows to skip and fade near-plane frustum shadows for users willing to display frustum shadows after a certain distance
    Poke me through support if you want immediate access to it.
     
    Last edited: Jul 31, 2019