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

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    Its a separate package but you will have 50% discount on any future NGSS product, forever.
     
    DiveshNaidoo likes this.
  2. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Hi.
    There is following issue in
    Unity 2019.3.0f1
    when you have NGSS installed in the Editor.

    Bug.JPG

    and you open this project.
    https://github.com/Unity-Technologies/multiplayer.git

    Simply clone it and open the project to reproduce it.

    Yo have the black rendering issue.
    Common workaround was to import NGSS package and add NGSS to the directional light.
    This is not possible anymore due to the errors.

    You have to uninstall NGSS and reopen the Editor to be able to use it.
     
    Last edited: Dec 1, 2019
  3. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    Is there possible workaround for it without importing asset into project? Cause i have some mobile projects that i don't want to use NGSS
     
  4. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @keeponshading,
    Those are not compile errors, just the compiler telling you about some values not being used.
    The black issue is because you have the NGSS libraries installed but no component is feeding them.

    @alternativevisual
    I'm adding a couple of internal default values in the next version to avoid this but for now the workaround if you are not using it in some specific project, uninstall it till next version (v2.3).
     
    alternativevisual likes this.
  5. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Yes. I know. I use NGSS since quite a while.
    Normally i attach the NGSS_Directional to the directional Light and the rendering is back.

    In combination with this project it is not possible to attach something because of the errors.
    https://github.com/Unity-Technologies/multiplayer.git
    You have to remove NGSS completly from Unity installation. Have a fast try.
    Clone or download the .zip and open the project in Unity 2019.3.0f1.
    I found no way work until i removed NGSS completly from Unity installation.
     
  6. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @keeponshading,
    I tried and yes looks like somebody set that project to treat warnings as errors.This can be fixed by either setting the project back to normal (don't treat warning as errors) or just comment out the variables in NGSS_Directional.cs.
    I'm not sure if Unity 2019.3 have an option to disable it but Visual Studio does have it.
    PS: That strict mode is not required by DOTS but that example project is set like that.
     
  7. keeponshading

    keeponshading

    Joined:
    Sep 6, 2018
    Posts:
    937
    Thanks for the info. Thats an solution.
    Unity in "treat warnings as errors" is like playing doom in nightmare difficulty.)

    I often exange projects with colleauges who don t have and editor ngss installation,
    When doable it would be great when there could be an popup window who says.

    "Project is using NGSS. Please install NGSS ...."

    something like that.)
     
    Last edited: Dec 1, 2019
  8. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @keeponshading,
    Like some editor script that detects if the libraries aren't installed and ask the user to install it?
    I'm adding it to the next version. ;)
    PS: Do not forget that NGSS license is per individual/organization. You cannot share it with people outside your organization (eg: contractors or freelancers).
     
    Last edited: Dec 1, 2019
  9. DiveshNaidoo

    DiveshNaidoo

    Joined:
    Apr 1, 2018
    Posts:
    23
    Cool. I'm waiting for the URP package and will purchase it as soon as it's available.
     
    tatoforever likes this.
  10. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @DiveshNaidoo,
    I need to finish couple of stuff for v2.3 then finish my point shadows implementation for URP and it should be ready for alpha/beta testing. I would say around January 2020 would be realistically possible.
     
    Bartolomeus755 likes this.
  11. alternativevisual

    alternativevisual

    Joined:
    Apr 16, 2015
    Posts:
    75
    Hello! I'm having problem with semi-transparent shadows.
    I've made a surface shader with "AlphaTest" Queue, keepalpha in pragma and Standard shader as a fallback.
    upload_2019-12-8_7-20-8.png
    As you can see, "Receive" pass is ignored and dithered, but "Cast" pass is filtered perfectly by NGSS.
    How is that possible?
     
  12. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    I think either your surface pass or shadow collector pass is being dithered, one of them but not both (looks more like your surface is dithered), but your shadow receiver pass not.
     
    Last edited: Dec 8, 2019
  13. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Hello, I've been wondering about how the progress on Close Fit projections support is going. The current version has some a bug in it where the softness value is not adjusted based on the "true" shadow drawing distance value (because of the projection). The softness value is also inconsistent with the stable fit projection (so the smoothing radius is different).

    I want to know if those issues are going to be adressed and, if they will, when can we expect the fixed version of the package to be released. Our current project can massively benefit from the close fit shadows and, ideally, we would like to implement them.

    Thank you.
     
  14. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @Kolyasisan,
    The problem with CloseFit is that it depends on what the depth is rendering and other factors, view angle, draw distance, etc. So is a bit tricky come up with something that works for all cases but is definitely something that I would like to improve in the future, I'm not done with that. However, I'm now busy with Cache shadows, other features of NGSS and SRP ports.
     
  15. seanybaby2

    seanybaby2

    Joined:
    May 17, 2013
    Posts:
    120
    Any ETA on those Forward Frustrum shadows?
     
    Bzuco likes this.
  16. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    January 2020. ;)
     
    seanybaby2 and Bzuco like this.
  17. tirarex

    tirarex

    Joined:
    Feb 19, 2015
    Posts:
    16
    Huge performance drop with PCSS in VR ( valve index + 1070ti)
    But no problem with Htc vive 1st gen (200% resolution)
    Cpu usage with pcss up to 20ms, and 5ms without

    Any suggestion ?

    ngss.png
     
  18. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    Hi,
    Normally PCSS and PCF doesn't make that much difference on PC unless there's something else already eating your computer alive. :D
    Do you have up to date drivers (GPU, VR, etc)? What happen if you re-open the Editor?
    With such little info is hard to tell. ^^
     
  19. tirarex

    tirarex

    Joined:
    Feb 19, 2015
    Posts:
    16
    only difference between 2 screenshots is pcss checbox
    1070ti with last driver. Last Updated SteamVR with new Valve index.
    video with this bug
     
  20. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
  21. tirarex

    tirarex

    Joined:
    Feb 19, 2015
    Posts:
    16
    semaphore problem in ngss scripts.
    I have same issue in FMOD, and real problem is fmod updating banks every 5 seconds.
    I can give teamviever for you, and you just check it
     
  22. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    There's nothing in NGSS_Directional that can slow you down like that, NGSS does not cause that.
    You can disable the script after hitting play.
     
  23. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @tirarex,
    Feel free to reach me out on the support email with a small repro project. I will give it a look this weekend and try to isolate the issue so it will serve as a repro case for Unity folks.
     
  24. tirarex

    tirarex

    Joined:
    Feb 19, 2015
    Posts:
    16
    I can give sample project but not sure what about you have a valve index for repeat a bug.
     
    tatoforever likes this.
  25. DeMexi

    DeMexi

    Joined:
    Dec 5, 2017
    Posts:
    18
    Are there any specific tips or do's & dont's for using NGSS in a scene where a (second) camera outputs to a render texture?
     
  26. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    Send it anyways, I will do my best to try to repro it without the Valve index.

    I'm not sure why you would have two cameras rendering the game simultaneously. What is that setup for?
     
  27. DeMexi

    DeMexi

    Joined:
    Dec 5, 2017
    Posts:
    18
    Golf-related party game. Second camera is pointed at the hole and outputs to render texture. That render texture is then drawn as a UI element in realtime. Sort of like a mini-map or radar.
     
  28. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @DeMexi,
    I see, well there's really no restriction per see, other than be careful if you crank the shadows quality way too high (real-time CGI like stuff), is not a good advice to have multiple cameras rendering it but in your case it should be fine. The limitations are kinda the same as if you where using Unity Shadows.
    In any case, report anything you find abnormal with shadows (performance, artifacts, etc). I'll be glad to help. :)
     
  29. DeMexi

    DeMexi

    Joined:
    Dec 5, 2017
    Posts:
    18
    Thanks!
    I am experiencing some weird issues, yes. The shadow resolution on the second camera seems extremely low, while the main camera looks fine. The issue wasn't there with regular Unity shadows.
    I will try to gather more information and post it here.
     
    tatoforever likes this.
  30. DeMexi

    DeMexi

    Joined:
    Dec 5, 2017
    Posts:
    18
    I have not managed to create a repro-case.
    However, the shadows in the second camera look awful with NGSS, and perfectly okay with regular Unity shadows.
    Do you have any further insights on this matter?




    primarycamera.png secondcamera.png lightingsettings.png secondarylightingsettings.png qualitysettings.png
     
    tatoforever likes this.
  31. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    The second camera shadows looks more like low ress shadowmaps. Shadowmap ress is the same for both NGSS and Unity but can you show me the same images with Unity shadows?
     
  32. DeMexi

    DeMexi

    Joined:
    Dec 5, 2017
    Posts:
    18
    Alrighty.

    Short sidestep, is there any way to make shadows independent of camera angle?
    Fiddeling got my nowhere, except when I set softness to 0.

     
    tatoforever likes this.
  33. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @DeMexi,
    OK so yeah, that's a drawback of CloseFit and is not really NGSS, is Unity with it's logarithmic depth buffer in CloseFit mode. I've implemented a small algorithm that tries to adjust the NGSS softness based on the camera angle but it doesn't work well in all situations because is not just the angle (how large is the depth, the amount of meshes being rendered to the shadowmap, etc) in that mode that affects the resulting kernel size. This is something I'm improving for the next version too. In the mean time you can use StableFit which does not suffer from this issue.
    PS: That game looks gorgeous! :cool:
     
    Last edited: Dec 17, 2019
  34. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340
    Hi, Really considering buying.

    - I read in a review on the asset store that I can render shadows quite far from my camera? With the regular unity shadows, its either a small shadow distance for good quality shadows, or big shadow distance and you loose all detail in the shadows. I need this as I have huge objects in the sky casting very important shadows on my large landscape.

    - Can an object cast semi-transparent shadow, so that the directionnal lighting still affects objects?

    Thanks!
     
  35. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @marcrem,
    Hi,
    Sky shadows and semi-transparent shadows behaves the same way as with Unity shadows (same restrictions too) but they are super soft with NGSS of course.
    As for far shadows, we have a solution for that called FrustumShadows. It allows you to draw view based infinite shadows on everything with the same cost as ContactShadows. It's super customizable, the typical setup is a non cascaded dir light to around 70-100m and the rest is blended with FrustumShadows nicely.
     
  36. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340

    So from what I could understand, I could have multiple directional lights so that my objects still have shadows when under a big sky object (think cloud) casting a shadow on the ground ?

    When you say "the typical setup is a non cascaded dir light to around 70-100m and the rest is blended with FrustumShadows nicely.", I unfortunately don't get anything you just said. You can set a light to be cascaded or not? What about the 70-100m ? What setting is this?

    Sorry for all the questions. Thanks!
     
  37. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @marcrem
    The 70-100m is the distance you want to set your directional shadows and from there you enable FrustumShadows up to infinite (where your view ends). They will both blend together seamlessly.
    You don't need multiple lights with a FrustumShadows setup and it help improve performance a lot. Though, when using FrustumShadows you won't be able to cast shadows larger than the ray length (which is computed in screen space). This can be tweaked up to half/full screen size at the cost of performance and memory bandwidth but the default setup is good enough for any kind of open world game with large view distances.
    Again the cost is very minimal compared to the traditional Cascaded Shadows with 1000-5000metters view. Not to mention that FrustumShadows looks way better in the distance than any Cascaded Shadows.
     
    Last edited: Dec 19, 2019
  38. DeMexi

    DeMexi

    Joined:
    Dec 5, 2017
    Posts:
    18
    Thanks!
     
    tatoforever likes this.
  39. Kinami37

    Kinami37

    Joined:
    Jun 12, 2016
    Posts:
    17
    Hello im trying to get something working, this is what I have
    https://i.imgur.com/oynleHA.png

    I dont like the close shadow thats looking very weird.

    I found a fix, if i disable the component, all the shadows stay but this is fixed (its also fixed when i disable PCSS but shadows lose sooo much quality)

    so disabling the component "fixes" it

    https://i.imgur.com/PcWj0uq.png

    until i restartu nity and everything is block because the component isnt enabled :c

    is there a way to archieve the results without disabling the component?
     
  40. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @Kinami37,
    What do you mean by the close shadow looking weird? Did you tried changing the resolution?
    Btw, 8 sampling for test with PCSS is not much, you should at least rise it to 16 or 24. Unless that's what you are looking for visually.
     
  41. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340

    Hi,

    Thanks for your quite fast reply. Great customer service, and looks like you got a solution for a problem I really needed to solve.

    Brb buying.
     
    tatoforever likes this.
  42. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @marcrem,
    Btw, here's a concrete example of a commercial open world game using it:

    FrustumShadows get enabled at 50secs.
    Same game but other location:

    In both cases FrustumShadows was configured to castShadows from distance 0 which gives a ContactShadows effects on top of infinite view shadows.
    Cheers,
     
    ftejada and gecko like this.
  43. Kinami37

    Kinami37

    Joined:
    Jun 12, 2016
    Posts:
    17
    ah yes, i fixed it with some setting tweaks.

    Any news on when support for URP is coming?
     
    tatoforever likes this.
  44. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    It's planned for early 2020.
     
  45. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340
    Hi @tatoforever , thanks for your help, I bought the asset and I'm very impressed by what it can do.

    However, here's my issue.

    I have pretty big clouds that should cast shadows on my world. here's one here
    cloud.png

    When the cloud hides the sun, it casts a shadow. With your recommended settings, you can easily see how the cloud shadow stops at 100m (quality settings value), and then the frustrum shadows take over.

    shadows1.png
    shadows2.png

    Here's my concerns:
    1- My cloud shadow doesn't seem to cast a shadow on the objects in the frustrum shadows.
    2- I want the objects to still cast a shadow on top of the existing cloud shadow, otherwise everything just looks unlit.

    what are my options here?
    Thanks
     
  46. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    Your cloud doesn't cast FrustumShadows on your objects because the ray length is shorter than the distance between the ground and the clouds (even at screen space). What I suggest is to tweak the ray length and see if it helps or use a cookie texture in your Directional Light to simulate the clouds (and disable the cloud objects casting shadows).
    If NGSS can't solve your problem properly, feel free to ask for a refund. :)
     
  47. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340
    Thanks, I managed to find a good compromise between the resolution of the shadows and the shadow distance. I'll make sure to tell the level designer to keep it in mind.

    I do have one last problem though. With a free-roam camera, everything looks nice. However, when I put a frustrum shadows component with the same settings on my vehicle camera (inside the vehicle), the effect doesn't work.

    Any idea? Thanks
     
  48. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    @marcrem,
    Right now only one FrustumShadows per scene works, you can't have more than one (also for performance reasons). Try to disable the free-roam one and then enable the one inside your vehicle. Switch between them?
     
    Last edited: Dec 27, 2019
  49. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    340
    Thanks.

    For the object being too far for the frustrum shadows to detect it, is there a way to increase the ray length?
     
  50. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,368
    Yes, in the FrustumShadows Ray Settings, the Ray Scale property.
    But again, this is not the most optimal way. If you are OK to add cookies your directional light (to simulate cloud shadows), that would be ideal.