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

    tempbuffer

    Joined:
    Dec 6, 2012
    Posts:
    14
    Hi, This is a very nice plugin, it's shame that it doesn't work on mobile now. Is there any issue to track this "bug"?

    BTW, have you done the performance profiling on android and ios? I want to know how much performance drop the NGSS can bring if I have only one directional light in my scene. Since I can not test it on device right now :(

     
  2. equalsequals

    equalsequals

    Joined:
    Sep 27, 2010
    Posts:
    154
    Thanks for clarifying. I'll stay tuned for the release.
     
  3. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    Is there any way to get contact shadows not to eclipse the back faces of foliage?
     
  4. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    There was an old but similar issue with shadows in mobile that sadly got closed recently and I don't know why. I've submitted a new one but the issue is that Unity is currently overriding any custom Directional Shadows with a default one in Mobile when set to forward renderer. It is wrong and should not happen.
    That's the reason why isn't working. I don't know exactly when they will fix this but will put any reply to the bug when they do. :\
    As for performance, it should not vary much of default directional shadows unless you are GPU bound already. Currents tests in mobile deferred shown similar performance with default directional vs NGSS shadows.
     
    Last edited: May 30, 2017
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    What do you mean exactly? Got any example image?
     
  6. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    Sure thing.

    No contact shadows: upload_2017-5-30_12-23-33.png

    With contact shadows:
    upload_2017-5-30_12-24-35.png
     
  7. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @brisingre,
    I see,
    The only way you can avoid that is by changing your foliage, either make it semi-transparent, turning off depth write with shader tag "Zwrite Off" or rise rendering queue above 2500.
    The reason is that ContactShadows works with anything that writes to camera depth.
    PS: PCSS on directional light will allow you to turn off ContactShadows in some scenes as it will harden shadows close to caster/receiver. I'm working on it right now. ;)
     
    arnoob likes this.
  8. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    Can I turn depth write off without making them unable to cast normal shadows?
     
  9. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Short answer no. As soon as you turn off depth write on foliage they won't cast shadows anywhere, but only receive them. Long answer, yes but you'll have to set custom replacement shaders, custom shadow renderer cameras and it doesn't really worth the effort.
    Just wait for PCSS on directional light, I'm pretty sure it will solve the issue.
     
    brisingre likes this.
  10. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    Yeah. It's not vital to anything that I'm able to use contact shadows -- just wanted to know if there was a way to write a shader to exclude them while otherwise receiving normal lighting.
     
  11. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    tatoforever
    Hello, what features should i wait in NGSS v2.0? Btw, are you working on "SSAO on steroids"?) I'm just really want to see Uncharted 4 technology in my game)
     
    tatoforever likes this.
  12. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @N3ON47
    NGSS 2.0 will primary remain a shadow product and will become part of a custom renderer we are working on with Scriptable Render Pipeline (more of that down below).
    First, setup remains simple, one manager and one per light component on your scene.
    - No more Unity depth maps with unknown size, will use custom depth maps with configurable size/precision.
    - True global SSAO, computed offscreen, will not dirt the screen image but instead will be applied as an additional shadowmask alongside shadowmaps.
    - New advanced shadow techniques and filtering (some performed screen space others light space).
    - PCSS filtering on any light (current limitation PCSS/ContactShadow on main directional light, no PCSS for spot lights).
    - Shadowmap atlasing (not in initial version though).
    - Advanced shadow encoding performance (eg: update depth atlas only if objects are moving and visible in light/eye space or just once for visible static objects).
    - And more secret sauce. :D

    Furthermore a new renderer (will give you guys discount if you own NGSS 2.0):
    - Custom Forward+ variation with massive compute light culling. Don't need a depth prepass (drawcalls won't double), perfect for VR, mobile or even PC (if you want extreme crazy performance). Big plus, multiple lights and shadows (initially 32 shadowed lights, 128 unshadowed lights but not limited to those numbers) computed/decoded in one single pass. Gazillion way faster than current Forward/Deferred renderers.
    - Lighting and shadowing techniques will work with any standard-like shader (or whatever default Standard shader is when it's out).
    - Volumetric lighting, on hold, not quite sure yet as this is not really part of a renderer but mostly a visual effect and there's existing solutions that works really well plus Unity is already working on volumetric effects. I'll make sure it works with those solutions though. ;)
     
  13. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    That's crazy cool!)
     
    tatoforever likes this.
  14. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    621
    Do you mean the project from the Adam demo on git or did they mention they wanted to make it part of the post processing stack in the future?
     
  15. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    That's a very exciting list. I can't wait to see some of this stuff in action.

    I'm very very glad you intend to maintain compatibility with volumetric lighting plug-ins. This is a critical feature for me. Hx volumetric lighting's pretty vital to my project -- my water effects and stuff are based off it. So if something isn't compatible I probably can't use it, no matter how good it looks.
     
    tatoforever likes this.
  16. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @brisingre
    I won't have to, It will work out of the box. ;)

    @christoph_r
    Not sure if it's the ones from Adam demo but I know they are working on volumetric effects cause it's written in the SRP docs. ;)

    But yeah, anything that works with Standard-like shaders will work with our custom renderer and future NGSS. But in the case that it's funky and weird, I'll make sure it works with. The idea is to let you guys use your own shaders (eg, default or asset store ones) and let us work on the renderer. :)
    And btw, this is not something we are thinking to bring, it's something we are already working for our current project on consoles/mobile.
     
    brisingre and punk like this.
  17. Klarax

    Klarax

    Joined:
    Dec 2, 2013
    Posts:
    17
    My issue was solved by emptying the array for each scene and then choosing the automatic find references again.

    works.
     
  18. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    It looks nice. just I need to set shadow strength to 0.25 cause when I set it more I lose some details.
    It that normal to set shadow strength to 0.25? but everything looks good.
     
  19. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @ksam2
    Yes, sometimes depending on scene setup light (size, range, etc) you will need to lower a lot, specially when you are looking for sharper shadows.
     
  20. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Having some precision issues with SpeedTree shadows when shadow projection is set to 'close fit'. Even when there is no wind zone, and trees are motionless, tree shadows will flicker when camera is rotated. Not experiencing this issue with 'stable fit'.
     
  21. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    This is how 'close fit' works, unfortunately - it's described in Unity official docs...
     
    tatoforever and buttmatrix like this.
  22. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Ah, I see, thank you very much! Sort of in conflict given NGSS docs suggest 'close' fit, but with a natural scene where there aren't an abundance of hard surface edges, 'stable fit' seems to be sufficient.
     
  23. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    I noticed NGSS is sensitive to directional z-axis rotation in ways that I don't understand; the shadow edges can appear beveled or aliased.

    Also, is there any chance we can get some debug visualizations for contact shadows? It would be nice to see *exactly* the ratio of shadow distance / shadow fade / ray width.
     
  24. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Really excited about shadowmaps for static objects rendering once instead of multiple times! Really cool! What is that global SSAO you are talking about? If it's global, can you implement color bleeding to simulate GI? That would be insanely cool!

    Also, what kind of volumetric lighting will it be? It can be just a standart linear fog with occlusion or a full atmospheric scattering. The one used in adam is atmospheric scattering with global and height based mie and rayleigh scattering. It looks super cool. I am sure that we'll all be dancing in hype if you implement atmospheric scattering to work natively with NGSS.

    Also, will you make a tiled deferred variant of your renderer? Foward+ ain't suitable for every situation.
     
    Last edited: Jun 10, 2017
  25. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Now that's kind of a dilemma for me... There's HD render loop coming, which will support all sorts of goodies (FPTL, proper HDR and lights, atmospheric scattering, etc.), and there's your renderer coming, which features awesome implementations (shadows, global ao, etc.). Do I properly understand that we can't create a mega renderer that will have features from both of them and run on deferred? ...or can we? Ugh, I'm tearing my hair in thoughts
     
  26. victorkin11

    victorkin11

    Joined:
    Apr 20, 2013
    Posts:
    175
    Any chance to work in unity 5.3.6p5?
     
  27. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    I didn't heard of it? Is it an official implementation you are talking about? That seems really interesting.
     
  28. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @Kolyasisan,
    With the new render pipeline you can create any renderer you want. The difference between what Unity is being working on and ours is that ours is faster but support less light counts around per frame visible at once (up to but not limited to 128). Big pro are it don't need a depth pre-pass, so your drawcalls are cut by half. The culling algorithm is also tight and small so more speed on that side too.
    As for shadows, the atlasing will be the same, filtering and quality will be NGSS 2.x features+.
    For any other effects that's not the renderer part, it's on the shading side of things which all should be compatible with btw.
    The renderer will be excellent choice for extreme PC performance, mobile and consoles platforms.
    Regards,
     
    Kolyasisan, one_one, punk and 2 others like this.
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @victorkin11
    While not officially supported (5.3), NGSS works with any version of Unity 5.3 up to 2017 (coming in next update).
     
  30. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Forgot to mention that for our renderer depending on selected platform light count limit will change. Eg: mobile 32, consoles 64/128 and PC 128+.
    But again, the trade of is single pass renderer, tiny tight rendering loop and exceptional performance.
     
    punk likes this.
  31. cadpeople

    cadpeople

    Joined:
    Nov 6, 2014
    Posts:
    21
    Hey any idea whats going with this grainy-ness in the shadows? Happen both in Editor view and Play Mode.
    upload_2017-6-14_10-15-3.png
    Standard scene, Windows platform, empty project except the standard "projector" asset is imported in the project.
     
  32. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    directional light bias, increasing it will reduce noise. Also going to be affected by shadow cascade splits.
     
  33. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Hi.

    Is there any plan to support single pass rendering in VR with the contact shadows?
     
  34. cadpeople

    cadpeople

    Joined:
    Nov 6, 2014
    Posts:
    21
    I moved all the light sliders up and down between min and max with no improvement to the noise :S
     
  35. victorkin11

    victorkin11

    Joined:
    Apr 20, 2013
    Posts:
    175
    I just buy it, but false to install in unity5.3,
    When import the package, unity5.3 have Fatal error!
    "CheckDisalowAllocation, Allocating memory when it is not allowed to allocate memory."
    Anyway to fix it?
     
  36. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @victorkin11
    Try the same process and restart Unity. If error continues please send the editor log with a small repro project to the provided support email. We will answer immediately.
    PS: First time i heard about this error with NGSS (maybe it comes some where else).
    Regards,
     
  37. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @LennartJohansen,
    Single pass VR support for ContactShadows coming in next update (very soon).
     
  38. dox

    dox

    Joined:
    Mar 8, 2011
    Posts:
    58
    Hi there,

    Just bought your product. Test in on Mac and on mac everything works perfectly.

    I've bug on windows with nvidia gpu 980ti, Unity 5.6.1f1.

    One more thing - shadows don't work - they just don't show up.

    I go through all your steps and while adding shader into Screen Space Shadows this bug shows up:

    Shader error in 'Hidden/Internal-ScreenSpaceShadows': undeclared identifier 'unity_RandomRotation16' at line 425 (on d3d11)

    Compiling Vertex program with SHADOWS_SINGLE_CASCADE
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA

    Thanks for help.
     
    Last edited: Jun 14, 2017
  39. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @dox,
    Save your scene/project, close Unity, delete your project shader cache folder (as explained in the Documentation), re-open your project and see if the error goes. Hit Play and check if directional shadows are working.
     
  40. dox

    dox

    Joined:
    Mar 8, 2011
    Posts:
    58
    @tatoforever Thanks for quick reply.

    I'm interested only in directional light shadows, so in Graphic Settings when I put your Shader into that slot I've still same bug.

    I've just do your tip. Actually I've deleted whole library folder and then reopen Unity project again and I've still the same error :/. If you would like to I can record quick video.
     
    Last edited: Jun 14, 2017
  41. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @dox,
    That's because shadow libraries works together (directional depends on shadows library, lot of shared data there). You can't delete shadows library, otherwise directional shadows won't work.
     
  42. victorkin11

    victorkin11

    Joined:
    Apr 20, 2013
    Posts:
    175
    This error may not directly cause by NGSS

    "Filename: C:/buildslave/unity/build/Runtime/Misc/GameObjectUtility.cpp Line: 1372)
    Load scene 'Temp/__Backupscenes/0.backup' time: 0.246505 ms
    Unloading 278 Unused Serialized files (Serialized files now loaded: 0)
    System memory in use before: 86.2 MB.
    CheckDisalowAllocation. Allocating memory when it is not allowed to allocate memory.
    (Filename: C:/buildslave/unity/build/Runtime/Allocator/MemoryManager.cpp Line: 433)
    empty()
    (Filename: C:\buildslave\unity\build\Runtime/Utilities/LinkedList.h Line: 180)"


    because unity 5.3.6 don't support ImageEffectAllowedInSceneView(5.4 do support),
    so I comment out ImageEffectAllowedInSceneView & ExecuteInEditMode(),
    then I unity can start up normally, but I still get some error from NGSS,

    WARNING: Shader Unsupported: 'Hidden/NGSS_ContactShadows' - Setting to default shader.
    Invalid pass number (1) for Graphics.Blit. Material=Hidden/NGSS_ContactShadows, npasses=1

    Since I don't have working project on 5.3, so that not really big problem for me. Just for anyone who working on 5.3 to notice.
     
  43. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @victorkin11,
    That's why 5.3 isn't officially supported but if you can't upgrade yet to a newer version of Unity email support and we'll find out a solution for you.
    Regards,
     
  44. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Directional PCSS.png Directional PCSS filtering preview with 25taps (32 and 64 taps coming in few mins). Works with any number of cascades, even with no cascades at all.
    Again, recommended with CloseFit projection but feel free to experiment with any projection and cascade number.
    Notice the shadows being sharp close to receiver and very smooth far from receiver. :)
    [EDIT]
     
    Last edited: Jun 14, 2017
  45. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Setup is simple, just add the new NGSS_Directional component to your directional light and that's it, nothing more to configure. If you don't want PCSS filtering, just remove it from your light, default NGSS shadows (without PCSS) will then be set.
    VR compatibility with contact shadows is being worked on, once finished I'll submit to the Asset Store. Global quality settings for shadows is also done. ;)
    PS: Added preview video in previous post. Video quality isn't good, so be careful. ^^
     
  46. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Great :)
     
    tatoforever likes this.
  47. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    adjust directional light strength
     
  48. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    this looks very, very nice. Well done, as usual!
     
    tatoforever likes this.
  49. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    437
    im keep pushing F5 and nothing happens!! :mad:
    seems my keyboar dead now...
     
    tatoforever likes this.
  50. cadpeople

    cadpeople

    Joined:
    Nov 6, 2014
    Posts:
    21
    Still grainy :/
     
    MarkusGod likes this.