Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    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. SenseEater

    SenseEater

    Joined:
    Nov 28, 2014
    Posts:
    73
    Unable to install. When i hit 'Install Local' from Wizard , Unity freezes. no crash. Running as admin on 2018.4.14f1
     
  2. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    120
    Same, I think it's because of Unity Hub. Just install the libraries manually.
     
    SenseEater likes this.
  3. tspk91

    tspk91

    Joined:
    Nov 19, 2014
    Posts:
    120
    I don't know if this has been suggested about the No update on play feature: in OnValidate, set the isSetup flag to false, that way any inspector changes will still be applied.

    Edit: another thing, the libraries installer looks for NGSS in Assets/Psychose... In many projects, it is located in Assets/Plugins/Psychose... Maybe it could search for the directory or just be hardcoded as an alternate path?
     
    Last edited: Jan 28, 2020
  4. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,866
    When we will see URP support?
     
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    @SenseEater,
    If UnityHub yes you have to manually copy the libraries now. In the next version it should be good (install tool got improved).

    @tspk91,
    By default is installed into Assets/Psychose Interactive folder but I can make the installer look inside Assets/Plugins too.

    @castor76
    Unfortunately Unity 2019.3 and SRPs are running like crap for me. Delayed a bit more until 2019 hit the LTS state.
    I will have pre-release version before that thought no ETA yet, sorry. :(
     
    Flurgle, tspk91 and hopeful like this.
  6. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    222
    Any news on HDRP support? Also - is there going to be some visual improvement with NGSS still?

    Cheers!
     
    id0 likes this.
  7. timbokoppers

    timbokoppers

    Joined:
    Nov 14, 2016
    Posts:
    46
    I would volunteer to test the URP version is you have something available?
     
  8. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    Hey guys,
    I've got a multitude of issues lately with Unity 2019.3 and some stuff inside both SRP that is slowing me down because they changed (again) but version 2.3 is a priority before finishing SRPs versions.
     
    timbokoppers likes this.
  9. AlteredPlanet

    AlteredPlanet

    Joined:
    Aug 12, 2013
    Posts:
    455
    will you have the cached shadows in 2.3?
     
  10. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    Yes! ;)
     
    Gekigengar likes this.
  11. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    286
    Any update on 2.3 release date? I don't suppose its possible to come next week?
     
  12. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    558
    Hello.

    There was a bug with the NGSS shadow that I mentioned a few months ago where when you opened a scene everything looked black until you either added NGSS component to the directional lights or disable the scripts and then enable them back but it was never fixed. So after I replaced the light shadow library with Unity defaults and deleted NGSS from the project, all my directional and spot light shadows are gone now.
    What could be causing this?
     
  13. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,491
    What's required to use Frustum Shadows? Do I need to replace the Unity shaders as well or does it work without replacement?
     
  14. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    274
    Why do shadows get blurrier when I aim the camera down?

    upload_2020-2-10_19-15-44.png

    upload_2020-2-10_19-16-0.png
    upload_2020-2-10_19-16-14.png
     
    Barliesque likes this.
  15. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    528
    Couple questions before purchase.
    Does this work with unity 2019.3.0f6?
    Does the soft shadowness bake into lightmaps using Enlighten so I can bake all that softness of the shadows into static lightmaps?
     
  16. vw_mikkokoiranen

    vw_mikkokoiranen

    Joined:
    Dec 15, 2016
    Posts:
    2
    Hi and thank you for this great asset! :) However, I've got a one issue:

    The way the NGSS should be utilized in my project is the Cloud Builds Library Integration. The manual says that I have to include NGSS libraries into my shaders, which (I think) I have already done. This makes the directional shadows correctly working for both Deferred and Forward, but spot and point light shadows are working for Deferred only. Forward spot and point light shadows are not given the NGSS treatment.

    So, could you please tell me which shaders I should actually put the lines to to include NGSS libraries for Forward rendering? And, is there something else that should be done to get those shadows working?

    I hope to hear you (or somebody else struggled with the same problem and solved it) soon!
     
  17. vw_mikkokoiranen

    vw_mikkokoiranen

    Joined:
    Dec 15, 2016
    Posts:
    2
    Hi again!

    Of course, right after commenting on this I got a step further. :D So, I created a custom shader to which I created a pass with LightMode being ForwardAdd. There I added the NGSS version of AutoLight, which made the NGSS spotlight shadows correctly working for Forward. Now, the next step would be including AutoLight to Standard shader, and so far there has been no luck with that.
     
  18. pigglet

    pigglet

    Joined:
    Aug 13, 2014
    Posts:
    113
    Hello there! I'm having a hard time trying to setup NGSS correctly in Unity 2019.30f6. My scene has only one spotlight and I want to lighten up a character (a pretty common task I believe :D ) But every time I manage to have a small details shadows (like nose shadow) I got completely ruined shadows on a big polygons - squares become clearly visible.


    edit: seems like unity didn't want to embed a gif, here is the direct link https://i.imgur.com/BXb6vCV.gif

    If I completely drop down the softness to zero - the nose shadow becomes hard but the problematic area on the sphere edge got the same big chunks of polygons.


    Of course, I just put the big white spheres to the scene to emphasize the problem but believe me on the character body parts (that are not so detailed as a face) - it looks the same. And it does not change with a shadow resolution or sampling. What am I doing wrong? Is it some kind of a bug or that's how it should works? Is it even possible to get a decent shadow quality in Unity with a simple spotlight?
     
  19. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    800
    Any updates on 2.3 release? :)

    Maybe shader cache is still in place? Try removing all shader related files from your Library root folder.
     
  20. Cactus_on_Fire

    Cactus_on_Fire

    Joined:
    Aug 12, 2014
    Posts:
    558
    Thanks, I'll try that.
     
  21. Pheck

    Pheck

    Joined:
    Jul 9, 2009
    Posts:
    194
    With all of the self quarantine going on, its a great time to get that update out... wink wink.
     
  22. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    169
    OCASM likes this.
  23. Barliesque

    Barliesque

    Joined:
    Jan 12, 2014
    Posts:
    46
    @tatoforever I've installed v2.2.5 into Unity 2019.2.20, and found that my point lights now produce no shadows at all, regardless of whether they have the NGSS_Local component added.
     
  24. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    274
    I realized my issue is i was using close fit instead of stable fit, didn't notice the documentation advises against that.
     
  25. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,064
    Question: I noticed in the docs that you need at least one component of both directional and local in my scene. What if I want to add the components purely dynamically? I already have a "Shadow Settings" component I add to all of my lights, which lets me easily set various settings, so I'd rather automatically add the local shadow component during runtime. Is this possible?

    Also, I don't exactly have a "main" point light to apply global settings to, since my world is an open world. Would there be any excess calculations done if I just have a disabled light in my main scene with a local shadow component with global settings enabled?
     
  26. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    Hello folks,
    I've been a bit distanced from the forums since all this Covid19 took off, we are confined in our houses and trying to do some side works to sustain family while also working on our game (to be released) and since Unity fails to send me email notifications (and I also fail to check forums regularly) you can reach me anytime through email support or even better, through discord: https://discord.gg/jWEUXYw
    Going to answer couple of questions now that I'm here.

    @ razzraziel
    This is what I already do with PrimitiveShadows, only that my solution works with all sort of primitives and any lights types. Having one sphere casting SDF shadows is easy. Having 100K+ primitive objects casting SDF shadows, multi-threaded, culled and working seamlessly with current renderers is tricky! ^^

    @Cactus_on_Fire
    This happens because the shadow rendering shaders expect some sample values and uniforms can't be initialized so if you don't tell the shadows system the amount of samplers (through a script) it will be zero.
    In the later versions of NGSS I clamp this uniform to at least 4 samplers so if the user forgot to add the script (that contains the sampler numbers and other properties) to the scene, the shadows system will still produce shadows @4spp.

    @ Rowlan
    FrustumShadows requires install of NGSS libraries and Deferred mode. If you have assets that overrides UnityDeferred lighting and shadows (Uber Shader, ATF, etc), you need to mod these files and add the required FrustumShadows fetch lines. Or email support, I got license of those package and modded their respective files to make them work with NGSS.

    @ Migueljb
    No, NGSS works with lightmaps (any lightmap, Bakery, Englighteen, progressive lightmapper, etc) but each of those lightmappers do their own raytracing to bake lightmaps.

    @ vw_mikkokoiranen
    For the Standard shader, if you can follow the hierarchy of included files in the Standard shader, you will see that each include files includes other include files up to the point where they reach AutoLight.cginc, at that level instead of pointing out to "AutoLight.cginc" you will point out to "Assets/Psychose Interactive/NGSS/Libraries/AutoLight.cginc" or wherever the NGSS libraries are located in your project. AutoLight.cginc points to "UnityShadowLibrary.cginc" but since you are loading the one in your project (instead of the one on Unity Install path), it will pick the right one.
    For Deferred files is the same.

    @ pigglet
    As bac9 suggested, you need to remove the ShaderCache. This was automatically done by the installer but since UnityHub (2019+) the installed doesn't work as it overrides the app priviledges and sets it to standard priviledges and NGSS install tool can't delete the ShaderCache nor install/uninstall the libraries automatically, it have to be manually done as in NGSS 1.x. I'm working on an external C# program that will be able to bypass Unity rights and be able to install/uninstall it automatically in v2.3.

    @ Barliesque
    Did you cleared your ShadowsCache folder? Are you using Deferred rendering with custom shader frameworks such as Uber or Atf?

    @ sacb0y
    Attaboy! ;)

    @ joshcamas
    Yes, that workflows works too. You don't need to add NGSS components to all your lights. For directional one NGSS_Directional and if you use local lights (Spot or Point lights) you add one NGSS_Local to your main light or to a disabled light somewhere. I'm updating the video tutorial with some notations to clarify that, we don't need NGSS_Local components on every lights, only one as the shadows type and softness can be tweaked directly in the Unity Light using the Strength and ShadowsType properties.

    PS: You can still post questions here but it's better to go Discord if you really want to catch me quicker! ;)
     
    Last edited: Apr 14, 2020
    razzraziel, OCASM, Bzuco and 2 others like this.
  27. tyrot

    tyrot

    Joined:
    Aug 18, 2013
    Posts:
    30
    i wanna use some volumetric lighting with NGSS... which one you would recommend? or better will you have it in future ? :))
     
  28. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    They all works fine with NGSS, I personally like a lot HxVolumetric but if remember correctly HxVolumetric requires a 1 line mod as it uses _LightShadowData.x. The changes are described in the docs.
    Aura is also good.
    PS: I don't have any plans now to work on volumetrics effects but I got some other secret sauce to work on. ;)
     
    dsilverthorn, transat and hopeful like this.
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    dsilverthorn likes this.
  30. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    Small correction, I do this with PrimitiveShadows but we don't require directional lightmaps bake. It's all dynamic using normals, positions and lights and support up to 512 primitive casters visible at once (up to 100K any time):

    Although, I'm not actively working on this feature right now, I'll get back to it in the future (if still makes sense). :)
     
  31. tyrot

    tyrot

    Joined:
    Aug 18, 2013
    Posts:
    30
    this looks so cool - and wondering other secrets:))
     
    tatoforever likes this.
  32. Barliesque

    Barliesque

    Joined:
    Jan 12, 2014
    Posts:
    46
    @tatoforever
    I did clear the ShadowsCache folder. I'm using Forward rendering. I'm not using any custom shader framework at the moment, though I may switch to using ShaderOne at some point.
     
  33. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,064
    Since I use git to share the project with my teammates, they also have to install NGSS on their end, correct?

    If so, it would be super nice if there were public functions allowing devs to hook into the installation process to automate things :D
     
    Last edited: Apr 20, 2020
  34. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    Yeah, I'm working on an external tool to automate installation, anyone will run it and it will automatically install/uninstall the libraries like before 2019. For v2.3. :)
     
    joshcamas and dsilverthorn like this.
  35. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    Make sure you install the libraries in the correct folder, pretty sure you did everything correctly but not the Unity version you are using. This happens quite a lot with UnityHub and multiple versions of Unity.
     
  36. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    505
    Will NGSS stop the UNity shadow flickering that happens in open world?
     
  37. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    It's a lot better with NGSS FrustumShadows yes, also a lot prettier and a lot faster! You can give it a go or ask for a refund if you are not happy. :)
     
    dsilverthorn likes this.
  38. dsilverthorn

    dsilverthorn

    Joined:
    May 14, 2017
    Posts:
    505
    Deal!
     
    tatoforever likes this.
  39. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    Great, after installing NGSS, try this setup in your open world game:
    Disable Cascaded Shadows in the Unity Graphics Settings panel, in the Quality Settings set the shadows distance to something like 100-150m (depending on your needs) and finally add the FrustumShadows to your camera.
    Tweak FrustumShadows quality (ray length and count, etc) and let me know how it goes.
     
    dsilverthorn likes this.
  40. AlteredPlanet

    AlteredPlanet

    Joined:
    Aug 12, 2013
    Posts:
    455
    Trying to get frustum shadows to work with custom alloy deffered shader, what line do I need to add. Sent email.
     
    tatoforever likes this.
  41. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    Email replied.
    Thanks,
     
  42. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    Just helped @AlteredPlanet adding support for FrustumShadows into Alloy Framework.
    If you need the addition:
    Open the file "Allow/Shaders/Deferred/Ligth.cginc" and on line 48 add this:
    Code (CSharp):
    1. d.shadow = NGSS_FRUSTUM_SHADOWS_ENABLED > 0.0 ? min(d.shadow, saturate(tex2D(NGSS_FrustumShadowsTexture, s.screenUv).r + NGSS_FRUSTUM_SHADOWS_OPACITY)) : d.shadow;
    Make sure to comment the same line (or use the original Light.cginc file) if you delete NGSS. This file will be provided (alongside all other frameworks changes) in the next version.
     
    Last edited: May 4, 2020
  43. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    1,031
    @tatoforever

    Hi, is it possible to get shadows such as pigglet's character's nose using a directional light, or only with spot lights?

    Thanks.

     
  44. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    With shadows maps? Not really, unless you use a very high shadowmap resolution which eat bandwith a lot. You might wanna use FrustumShadows for directional lights. It does exactly what you need.
     
  45. Seth_Knight

    Seth_Knight

    Joined:
    Sep 1, 2015
    Posts:
    12
    Hi there!
    Thanks for the great asset, saved me a little bit of heartache trying to get shadows in the distance without turning my character shadows into formless blobs.

    I was wondering if there's a way to increase the size of the frustum that the Frustum Shadows use, when calculating for shadows - I've got some noticeable shadow issues when moving around the map and turning the camera, and while I'll be able to get over it (eventually) I figured I'd ask here if you've got any insight on them.

    Granted, some of the issues (namely the tree shadows) I don't imagine is a product of the frustum size, but here's a clip that demonstrates what I'm talking about.



    The second issue demonstrated is the main concern, but if you've got any insights as to why the first might be occurring I'd appreciate that as well.

    Thanks a lot!
     
  46. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    @sethofgrace,
    I see yeah, is hard to come by those as the shadows are computed screen space, hence why the top of the mountain is not visible you won't see it on the ground. Same as other screen space image effects such such as SRR.
    What's happening is that the frustum shadows algorithm see in terms of depth when the tress are hiding the mountain is exactly that, it sees the tree depth, not the mountain depth, hence why mountain shadows disappears and appears when moving the camera in that angle.
    If you don't want the mountain to cast frustum shadows (or the front trees interfere with the distant mountain shadows) you can play with the ray length and see if it helps (it should).
    I'm still improving it for the next version through but those screen space limitations will remain sadly.
    PS: Beautiful game btw.
     
    Last edited: May 5, 2020
  47. Seth_Knight

    Seth_Knight

    Joined:
    Sep 1, 2015
    Posts:
    12
    Ahh, I see. Well, I figured it was worth an ask - even still, I'd say your asset allowing for shadows in the distance is still a net positive even with these limitations.

    I will try playing around with the value, but I do recall having to set it high (I think) to get results I wanted. Will see how it goes.

    Thanks for the compliment, and the response.
     
    tatoforever likes this.
  48. Barliesque

    Barliesque

    Joined:
    Jan 12, 2014
    Posts:
    46
    @tatoforever Hi again. Coming back to this after focusing on other things for a while. I've just noticed that if I change the lights to Hard Shadows, then they do cast shadows and the NGSS components let me control softening. But when set to Soft Shadows, no shadows are cast at all. This is the case for both Directional and Point lights; haven't tested other types. ...and of course, the NGSS components automatically switch the lights back to Soft Shadows whenever their GameObject is activated.
     
    Last edited: May 13, 2020
  49. Barliesque

    Barliesque

    Joined:
    Jan 12, 2014
    Posts:
    46
    There are other issues, it seems. The shadows are full of hard noise...
     
  50. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,068
    This is all normal. If you don't like the blue noise, you can switch back to dithering. Or add more sampling to your shadows to fill the gaps between each sample and reduce noise.

    As for your first question, Local and Directional shadows behave a bit differently, local shadows uses both shadows types (Hard and Soft) to create PCF and PCSS filtering. But Directional shadows Hard shadows produces 1tap (Hard) shadows and in Soft-Shadows mode you set the filtering (PCF or PCSS) on the NGSS_Directional component itself.
     
unityunity