Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Right, you'll have to chat with @tatoforever about that. I thought you were just trying to control the extent of the shadow filtering - there will always be some grain when you are at practically zero-distance from the shadow.
     
  2. cadpeople

    cadpeople

    Joined:
    Nov 6, 2014
    Posts:
    21
    Yeah this happens no matter the distance though. It's pretty jarring :/
     
  3. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @cadpeople
    Noise is a sub product of the algorithm used in NGSS. Basically you trade banding for noise. Noise is a more natural and is used in Monte-Carlo like renderers.
    Though, it can be improved in many ways, avoid high frequency surfaces (such as the one in the example) or wait for next update and set quality a bit higher (more taps per frag) which will help reduce noise in extreme cases.
     
  4. cadpeople

    cadpeople

    Joined:
    Nov 6, 2014
    Posts:
    21
    What do you mean by high frequency surfaces?
     
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Sorry, I meant low frequency surfaces (surfaces without much detail). Shadow mapping will never be perfect, there's always something that need to be masked (either banding, noise, bias, acne, etc). The best way to mask shadows imperfections are high frequency surfaces (with plenty of details) and design your scene to avoid such artefacts.

    Example High frequency (ground):



    Example Low frequency (ground):


    Where are shadows more visible, first or second image? ;)

    Although, next version you'll have control over quality and one of the options will let you slide between banding and noise. Basically, at 0 you'll have full banding (classic approach) and 1.0 you'll have full random stable patterns (NGSS approach).
     
    laurentlavigne likes this.
  6. cadpeople

    cadpeople

    Joined:
    Nov 6, 2014
    Posts:
    21
    Thanks for your answers. It's unfortunate that one of the center pieces in my project, is basically entirely textureless white. I guess what I really need is good hard shadows :L

    I'll take a look again in the next version and try finding a good balance between banding and grain, but the grain is more jarring than the normal Unity shadows, for this project.
    Might be okay for another project :)
     
    tatoforever likes this.
  7. LarsH673

    LarsH673

    Joined:
    Mar 7, 2015
    Posts:
    17
    Hi,I have some trouble with my bias settings, i get big artifact everywhere. My settings on this Image = Bias 0.05, Normal Bias 0 and Near Plane 0.1
    Shadow Flicker.jpg

    if i want to get rid of this flickering i need to turn i up the Bias to 1.00. But that's to much ! i lose so much details !
    Can some pleas help me ?

    Sorry for my bad english
     
  8. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    This looks really nice! Does directional PCSS work with 2017.1 beta?
     
  9. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @Kolyasisan
    Not yet fully tested with 2017 but it should work. We'll lay out first next version of NGSS (1.4) and then works towards compatibility with UT2017.
     
  10. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @LarsH673
    Can you please submit a small repro project with that terrain/shader (to support email)? It looks like your shader is rendering the terrain twice (or your bias is completely turned off). I need to check that out closely.
    Regards,
     
  11. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @cadpeople,
    You will be able to rise the number of taps per frag in next version and disable the NGSS algorithm (use a standard one) but banding may become visible though.
     
  12. AlteredPlanets

    AlteredPlanets

    Joined:
    Aug 12, 2013
    Posts:
    455
    please check you PM box, I sent you message on purchasing this asset.
     
    tatoforever likes this.
  13. f0ff886f

    f0ff886f

    Joined:
    Nov 1, 2015
    Posts:
    201
    Hi @tatoforever, thank you for the awesome plugin. Just using it on my directional shadow for now and its a big improvement.

    I do have one question, if I do not move my camera at all, I'm having trouble with my shadow shimmering very quickly. No camera motion, but lots of shimmer. Any idea what this could be?

    Here is a gif showing the issue: https://media.giphy.com/media/xUA7aNZVzPuI6nuCaY/giphy.gif

    Note, if I move the camera around, there are sometimes views that show me no shimmer.
     
  14. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    close fit vs stable fit?
     
  15. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @vostk4,
    Rise the bias value a bit or (if possible for your scene) disable shadow casting on your floor, set it only to receive shadows only.
     
  16. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Folks,
    I'm experimenting with exponential variance shadowmapping for NGSS 2.0. This has plenty of benefits including removal of bias/peter panning and other shadow artifacts, hardware pre-filtering of shadowmaps and single fetch per frag (shadowmaps arrives at the frag level already filtered, so only 1 fetch per frag). It's extremely fast but PCSS filtering get's a bit tricky (but certainly doable). Small preview in the coming days. ;)
    Again, if you own NGSS 1.x, you'll have 50% discount.
     
    TerraUnity, buttmatrix and punk like this.
  17. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    155
    Looks promising!

    50% of how much by the way? :)
     
  18. sickbattery

    sickbattery

    Joined:
    Jul 13, 2014
    Posts:
    20
    Works for Editor. Doesn't work in Build.


    Shader error in 'Standard': Invalid const register num: 32. Max allowed is 31. at /Program Files/Unity/Editor/Data/CGIncludes/UnityShadowLibrary.cginc(195) (on d3d9)

    Compiling Fragment program with SPOT SHADOWS_DEPTH
    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
     
  19. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @sickbattery,
    You should remove DX9 from your target platform if you are using complex shaders such as a displacement offset mapping and the like. Otherwise you'll run of registers and instructions quickly. Set it to DX11 and build again see how it goes.
    PS: Btw what kind of shaders are you using?
     
  20. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,539
    Curious if this new feature in 2017.1 will be of help to your shader?
     
    buttmatrix likes this.
  21. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @Invertex,
    Yes, this is the feature I was wating for in order to integrate PCSS on spot and directional shadows. The latter is already done as you saw. ;)
     
    Invertex likes this.
  22. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Basically, what this allows us is to get both hardware sampling comparison states and raw depth from shadowmaps.
    Avoids tons of headhaches, texture duplication and other gazillions performance critical stuff.
    PS: I requested this last year. :)
     
  23. f0ff886f

    f0ff886f

    Joined:
    Nov 1, 2015
    Posts:
    201
    This was close fit, stable fit didn't help at all (and made visual quality much worse).

    Ok, played with the bias values a bit, it is a bit better now. Thank you!
     
    tatoforever likes this.
  24. Rumbleboxer

    Rumbleboxer

    Joined:
    Dec 26, 2012
    Posts:
    27
    Hey NGSS team, I'm seriously considering getting your plugin after seeing the results but I heard from my friend that the installation requires changing unity files and backing things up. Is there any plans to make this step easier? As I imagine different projects would require backing up files and so forth to be quite a hassle.

    Also, do you know if your plugin works flawlessly with HX Volumetric lighting? I'm not a technical person so worried there's a conflict or problem between this and theirs.
     
  25. Howard-Day

    Howard-Day

    Joined:
    Oct 25, 2013
    Posts:
    137
    Rumbleboxer: Yes, NGSS works great with HX Volumetric Lighting. I'm using them together and they look fantastic. Only one hiccup - since the NGSS system hijacks the "Shadow Intensity" slider to change how fuzzy the shadow maps are, it can mess with the intensity of the HX Volumetrics from those lights - causing the volume shadows to fade as well. Luckily, HX provides an override shadow strength slider that fixes this - just set it back up to 100%, and you're golden. Also, the replacement of the .cginc files in the Unity editor folder is painless. You really don't need to make backups. :D
     
    tatoforever likes this.
  26. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Hi Rumbleboxer,
    Installation is simple, back your UnityLibraryShadow file (Unity install directory), replace with NGSS one and then delete your Shader Cache folder for project you want to use NGSS. For directional shadows there's an extra file that you must set through your project Graphics menu. That's it.
    Note: You have to replace Unity shadows library every time you install a new version of Unity as the installation will override NGSS shadows library. This is quite a bit dumb I know but Unity doesn't provide any point/spot shadows override through the Project Settings (only with Directional shadows). :\
    For HX volumetric (or any other special effect that uses Shadows Strength value internally), there's a small description in documentation on how to do it. You can always email support if you need help on that but it's only one line change in your effect file. What Howard suggested will avoid change your effect file.
     
    Last edited: Jun 22, 2017
    Howard-Day likes this.
  27. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    small show off using you ngss totally would love to see the new features with this scene.
     
    docsavage, buttmatrix and tatoforever like this.
  28. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @nbac
    Beautiful, with the new features coming it will look even sexier! :D
     
  29. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
    This shadow grain looks so cinematic :)
    Are contact shadows like Sonic Ether's raytraced shadows?
     
  30. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @laurentlavigne
    They are like UnrealEngine ContactShadows, similar techniques (raymatched, screen space, etc). Dunno about Sonic Ether though.
     
  31. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Folks,
    Regarding the issue where Unity overrides NGSS shadows if platform is set to mobile and renderer to Forward. I'm discussing with Unity folks right at this moment (they finally answer the bug request). :)
    I'll let you know asap when we are done.
     
    ilmario likes this.
  32. Nocturness

    Nocturness

    Joined:
    Nov 10, 2015
    Posts:
    7
    tatoforever likes this.
  33. Rumbleboxer

    Rumbleboxer

    Joined:
    Dec 26, 2012
    Posts:
    27
    @tatoforever @Howard-Day Thanks guys! I'm pretty sold on this. Going to get a copy of NGSS this weekend.

    edit: Woops.. just curious but when is NGSS 2 coming out? Maybe I should wait for that.
     
    Last edited: Jun 23, 2017
    tatoforever likes this.
  34. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
  35. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    NGSS2.0 it's due later this summer, most important feature it will contain new shadowing techniques.
    EDIT: IndirectShadows and projected shadows (faster shadows on the planet) are also planned for NGSS2.0 alongside other shadowing techniques. My goal for NGSS2.0 is to provide all shadowing techniques found in Unreal Engine (or their best ones) that can be useful in any game case/type.
     
    Last edited: Jun 23, 2017
    Bartolomeus755 likes this.
  36. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    NGSS turning scenes full pink after install in 2017.1.0 Beta 9
     
  37. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @buttmatrix
    The version you have is not compatible with UT2017, next week version is compatible with UT 2017.
     
    buttmatrix likes this.
  38. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
    Thanks for the response. Unreal penumbra shadows look amazing.
    This is SE shadows. Good contact shadows for small details and apparently grass too. http://www.sonicether.com/screenspaceshadows/
     
  39. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    SE screen space shadows only works in deferred tho
     
    Last edited: Jun 24, 2017
  40. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    NGSS contact shadows works in any rendering path.
     
  41. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Folks,
    Next update is planned for next week, it will contain PCSS for directional and spot lights and quality sets (16, 25, 32 and 64 samplers) which translates to Low, Medium, High and Very High. Plus few improvements to ContactShadows and support for UT 2017. Testing out and finalizing few things before Asset Store submission (please bare with me).
    What I'm currently working on, I'm implementing normal offset bias on point and spot lights shadows. This will help reduce shadow artifacts such as bias, petter panning and the like issues. Directional lights already provides normal offset bias (but not spot/point).
    The algorithm is working (with constant hardcoded values) but trying to get access to that value internally always returns zero. Looks like Unity default renderer don't update the value if the light is set to spot/point. I'm investigating a bit more and will try to find a workaround.
    Other small issues I'm solving are flatting out disk projections to avoid projecting samplers out of surface space (if too soft = some areas can gets a bit noisy if bias/offsets values are too low). Improving on that side too.
    I also spoke with Unity QA about the mobile issue. The guy was unable to repro the very simple steps I've provided in the example project (NGSS project). He said NGSS works fine on mobile (which it doesn't work cause Unity force replace custom shadows in forward mode). I'm suspecting a Unity bug. I re-send more pictures of how he needs to setup the scene in order to repro the issue and again I'm still waiting for his answer.
    So folks, please be patient (with Unity QA guys). :rolleyes:
     
    Last edited: Jun 24, 2017
    ilmario, nxrighthere, Lex4art and 2 others like this.
  42. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    alternativevisual and buttmatrix like this.
  43. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,766
    Hello, I have a few questions on the asset:

    1. Right now I'm still using Unity 5.3.6. Does this asset work with that version of Unity?

    2. Is there a link to just the documentation? Or is the doc only available with the asset?

    3. Does this asset help resolve the issues of shadow dithering due to semi-transparent shadows?
    The issue I'm running into with Unity appears like this:

    shadow1.jpg

    Can this assets be used to help to improve the appearance of these types of semi-transparent shadows from point lights?
    (This is just the Unity standard shader in "Fade" mode)

    Thank you.
     
  44. Bartolomeus755

    Bartolomeus755

    Joined:
    Jun 20, 2013
    Posts:
    283
    Hello,

    after making a standalone build (Unity 5.6.0f3) I have the following error code in the output_log.txt which is repeated continuously.

    Code (csharp):
    1. (Filename:  Line: -1)
    2.  
    3. NullReferenceException
    4.   at (wrapper managed-to-native) UnityEngine.Material:Internal_CreateWithShader (UnityEngine.Material,UnityEngine.Shader)
    5.   at UnityEngine.Material..ctor (UnityEngine.Shader shader) [0x00000] in <filename unknown>:0
    6.   at NGSS_ContactShadows.get_mMaterial () [0x00000] in <filename unknown>:0
    7.   at NGSS_ContactShadows.Init () [0x00000] in <filename unknown>:0
    8.   at NGSS_ContactShadows.OnPreRender () [0x00000] in <filename unknown>:0
    9.  
    I replaced the UnityShadowLibrary.cginc in the Unity folder and I also deleted the ShaderCache folder of my project. And also set the Screen Space Shadow to custom and added the Internal-ScreenSpaceShadow shader file. Have I overlooked something?
     
  45. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @TTTTTa
    1 - Yes, except ContactShadows work only in Game view because some functionalities to make it appears in Editor view were available after version 5.4 (you have to comment the line [ImageEffectAllowedInSceneView], as is not compatible with UT5.3 and below. In any case, you can always email support with your custom scripts, shaders or even projects, I'll be happy to make them work with NGSS.
    2 - Documentation is available after asset purchase but frankly it highlights only how to install NGSS (replace Unity core shadows) which is quite simple.
    3 - Yes, this asset removes banding pretty well, you won't see those grid patterns in shadows (make sure they are very soft, not hard).
     
  46. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @Bartolomeus755
    This is an old Unity bug, where it sometimes can’t find shaders internally using the Shader.Find command (returning null even if you have the shader) so the workaround is simply add the shader manually via public property.
    I’ve slightly modified the code to make it work. Use the version I've sent you through email. Make sure to add the ContactShadows.shader manually to the ContactShadows.cs component property.
    It should fix the problem.
    Regards,
     
    hopeful likes this.
  47. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    617
    Thanks Tato, I love your asset way too much. Some comparison images here

    off:
    engine default.jpg
    on;
    engine NGSS.jpg

    off:
    default shadows.jpg

    on:
    NGSS full.jpg

    Performance suffers a lot, but... I don't care! :D

    Thanks!
     
  48. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    @DavidMiranda
    Those shots are lovelly. Upcoming updates will improve Directional/Spot shadows filtering and even overall quality a lot more! ;)
     
    Bartolomeus755 and buttmatrix like this.
  49. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Folks,
    Good news regarding NGSS and mobile. The issue is deeper than we thought but it has a workaround (fortunately). Well, the problem lies within Unity corrupting ProjectSettings and/or Library when importing the project from older versions.
    The workaround requires you to delete the Library or some files in your ProjectSettings folder and re-import the project again. I'm doing some more tests to confirm the workaround and let you know!
     
    Last edited: Jun 26, 2017
    ilmario and alternativevisual like this.
  50. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,364
    Ok so more on the mobile issue. The workaround doesn't seem to work. Deleting the library or even ProjectSettings folder didn't worked as expected. Looks like the Editor corrupts some project data somewhere when upgrading projects from old to new Unity versions that prevent from setting custom directional shadows (Graphics Menu).
    The QA guy sent me a test project where NGSS shadows worked on mobile (email support if you want to tests on your end) but we don't know exactly where the bug lies so they will do more tests to find out. Fortunately, they where able to reproduce the bug and will keep me updated.
    I will keep doing tests and try to find out a workaround in the mean time. Please remain patient. :)