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

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    So, apparently they have shadows being cast on semi-transparent objects, which themselves are also casting shadows, in the ScriptableRenderLoop preview. That's really exciting as that solves a longstanding issue Unity and many other game engines have. The only issue currently is that the semi-transparent shadows are full intensity regardless of transparency now, hopefully they're able to fix that part!


    I can't remember, @tatoforever , were you moving to the render loop for 2.0? It would be awesome to be able to use your system alongside this capability.
     
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Invertex,
    Yes, our custom renderer is being ported over SRP. However is a separate product of NGSS 2.0 and it won't come any sooner but it integrates with NGSS 2.0. Though, NGSS 2.0 is planned for this year. ;)
     
    Abuthar and Invertex like this.
  3. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    Wait where does that screenshot comes from? Oo Is it really achievable in Unity?
     
  4. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    Download Unity 2017.3, make a project, set to Linear rendering.

    Extract this repository to your Assets folder:
    https://github.com/Unity-Technologies/ScriptableRenderLoop/tree/Unity-2017.3
    As well as this one:
    https://github.com/Unity-Technologies/PostProcessing/tree/0cf866234273ca5630eeea3a6b2aa6f243665baa

    Then in Unity, open up the HDRenderLoopTest.unity Scene in Assets/SampleScenes/HDTest/.
     
    tatoforever, arnoob and Lex4art like this.
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Semi-transparent shadows is not hard to achieve just that with current default Unity pipeline not technically possible without modding all your shaders as it requires some sort of treatment that's why it wasn't already done with NGSS 1.x but it's planned for 2.0. ;)
     
    Invertex likes this.
  6. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    Hmm? But Unity 2017 already does semi-transparent shadows, just not in this new render-pipeline yet. Or were you referring to shadows cast onto semi-transparent objects?
     
  7. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Sorry, I meant semi-transparent objects casting shadows and the current implementation using screen-space dithering that is just garbage. ^^
     
    Invertex likes this.
  8. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    And btw semi transparent objects should properly receive shadows I don't know why Unity don't do it properly. As soon as the object is tagget as transparent Unity ignore shadows decoding on them. This should not happen as the object even if it doesn't write to depth buffer it still should receive shadows using the vertex position interpolated into the fragment shader for distance compare with the shadowmap depths.
     
    arnoob and hopeful like this.
  9. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    But wouldn't that block shadows from being seen through the semi-transparency? I believe the issue was that it would involve an extra pass and frame buffer to handle it with the current system.
     
  10. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    No, as shadows decoding and shadows casting happens in different passes. The semi-transparent object should/can receive shadows and optionally not cast any shadows at all. However in the current pipeline (default one) semi-transparent objects simply do not receive any shadows.
    And there's the issue of casting semi-transparent shadows from semi-transparent objects that I was talking in my initial post. This one requires an additional buffer yes. ^^
     
    Last edited: Sep 28, 2017
    hopeful likes this.
  11. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    Wait, just to be clear, are you saying that in NGSS 2.0 semi transparent object will be able to receive shadows by default? Oo That's HUGE!
     
    tatoforever likes this.
  12. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    After installing a latest version I have this error and all shaders are pink:
    Shader error in 'Standard': undeclared identifier 'unity_OcclusionMaskSelector' at /Program Files/Unity/Editor/Data/CGIncludes/UnityShadowLibrary.cginc(687) (on d3d11)

    When switching to defered camera, it crashes unity. I'm using Unity 5.5.1p3
     
  13. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
     
  14. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Ops. But it worked on 5.5 before . I was updating a project that used Soft Shadows.. But now I can't go back as I don't have a possibility to download an old version. Ok, I will write to support and see if they can send me a old version.
     
  15. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @arnoob,
    Yes, they will properly receive shadows.
     
    arnoob likes this.
  16. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @olix4242,
    If you need a version compatible with Unity5.5 or 5.4 please email support with your invoice number.
     
  17. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    That's fantastic, I wasn't expecting that at all!

    When do you think will we be able to try it?
     
  18. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @arnoob
    Not sure yet, but it's planned for this year. :)
    Although, is nothing complicated it's really quite simple and there's a way to do it with current default standard shadows by doing some minor tweaking to it's core. If you are really desperate I'll check that out and see what i can do. ^^
     
    Last edited: Sep 28, 2017
    arnoob and Invertex like this.
  19. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    That would be amazing if you could, hair cards are a sore spot for us with lighting and dithered cutout alpha isn't really acceptable quality.
     
    hopeful and arnoob like this.
  20. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    hi
    you think increment the price in the next update?
     
  21. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @claudius_I
    Yes, but existing users will have a discount (50% off).

    @Invertex,
    I was talking about receiving shadows onto semi-transparent objects. Not to cast proper semi-transparent shadows from semi-transparent objects. That one will come with NGSS 2.0. ^^
     
    tweedie likes this.
  22. tweedie

    tweedie

    Joined:
    Apr 24, 2013
    Posts:
    311
    We're struggling with this same issue at the moment, ha. Could really do with alpha blended cards receiving shadows, so this is super exciting :)
     
    tatoforever likes this.
  23. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    wow
    i just buyed, and my game look more awesome xD

    Gaia, Enviro, Gena CTS,AQUAS,NGSS,Horizon Based Ambient Occlusion , UBER and
    MadGoat SSAA
    Do you know another asset for get better quality?
     
    tatoforever likes this.
  24. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @claudius_I
    I think you got the whole package to explode your game visuals. xD
     
  25. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    Well that should do fine for us, that is the part we're missing right now, assuming the change you're suggesting doesn't get rid of Unity's dithered semi-transparent shadow casting, as that is acceptable enough for us since it blends in with most other stuff, and when TAA is on, the shadows look perfectly smooth as long as your shadow softness is high enough.
     
    tatoforever likes this.
  26. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Invertex,
    No, it will just add shadows decoding on semi-transparent materials (alphablended/multiply) which right now is completely missing. Does not remove any shadow dithering though.
    Btw, Unity shadows dithering can be improved if unculled texels are mapped to screen pixels (the same way we do with noise filtering) or if it's mapped in world space (to avoid unstable texels jumping all over). But that will require messing a lot more with multiple core files within Unity current rendering and this can become hard to manage quickly with any update. Even adding shadows to semi-transparent objects will probably require core changes so I'm looking into it right now and will post the changes here for anyone brave enough to take the risk (that change probably won't be part of NGSS 1.0 but it will be supported natively by NGSS 2.0). ^^
     
    Invertex and arnoob like this.
  27. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Improving semi-transparent shadows dithering. No more unstable texels jumping/moving all over the place:


    Same thing but harder shadows so texel stabilization can be seen better:

     
    Last edited: Oct 1, 2017
    No0B25, arnoob, Shodan0101 and 4 others like this.
  28. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    Could you go for colored semitransparent shadows as well?
     
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @nbac,
    Not with current Unity rendering framework. I've already tried for a client and ended up making a special shader that only do colored shadows (without drawing visible object). Cause there's plenty of internal core files that needs to change and no one in their right mind would like to replace the whole CGINCLUDE folder. I also don't want to maintain it knowing how it quickly change between Unity releases. :D
    This is something very easy to achieve with a custom renderer though. ;)
     
    Invertex and buttmatrix like this.
  30. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    I did some research before .... In ue it is quasi possible. In Unity I did a semi fake for this small project.

     
    tatoforever likes this.
  31. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    If you are using a custom renderer is pankake. Modifying Unity default core rendering files is risky as plenty of custom shaders use the core files here and there and can break things up quickly. ^^
    If I remember correctly in Unity renderer core files, attenuation (which contains shadow) is just a single channel float. For a color you will need at least 3 channels. And trying to change upwards and downwards in the pipeline from there is painful and again, will break things up quickly with any update.
     
    Last edited: Oct 4, 2017
    arnoob likes this.
  32. canek

    canek

    Joined:
    Sep 13, 2014
    Posts:
    21
    Is there a link to a formal bug report about this that we could support? We've been wanting to use your shadows and still waiting for them to be functional for mobile.

    Thanks!
     
  33. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
  34. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi @tatoforever , I'm just getting to grips with NGSS but i'm having a problem with trees. The shadow does not have any definition to the leaves. Just a large block around tree for shadow. I have tried all settings but nothing is getting the leaves to show as shadows.

    Any idea what I could be missing? I am using SEGI and volumetric lights on a realtime directional light (Sun). Quality settings for shadows are high with 4 cascades. stable fit.

    Andy
     
  35. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    70
    Try disabling it. GI adds light to the scene which can make the shadows less pronounced. Also probably the shadows are too soft. On the directional light you attached the NGSS script to, try setting the global softness value lower. Try with the lowest for starters and see if that gets you back the leaves. Less blur will also improve performance quite dramatically as I noticed.
     
    AndyNeoman and tatoforever like this.
  36. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @AndyNeoman
    Can you post some images of your Directional light setup and scene? Will help me understand better your needs. :)
    Regards,
     
  37. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi there, sorry for the delay 'other job' interfering. Below are the settings for the light and ngss on the light. I have turned off volumetric light and segi GI in case they were the problems. Shadows are darker but still the same problem. I have removed all but one tree and all the grass/plants to make it easy to see the scene.

    Thanks,

    Andy
     

    Attached Files:

  38. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @AndyNeoman
    Can you try disabling NGSS directional and see if your tree leaves still dont cast shadows well? Maybe it's your tree shader that don't write well to the depth buffer.
     
  39. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Turning off NGSS just took away the nice blurred edges but the same result on the shadow with no leaves.

    Your right - it's the shader. I changed to another tree shader and the leaves are back. Argh, not sure what to do now. Thanks for your help.
     
    tatoforever likes this.
  40. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    When cutout objects are not casting proper shadows it's probably they aren't encoding their cutout values properly when being rendered into the depth buffer (ShadowCaster pass). Try look for that. Make sure they implement ShadowCaster pass properly instead of fading back to something else.
     
    AndyNeoman likes this.
  41. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    One more thing, if your object don't cast any shadows with Unity default shadows, they won't cast either with NGSS. As NGSS replace internally default Unity shadows. In other words it overrides the default shadowing algorithms. Is not a system running side by side, it's becomes the default system itself. :D
     
    buttmatrix and AndyNeoman like this.
  42. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    I edited a tree shader with he help of the dev but it must have caused this error somehow. The default one cast shadows normally. I have only added texture and setting for rain/wet effect no idea why it has upset shadows.

    The shadow pass settings are unchanged. I will have to step through and trace the error.

    It's my first attempt with shaders - back to the drawing board....
     
    tatoforever likes this.
  43. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @AndyNeoman
    Make sure you are not altering the ShadowCaster pass and make sure your tree shader _Cutout property is named exactly the same as in ShadowCaster. Otherwise ShadowCaster won't find it and won't be able to clip pixels when rendering to depth buffer.
     
    AndyNeoman likes this.
  44. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Seems like NGS is not working with Unity 2017.2
     
  45. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I'm doing some tests right now, and will get back asap.
     
    olavrv and buttmatrix like this.
  46. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Strange, I've made a couple of early tests with 2017.2 beta versions and it worked fine though.
     
    Last edited: Oct 13, 2017
  47. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    70
    @olavrv I just updated yesterday and it works fine for me. Did you replace the cginc file in Unity's CGIncludes folder and empty the ShaderCache folder for your project?
     
  48. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Yeah,
    I tested early today and it works fine. It looks like he probably forgot to place the cginc files and delete the shader cache folder.
     
    AndyNeoman likes this.
  49. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @olavrv
    Btw, every time you install a new version of Unity, you have to redo the setup for your NGSS spot/point shadows (install the cginc file and delete your project cache folder).
    Other than that NGSS Directional and ContactShadows don't require any setup as they are scene dependent (not Unity install dependent).
     
    ilmario likes this.
  50. Abuthar

    Abuthar

    Joined:
    Jul 12, 2014
    Posts:
    92
    Hello! I am using NGSS in a project where I am trying to incorporate the Pre-Integrated Skin Shader. The problem I am having is that for Point Lights, any value between .3 and .9 for shadow strength produces seethrough or nonexistent shadows. Similarly with Spot Lights but at different values. Also I am getting transparent shadows with i have a semi High light intensity, which makes it just look bad. Is anyone else experiencing this? Is there a fix I do not know about?

    I posted about this before but couldn't quite get the issue fixed.

    Anyways, great plugin, vehemently awaiting for NGSS 2.0! :)