Search Unity

  1. Unity 2019.2 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. Rohirm

    Rohirm

    Joined:
    Oct 17, 2017
    Posts:
    9
    Hi, after updating to the latest version all the shadows were missing. After I enabled the "NGSS_MANAGE_GLOBAL_SETTINGS" in one of my spotlights they appeared again. What is this setting exactly? Should it be enabled? If so, is it good to leave on only for one spot or for all?
     
    Last edited: Jun 13, 2019
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    Hi,
    On Local shadows (Spot & Point) you need one of your scene lights to act as manager to feed global properties for lights. That's what option is for. The rest of your light don't need to be managers, only one.
     
    Rohirm likes this.
  3. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    Folks,
    Version 2.1 is out, go and get it and let me know what you think of the new features? :)
     
  4. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    Playing with various blue noise signals:

    Blue noise offers better banding and noise removal compared with random white noise. In this test only 8spp with one denoiser iteration.
    From 1m21 to 1m50 I switch over dithering and we can already notice the banding. However dithering stabilizes more the noise at the expense of banding on the other hand blue noise jumps way less than standard random white noise.
     
    Last edited: Jun 13, 2019
    OCASM likes this.
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    Blue noise on Local Shadows.
    Point Shadows (8spp):
    upload_2019-6-14_2-3-35.png

    Point Shadows (default sampling):
    upload_2019-6-14_2-5-9.png

    Our current game for Nintendo Switch (only 4spp):
    upload_2019-6-14_2-50-11.png
    In a real game scenario it should look even better as shadows blended with low frequency material looks even better.
    The banding removal by blue noise signals is incredible!
    Oh yeah, I'm submitting this update tomorrow! I just need to finish a new stuff that I got for the Denoiser (yeah more improvements) and it should be ready for submission. ;)
     
    Last edited: Jun 14, 2019
    OCASM, Elecman, Akshara and 1 other person like this.
  6. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    NGSS v2.1.5 just got submitted for review:
    Features and Changes:
    - Blue noise shadows (the default shadows now). NGSS provides various blue noise textures but you can use any noise input with any pattern you want
    - Minor tweaks to the Denoiser
     
    OCASM, Zyblade, Lex4art and 1 other person like this.
  7. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    382
    I miss NGSS in HDRP.
    Have a look on Fontainebleau Github update for 2019.
    It needs NGSS support.
     
    Last edited: Jun 15, 2019
    tatoforever likes this.
  8. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    @keeponshading
    Is planned for this year. I'm waiting for it to be more final cause HDRP is constantly changing. :)
     
  9. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    V2.1.5 is out with blue noise shadows. Let me know what you think about it.
     
  10. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    93
    If I put the noise texture innto the slot, I can't make out a difference. But I think I have to adjust the resolution before. Is the "NGSS_NOISE_TO_DITHERING_SCALE" on purpose a 0 or 1 slider? I can't move it in between those values.
    And yes, I cleared my cache in admin mode before.

    edit: Okay, if I change the resolution to a lower one, the noise becomes much better than dithering. But still no difference between no texture and blue noise tex in the slot, I zoomed in pretty close and turned down environment lighting for deep black shadow, so noise become clear.
     
    tatoforever likes this.
  11. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    I forgot to mention that when you change the noise texture you have to disable/enable the NGSS light component for the changes to take effect. Reason is that the noise texture is feed globally once (OnEnabled) to avoid any runtime overhead.
    Going to add a note into the documentation about it.
    [EDIT] If NGSS component detects no noise texture, it will load the default one which is BlueNoiseR8_8. So make sure when you add your custom noise texture to disable/re-enable the NGSS component for changes to take effect.
     
    Zyblade likes this.
  12. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    93
    Okay that works. I can't make much difference between the individual noise textures, but as I said, at really low resolutions, blue noise can improve the look quite a bit. But the info message on the NGSS_NOISE_TEXTURE is still confusing. "If you se the noise scale value to something less than 1,..."
    Well I can only set it to 0 or 1, like an int slider : P I can fix that myself, but I'm still wondering if the info is wrong or the slider behavior^^

    edit: gonna get some sleep now. Thanks for the update, ngss is one of the first things I add to any 3d project^^
     
    Last edited: Jun 17, 2019
    tatoforever likes this.
  13. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    The individual noise textures are mostly the same just generated with a different blue noise pattern.
    The NGSS_NOISE_TO_DITHERING_SCALE is an interpolation value. When is set to 0 (default) = blue noise shadows and when is set to 1 = dithering shadows. Use blue noise when you are looking for absolute no banding and use dithering when you want to avoid noisy shadows (specially at close range).
    If you edit the NGSS light component you can set NGSS_NOISE_TO_DITHERING_SCALE to a float and blend between blue noise and dithering. I did zillions tests and is best to keep it either 0 or 1 otherwise you might end up with the worse of both case scenarios (noise and banding) but feel free to change it to a float and experiment yourself. :D
    Cheers,
     
  14. zeohn8

    zeohn8

    Joined:
    May 21, 2017
    Posts:
    2
    Hello! I want to ask you a question about your amazing asset.
    I have been working with real-time shadows in my project and everything worked fine, but after changing the Shadowmask Mode from Quality Settings to "Shadowmask" to work with Mixed lightning and improve optimization in the project, the static objects don't cast shadows above dynamic ones and even seems that Light Probes are not working. The character moves around the Light Probes in scene but does not change the appearence of the character between dark and brighter zones. Do you know if it works well with Shadowmask Mode "Shadowmask"and Mixed Lighting?

    Thank you!
     
  15. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    @zeohn8,
    NGSS Shadows works the same way as Unity Shadows with ShadowMasks, it uses the same built-in renderer so you will have the same behavior you currently have with ShadowMasks. However the upcoming feature "Shadows Cache" is a better alternative to ShadowMasks as it creates better static shadows filtered with NGSS algorithms that can be casted on dynamic characters. The rendering of static shadows are done on the GPU like regular shadowmaping really fast (from ~0.1 to ~1ms depending on the ammount of static objects to render). Plus you can control when static shadows updates (eg: when the scene loads or whenever you want to update it at runtime). Shadows Cache is still in dev and will soon enter test pahse. Planned for v2.2 (early this summer).
    Let me know if that answers your question? :)
     
    Last edited: Jun 20, 2019
  16. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    Got a couple of folks asking for some time CloseFit support in NGSS. I started doing some black magic trickery to support CloseFit in the next version. You'll be able to have the same soft-ness goodies but now with less aliasing and very smaller shadowmap size. Video coming very soon.
     
  17. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    NGSS CloseFit support:

    It works better without cascades. I try to match shadows softness with Unity blackboxed CloseFit wonky projection using some view angle computation (few instructions more). Is not perfect but this can be handy for people willing to display very large distances and avoid some of the limitations of StableFit projection.
    You can have access to it right now (send an email to support with your invoice number if it's your first time).
     
  18. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    Infinite Frustum traced shadows:


    Everything is frustum traced. Ultra fast to render (is an extension to the current ContactShadows)! No need RTX/DXR! . No shadowmap was used in this video though.
    This beautiful open world game we can see in the video is "WolfQuest: Anniversary Edition" and I'm helping them folks to optimize their shadows and other stuff in their game. :)
    If you want to know more about this game head to their web site: WolfQuest.org
    Coming very soon to NGSS (v2.2). :)
    [EDIT] Say good bye to Cascaded Shadows, forever!
     
    Last edited: Jun 29, 2019
  19. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,030
    I've been looking for two and half years for a way to have distant shadows in our game map, and it's quite incredible to see them now in the game. And for no more GPU cost than NGSS's regular contact shadows! Just stupendous work by tatoforever. This is a must-have for any open world game.
     
  20. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    782
    That looks amazing! I imagine those shadows would have far more simple filtering than the traditional ones, but that's not bad for the incredible benefits you get.

    I wonder if this kind of shadows can be used as a fallback past the distance where a single-cascade shadow map is being rendered. Then games might be able to enjoy all the benefits of advanced techniques like PCSS like keeping distant objects shaded nicely - and past a certain distance, you don't necessarily need PCSS anyway. :)
     
    tatoforever likes this.
  21. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    @bac9-flcl,
    Yes, that's the whole idea, use frustum traced shadows for very fine small details and infinite view shadows in combination with upclose short distance directional shadows. Your upclose directional shadows can be either Unity shadows or NGSS shadows. You only need to have installed NGSS libraries and NGSS_FrustumShadows on your cam. This new component replaces NGSS_ContactShadows as it does both upclose fine details and infinite long range shadows too for the same cost. :)

    PS: I will record a new video with Directional and frustum shadows enabled and post it later tonight. :)
     
    Lex4art and Vagabond_ like this.
  22. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    782
    God, that's music to my ears :D
     
    tatoforever likes this.
  23. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    93
    Really nice! Now I don't know for which feature I more eager to get them! Primitive shadows or frustrum traced shadows >.< Keep on shading, this is a great feature addition =)
     
  24. Bzuco

    Bzuco

    Joined:
    Sep 6, 2015
    Posts:
    44
    @tatoforever Can be the frustum a little bigger than camera frustum is? I the video I see disapearing shadows from object which goes away from the camera frustum. Or please add an option to enable frustum traced shadows only from certaind distance. :)

    Current contact shadows have this issue too and I was forced to not use them. :(
     
  25. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    @Bzuco
    They are limited to what's on your cam view (depth buffer) hence the frustum name. Same as anything view dependant. However is extremely cheap to render infinite vistas and that's a huge winner. Most games don't have any shadows after 150-200m and it looks horribly aliased and pixelated. xD
    However, you can mitigate the view dependant issue by using a smaller portion of your game view upscale to the whole screen and so when objects enters the hidden frustum it won't be noticeable (similar idea to directional shadows). But that's an idea on paper, need to implement it and test it. For now is limited to the whole view. :)
     
    Last edited: Jun 29, 2019
  26. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    Demonstration of a perfect combination of Frustum traced shadows and directional shadows:

    At the beginning only a short amount of directional shadows is shown, then later on frustum shadows is enabled. You can notice how the sharp close up details blends well with the very soft directional shadows.
    The cost of frustum shadows is similar to a very cheap AO and the results is faster and prettier short-range and infinite view-range shadows. Trying to display 15KM+ of shadows in a cascaded depthmap is close to impossible, looks ugly, aliased, pixelated what not and requires huge amounts of memory and computation. In this video a very short range (~40m) non-cascaded directional shadows with a small (1024x1024) depthmap was used.
    Credits to: WolfQuest.org
    [EDIT] If you are looking for maximum quality and performance you can entirely disable Cascaded Shadows and use a small range directional shadows in combination with the new upcoming frustum traced shadows. This combination is a lot faster and more efficient than cascaded shadows itself!
     
    Last edited: Jun 29, 2019
  27. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    I'm planning to move frustum traced shadows into compute shaders because I can improve speed a lot more and use larger rays lengths for even better raytraced shadows! Probably not for v2.2. On 2.2 I'll ship directional and local (yeah point/spot) frustum traced shadows alongside the long awaited gradient bias for point shadows and then focus on moving frustum traced shadows into parallel compute shading for maximum efficiency and performance in v2.3.
     
    jcarpay and alternativevisual like this.
  28. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    66
    It looks so gorgeous and promising!
    But, will be there an option to use them without compute shaders? :confused:
    Cause my friends PC doesn't support them :D
     
    Last edited: Jun 29, 2019
    tatoforever likes this.
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    @ alternativevisual
    Yes, is a full replacement for ContactShadows. In fact the file will get renamed in the next version to NGSS_FrustumShadows. As for ComputeShaders, your friend should be fine if he has a DX11 GPU.
     
  30. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    320
    Is FrustumShadows for directional light only?
     
  31. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    For all lights types. I'll post a video later today showcasing frustum shadows on point lights.
     
    id0 likes this.
  32. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    66
    But he doesn't :p
    Maybe it's just really too old to support)
     
  33. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    The minimum supported API by Unity is DX11. I think since version 2017 DX9 support have been dropped.
     
  34. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    More frustum shadows showcase:

    This beautiful upcoming multiplayer game is WolfQuest.
     
    hopeful likes this.
  35. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    926
    Hi @tatoforever ,
    do you plan to raise the price for next versions ?
     
  36. asdzxcv777

    asdzxcv777

    Joined:
    Jul 17, 2017
    Posts:
    28
    i bought ngss 1 in january 2019 end and it became deprecated soon after.
    It says it is deprecated and replaced by new version, but it seems I will have to buy the new version as well which seems unfair as I could not use the asset despite paying for it
     
  37. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    93
    No worries, as you own ngss 1, you get a discount for version 2. Instead of paying 30$, you pay 15$.

    Here you can read it up:
    https://forum.unity.com/threads/nex...shadows-for-unity.440088/page-39#post-4166299

    Btw., the old version is still downloadable and usable from within unity, if you already own it.
     
  38. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    @asdzxcv777,
    You can use the deprecated assets forever, its on your AssetStore account and NGSS 1 works fine even on Unity 2019.2.
    You also have a 50% discount forever on ver2 as you own ver1.

    @ Vagabond_
    The price will remain the same for every renderer version. That includes current discounts (v1 owners, plus/pro, etc).
     
    AndyNeoman and Vagabond_ like this.
  39. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,440
    latest one seems a bit broken with 2 cascade splits... 1, 4 is ok though
     
  40. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    @Player7
    What do you mean by broken? What seems broken? Do you have any screenshot or video?
    Cheers,
     
  41. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    870
    These look fantastic. I'm knee deep in other stuff at the moment but soon will be looking at performance and this looks like a nice upgrade from v1
     
    tatoforever likes this.
  42. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,440
    Yeah I'll post a screenshot later
     
  43. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,440




    so yeah.. only 2cascades is broken...
     
  44. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    That looks like Unity broken shadows culling system. Did you tried disabling NGSS and see if it happens to Unity shadows?
    Cheers,
     
  45. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,440
    I forgot.. but I did update to the latest 2019.1.6f1 version, deleted library, reinstall cginc stuff.. and same prob... just takes ages doing the library, but basically its broken...either the asset or unity shadow stuff, and no idea what needs reporting on that front
     
  46. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    If there's a projection or culling problem is 100% Unity cause NGSS uses the internal renderer for all that stuff. I remember Unity 2019.1alpha had a similar shadows projection problem. Just report it as a normal Unity bug and provide a simple test project. If is related to the same i had, I've already reported but looks like still not yet fixed. :(
     
  47. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,440
    tatoforever likes this.
  48. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    I also reported that one too. My conclusions where to not use Unity 2019 just yet. The cascaded projection issue in 2019 looks to be partially fixed but still the problem persist with two cascades. So try to submit an other bug report and tell them that the problem persist but now with two cascades. :\
     
    hopeful likes this.
  49. zagreekie

    zagreekie

    Joined:
    Nov 20, 2017
    Posts:
    13
    Hello, just grabbed your asset, looks awesome. However I am getting these minor artefacts on the floor of this image, notice pixels of a pure shadow next to ones of pure light, is there any way to smooth this out a bit?
    upload_2019-7-3_15-49-53.png

    Second minor question, i get this edge between what i am guessing is the near shadows and far shadows. where the near area is noticeably more lit then the far area, it seems to be a box around the point light. light render issue.png
     
    Last edited: Jul 3, 2019
  50. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    3,895
    Hi @zagreekie,
    So first issue can be solved by rising the sampling (specially the test sampling).
    The second one happens because Unity has a hardcoded bias in the renderer that is close to imposible to reverse. Howerver in the next version I'll provide a gradient bias to point light shadows (already available to directional and spot shadows) that should remove this problem and improve any bias related problem on point lights shadows.
    Thanks for grabbing the asset! :)
     
    hopeful likes this.