Search Unity

  1. We would like to hear your feedback about Unity and our products. Click here for more information.
    Dismiss Notice

[Released] SE Screen-Space Shadows

Discussion in 'Assets and Asset Store' started by sonicether, Dec 7, 2016.

  1. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    I don't really know how Sunshine applies its custom shadows. Does it render its own shadow result and overwrite the Unity default one? If that is the case, perhaps this is happening after SE Screen Space Shadows is blending its result. Perhaps changing the execution order of your scripts so that SE Screen Space Shadows executes after Sunshine will help.
     
    RB_lashman likes this.
  2. Nexusmaster

    Nexusmaster

    Joined:
    Jun 13, 2015
    Posts:
    53
    Thx for the quick reply! I did some more testing and I think it doesn't show up because the Light's ShadowMask gets disabled when you turn off unity shadows. So, I just have to put the blending somewhere else, maybe as a post effect... the scripting order didn't change anything, (when you disable the unity shadows globally, the SESSS effect is gone. So there must be a connection with the blending.)
     
    RB_lashman likes this.
  3. reggie_sgs

    reggie_sgs

    Joined:
    Jun 29, 2014
    Posts:
    177
    RB_lashman likes this.
  4. Flurgle

    Flurgle

    Joined:
    May 16, 2016
    Posts:
    368
    This is looking really good.

    I read through the thread, but couldn't figure something out.Is point lights / spotlights support possible? (or future feature), Or is it impossible due to the restrictions of screen space?

    Thanks,
     
    RB_lashman likes this.
  5. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    199
    Does this working in single pass renderning? If not, can you implement support for this?
     
    buttmatrix, SteveB and RB_lashman like this.
  6. atomicjoe

    atomicjoe

    Joined:
    Apr 10, 2013
    Posts:
    365
    Completely off-topic, but I had to say it: Your game looks (and moves) AMAZING!
    I'm seriously impressed :)
     
    arnoob, Seith, hopeful and 1 other person like this.
  7. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    831
    Hello, I wonder if you can make a version that works with 5.3 (I don't remember if we already discussed this option)
     
    RB_lashman likes this.
  8. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    There is no way to properly blend screen-space shadows with point lights/spot lights for now, unfortunately.

    I'm currently working on this.

    Unity 5.4 is the oldest version with the correct CommandBuffer functionality for this effect. Unfortunately, it is the oldest version of Unity that I can support with this asset.
     
    stylophone and RB_lashman like this.
  9. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    695
    Hey CODY,

    you recommended to use TAA. But TAA is not provided with Unity image effects because of temporal movement jitter bug. Is there any other working TAA available for Unity? Unfortunately didn't found any for Unity.
    Are the shots from UE?

    Regards, Q
     
  10. Flurgle

    Flurgle

    Joined:
    May 16, 2016
    Posts:
    368
    RB_lashman likes this.
  11. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    695
    Flurgle likes this.
  12. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    695
  13. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    711
    RB_lashman likes this.
  14. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    I'm sorry about that! It was a bit of an oversight on my part, I've forgotten to have the shader not attempt to compile on incompatible renderers (by using #pragma only_renderers d3d11 glcore xboxone ps4 for example). Other than these build errors, does the effect show in builds properly?

    Is there any reliable way to reproduce this problem? I definitely want to take a closer look at this. If you could send me a scene that reproduces it, that would make fixing the problem a lot easier for me!
     
    Seith and RB_lashman like this.
  15. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,316
    Hi SE,

    Here is a video of my finished 2 year project. It features your screen space shadows:

     
  16. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    695
    Sure If you send me the Boom (brought 2 years ago) with Fog for testing, I will prepare a demo with all sources to test for you. Use my #SC .

    Contribution
    RogerCabo.jpg
     
    Last edited: Mar 4, 2017
  17. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    711
    Thanks! Yes, the effect does show up properly on all those platforms.
     
    RB_lashman likes this.
  18. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    152
    Btw, feels like shadow frustum bug (e.g. related to standard Unity shadowmaps). Can you add to this scene objects were will be clearly visible standard Unity shadows. If it will disappear too - that means SESSS is just disappearing following Unity shadows...
     
    Last edited: Mar 5, 2017
    RB_lashman likes this.
  19. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    695
    Yes, this is a strange behavior. Because you can disable shadows on an object, and SESSS produce shadows on it, because another shadow bounds/caster is in a calculated range, BUT NOT currently visible for the cam. Generally it cause SESSS disable and enable for any uncontrollable reason.

    For example a dens grass field (without shadows) with trees. If you walk around between the trees SESSS pops in and out because of the shadow trees.

    1) I would like an option have to generally fade out these lets say "micro shadows" from SESSS X meters including a fade range.
    2) An additionally option to ignore unity shadows bounds (or what every its cause to pop in and out).
     
    JBT27 likes this.
  20. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,831
    Is this the kind of thing a user can compensate for by putting a tiny shadow casting object behind the camera?

    That way Unity shadows are always on.
     
    RB_lashman likes this.
  21. ggXXmastrerz

    ggXXmastrerz

    Joined:
    Dec 26, 2016
    Posts:
    2
    Hello SonicEther, the screenshots of your product look stunning! However, I am still a little bit unsure of how this product would contribute to my project, as I am sure many others are as well. Would it be possible for you to offer a trial version for overly cautious buyers such as myself? :p

    Please and thank you,
    ggXXmastrerz
     
  22. arnoob

    arnoob

    Joined:
    May 16, 2014
    Posts:
    151


    Fantastic asset! The performance are great and permit to do great things! Also it works perfectly on a split-screen setup as you can see.

    Here the grass and the fps guns meshes are set up to not cast shadows, but they still get shadow from SSshadows.

    With a bit of tweaking, this permitted me to have self shadows on the guns that don't get projected on the ground (showing flying arms shadows) while still receiving environmental shadows.
    As well, all the grass get shadows from SSshadows only, wich avoid them creating new shadow casters (just look at the statistics, and I use a GTX770 2go!).
     
    Last edited: Mar 13, 2017
    punk and RB_lashman like this.
  23. KWaldt

    KWaldt

    Joined:
    Nov 1, 2013
    Posts:
    122
    Hey there!

    Anyone got it working with transparent (8bit) materials? I have some soft alpha objects in a characters face to ease the transitions, but it looks rather ugly with SSS.
    I tried it with a shader that writes into the depth buffer, but that didn't work either.

    Best Regards,
    Kristina Waldt
     
    RB_lashman likes this.
  24. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    695
    The transparent shader does NOT write into the depth Buffer. You need a second Pass or a Proxy object for the transparent Shader that is visible to SSS only.

    CODY knows the answer.
     
    Last edited: Mar 13, 2017
    RB_lashman likes this.
  25. KWaldt

    KWaldt

    Joined:
    Nov 1, 2013
    Posts:
    122
    @Quatum1000 Huh. Do you have an example shader available?
    The shader I linked seems to have two passes, but if I test it with DoF, I can see that it doesn't actually write into the depth buffer.
    (https://forum.unity3d.com/threads/transparent-depth-shader-good-for-ghosts.149511/)
    [You need to scroll down, it's the second one in the first post.]

    Thanks for the heads up that it's possible, though! I appreciate it.
    Maybe someone can shed some light on the details / the actual implementation. The proxy object sounds pretty interesting too, though I don't have a clue on how to do that one.

    Again, thank you for your response!
    - KW

    Edit: I thought about this a bit and I'm a bit unsure if it's possible at all. Transparent shaders are always a mess when it comes to receiving shadows. I guess I'll see if a stipple shader will do the job for me, or if I can remove the transparent areas from the characters face.
    If it's somehow possible to do with SESSS (because it's depth based or whatever), I'll be glad to hear it though.
     
    Last edited: Mar 14, 2017
    RB_lashman likes this.
  26. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    695
    Hey,

    SE should answer this, he knows what's going on and can provide a solution.

    I know a Shader Developer who would be able to solve this perhaps. But this guy takes money for this work.

    There are a lot of problems to solve with transparent objects working with lights and shadows anyway. Also Nvidia and ATI vendors stuck on this complex problem.
     
    arnoob and RB_lashman like this.
  27. runelink

    runelink

    Joined:
    Jun 2, 2014
    Posts:
    3
    Hey,

    I am getting the same errors as shown in the screenshot. The effect shows in the build but the errors are stopping our automation. Will you release an update with a fix soon or would you be able to send a code snippet with a fix?
    I'm not sure where I would use that line of code you used as an example there, I don't have a lot of experience with shader code.

    Thanks
     
    RB_lashman likes this.
  28. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,237
    I will give it a try and find the line number for you to add the code. this #pragma controls what platforms to try to compile for.

    just try to add it under the other pragma lines in the shader.
     
    Seith and RB_lashman like this.
  29. 44ffd3

    44ffd3

    Joined:
    Dec 29, 2013
    Posts:
    1
    Last edited: Mar 30, 2017
  30. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,031
    Nice improvement I was looking in the old post...

    From disable



    To Enable



    Thanks for the asset!
     
    Last edited: Apr 10, 2017
    buttmatrix and RB_lashman like this.
  31. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,237
    If you want to remove the dx9 errors you can exclude dx9 from the shader.

    add this

    #pragma exclude_renderers d3d9

    under the other #pragma lines
     
    RB_lashman likes this.
  32. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,031
    I did not notice a performance FPS drop. Congratulations! But can you add in the [tooltip] note for each value performance?
    as for example: "Samples" Bigger the value more GPU computational expensive.
    Thx
     
    RB_lashman likes this.
  33. ryschawy

    ryschawy

    Joined:
    Jul 28, 2012
    Posts:
    59
    I wonder if it will work together with shadow softener. Any experience? Thanks
     
    RB_lashman likes this.
  34. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,031
    It works with plugins that change the custom shadow property inside the build in shader settings (custom screen space shadow shader) as for example new gen soft shadow
     
    ryschawy and RB_lashman like this.
  35. jwilliamsen

    jwilliamsen

    Joined:
    Aug 8, 2010
    Posts:
    56
    In regards to it's function in VR (HTC VIVE) I can say that you will take a noticeable hit on performance, and will probably see some artifacting (the kind of weird sizzle/flicker that occurs with a lot of screen-space effects - usually dependent on head orientation) - but it also makes a pretty huge difference in how "present" a lot of objects look. I have a pretty massive scene going (1400 trees, 92 species of trees, 8GB textures, ~ 3 million triangles in the view frustrum, etc) and it's making enough of an improvement that I want to see if I can gain back the performance loss somewhere else to make up for it being in the stack.

    It's not perfect (in VR) but it's pretty good - makes a noticeable difference...I'm hoping it will improve with some time and testing ;)


    Without screen-space shadows
    Capture.JPG

    With screen-space shadows - notice the noise on the plain-shaded object in the background
    Capture2.JPG
     
    Last edited: Jun 2, 2017
    Lex4art, pixelsteam and RB_lashman like this.
  36. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Hey everyone!

    If you're still getting build errors, I'd recommend making the following simple changes. I'll be submitting an update with these fixes, but for now hopefully this will solve your problems.


    In SEScreenSpaceShadowsFallback.shader, on line 30, you'll see

    float4 vertex : SV_POSITION;

    change this to

    float4 vertex : SV_Position;


    It seems that Unity's ShaderLab language is somehow interpreting "SV_POSITION" as "POSITION" instead of the intended semantic "SV_POSITION". Strangely, if you change "SV_POSITION" so that it's not all-caps, ShaderLab interprets the intended semantic. I'm not sure why this is happening, I don't think this was an issue in previous versions of Unity when I first submitted this asset.

    And, as mentioned previously in this thread, in SEScreenSpaceShadows.shader, just add

    #pragma only_renderers d3d11

    below line 17. This will prevent Unity from trying to compile this shader for d3d9 platforms.

    Please let me know if these changes cause issues for anyone so I can make further adjustments before I submit an update.

    I apologize for the inconvenience!
     
  37. dawidtheoutsiders

    dawidtheoutsiders

    Joined:
    Oct 2, 2015
    Posts:
    3
    Is there a problem with this asset in Unity 5.5.0f3? I made a new project, imported SEScreenSpaceShadows and opened the demo scene and there´s no screen space effect.
     
    RB_lashman likes this.
  38. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    822
    Hi there!

    I was testing the asset with VR single pass mode and doesn't seem to work properly:


    Is there any chance you could support it? It seems to work fine in multiple pass VR.

    Also, could fading the shadow in the distance save some computational power (skipping far pixels) while still leaving us the chance to be able to use the effect as a "close detail" effect, blurring it with distance? ::)
     
    Murad-Khafizov and RB_lashman like this.
  39. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,468
    How well does this asset work with PRISM or Hx Volumetric Lighting?

    [EDIT]
    Bought it and seems to work perfectly fine with both assets. Btw, thanks for the build error fixes. I needed those.
     
    Last edited: Jul 6, 2017
    RB_lashman likes this.
  40. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    514
    Hi does it work with terrain self shadowing?
     
    RB_lashman likes this.
  41. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    514
    The demo scene lags like hell is it normal?

    Yeah its due to unity grass, nevermind
     
    Last edited: Aug 9, 2017
    RB_lashman likes this.
  42. coverpage

    coverpage

    Joined:
    Mar 3, 2016
    Posts:
    385
    Used this asset to create slight shadows on otherwise plain grass.

    img04838.jpg
    img00163.jpg
    img01929.jpg
    img05539.jpg
     
  43. portaplay

    portaplay

    Joined:
    May 17, 2013
    Posts:
    7
    Hi, I have some problems getting the shadows to show up between geometry and Unity Terrain.
    On foilage, it works great,
    But on geometry, it does not show up.

    Everything is "static" with shadows on (not related, I know, but still).
    I'm using Linear lightning and deferred rendering.

    You can see the screenshots attached, where the difference works on the actual model, but not between models and terrain.

    Also see the camera + light settings attached
     

    Attached Files:

    RB_lashman likes this.
  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,975
    Just purchased this asset and I must say I am PROUD of it. Finally my characters self-shadow and also too, the shadows under the feet feel like they connect with the world. I REALLY wish this worked with point lights, but I will accept this.
     
    RB_lashman likes this.
  45. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,100
    Which version of Unity are you using? 2017.2.0f3 gives an error in a empty scene & with the included demo.

    Invalid pass number (1) for Graphics.Blit (Material "Unknown material") with 1 passes)
     
    KRGraphics and RB_lashman like this.
  46. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,975
    I'm still on 2017.1... haven't touched Unity in a while
     
    RB_lashman likes this.
  47. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    447
    Could somebody tell me who also owns Next-Gen Soft-Shadows how SE Screen-Space Shadows compares to it in regards of speed?
    Unfortunately I can't purchase SE Screen-Space Shadows just to compare the speed of these two.
    Any help would be much appreciated.
     
    RB_lashman likes this.
  48. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,468
    I have them both and while I haven't compared them for speed, they are not competing products. They both serve different purposes. NGSS is a shadow replacement system to soften the shadows for a more natural look while SE Screen Space Shadows adds additional shadowing to objects via a screen-space post effect. They actually complement one another.
     
    RB_lashman and OfficialHermie like this.
  49. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    447
    Hmm, unfortunately I understand too little of it. I just took a look at @coverpage 's screenshots and thought that it looks just like NGSS, so I'm actually more confused than before.
     
    RB_lashman likes this.
  50. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,468
    Think of it this way. Without SESSS, you have less shadowing. For example, you might have grass without shadows and when you turn on SESSS then you have shadowing for the grass using a post image effect. With NGSS you don't get additional shadowing, you just have different looking shadows that have a softer more natural look.
     
    turboscalpeur, Arganth and RB_lashman like this.