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

    alejojamcity

    Joined:
    Aug 30, 2018
    Posts:
    7
    I can give a hand with the Mac. Just let me know.
     
    tatoforever likes this.
  2. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @alejojamcity
    Poke me through support email, ill send you the package. :)
     
  3. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    I'm adding support to OpenGLCore API in v2.0.5. Making last adjustments and we should be ready to ship. Plus, coming to v2.0.5 you can disable component updates and shader global updates at runtime for all NGSS components, using the public properties "NGSS_DISABLE_ON_PLAY" and "NGSS_NO_UPDATE_ON_PLAY". This saves some extra CPU cycles.
    I also added a couple of new tiny optimizations like better coherent dynamic branching only if the API/platform support it well. In some cases dynamic branching can be worse so new compiler defines to check if im not being silly and putting unnecessary overhead. :)
     
    Last edited: Feb 17, 2019
  4. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Updated tutorial video:
     
    wetcircuit and Lex4art like this.
  5. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Folks,
    Version 2.0.5 has been submitted for review.
    Features and Changes:
    - Added coherent branching compiler defines (improves speed on some APIs/platforms)
    - Macro speed improvements to PCF, skipping couple of unneeded instructions (all shadows)
    - Ability to stop NGSS components from updating variables or receiving updates at runtime (if no needed)
    - Disabling shadows on the light will stop NGSS component from update shadows variables
    - Fixed a bug where new added local lights to the scene will override existing Global Settings
    - Added support to OpenGLCore (PCF Local Shadows and PCSS/PCF Directional shadows)
    - Added PCSS support to GLES3.0 (Directional shadows only, Local shadows still use PCF)
    - Fixed a bug with Arkit shadowprojection
    - NGSS libraries has now default minimal values (to avoid shadowed screen on install)
    - Fixed a rare bug with Spot light shadows on Mac (Metal API)
    - Removed OrderedDitheringDir array out of function (causes compilation error in PS4)
    - Removed System.Security.AccessControl and its method block code (no needed)
    - Cleaned up unneeded namespaces from NGSS components
    - Fixed Contact shadows leaking on top of the main camera (can now be used on multiple cameras game setup). Renamed the light property into a more generic one, if you don't see ContactShadows make sure the light property is not null.
    - NGSS internal libraries can now be added directly to shaders using the #include compiler directive. Useful if you can’t install the library locally, for example cloud builds (Refer to documentation)
    - Update to documentation & new video tutorial added (to reflect new changes)
     
    Last edited: Feb 18, 2019
    Bartolomeus755, Arganth and hopeful like this.
  6. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Version 2.0.5 is out. :)
    My email box is ready! :cool:
     
    hopeful likes this.
  7. jejacks0n

    jejacks0n

    Joined:
    Jul 28, 2013
    Posts:
    8
    It's working well on MacOS, and I haven't built for iOS just yet. I updated from unity ~2018.1 to 2018.3.6f1 and everything continues to work. I also tried in the 2019.2.0a4 and it also works there.

    This is a great resource, thanks for putting in the work!

    I do have a question about shadows and strength in general. I can't really think of a solution to this, and so want to throw it out there and see if there's an easy way to accomplish it or if you have any ideas.

    Do you have any thoughts on a solution to apply shadows to different targets at different strengths? Let's say you have a sphere with a small cube placed on the surface. I want the shadow of the cube to be cast upon the sphere at 60% strength because it looks really nice, but I want the sphere to cast a shadow of 100% strength onto the cube. A light is moving around the sphere.
     
    tatoforever likes this.
  8. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @jejacks0n
    Glad that you are having great time with the latest version. Nothing more enjoyable and motivational than a happy user. :)
    There's no way to do that, at least with Standard renderer. The reason is that I don't have access to lights indexes from the renderer (only to its rendering files) so is hard to say which light will have this property.
    The only native shadows properties that I get access to are shadows strength and shadows type. So I play with.
    If your game absolutely requires this feature, I can for instance re-work a custom version for you, invert some features such as shadows strength will become a per light opacity instead of per-light soft-ness. But this require some time, testing and is extra work yeah. Other than that, wait for HDRP coming late this year. :D
     
    Last edited: Feb 19, 2019
  9. jejacks0n

    jejacks0n

    Joined:
    Jul 28, 2013
    Posts:
    8
    It's not an absolute required feature, and I appreciate your time in responding. This is pretty much what I figured. =)

    Ok, so I built for iOS tonight and I'm not getting any light from the light with the NGSS_Directional script on the device. iPhone X, iOS v12.1.4. Any ideas off hand? I haven't looked for any questions/support issues regarding this yet, just posting before I head to bed.
     
  10. Flurgle

    Flurgle

    Joined:
    May 16, 2016
    Posts:
    389
    Will there be an HDRP alpha we can try out / test out in the meantime? Looking forward to this in SRP!
     
  11. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @jejacks0n
    Make sure you installed the libraries and if you target mobile disable Cascaded Shadows in your project Graphics Settings (iOS tab).

    @Flurgle
    Yes just not yet. We are working on v2.1 right now which is a big major update. Then we will get back to HDRP.
     
    Flurgle likes this.
  12. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @jejacks0n
    I think i found an issue with the soft-ness being at zero when cascades are disabled (the default for mobile) and is fixed for the next patch update coming tomorrow (v2.0.6).
    If you want the patch you can send an email to support or wait till tomorrow. :)
    Cheers,
     
  13. jejacks0n

    jejacks0n

    Joined:
    Jul 28, 2013
    Posts:
    8
    @tatoforever
    Interestingly, it does show up sometimes, apparently at random after restarting the app. I'll wait, and I'm glad I was able to help you identify something and that you're working to resolve it. Later today I'll try adjusting the cascaded shadows and let you know what effect that has.
     
    tatoforever likes this.
  14. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    V2.0.6 have been submitted for review:
    - Fixed two bugs with directional shadows in Forward when Cascaded Shadows where disabled.
    One with shadows opacity and the other with the shadows softness not scaling well.
     
    ceebeee and jejacks0n like this.
  15. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    V2.0.7 have been submitted for review:
    - Fixed a bug with NGSS_Directional component not updating shader global values if NGSS_NO_UPDATE_ON_PLAY was enabled. You don't need to re-install libraries with this update, only download the package from the store into your project.

    If no other bug is found, the next update will be v2.1. I'm rewriting major portions of components and optimize them a bit. Making all public values properties that you can access and they will update their global shader uniforms only when they change (instead of every frame). For now, you can disable shader uniform updates but its either all values or none.
    Cheers,
     
    Last edited: Feb 20, 2019
    hopeful, Bartolomeus755 and ceebeee like this.
  16. alejobrainz

    alejobrainz

    Joined:
    Sep 10, 2005
    Posts:
    288
    Thank you for such a great job!
     
  17. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    141
    @jejacks0n For custom controlling shadow/light strength on individual objects, I'd rather using a special shader than editing the shadow plugin itself. I use amplify shader for special shader requirements. Per object shadow strength could then controlled through vertex colors.
     
  18. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    tatoforever likes this.
  19. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @ceebeee
    I've put my hands not long ago on a dynamic voxelizer implementation made completely on the GPU using compute shaders but didn't had much time to play with. Mostly because I'm hoping DXR will solve some of those raytraced shadows techniques problems. Though, the accelerated structure can be a problem in some cases, I still need to test it on a real world example, my previous tests with nVIDIA OptiX have been primitive based simple scenes but once 2.1 is out, I'll get back to it. This is definitely my main field of research & dev, high quality shadows. :)
     
    hippocoder and ceebeee like this.
  20. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    We're using NGSS v2 Contact Shadows and Directional Light in our big open-world game, which has 64 terrain/LOD tiles that load/unload as the player moves around the map (using World Streamer). Looking at the profiler from a dev build, I noticed that Contact Shadows spike during each additive scene load. Is there anything we can do to reduce/eliminate this? (2018.3.6)

    thanks!
    Dave

    additive-ngss.PNG
     
  21. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @gecko
    How the profiler looks like if you disable contact shadows and does the same loading process of your terrain data?
    Are you loading new cameras? Cause normally, the ContactShadows spike should happen only once (when your scene loads at first when creating RTs and command buffers). After that is just read the depth buffer and compute shadows with. ContactShadows should not spike unless you are doing something funny with like reseting or enabling/disabling it.
     
    Last edited: Feb 21, 2019
  22. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    Testing in the editor (quicker), i get this NGSS Contact Shadows spike on the GPU when it's enabled on the camera, but not when it's disabled....which isn't too surprising.

    Grass is being rendered by Veg Studio Pro, using runtime rules, so new grass is spawned when additive scenes load and unload....but that's pretty unavoidable (since I can't bake grass to VSP's persistent storage, way way too many instances of it across the game map.) So....anything I can do about this?
     
  23. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    Are you enabling ContactShadows at runtime? I mean, while playing the game (not when your scene loads).
     
  24. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    nope, it's always enabled. (Can't live without it)
     
    tatoforever likes this.
  25. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @gecko
    Is there a way for you to send me a portion of your scene with that behaviour? Or give me access to your project so I can investigate on my end?
     
  26. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    not easily -- it's a ginormous project. Would skype screen-sharing be an option?
     
  27. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @gecko
    Sure thing, we can do it sometime tomorrow. Hit me through support email.
     
    gecko likes this.
  28. mishanany

    mishanany

    Joined:
    Feb 25, 2014
    Posts:
    5
    Pre-Integrated Skin Shader + Next-Gen Soft Shadows problem.

    Hi, I am having a problem with using both assets in my project. All shadows over pre-integrated skin shader textures are not correct.
    I saw your previous reply to one of the users with a similar issue that was reported. I managed to fix point lights by following your suggestion. I adding the following line to PreIntegratedSkinShaderCore.cginc:

    _LightShadowData.r = 1;

    However, spot light still present a problem where surface that is using pre-integrated skin shader is much darker than others and shadows are not correct.

    Can you provide a solution to this problem ? I purchased both of your soft shadow assets, version 1 and version 2.
     
  29. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @mishanany,
    You can email me your shaders to support, I'll do the tweak, won't be that long.
    PS: In v2 you can set the shadows opacity (through the NGSS_Local component).
     
  30. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @mishanany
    Please email any file to support, do not post publicly assets in this thread. Photos and videos are OK.
     
  31. mishanany

    mishanany

    Joined:
    Feb 25, 2014
    Posts:
    5
    file emailed
     
    tatoforever likes this.
  32. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    538
    Hi,
    I have the previous version of your assets. As I can see it's not longer available at UAS. Do I need to buy the new one again or just provide you my order number of the old one to get this new version?
     
  33. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @NOT_Lonely
    You can access the old version in your Downloads section of the AppStore.
    Cheers,
     
  34. NOT_Lonely

    NOT_Lonely

    Joined:
    Feb 2, 2013
    Posts:
    538
    But you dropped support of it?
     
  35. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @NOT_Lonely
    I stopped updating it because v2 but still works fine and if you have any questions about it let me know.
     
  36. CGBull

    CGBull

    Joined:
    Feb 12, 2017
    Posts:
    82
    I want use NGSS to custom srp. Is this possible?
     
  37. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @CG_Bull
    SRP support is being worked on and is not yet released, coming sometime this year. For now just Default (Standard) renderer support.
     
    ceebeee and Flurgle like this.
  38. CGBull

    CGBull

    Joined:
    Feb 12, 2017
    Posts:
    82
    Cool, Expect for custom srp support.
     
    tatoforever likes this.
  39. skyecrack

    skyecrack

    Joined:
    Jan 5, 2018
    Posts:
    29
    I'm finally able to pinpoint what bugs me about your primitive shadows. Here, take a look: Screenshot_593.png
    It looks just like you're just increasing the partially occluded part while the fully occludded part stays the same, whereas in real life the fully occluded part shrinks as the light source size increases. Is there a way to circumvent this?
     
  40. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    He mixes up the words "obsession" and "research" but we love him anyway.
     
    AlanMattano, tatoforever and ceebeee like this.
  41. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @skyecrack
    You are right, the large penumbra I obtain in primitive shadows is completely free. Have the same cost as hard shadows. However there's other ways to hack into it and make it appears more physically plausible (more than how it looks already). I'm working on it. :)
     
    Last edited: Mar 5, 2019
    alternativevisual and skyecrack like this.
  42. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @hippocoder
    I'm seriously obsessed with shadows! :V :D
     
  43. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    141
    If the primitive penumbra is really free atm, I'd like to have the choice, if you plan to implement a more realistic approach of rendering them. The "free" variant looks good enough for me :p Would be nice to know at which point I shouldn't replace one complex mesh shadow with multiple primitive ones anymore, because it's not worth performance wise.
    Are there already "known values"?^^ Maybe I should combine some cubes into one mesh and test it out once 2.1 is released.
     
  44. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @Zyblade
    I don't think the variants will be any cheaper and if you are looking for a more CG/physically approach just wait for my upcoming product based on DXR. This however requires modern DX12 GPU with hardware support and if I'm not mistaken Unity is adding support to DXR only on SRP modules.
    In any case, primitive shadows are a way to skyrocket character shadows (or even simple geometrically shaped scene props) for free. Having the penumbra with the size of the whole screen cost the same as hard shadows. :)
     
  45. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    you're killing me with the wait for 2.1..... got an ETA yet?
     
    tatoforever likes this.
  46. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @gecko
    Hehe, it's safe to say before summer should be released and beta versions before that. ;)
     
    Flurgle likes this.
  47. haleler51

    haleler51

    Joined:
    Apr 9, 2015
    Posts:
    30
    I have NGSS 1 and I've been thinking of upgrading to NGSS 2. But I'm curious about performance. At a similar or equal level of quality, does NGSS 2 perform better than NGSS 1?
     
  48. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @pilamin
    Performance is either similar or better due to the fact that you have newer algorithms to play with (Dithering and Denoiser) and it allows you to reduce sampling while having overall better looking shadows.
    If you are targeting mobile, you will also find a new optimized directional shadows when you disable Cascaded Shadows in your Graphics Settings that runs extreme fast.
     
  49. anpd03

    anpd03

    Joined:
    Aug 7, 2013
    Posts:
    65
    Hi is there anything specific that needs to be done to make it work in build. I get weird pink, purple colors across the whole scene where the shadows should be.
     
  50. tatoforever

    tatoforever

    Joined:
    Apr 16, 2009
    Posts:
    4,369
    @anpd03
    Can you provide more information about your project, target platform and build settings?
    Did you installed NGSS libraries?
    Cheers,