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

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    With the latest version there are no shadows in builds, works fine inside unity (runtime)
     
    Last edited: Jul 21, 2017
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @olavrv
    What kind of shadows are not visible? Can you provide more info, images, logs?
     
    Last edited: Jul 21, 2017
  3. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    nice small demo! reminds me of silent hill! any info on the project?
     
  4. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @nbac,
    It's the game we are currently working on. We already published a mobile version. Now a new version of the game is coming to Desktop/Consoles. Though, the video and scene quality is garbage, a bit over saturated and too much specular. ^^
    PS: This game uses NGSS and our custom renderer (which is being ported over SRP).
     
    buttmatrix likes this.
  5. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Hi, there are no shadows in builds when using latest version of NGS (same as if shadows were disabled)
     
  6. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @olavrv
    I need more info, try to make development build and attach profiler to the player, it will provide player build logs.
    Build log errors could help too but development builds with profiler attached are better to catch playerbuild runtime errors.
     
  7. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    How do you guys find the new update? Me want to see some of your shots! :)

    I'm working on an new early bailing algorithm and compacting depth comparison in multiple channels for additional performance boost. Video or it never happens:

    Basically, what it does, it averages few samples around a kernel and then using dynamic branching if fragment is lit or if the fragment is occluded early out. Computing only PCF/PCSS filtering in the penumbra area (the soft part of shadows). Also provides small extra bias support for free as kernels are not stretched in lit areas. :)

    PS:
    Directional Early Bailout optimization is ready, if you want access just ask support. Spot and Point coming tomorrow. :)
     
    Last edited: Jul 23, 2017
    scvnathan, Invertex, Seneral and 5 others like this.
  8. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    ^that perf advantage, wow
     
  9. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    I have a couple questions. In older versions you were supposed to use "Built in shader settings, to set Screen space shadows to the "Internal-screenspaceShadows" shader from NGSS. But I don't see anything about that in the new instructions. Should you still do this or not?

    In the instructions I see: "Bonus: If your target platform is Desktop or Consoles, try to enable 32 bit depth buffer in
    Graphics Menu, this provide better shadows precision (less panning) with larges distances."

    But if I go to Edit->Project Settings->Graphics, I don't see anything about depth buffers. I do see something that says "Prefer 32 bit shadow maps" is that what you mean? (this is with Unity 2017 by the way).
     
  10. churi24

    churi24

    Joined:
    Sep 17, 2013
    Posts:
    98
    Thanks for helping us! the response and solution was faster than speed of light! Now we have our game running at 60fps with Soft Shadows and in an old video card!! =) This asset should be at least at 50 bucks because Unity didn't solve this problem, and shadows are really important to take your game to the next level, to a realistic world.
    Screenshot from our Project Nightmares.
     
    Last edited: Jul 25, 2017
  11. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    This asset now have a good 20$ price, as Unity didn't solve this problem, it has a huge demand =-)
    But for future NGSS v2.0 with Volumetric Light and SSAO on Steroids, i will pay any amount!)
    Btw, tatoforever, what to you thinking about performance of your AO solution (or you can not)? Some days ago, keijiro ported MiniEngineAO made by Microsoft team, which is have an increadible performance and quality.

     
    tatoforever likes this.
  12. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @ceebeee
    Hey man,
    Yeah my bad, I should've mention that 32bit depth buffer is only available in Unity 2017 and for directional shadows.
    Next update which focus 100% on huge performance gains (see video below) will be submitted sometime tomorrow and will have that lil detail in the doc.
    Thanks for pointing out.
    Regards,
     
    ceebeee likes this.
  13. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @N3ON47
    With that many good AO solutions on the store, is not my main focus right now. What I will probably do is have direct support for those AO solutions within NGSS. Like having some ways to directly inject those AO to NGSS buffers to improve their quality even more.
    So yeah, instead of developing another AO and compete with some many others AO, my focus is mainly on our unique solutions (NGSS and custom renderer). Specially NGSS, I got really good stuff coming to it: new filters, screen space bilateral filtering, deferred shadows, projected shadows, spherical cascade blending, atlasing, lot of speed optimizations and many other goodies. :)
    Like I said, it's an ongoing solution and still heavily researched. :)
     
  14. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    Folks,
    In version 1.4 I've changed how filtering is being set (changing filtering type through shader). Forcing one filter at time I believe is counter productive and some people don't want PCSS at all, they are looking for uniform soft shadows.
    So, I've decided to provide you folks both filters PCF and PCSS by choosing between shadows-type. That way, you can switch between filters for any light (more flexibility) without the need of editing the shader file.
    PS: I've updated the documentation (please read it every update). :cool:
    Cheers,
     
  15. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    hi @tatoforever ,
    that's my shot with PCSS disabled:

    great job with the latest version!! ;)
     
    punk and tatoforever like this.
  16. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @ghiboz
    Good looking shot, shadows are quite soft. :cool:
    This week update bring massive optimizations to the table. PCF/PCSS shadows are now quite cheap to render and skyrocket performance by huge marge. :)
     
  17. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    ^thank you so much!
     
  18. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    Point light shadow example scene with 64 taps and early bail out optimization enabled. :eek:

    This is beyond ridiculous. :cool:
     
    OCASM, Howard-Day, punk and 4 others like this.
  19. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    Folks,
    Today I did a blocker search optimization for the point light shadows PCSS algorithm which makes it 50% faster than before + the new early bail out optimization = tons of speed improvements for all shadows type.
    All my tests where done with 64taps shadows and I've saw ridiculous gains of performance. :)
    Update is ready, you can bomb support for early access now. :D

    PS: Already submitted to the store. ;)
     
    Seneral, ghiboz, hopeful and 3 others like this.
  20. Howard-Day

    Howard-Day

    Joined:
    Oct 25, 2013
    Posts:
    137
    WHEEEEEEEEEEE. I gotta use this for something. :D
     
    tatoforever and buttmatrix like this.
  21. UnityCommunityAccount

    UnityCommunityAccount

    Joined:
    Jul 25, 2017
    Posts:
    1
    Here's a scene with NGSS + SEGI. With the optimisations I average ~45 fps compared to ~30 with the previous NGSS versions, making it much faster than unity shadows while looking far better. Thanks for this asset!


     
    Last edited: Jul 25, 2017
    OCASM, hopeful and tatoforever like this.
  22. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @UnityCommunityAccount
    Yes, both NGSS filters PCF and PCSS are now officially faster than default Unity PCF optimized shadows.
    In your test scene I see it's PCSS, if you put PCF it's 2x faster than PCSS. :)
    I personally love PCSS because it's closer to raytraced offline shadows and plays well with Area lights.
    PS: Great looking shots you got there. Btw, your third image cannot be displayed (it's higher than 5MBs), try upload it again in a different format, Jpg or something else.
     
    Last edited: Jul 25, 2017
    nxrighthere, OCASM, Seneral and 2 others like this.
  23. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Hi,
    Really awesome asset so far! Glad to hear about these awesome performance improvements, too:)
    Had some troubles setting up the contact shadows though, you need to explicitly set the Renderin Path on the camera (not 'use graphics settings') for them to work, else the component can't be enabled. This is nowwhere to be found in the docs though, just remembered it in the back of my head reading here...
    On that note, would also have loved to read the documentation before buying, maybe put in online somewhere and put a link here. Even if it only contains simple setup steps, I was very weary without knowing what these steps were (I only heard about replacing unity shader files). Reading it for the first time then made it seem way easier:)
    Thanks for this asset!
    Seneral
     
    tatoforever likes this.
  24. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @Seneral
    And there's even more optimizations coming to v1.x. Edge dilatation is one of those. :cool:
    PS: I will attach the documentation to the first post of this thread for future ref. :)
     
    Seneral and buttmatrix like this.
  25. OCASM

    OCASM

    Joined:
    Jan 12, 2011
    Posts:
    328
    If you work on capsule shadows, that technique can be used for AO as well. The Order 1886 is a good example of this.
     
    tatoforever likes this.
  26. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @OCASM
    Yes,
    Capsule Shadows are planned for NGSS 2.0. :)
     
  27. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    Great work you're doing here bro
     
  28. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    So yeah folks,
    NGSS 1.5 is live on the Asset Store which features new early bailing algorithms for crazy speed boosting.
    I'm working now on a global settings component that will let you tweak shadows settings. It will be a global setting script with similar settings you already have access to (through shader) but with the advantage of tweaking at runtime without leaving your project. Global settings will let you tweak all spot, point and directional shadows.
     
  29. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    And i have 7 fps average.. (?????)
     

    Attached Files:

  30. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    But without PCSS and with 4 point light on low res, i have 55~ fps. I know, something wrong with my PC, but 7 fps is just not funny joke)
     

    Attached Files:

  31. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    There seems to be some process running in unity (see taskbar), maybe 'Auto Generate' is enabled in the lighting window and it calculates lighting?
    Or some other stuff. But the 100ms CPU time most definitely does not come from NGSS...
    Haven't yet tested the new update yet though, maybe there IS some huge joke calculation;)
    Seneral

    EDIT: Also there seems unnaturally much geometry in your scene... 38k tris? Where from?
     
  32. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @N3ON47
    What was your average fps before v1.5?
    What's your computer spec (cpu, gpu, memory, etc)? Up to date drivers?
    Can you send some pics of your profile running?

    [EDIT] You should not have more than 3 point light casting shadows at time. Modern shadowing techniques stop around 18 shadow casting lights but due to the fact that point light shadows have 6 faces = 6 * 3 = 18 leaving little to no room in the shadowmap atlas for other shadows.
    Also, depending on how powerful your computer is you want to reduce the number of samplings. You can go from 16 up to 64. The latter recommended for high-end PCs.
     
    Last edited: Jul 26, 2017
  33. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,546
    Lookin really good on Unity 2017, keep up the great work :)
     
  34. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    Invertex likes this.
  35. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,682
    Very awesome. :)
     
  36. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Incredible, beautiful. You are using real-time GI or baked or SEGI?
     
  37. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,546
    Just Unity realtime+baked GI in new Distance Shadowmask mode, along with some reflection probes and light probe proxy volume and Unity Post-Processing stack v1.
     
    buttmatrix and tatoforever like this.
  38. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    Been loving the new update! Awesome stuff!

    If i might put in a feature request?

    I'm currently working on a game that uses shadow maps for most of its shading. Abzu does something similar but also appears to have a really awesome feature where instead of going straight from lit to shadowed it fades over some distance. Its like if shadow bias has a min/max distance. When this is turned up it can turn into both a way to remove aliasing and also a fake SSS method for this kind of shading. In unity 2017.1 they added a feature that is supposed to let you sample raw depth while also performing a PCF.

    abzu_13.jpg

    I have no clue if this is even possible in NGSS but it seems like it could be a useful thing to make shadow acne less visible while not being as heavy handed as raw shadow bias. both in combination could be awesome! Sorry if its too niche but i have to ask.

    Thanks for reading,
    -Cynicat
     
    tatoforever and Howard-Day like this.
  39. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    Before 1.5.1 on PCSS point light demo scene i had 30 fps average, i think it because of count of samples, but, i don't want to edit it in the shader, can it be like option in a script, or depended on shadows resolution?
     
  40. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    I tried to search for "emissive" in the thread but results came up empty. So, does this asset support shadow casting from emissive materials, or perhaps area lights? (Area lights come up in search results, but unclear how to properly use this. Is there perhaps a tutorial on how to create a large office-style ceiling lamp and have it cast shadows, something I think currently impossible in standard Unity?)
     
  41. id0

    id0

    Joined:
    Nov 23, 2012
    Posts:
    455
    Great shadows you make, I'm happy with it. Shadows is very important for my game.
    But with those shadows 2.0 - will you continue support old shadows as well?
     

    Attached Files:

    tatoforever likes this.
  42. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @N3ON47
    I'm working on a global_settings script to let you change all that stuff at runtime without leaving the editor (coming this week update). What's your computer spec btw?

    @Cynicat
    Can you showme some video/images displaying that behavior you are talking about (the bias fade thingy). :D

    Unity 2017 provides inline sampling to do multiple sampling types per texture but this doesn't help much if you don't have access to the internal shadowmap texture format and NGSS works with Unity internal shadowmaps.
    PS: It won't be a problem with NGSS 2.0 thought. ;)
     
  43. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @roberteker
    Area light shadows can be simulated with NGSS PCSS filtering and a really wide large kernel size. Thought right now to have larger kernels you need to change the shaders and editor light properties only let you reduce the kernel size (not go higher). In this week update I'm exposing all those internal options through a single global script.
    The idea of PCSS shadows is that, simulate area light shadows:
     
    Last edited: Jul 26, 2017
    OCASM likes this.
  44. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Hi
    I've been reading and searching the thread and think I understand but want to check:

    Android shadows?

    My hesitant conclusion: Not until a bug is fixed.

    In one place I saw mention of a bug that says custom shadows are overwritten and in another, I saw mention of their being as expensive as Unity default on Android so are viable. I took the latter to mean they do work but... that'll be once the bug is fixed? Sorry if I got myself confused. Any clarity would be really appreciated.

    I have several candidate games to use it in but this question most concerns one for mobile VR (Cardboard, etc) so yeah it's performance first, pretty second. My main interest is that, playing as a rabbit, the default shadows are super-close and blocky so look even more awful than usual!

    ...hmm... writing this I just realized I should try scaling everything up and see if that helps!

    Thanks!
     
  45. Seneral

    Seneral

    Joined:
    Jun 2, 2014
    Posts:
    1,206
    Upscaling will shorten the shadow range in relation to your game world (and it might mess up other game relevant stuff like physics), but no magically increase shadow map size;) If you can sacrifice some shadow range, you should put your shadow distance down, which will increase the shadow resolution per unit:)
    Seneral
     
    Arkade and tatoforever like this.
  46. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @Arkade
    Latest NGSS version provides really good performance boost and makes it faster to render than default optimizedPCF unity shadows. Which makes NGSS a good candidate for great looking shadows on mobile. But yeah, the bug still there, the case still open and I have no idea when Unity will fix it. I've provide them ways to reproduce it easy but they just seems not worried about it. :(
     
    Howard-Day and Seneral like this.
  47. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @roberteker
    Another good visual representation of how shadows in real life works and what PCSS shadows tries to solve. Pay careful attention to red/blue rays coming from the sun as it represents light width (Very important in area light simulation):
     
  48. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    Another good optimization coming this week for PCSS. Undersampling blockersearch with mipmap sampling. And reducing number of samplers based on soft-ness amount (the sharper = the less samplers needed).
    And more more optimizations underway. :D
     
  49. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Thank you for your replies!

    I'm still waiting to test all this until it's fully working with 2017.1 without having to replace any Unity files.

    The first scene I'm going to light is an indoor scene without any windows, that's lit with 6 of these very large surface lights:

    http://www.hjmled.com/e/products/LED Panel Light/p307.html

    Right now, I'm attaching a point light to each, and then grouping all surrounding objects into layers to make sure that each light only affects the objects in its immediate area, and the transitions between those areas are not pretty.

    So I understand I am going to have to tweak some shader value. Will this be exposed through the inspector? I'm guessing it's going to be a while until we have an in-editor adjustable box or cone, like with boxcolliders or spotlights.
     
    Last edited: Jul 27, 2017
  50. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,366
    @roberteker,
    You don't have to tweak any shader in order to have NGSS working. Setup is done once (copy one file and drop one script in your scene) and that's all.
    You don't need to set layers or anything like that, Unity sets the proper set pass on objects that are within lights frustums. If an object isn't touching any light volume, it won't get rendered into their depth map.
    PS: Editor twekable values are underway (this week update).