Search Unity

  1. Unity 2019.1 is now released.
    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. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    @castor76
    Basically for launch (2.0) we will have new improved shadows (local and directional), denoiser, new filtering, depth gradient bias for all lights, primitive shadows (directional) and the tool to install/restore files. I'm probably missing something, been working on all night (gotta sleep :D). Will post the full change list later today. On page 35 or 36 there's a full list of features.
    Price wise I'm thinking around 30$ full price and 50% discount for current licensee owners.
    And still around the corner, ~1 more week to finish polishing and ~1 more for testing and finalizing new documentation and launch video. Calling for current NGSS users to get some of their projects videos. :)
    Cheers,
     
  2. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,387
    Excellent... I am willing to pay $15 more for the upgrade. Super.
     
    tatoforever likes this.
  3. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    @castor76
    NGSS 1.0 was launched in January 2017, coincidentally we will launch v2.0 around the same time (January 2019). It have been two wonderful years of stellar support and happy customers. I think what is more enjoyable are my fav games made with Unity, most of them (the number keep rising every day) are using NGSS. I feel like part of them and is really rewarding. :)
     
  4. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    55
    Finally!
     
  5. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    55
    Wow, two years have passed so fast...and i didn't made so much:(
    But i'm inspired by your work! So good asset and such a wonderful support in a cheap price) Keep it up!
    And very happy new year everyone! :D
     
    tatoforever likes this.
  6. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    339
    Please be sure it makes a backup of the original UnityShadowLibrary.cginc because it would be a nightmare to get the original file back should I need it if it was deleted. I usually just rename the original file to "UnityShadowLibrary.cginc.old" so it's handy. Thanks :)
     
    tatoforever likes this.
  7. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    @ceebeee
    It does, we can see in the video the new files with .bak extension after installing NGSS files. And it revert back to these bak files if we uninstall NGSS files.
     
    alternativevisual and ceebeee like this.
  8. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    I already demonstrated Depth gradient bias for directional lights for the upcoming NGSS version. Now for local lights (bias value is very close to zero = 0.0000001):
    upload_2018-12-31_11-37-26.png
    This is the cube from local lights example scene deep under the ground which measures 1x1x1 Unity unit. Notice the small shadows and zero acne artifacts.
    upload_2018-12-31_12-14-44.png
    Same scene, now the light is far up 50metters, notice the bias being computed based on distance and slope.

    Not only it fights acne and panning (specially with very large kernels) but it restores back lot of tiny small details lost due to standard basic bias.
    Keep in mind this is not raytraced shadows but improves shadowmap quality a lot more.
    Coming soon in v2. :cool:

    PS: In next post will show the new local shadows algorithms (which looks a lot better). :)
     
    Last edited: Dec 31, 2018
  9. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    New local shadows algorithms (v2). Noise is stabilized with screen space grid patterns. This technique avoids the shaky noisy patterns by applying a screen space blue noise like algorithm to the rotated disk samples thus improving shadows greatly.
    Grid stabilization can also be turned off and will give you back noisy patterns but this time the noise is computed at screen space which is more stable and similar to directional shadows.

    The default now is 16spp (instead of 48):
    upload_2019-1-2_9-21-31.png

    Lower (8spp):
    upload_2019-1-2_9-27-41.png

    Close up (8spp):
    upload_2019-1-2_9-28-14.png

    I can go even lower than that, starting to become quite ridiculous cause Unity local shadows are 4spp and looks ugly. :D

    PS: After initial 2.0 release, I will add a global wizard tool to let you change local shadows properties (globally) such as sampling, noise, etc. No more digging with the UnityShadowLibrary. :cool:
     
    Last edited: Jan 2, 2019
  10. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    55
    But may i be able to change it in game build, in my game settings ?
     
  11. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    @alternativevisual
    Short answer yes. :)
    Very long answer:
    In the past, I tried and it didn't worked because UnityShadowLibrary is a cginclude library (not a shader) that is included in many other include files and these files are part of the standard shaders. The problem is that Unity doesn't seems to pick global uniforms well on cginc files (I tried many times lol). But I discovered that due to the fact that v2 replaces all Unity shadow rendering files (not just UnityShadowLibrary), it seems to pick global uniforms well. The reason, unknown, the standard renderer is a blackbox and what I have access only is the rendering files, not the renderer itself ,so hard to tell if is a design flaw, bug or "engine feature". :oops:
    The good news is that you should be able to tweak them at runtime in v2 (similar to Directional settings) and it will be set up in a NGSS_LocalManager sort of component. Globally only, remember, I can only change the rendering, no access to renderer = no idea which light is rendering what/when etc.
    How this new local shadows manager should/will work? As so:
    Anything that holds a value (such as sampler numbers, banding to noise ratio, pcss min/max, etc) and is not a conditional or compile feature can be tweaked at runtime this way. For shader compile conditional/features the wizard tool (which is only available in Editor) will be used by injecting/removing lines of codes in the NGSS include files. This tool will hold settings that no one is interested in changing at runtime such as side aesthetics and other visual style (grid/noise or the min or max PCSS softness). Stuff that are not for the end user (the gamer).
    For instance things that are related to the quality/speed of shadows which are simple to the end user to tweak should be twekable at runtime and will be thanks to the global local shadows manager.

    To make things clear, these limitations are related to local shadows with the Standard blackboxed renderer only. Directional shadows doesn't have this workflow limitation, neither Scriptable Render Pipeline based renderers as I have access to all these sources.

    On initial 2.0 launch, the only wizard tool you'll have is the one to install/uninstall NGSS internal files. The other tools will come in later updates.
    Hope it's clear now. :)
     
    Last edited: Jan 3, 2019
  12. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    Folks,
    If you want early access to v2.0, please poke me through email support and do mention your forum nickname so I can keep track of any reported issue/bug. :)
    PS: It should be finished and ready to test this week. ;)
     
    transat, Flurgle and AthrunVLokiz like this.
  13. Flurgle

    Flurgle

    Joined:
    May 16, 2016
    Posts:
    346
  14. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    Are you guys ready to be blown away? So many new improvements to shadows, new techniques, new optimizations, more quality with less sampling. Bye bye noisy shadows (well you can still switch back to it if you want)!
    This Preview version don't have Primitive Shadows yet, but in the subsequent preview versions should be available, I want to make sure we test properly new shadowmap algorithms and denoiser before getting into Primitive Shadows. It will be available for launch update.
    Things that I need you to try (in this same order):
    - The new setup wizard (install/remove files)
    - Test on Unity 2017 or 2018 (if possible both)
    - Test with your game projects or something else than NGSS showcase scenes
    - Test with your custom lighting/shader stuff (Hx volumetric, amplify shader, etc)
    - Test building to devices/platforms, specially mobile (don't abuse the sampling count though)

    Make sure you delete the old version of NGSS before installing v2.0 as is not compatible anymore. Otherwise expect unknown compile errors and behavior.
    But don't worry, you won't risk loosing any data, the worse that could happen is you have to re-install your Unity Editor again.
    Regarding the new mobile optimization, we will try both the new Gaussian-Box like and the new dithered-grid algorithms. Starting with the dithered-grid one.

    PS: Please poke me out through support email (mention your forum name) I will issue versions later today (packing stuff out now).
     
  15. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    Beta versions sent. Read the email very carefully. :D
     
  16. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    Small preview of v2.0 new Denoiser and Gradient Bias (notice the bias value at 0):

    PS: Sorry about the wonky compression, I'm prep a new showcase video with detailed info about new improvements and features of NGSS soon.
     
    Bzuco, OCASM, Flurgle and 1 other person like this.
  17. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    NGSS 2.0 Denoiser at work:

    The video seems blurred but is not, is the Denoiser removing "noise" from the shadows which produces the equivalent of 512spp with only 32spp. This technique can also be applied to raytraced shadows and improve monte carlo based algorithms. At min 1:21 we can see Unity Soft-Shadows for a brief moment, which aren't that soft tbh.

    Video compression is not that great so here are High res images (default settings):
    upload_2019-1-10_16-5-17.png

    upload_2019-1-10_16-5-27.png

    upload_2019-1-10_16-5-37.png
     
    Last edited: Jan 10, 2019
    Elecman, Bzuco, OCASM and 1 other person like this.
  18. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    Heading to v2.0 NGSS_Local component for Spot and Point shadows:
    upload_2019-1-11_3-22-26.png

    PS:
    More options are being added to it! ;)
     
    ceebeee, jcarpay and Bartolomeus755 like this.
  19. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    I'm exposing more Spot/Point shadows options to the new NGSS_Local component:

    upload_2019-1-12_4-36-26.png

    Beta testing feedback is great, we are close to be ready to launch. Primitive shadows might ship in preview mode or maybe I'll hold it till v2.1. I don't want to delay v2 anymore.
    Next week I'm going to work out a nice launch trailer with some new material from our console project Forgotten Memories. I guess people are tired of planes, spheres and cubes videos. :D
     
  20. Bartolomeus755

    Bartolomeus755

    Joined:
    Jun 20, 2013
    Posts:
    217
    Really exciting news! :)
     
  21. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    1,979
    I recommend you use a little icon for the scripts. so they show up nicely in the inspector.
    ( like next to the light there is a lamp, you could do a little icon the same way )
     
    tatoforever likes this.
  22. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    141
    Absolutely loving the v2 beta. A great improvement on v1 which was already miles ahead of Unity's standard shadows. Noticed a possible edge case issue @tatoforever @jbooth ... When I enabled glitter on my Microsplat terrain I got this:

    Code (CSharp):
    1. Shader error in 'MicroSplat/MyTerrain': Unexpected token '['. Expected one of: ',' ';' at UnityShadowLibrary.cginc(87)
     
    tatoforever likes this.
  23. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    @transat,
    Awesome,
    What beta version you got that error? Please hit me through email support with more info about the error. I'll make sure is fixed for the next beta.
    Cheers,
     
    transat likes this.
  24. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    141
    Confirming that all seems perfect now. Thanks so much for fixing this so quickly!
     
    tatoforever likes this.
  25. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    Guys,
    NGSS 2.0 is ready, main features:
    - Denoiser, very powerful separable filter for shadows which gives the equivalent of 1024spp with only 48 spp total
    - Shadows dithering, improve shadows by stabilizing random patterns into screen space grids (perfect for low spp scenarios)
    - Gradient bias, adjust shadows bias based on surface slope, helps fights shadows artifacts (acne, peter panning)
    - NGSS Libraries Manager, helpful wizard tool to manage, install and uninstall NGSS shadow internal libraries
    - NGSS Local component for spot and point lights, allows you to tweak local shadows properties and quality at runtime

    There's others macro improvements everywhere, such as ContactShadows gets denoised for free due to being part of the directional shadows. Algorithms noise is more stable. Documentation got updated too.
    Thumbs up to beta testers, they did a great job! :)

    Primitive Shadows didn't make it to 2.0 but is being worked on as we speak for v2.1. Beta testers will get access to it soon.
    PS: Expect a new launch trailer sometime this week and asset store submission will follow.
     
    Elecman, ceebeee, jcarpay and 3 others like this.
  26. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,706
    Looking forward to some video showing the dithering effect. I'm wondering if there are opportunities there for a more artistic / illustrative type FX?

    Also, the improvements to contact shadows. I'd be curious to see how this looks on a closeup of a moving character.
     
  27. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    @hopeful,
    Yes v2.0 provides bayer and ordered dithering (with built-in matrices and arrays) for all shadows but in v2.1 you will be able to plug in your own dithering textures (blue noise, white noise, etc).
    Not just artistic but performance and visual improvements. :)
     
    hopeful likes this.
  28. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    339
    I don't have video, but here's some stills, without/With the dithering.



    This was early in the beta and that acne in the first has since been rectified but I wanted to show how if such a situation did exist, the dithering does a nice job of hiding it.
     
    tatoforever likes this.
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    I'm working on some in-game videos but here are some preview images using only 4 samplers per pixel which is the same amount of sampling Unity does for Local soft-shadows while looking softer and smoother. You can't get more extreme than that.
    Standard Noise v1.9 (only 8spp):
    upload_2019-1-14_19-45-21.png

    Shadows Dithering v2.0 (only 4spp):

    upload_2019-1-14_19-44-54.png

    upload_2019-1-14_20-22-14.png

    Not bad for only 4spp. :cool:

    In this video we can see the same quality count (4spp):


    In v2.0 the random sampling get's feeded with screen space position.
    Not only that but the sampling jittering is not visible with dithering so it's excellent for extreme low sampling count situation where noise gets super jumpy and visible.

    Images and video taken from a game we are working on for Nintendo Switch. So yeah, shadows must run fast and look pretty! :D
    PS: I'll add more images soon.
     
    Last edited: Jan 15, 2019
    ftejada, hololens90, OCASM and 5 others like this.
  30. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    Another comparison between the new noise and dithering algorithms both available in v2.0. Quality and other aspect of shadows can now be tweaked at runtime for all lights through a new NGSS_Local component.

    Noise (4spp):
    upload_2019-1-16_14-32-24.png

    Dithering (4spp):
    upload_2019-1-16_14-32-36.png

    Both images showcase extreme fast PCSS shadows with only 4spp. On top of that, PCSS is now as fast as PCF as the blocker search got reworked to act as an early bailing out algorithm for both filters.
    I also added lot of useful tips in the documentation to help you out with quality, speed and look of your shadows in your projects when using NGSS.

    PS: Working on the launch trailer and submit as soon as is done.
     
  31. wwg

    wwg

    Joined:
    Apr 2, 2014
    Posts:
    108
    @tatoforever, I'm still having trouble with this. I've tried your suggestions and still not working correctly. Although, my solution of placing NGSS on both the main camera and the weapons camera worked, there now appears to be a major impact on FPS performance. The UFPS weapons camera is already set to clear DepthOnly by default.

    This shows the issue when the NGSS script is only on the main camera.
    ngss_arms1.png
     
    Last edited: Jan 17, 2019
  32. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    @wwg,
    This is a common problem in FPS games that uses two cameras (world and hands cameras) in one single 3d scene. For performance reasons (and other lighting/display reasons) I wouldn't suggest to use more than one camera. With one camera setup, the trick is to avoid characters hands getting inside objects by animating hands and providing larger collision when really close to obstacles.
    Other tricks includes combining both cameras depthmaps but this can also risk performance issues as you are basically blitting the whole screen RT twice. With SRP you can also create your own FPS renderer in which you will render your arms at the very end of the pipeline overwriting any existing depth (this is not trivial to do and requires graphics and rendering knowledge).
    I'm going to give this a go soon and provide a solution for multiple cameras setup, but keep in mind one camera setup is the ideal way for built-in renderer.
     
    Last edited: Jan 17, 2019
  33. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    Let the darkness take control:

    I got longer version of these videos, will be available at launch.
    PS: Updating the main product page today. Submission will happen tomorrow.
     
    ftejada, TreeMSI, buttmatrix and 5 others like this.
  34. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    NGSS 2.0 is awaiting review and will be available here (sometime next week): http://u3d.as/1qNz
    I updated the main page too but here are a couple of new images from it:

    NGSS 2.0 logo.png
    directional shadows.png
    contact shadows.png
    denoiser_pcss.png
    point shadows.png
    Asset Store Link: http://u3d.as/1qNz
     
    Last edited: Jan 20, 2019
    tspk91, hololens90, Zyblade and 3 others like this.
  35. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    In v2.0 ContactShadows get the benefit of the new Denoiser for free. But in v2.1 Im reworking ContactShadows to be more like a hackish RaytracedShadows so you can display really far frustum shadows at the cost of more sampling of course. But you will be able to adjust the distance, quality and number of sampling to suit your needs.
    This new addition in v2.1 alongside with the primitive shadows will be a sort of "raytraced" focused update.
    I'm also experimenting with aperture shadows for large meshes (including terrains) which is a totally different technique from the others two.
    At this point anything that goes beyond that (including DXR and RTX support) will go to future versions of NGSS family products with SRPs.
     
    nirvanajie and ceebeee like this.
  36. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    339
    Sounds good. Speaking of RTX... people were excited about this today in the Unity Discord:



    Seems the latest GitHub release of HDRP pipeline has Raytracing (at least on the interface)
     
    tatoforever likes this.
  37. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    My plan is to use one single ray per pixel for hard shadows then apply NGSS filters (screen space) to it, including denoiser and other new goodies! And so, it will run super fast while being super soft. ;)
    I have other crazy ideas as to record nearest point distances using raytracing and compute AO, soft-shadows etc from it. I will land some images and videos once Unity support the new API.
     
    Last edited: Jan 22, 2019
    hopeful likes this.
  38. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    I got this guy working for v2.1:

    Infinite shadows range at will. After all it's raytraced! :D
     
  39. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    339
    That's how the sun usually works after all, 93 million miles away and we still get sharp shadows ;P
     
    tatoforever likes this.
  40. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    @ceebeee
    In the video I pushed the point light far out of view and shadows remain sharp because is frustrum based. Also the light falloff is disabled in the video so we can visualize extreme out of view shadow ranges for local lights. ;)
     
    ceebeee likes this.
  41. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    339
    The sun is actually a point light in RL :p Unity got it wrong! Conspiracy!
     
    tatoforever likes this.
  42. mehrankan

    mehrankan

    Joined:
    Apr 12, 2015
    Posts:
    52
    @
    so this is exactly what I need, but will it work in vr on old cards like 970.
     
  43. mehrankan

    mehrankan

    Joined:
    Apr 12, 2015
    Posts:
    52
    I mean in my project I have a point light working as a sun , can't use a directional light because the art brief does not allow that. So the biggest problem than becomes that the real-time shadows come off as extremely crap!!!. I did post earlier about this but seeing this gives me a bit of hope.Any chance ngss2 will solve my problem out of the box? I work in vr btw.
     
  44. Suki-W

    Suki-W

    Joined:
    Mar 11, 2014
    Posts:
    33
  45. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    @mehrankan
    The new raytraced local shadows is not a full shadows replacement. Objects outside the screen won't cast raytraced shadows as it is frustrum based. If you can live with that, then yes it can help solve you problem. Works with VR and any GPU capable of SM3.0+.

    @Suki-W
    HDRP support is planned for this year but for now NGSS is only compatible with Standard pipeline.
     
  46. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    207
    is this requiring a card that supports raytracing, ie an rtx card?
     
  47. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    @thelebaron
    No, any GPU capable of SM3.0+ will support it fine.
     
    ceebeee likes this.
  48. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    NGSS 2.0 got approved 4 days ago but v2.0 isn't live yet. I think when an asset gets a new release with an upgrade (like i did with v2.0) there's some manuals steps to be done by the Asset Store folks that weren't done.
    I wrote them and will get back from them next week. Hopefully it won't take long.
     
    hopeful likes this.
  49. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    643
    Are transparent objects able to receive shadows with your solution?
     
  50. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,722
    @SunnySunshine
    Out of the box no, but I provide a free custom standard shader for semi-transparent surfaces to receive shadows in a hacky way. Works best with decals or meshes close to opaque objects. This shader is not part of NGSS family but some NGSS users asked me and I've provide them for free. :)
    This same shader is the one I used in the NGSS showcase videos with indoor shadows (the dirty toilets scene). All decals and scene semi-transparent parts use that shader.
    Reach me out through support email with your invoice number if you ever need it.
    Cheers,
     
    alternativevisual and ceebeee like this.