Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[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. _M_S_D_

    _M_S_D_

    Joined:
    Nov 12, 2013
    Posts:
    511
    upload_2018-1-2_21-36-35.png

    Seems the issue has not resolved itself in the latest version either.
    Same scene in the editor.
    upload_2018-1-2_21-37-28.png
     
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @_M_S_D_
    Can you provide me a small repro project showing the issue? Otherwise, I would say to wait for the fix (coming today).
     
  3. _M_S_D_

    _M_S_D_

    Joined:
    Nov 12, 2013
    Posts:
    511
    Don't know if I can easily make this into something small and manageable. If there's a fix on the way, I can wait, I somehow managed to get my most recent builds out functional and what I had planned now was just a minor patch. So no rush.
     
    tatoforever likes this.
  4. Piahouka

    Piahouka

    Joined:
    Sep 1, 2015
    Posts:
    40
    Hi, tatoforever.
    I tried the newest ngss in unity2017.3f3, it operates good!
    But, not working with slightlymad's VolumetricLight script.(https://github.com/SlightlyMad/VolumetricLights)
    If camera is in point light attached volumetriclight script, screen will be pink.
    View attachment 260319
    and I got this error.
    Trying to access pass 2, but material 'Sandbox/VolumetricLight' subshader (0) has only 1 valid passes.UnityEngine.Material:SetPass(Int32)
    VolumetricLight:SetupPointLight(VolumetricLightRenderer, Matrix4x4) (at Assets/VolumetricLights-master/Assets/Scripts/VolumetricLight.cs:213)
    VolumetricLight:VolumetricLightRenderer_PreRenderEvent(VolumetricLightRenderer, Matrix4x4) (at Assets/VolumetricLights-master/Assets/Scripts/VolumetricLight.cs:188)
    VolumetricLightRenderer:OnPreRender() (at Assets/VolumetricLights-master/Assets/Scripts/VolumetricLightRenderer.cs:319)
    Please give me an answer how to fix it.
     
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @Piahouka
    Could you try the Volumetric asset without NGSS see if the error goes?
    Other than that, I would need a repro project with the volumetric effect showing the error (I can modify the asset to make it work with NGSS if not the case).
    PS: Please submit your test case project to support (not publicly).
     
    Piahouka likes this.
  6. TeohRIK

    TeohRIK

    Joined:
    Jan 22, 2014
    Posts:
    106
    Do I need to buy 2.0 again? or its a free update?
     
  7. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @TeohRIK
    NGSS 2.0 is a new product with modern shadowing techniques thus we'll offer discount for NGSS 1.x users.
     
  8. Piahouka

    Piahouka

    Joined:
    Sep 1, 2015
    Posts:
    40
    Sorry, I reconfirmed it again after reinstalled ngss, but it was operating normally.
    So now I have no problem except shader error at build. I am looking forward to be ngss updated.
     
    tatoforever likes this.
  9. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @Piahouka
    Mind pasting the build errors (just to make sure)? :D
     
    Piahouka likes this.
  10. Piahouka

    Piahouka

    Joined:
    Sep 1, 2015
    Posts:
    40
    ・I got error at build time with UBER(https://www.assetstore.unity3d.com/jp/#!/content/39959)
    Shader error in 'UBER - Specular Setup/ Core - simple (no normalmap)': 'UnitySampleShadowmap': no matching 1 parameter function at Assets/UBER/Shaders/Includes/UBER_AutoLightMOD.cginc(101) (on d3d11)

    Compiling Vertex program with SPOT SHADOWS_DEPTH _WETNESS_NONE
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_HARDWARE_TIER1 UNITY_LIGHTMAP_RGBM_ENCODING
    Shader error in 'UBER - Specular Setup/ Core - simple (no normalmap)': 'UnitySampleShadowmap': no matching 1 parameter function at Assets/UBER/Shaders/Includes/UBER_AutoLightMOD.cginc(106) (on d3d11)

    Compiling Vertex program with POINT SHADOWS_CUBE _WETNESS_NONE
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_HARDWARE_TIER2 UNITY_LIGHTMAP_RGBM_ENCODING
    Shader error in 'UBER - Metallic Setup/ Core': 'UnitySampleShadowmap': no matching 1 parameter function at Assets/UBER/Shaders/Includes/UBER_AutoLightMOD.cginc(101) (on d3d11)

    Compiling Vertex program with SPOT SHADOWS_DEPTH _WETNESS_NONE
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_HARDWARE_TIER1 UNITY_LIGHTMAP_RGBM_ENCODING
    Shader error in 'UBER - Metallic Setup/ Core': 'UnitySampleShadowmap': no matching 1 parameter function at Assets/UBER/Shaders/Includes/UBER_AutoLightMOD.cginc(106) (on d3d11)

    Compiling Vertex program with POINT SHADOWS_CUBE _WETNESS_NONE
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_HARDWARE_TIER1 UNITY_LIGHTMAP_RGBM_ENCODING
     
  11. danix

    danix

    Joined:
    Nov 15, 2013
    Posts:
    29
    Hey, no worries. Many of us here, asking for something.

    I did what you said, the noise is gone, but the shadow quality is lower now. Still not the same as your example. Also changing the NGSS_Directional.cs variables, does nothing.

    upload.png 4.JPG

    Thanks!
     
  12. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @danix
    For those shots I used a shadow distance of 150 units, Very High resolution and NGSS_USE_POISSON_SAMPLING_MOBILE off but this will give you banding if your settings differ from mines.
    Try playing with those settings and let me know how it goes.
    PS: Kernel size can be controlled with three factors: shadowmap resolution, shadow distance and the softness property on NGSS_Directional component.
     
    danix likes this.
  13. danix

    danix

    Joined:
    Nov 15, 2013
    Posts:
    29
    Same settings as yours. Below this softness value, the shadow are worse.
     

    Attached Files:

    • 6.JPG
      6.JPG
      File size:
      163.8 KB
      Views:
      929
  14. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    If you have the same setting you should have the same shadows. Try reducing the shadowmap resolution?
     
  15. danix

    danix

    Joined:
    Nov 15, 2013
    Posts:
    29
    Shadow Resolution : High
    Shadow Distance: 150
    I've also tried to bake the shadows, but I get " 'unitySampleShadow': no matching 1 parameter function " Error, which I guess is the same as the one, you are working on a fix. I don't want to look like I have complains or something, still looks better than Unity default shadows. Thanks for your help!
     

    Attached Files:

    • 6.JPG
      6.JPG
      File size:
      169.8 KB
      Views:
      862
    tatoforever likes this.
  16. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @danix,
    Don't worry man. Try rising the shadow distance to make the shadows texel bigger (faked blurry). Other than that, I will suggest to stick to the noisy solution as it works with any kernel size and fights banding (you are having some visible banding in your shadows).
     
    danix likes this.
  17. danix

    danix

    Joined:
    Nov 15, 2013
    Posts:
    29
    I'll play around more with the settings. Looking forward for the next updates. Thanks again for the help!
     
    tatoforever likes this.
  18. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    Folks,
    The fix is ready and already submitted to the Asset Store (v1.6.2.1).
    Things that changed:
    UnityDeferedLibrary.cginc is not needed anymore but you have to revert back to the default one. I've provided one in NGSS folder one or you can use the default one provided in the Built-in shaders zip file by Unity.
    Keep in mind that if you are looking for Mobile Directional shadows it requires the install of both UnityShadowLibrary.cginc and AutoLight.cginc files.:)

    The documentation got updated to reflect those changes.

    PS: You can bomb support if you need it now. :D
     
    Last edited: Jan 4, 2018
    Piahouka and danix like this.
  19. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    NGSS 1.6.2 is live on the store.
    As always, read the documentation. :)
     
    danix and hopeful like this.
  20. danix

    danix

    Joined:
    Nov 15, 2013
    Posts:
    29
    Still getting this error, when I try to bake the shadows.

    Shader error 'unitySampleShadow': no matching 1 parameter
    Compiling Vertex program with DIRECTIONAL SHADOWS_SCREEN LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADOWS_SHADOWMASK
    Platform defines: UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_DESKTOP UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_DLDR_ENCODING
     
  21. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @danix
    Did you deleted your shader cache folder and redo the UnityDeferedLibrary.cginc when upgrading to 1.6.2?
    Also, do you have the whole stack error?
    What are the steps to repro the error? I baked all the exampled scenes and no errors.
     
  22. danix

    danix

    Joined:
    Nov 15, 2013
    Posts:
    29
    I've reverted back to the original UnityDeferedLibrary.cginc and also deleted the shader cache folder.
    Not sure - this is everything in the console.
    Make simple cube primitive objects lightmap static, and just trying to bake the shadows in mixed mode lighting with PLM, static shadows disappear and it shows the error.

    PS: no static lightmap shadows, but dynamic objects cast and receive shadows.
     
  23. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    Last edited: Jan 5, 2018
  24. danix

    danix

    Joined:
    Nov 15, 2013
    Posts:
    29
    Just cleared CGIncludes folder and installed it again with the needed files.
    Made new empty project this time using the Standard Shader, still getting the error.
    Where can I send you the project?

    Shader error in 'Standard': 'unitySampleShadow': no matching 1 parameter function at /Program Files/Unity/Editor/Data/CGIncludes/UnityStandardCore.cginc(439) (on d3d11)
    Compiling Vertex program with DIRECTIONAL SHADOWS_SCREEN LIGHTMAP_ON LIGHTMAP_SHADOW_MIXING SHADOWS_SHADOWMASK
    Platform defines: UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_DESKTOP UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_DLDR_ENCODING
     
  25. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @danix
    Upload the project somewhere and send the download link to the support email: support AT psychozinteractive DOT com
     
  26. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    Folks,
    I've just submitted a new version (v1.6.3) that fixes an other bug introduced in 1.6.
    Thanks to @danix for the in-depth test through. ;)
    PS: If you are affected by this bug, just ask support for the fix.
     
  27. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,502
    I see you mention SRP only in relation to 2018.1, but 2017.2 has the SRP slot in its graphics settings, so I'm curious what is changing about the SRP in 2018 that is needed for NGSS 2.0 that 2017.2 doesn't have? Cheers
     
  28. f0ff886f

    f0ff886f

    Joined:
    Nov 1, 2015
    Posts:
    201
    Small question, is it expected that NGSS should run on XB1/PS4 without too much issue, given that scene requirements are not insane of course?
     
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @Invertex,
    Both default renderers HD and LD still in progress and the versions compatible with 2017 is not fully featured. I received an email from the Unity staff to make our NGSS compatible with SRP (starting in 2018.1) and the definitive SRP public version will be 2018.1 so that's the one we are focusing on.
    So yeah I will keep NGSS 1.x support in 2018 till NGSS 2.0 is out.
    As for NGSS 2.0, I'm finishing the main feature which is a massive screen space shadows filtering. It basically filters all lights at screen space only once. It's also ultra cheap, as it only filters specific areas with the help of a screen-space mask (I'm in the process of optimizing this even further with the stencil buffer). On top of that, we have the early bail out algorithms that filters only penumbra areas discarding antumbra and lit regions. And of course there's the rest of planned features for 2.x. ;)
    NGSS 2.0 got a small hold due to vacations and some works we are doing in our released game Forgotten Memories but I'm back on it. :)
    @vostok4
    If you are not already GPU bound then you are good to go. One of my customers does something like 30-50 shadowed lights per scene in a commercial game (I don't remember the name though). Of course they aren't rendered at once, it takes advantage of scene occlusions.

    @Folks,
    NGSS v1.6.3 is out, it fixes a rare bug with Mobile users using mixed lights with NGSS shadows. Remember to always read documentation! :cool:
     
    Last edited: Jan 9, 2018
  30. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    @tatoforever I am having an issue with the shadows that maybe is obvious to someone? It seems that objects are creating shadows additively so the more objects projected onto the same space, the more darker the shadow is in that spot. Or, the underside of objects is reflecting light down?
    Here is a very quick example. It shows an example model car, but as you can see the car body casts a shadow and then the wheels cast a shadow that makes that area of the shadow even darker. The is only 1 directional light in this test. Linear deferred.

    upload_2018-1-9_12-0-12.png
     
  31. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @Baraff
    The image you posted is extremely small, can you post a bigger one?
    Are you using ContactShadows?
    What's your scene shadows settings?
    What version of NGSS are you using?
     
  32. TeohRIK

    TeohRIK

    Joined:
    Jan 22, 2014
    Posts:
    106
    Hi, does contact shadow work without any directional light in the scene?
     
  33. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    @tatoforever
    Yes to contact shadows.
    Scene shadows settings are as shown. I had played with the contact shadows and it helped a little bit, but the effect is mostly still there.
    Version is the latest from the asset store from yesterday. 1.6.2.1

    upload_2018-1-9_13-37-38.png

    upload_2018-1-9_13-38-25.png

    upload_2018-1-9_13-39-1.png

    upload_2018-1-9_13-44-2.png
     
    Last edited: Jan 9, 2018
  34. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @Baraff
    Since version 1.6 ContactShadows opacity follows Dir shadows opacity to avoid the same exact problem you are having.
    Are you using a custom shader on your terrain? What happen if you use a default terrain shader?
    @Teo
    ContactShadows requires Directional shadows yes.
     
  35. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    @tatoforever
    Yes, I am using microsplat but the shadow problem happens on other objects also. For example on a road section which is just using the standard shader. Or are you saying that the custom shader (microsplat) may be interfering with things?
    Example:

    upload_2018-1-9_15-45-15.png
     
    Last edited: Jan 9, 2018
  36. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @Baraff,
    What happen when you change directional light opacity? Do ContactShadows opacity change or remains the same?
    The issue you are having should not happen unless your custom shader is doing something with the shadows.
     
  37. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    @tatoforever
    If you mean directional light intensity, then yes when I change this, the shadow intensity changes. I remembered I had changed the shadow strength to .9. If I change it back to 1 it is much less obvious, but still there.
    I also tried just the standard terrain shader and the problem is still there.
    Also just tried turning all effects off, resetting back to standard any changed shaders in Unity settings.

    Not sure yet, but during a testing just then and madly turning everything off and resetting back to standard as mentioned above, it seemed that turning TOD's skydome off and just using a directional light may have fixed it. So maybe it is not compatible with TOD in some way. Not sure how to figure out a way around it though. Anyway, first I need to try and confirm that is the issue.
     
    tatoforever likes this.
  38. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @Baraff,
    Since NGSS v1.6 both ContactShadows and DirectionalShadows follows the same opacity change. You can look in the source code, it's exactly the same for both. We can see that behavior in the ContactShadows example scene, if you change dir shadows opacity it does exactly the same on contact shadows.
    Keep in mind that NGSS replaces Unity shadows at it's core rendering files, any custom shaders doing funny stuff with the shadows opacity will break the opacity sync of Contact and Directional shadows.
    Would be nice if you can do more tests on your end and let me know the result so I can open a case and proceed with further tests.
    Regards
     
  39. Baraff

    Baraff

    Joined:
    Aug 16, 2014
    Posts:
    255
    @tatoforever I will see if I can get some more testing done tomorrow. I'll probably set up a fresh proj and just do a step at a time to see what I can dig up. My main one is bit of a pain to test on.
     
    tatoforever likes this.
  40. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    Folks, v1.7 coming very very soon:

    Taking advantage of Unity 2017 inline samplers. Fetching depth and doing hardware PCF using an advanced custom PCSS algorithm.
    Also in this version PCSS algorithm for spot shadows (finally)! :D
    Deprecated support for Unity 5.6 because yeah inline samplers only available in Unity 2017. You can still use up to v1.6.3 and if you have any trouble with, just hit me through support with your requests as always.
    PS: NGSS 2.0 videos coming soon! :cool:
     
    Last edited: Jan 13, 2018
  41. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Hi @tatoforever, it looks like there are lots of concerns in the asset developer community related to scriptable render pipelines and how that may complicate our ability to use other shader-based assets with the new render loops. In particular, it sounds like custom loops outside of the ones Unity will maintain could be especially problematic, depending on how much they differ from the pipeline from the standard Unity ones.

    Could you share your thoughts on how easy/hard it might be to integrate your upcoming SRP asset with other shader-based assets, once you release it? There's this thread on the beta forum for the running conversation about asset developer concerns. For me specifically, I'm wondering if the shader graph editor that Unity is launching with SRPs and Amplify Shader Editor-generated shaders will work (once ASE is compatible with SRPs, which the devs have committed to doing).

    Many thanks in advance! :)
     
    buttmatrix likes this.
  42. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @chiapet1021
    I'm aware of the situation yes and indeed it can be problematic if people start to differ too much their custom renderers without any structural base.
    The solution consist of laying down some hierarchical foundations similar to current renderer (Deferred/Forward) where most of it's rendering code is layered down onto shader files within functions and macros. So instead of everyone re-implementing their own "EnterSomeWeirdNameFunction" for lets say decode shadows, people will follow some naming guidelines convention. Exactly what current renderers are doing except that people will ship the renderer too, not just the "rendering part" though.
    For reference, the renderer is the one that says what and when things should be rendered, the giant loop though and the rendering part is the shader files that says how to render those things.
    I didn't had the chance to give a look to the Shader Graph yet but hearing from Unity folks directly they will work very closely with both HD and LW renderers. So yeah, anything that is compatible with default renderers will work with NGSS out of the box.
    Right now I'm making NGSS gets plugged in both HD/LW renderers without moving anything else. In other words, if I remove NGSS code from it, it should compile and work normally. I'm still investigating onto how to make it plug able out of the box within other custom SRP assets and I will get back to you with more on that later.
     
    buttmatrix and chiapet1021 like this.
  43. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Thanks! So just to clarify further, are you still working on your own custom render pipeline asset that will be separate from NGSS? I believe you said certain features you wanted to provide customers would not be doable until SRPs are implemented in Unity. That new asset (if it is still in the works) is what I was referring to in my previous post. Getting NGSS to work with the new standard SRPs (and other custom ones, under the right conditions) is great too, obviously. :)
     
    tatoforever likes this.
  44. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    Yes but I don't think I will make it available to public for that same reason, it kinda differs from both HD and LW renderers and it won't be compatible with custom SRP solutions (At least not just yet). But that will probably change in the future as SRP matures. Right now, LW is a very good contender in terms of speed. I think mines sits in between HD and LW in terms of features and speed.
    Generally speaking, SRP are indispensable in order to implement new lighting and shadowing techniques. For instance to implement let's say moment shadowmapping or exponential variance shadowmapping it's just impossible with default renderer cause it requires a special rendertarget and we cannot control that part in default renderer. That's why I'm kinda limited to PCF and PCSS right now. Not the case with NGSS 2.0 though. ;)
     
  45. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Okay, thanks for clarifying. Yes, I wondered if you would decide to not release your custom render solution, after these complications about interacting with other assets have come to light. Can't say I'm not disappointed, but it totally makes sense. If NGSS 2.0 works with the upcoming HD loop, I'll be happy. :)
     
  46. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    I'm working on it. It will! ;)
     
    chiapet1021 likes this.
  47. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    More on future updates (beyond v1.7).
    I'm in the process of making Unity graphic guys add support for black magic trickery (some intrinsic functions) that allows fetching 4 samples at a time. Speed gains can be marginal (4 times) which means prettier (or faster) shadows.
    Speaking of rendering speed, I also had the chance to look at SATS (Summed Area Table Shadows) more closely as it's a good alternative for speed up shadows even further. A possible drawback of this functionality is that it forces a fixed kernel size. In other words, you lose the ability to control shadow soft-ness interactively and gradually in exchange of ~4 times rendering speed gains. Can be worked around by with some shader_feature that sets lets say an amount of fixed taps. The more taps you sets, the bigger the Kernel size (softer shadows). I'm also investigating if this technique can work with in tandem with the magic hardware trickery already mentioned at the beginning of the message which could lead to even more filtering speed improvements.

    NGSS 2.0:
    On top of that, Intensive works on the massive screen space filtering (for all lights in a single call) are in the process while getting my hands super dirty with SRP renderers. I'm in the stage of indexing layers of lights into a screen buffer. After that, I will lay down the bilateral filters and finally sample that map directly on shaders. Theoretically speaking, the performance hit should be similar as having hard shadowed lights and a post-effect on the screen. Similar to a deferred shadow system but without re-rendering shadowed objects (fetching directly mind you).
    In conclusion that will make the main features of NGSS 2.0, massive rendering speed improvements of shadows.
    Furthermore, other shadowing features and improvements will get added in a similar fashion as NGSS 1.x (on every major update).
     
    Last edited: Jan 13, 2018
    Baraff, buttmatrix and Invertex like this.
  48. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,502
    I'm curious how a technique like this would be able to handle transparent objects casting semi-transparent shadows (and even more complicated receiving shadows at the same time too) if it is done in a single pass?
     
  49. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    @Invertex
    I'm going to post a research paper that explains the technique in depth (need to find where it is) but basically it's similar to current screen space directional filtering but it extends it to all lights by gathering lights info into a screen buffer (using all channels and levels of gradients to create light layers).
     
    hopeful, wetcircuit and Invertex like this.
  50. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,353
    One more video about upcoming improvements in v1.7:

    Major features in this version:
    - Inline samplers
    - Improved PCSS and PCF algorithms for all lights
    - PCSS algorithm behaves more like offline raytraced shadows
    - PCSS algorithm added to Spot Shadows (finally)
    - No more duplication of directional depthmaps when using PCSS algorithm (thanks to inline samplers). Saves tons of Memory and improves speed. Bye bye CommandBuffer :cool: