1. Unity 5.6 is now released.
    Dismiss Notice
  2. We've introduced thread tags, search within a thread and similar thread search. Read more here.
    Dismiss Notice
  3. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice
  4. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  5. The launcher is currently pulling earlier versions of the content packages which may have errors, see post.
    Dismiss Notice
  6. We've released our first Timeline Experimental Preview, our new tool for creating cutscenes and more! To check it out click here.
    Dismiss Notice
  7. Check out all the fixes for 5.5 in patch releases 1 & 2.
    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:
    246
    SE Screen-Space Shadows provides screen-space raytraced shadows for directional lights for sharp, detailed contact shadows. It can capture details in shadows that would otherwise be missed using traditional shadow maps alone.

    This effect works by tracing in screen-space using the depth buffer information, similar to SSAO or screen-space reflections. Like these other effects, anything that is not directly visible in the main view will not contribute to screen-space shadows. However, because this effect is meant to be used in combination with traditional shadow maps to improve close-proximity contact shadows, this limitation is generally not apparent.

    This effect requires DX11 or OpenGL 4.1 or newer. It is not compatible with OpenGL ES and won’t work for WebGL or mobile platforms. It is compatible with Unity 5.4 and up. SE Screen-Space Shadows requires the deferred rendering path.

    Visit sonicether.com/screenspaceshadows for more information and screenshots

    [​IMG]
    Click the image above to view the Asset Store page.



    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]


    Since this effect uses the depth buffer to draw shadows, a parallax shader that modifies the depth buffer can cast and receive shadows (UBER used here).
    [​IMG]
    [​IMG]






    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]





    [​IMG]
    The above graph compares the render time of SE Screen-Space Shadows (in the grassy scene seen above) and both Unity’s Antialiasing (FXAA) and Ambient Obscurance image effects.

    The render time of SE Screen-Space Shadows is independent of scene complexity, and far away surfaces are quicker to calculate shadows for.

    This thread will serve as the main discussion thread for this asset. Please share your experience with SE Screen-Space Shadows!



    Did this asset help your project/scene look awesome?

    If you'd like to share your work, post a screenshot in this thread and mention how you should be credited! The most awesome screenshots will be featured in this thread, on the webpage for this asset, and on the Asset Store page (with credit given, of course)!
     
    Last edited: Jan 10, 2017
    EvilFox, GMax, JacobSmaga and 21 others like this.
  2. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    2,947
    This looks awesome! I drooled a little bit when I saw the UBER Parallax + Shadows cube.
     
    NeatWolf and RB_lashman like this.
  3. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    42
    A must-buy for me to hopefully fix the dreaded light leaks I got in my clean geometry, alongside the general aesthetical improvement. Very cool thingy you got there!
     
    RB_lashman likes this.
  4. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    233
    At what resolution has the render time been taken? 1080p ?
     
    RB_lashman likes this.
  5. DawidMoza

    DawidMoza

    Joined:
    Nov 24, 2016
    Posts:
    60
    It looks pretty realistic!
     
    RB_lashman likes this.
  6. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    168
    @No0B25 made an interesting comment above about how this effect could act as a solution to light leaking in Unity 5, something I had not considered. Could you comment directly on how generalizable this effect might be in that context?
     
    RB_lashman likes this.
  7. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    207
    Looking forward to this! Your website is linking to the wrong thread on the SESSS page. The Unity Asset Store link is wrong too but that's understandable since it's not out yet. You could link it to your general asset store page for now though.
     
    RB_lashman likes this.
  8. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    246
    Yep, 1080p.

    This effect does help with light leaking a lot, but it doesn't 100% solve it in some situations (since it's a screen-space effect).

    Oops, thanks for letting me know, I forgot to change those links! I've fixed it now.
     
    buttmatrix and RB_lashman like this.
  9. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    233
    At 1080p this looks very good performance wise. I am guessing it goes insane though, in 4k. But thats 4k. Nothing you can do about it.
     
    RB_lashman likes this.
  10. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    2,461
    The screenshots look super sweet! How much will it cost when it hits the assetstore?
     
    RB_lashman likes this.
  11. TimNedvyga

    TimNedvyga

    Joined:
    May 18, 2015
    Posts:
    15
    Does it support VR?
     
    SteveB likes this.
  12. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    246
    $20

    I can't think of a reason why it wouldn't work with VR, I've yet to test it out myself. Although I'm not sure how well a screen-space effect like this would translate to VR.
     
    TerraUnity, RB_lashman and Martin_H like this.
  13. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    168
    Could you elaborate on your above comment, why this may or may not translate well into VR?

    Also, given that the effect is tracing the depth buffer for directional lights only, how would this effect work for occluded geometry that only receives secondary bounce light from a directional light source. For example, consider the indoor archviz screenshot on the SEGI page: how would indoor props that are occluded by the ceiling and walls be affected if they are not immediately visible to the directional light?
     
    RB_lashman likes this.
  14. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    246
    Sure. I only meant that sometimes screen-space effects can work well outside of VR, but with stereoscopic rendering, the limitations of a screen-space effect become more apparent. I don't know since I haven't tested it myself yet.

    Also, shadows are blended as you would expect them to be. In areas that are already in "shade", this effect doesn't draw shadows "on top" of the shaded areas. Essentially what you get is (shadowmap shadows) * (screen-space shadows) where 1 means fully lit and 0 means fully in shadow. In the event that the shadowmap shadow value is 0, well, you see what I mean.
     
    RB_lashman, jdraper3 and buttmatrix like this.
  15. Games-Foundry

    Games-Foundry

    Joined:
    May 19, 2011
    Posts:
    632
    Why the comparison with FXAA in the chart? Are you also doing AA in this shader?

    I appreciate this is designed to be used in addition to soft shadows, but can you post another comparison of no existing shadows vs. screen-space shadows (other than the grass scene). I'm interested to see if this potentially could allow us to provide players with an option to turn off real-time shadows and just have SSS.

    For $20 we'll probably pick up a copy anyway to evaluate our jump to 5.4.3p3.
     
    RB_lashman likes this.
  16. FPires

    FPires

    Joined:
    Jan 5, 2012
    Posts:
    132
    Obviously only SE can give a definitive answer but my suspicion would be that using only SSS would look very weird because shadows would pop in and out of existence constantly. You'd only have shadows projected from stuff seen on the screen. I imagine if you're at the back side of a house and turn around suddenly you'd go from being in the shadows to being exposed in bright daylight.
     
    Martin_H and RB_lashman like this.
  17. Games-Foundry

    Games-Foundry

    Joined:
    May 19, 2011
    Posts:
    632
    Sure, I'm anticipating that. But it might be an acceptable compromise option for players who still want some shadows but lack the spec of PC to have them (we're 100% real-time shadows with heaps of objects so it's costly).
     
    RB_lashman likes this.
  18. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    122
    Damn hard to wait for this to appear on assetstore :) looks yummy!
     
    RB_lashman likes this.
  19. GTsphere

    GTsphere

    Joined:
    Sep 7, 2013
    Posts:
    119
    Wow looks amazing, nice work!
     
    RB_lashman likes this.
  20. semaphore

    semaphore

    Joined:
    Mar 21, 2011
    Posts:
    49
    @sonicether

    - Any updates on the asset store status? It's taking a while to show on there it seems.

    - Is this meant to replace other screen space AO like SESSAO or to compliment them?

    - Is it needed when SEGI is used?
     
    RB_lashman likes this.
  21. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    246
    I haven't heard back from the Asset Store yet, the process can take up to 10 business days.

    This effect acts totally independently from GI, SSAO, or anything like that. If you want more detail in contact shadows from your main directional light, it'll do that, but that's all it does.
     
    Martin_H, olavrv and RB_lashman like this.
  22. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    3,476
    If the Unity staff takes vacation time around now, I'd expect delays for any submission to the store.
     
    RB_lashman likes this.
  23. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    207
    Try of Motion Controller has been waiting even longer for a new asset store submission to get approved and he said Unity told him there was a backlog when he contacted them about trying to get it sped up(couldn't, processed in order received). I'd say everyone just needs to be patient.
     
    buttmatrix, Martin_H and RB_lashman like this.
  24. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    122
    Thanks for the update!
     
    RB_lashman likes this.
  25. Assembler-Maze

    Assembler-Maze

    Joined:
    Jan 6, 2016
    Posts:
    296
    Hey, have you tried to integrate this with the new post-proc stack? So that we can be sure we place it at the correr execution time.
     
  26. david55527

    david55527

    Joined:
    Mar 24, 2013
    Posts:
    54
    The Asset Store team sure is taking their sweet time getting this approved. :(
     
    olavrv and RB_lashman like this.
  27. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    122
    Yes, a lot of assets submitted later is allready on there.... I thought I would have some fun experimenting with screen space shadows this christmas ... bah!
     
    RB_lashman likes this.
  28. Tasmeem

    Tasmeem

    Joined:
    Jan 14, 2010
    Posts:
    101
    Yeah, Three weeks for a submission is weird. Can you maybe ping them Cody?
     
    olavrv and RB_lashman like this.
  29. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    246
    Hey guys, the asset was declined due to a bug that happens on a Mac that I wasn't aware of. They also asked me to provide a demo scene. I've already finished putting together one.

    I'm going to do my best to get my hands on a Mac as soon as possible so I can fix this bug and resubmit the asset.

    I'm so sorry for the long wait. I'll let you guys know when I've resubmitted the asset.
     
    No0B25, olavrv, Martin_H and 3 others like this.
  30. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    246
    Alright, I was able to pick up a used iMac and that thankfully was able to reproduce the error. I've fixed the error, added a demo scene, and resubmitted the asset. I'll keep you guys updated on how that goes.
     
    pcg, nxrighthere, John-G and 7 others like this.
  31. Killersan

    Killersan

    Joined:
    May 27, 2014
    Posts:
    63
    Great news, I think many of us are waiting for Your asset.
     
    RB_lashman likes this.
  32. david55527

    david55527

    Joined:
    Mar 24, 2013
    Posts:
    54
    Thanks! Looking forward to seeing it pop up on the asset store :)
     
    RB_lashman likes this.
  33. Golden-Skull-Studios

    Golden-Skull-Studios

    Joined:
    Jan 18, 2015
    Posts:
    39
    Very interesting asset, I am sure it will come in handy in various occasions.

    Reading through the comments, I am still wondering about this question:
    Games-Foundry:
    "I'm interested to see if this potentially could allow us to provide players with an option to turn off real-time shadows and just have SSS."

    Could it be that this is the answer:
    sonicether:
    "If you want more detail in contact shadows from your main directional light, it'll do that, but that's all it does."

    So I guess it will improve shadows for outdoor scenes and won't work on point or spotlights with shadows and it won't replace shadows, it will improve them, right?

    If that is the case, generally speaking, would there be a way to fully replace realtime shadows with a SSS solution within a reasonable performance? Would that even make any sense to do? What would be the pro/con of doing it and what would be the usecase? Could that approach work on non-directional lights aswell? Does it support soft shadows as well?

    I am pretty interested in the pros and cons of those screen-space approaches and am a happy owner of all existing SE assets so far, so I am really looking forward to seeing what else you'll come up with.

    Cheers
     
    IronDuke and RB_lashman like this.
  34. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    2,461
    I don't think so. Shadows need to take off-screen geometry into account. You can't rely only on screenspace information for that. You'd get weird behaviour all over and it would be super noticable when you move and look around. If you want better performance than realtime shadows, you'll likely have to look into light-baking I suspect.
     
  35. Golden-Skull-Studios

    Golden-Skull-Studios

    Joined:
    Jan 18, 2015
    Posts:
    39
    Thanks for the comment.

    I thought so. Your explanation makes complete sense.
    It it always interesting to hear about new and different approaches to what is known, thanks for sharing your insight on that.

    As an alternative lighting system, I found that the SEGI approach of voxelized lighting information to be a great approach for realtime lighting. It comes with its own pros and cons but is a fantastic new direction.

    With our own assets, we are heading more towards voxel-worlds and with those we rely on realtime lighting since there is no realtime baking solution we know of yet.

    Cheers
     
    IronDuke, Martin_H and RB_lashman like this.
  36. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    246
    @Martin_H is right, it wouldn't make much sense to use screen-space shadows without shadow maps. Pretty much all of the drawbacks of screen-space shadow tracing are covered up when combined with shadow maps. When those shadow maps are gone, there are just too many issues to rely on screen-space shadows alone.
     
  37. mensch-mueller

    mensch-mueller

    Joined:
    Nov 25, 2014
    Posts:
    140
  38. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    246
    Yep! It got approved just a few hours ago!
     
  39. HenriqueGomez

    HenriqueGomez

    Joined:
    Dec 13, 2012
    Posts:
    59
    Just bought it. Really impressive! Well done! :D
     
    Vagabond_ and RB_lashman like this.
  40. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,390
    Purchased! Very cool instantly, and when combined with SEGI...mmmmmmm.

    Don't forget to add

    Code (CSharp):
    1. #if UNITY_5_4_OR_NEWER
    2. [ImageEffectAllowedInSceneView]
    3. #endif
    ...after

    Code (CSharp):
    1. [ExecuteInEditMode()]
    ...to see the effect in Scene View
     
  41. Safemilk

    Safemilk

    Joined:
    Dec 14, 2013
    Posts:
    8
    This is great! Thanks so much!

    Crossing my fingers you wake up in a cold sweat and want to add functionality for point lights or something...

    [​IMG]
     
    GMax, nxrighthere, Stardog and 4 others like this.
  42. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    90
    Just bought it. Well, it's kind of hard to controll. At one hand you want clear shadows on the close-up character but on the other you also want grass shadow but you can't have both at the same time as either the character's shadows become choppy or grass won't be casting it and that slider which gives you better shadows in close-up doesn't rrally give much. I really hoped that this one will be absent of stretched range and it will be constant everywhere but I was wrong. Still, a very good asset. It would be great if further improvements will be made.
     
  43. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,390
    Can you explain that a little more clearly, perhaps with images? From what I'm seeing on my end, it simply allows the smallest detail to cast a shadow, so why would it differentiate between a character and grass?

    Remember too that those objects are still casting shadow's with Unity's shadow mapping, and that this asset is merely augmenting them.

    Again screenshots should make your issue more clear.
     
    chiapet1021 and RB_lashman like this.
  44. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    42
    Cheap grass shadows and fixed light leaks. Took a bit of tweaking, but now it's all I wanted and more. :)
     
    SteveB and RB_lashman like this.
  45. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    276
    It works really really well for sunny scenes, but not so good for darker night time scenes. I was hoping for a little more creative control, but I'm guessing it's because you've tried to keep it physically consistent, dam reality! I do think there are circumstances where this could be used to great effect without real time shadows, for example lightning strikes maybe cheaper to do shadowing in screen space rather than use real time shadows
     
    RB_lashman likes this.
  46. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    276
    @sonicether - Here's a before and after pic, you can see the effect on the character's shoulder and it works really well. Ideally I'd like it darker - I currently have the blend strength and accumulation at max, but its getting washed out by my character lights (I have a kinda of film set up), is that something that would be possible in the future perhaps with a multiply slider? or would the nature of unity's lighting prevent it?

    SEShadows.png
     
    GMax, Safemilk and RB_lashman like this.
  47. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    276
    @sonicether also could you make it work in single Pass VR mode?
     
    RB_lashman likes this.
  48. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    368
    we discussed you could potentially write a dx 9 version, but what about forward rendering, any chance it can work with this rendering path as well?
     
    chiapet1021 and RB_lashman like this.
  49. env_warby

    env_warby

    Joined:
    Nov 22, 2013
    Posts:
    21
    I am making a game that doesnt use a directional light in its scenes ( its all indoor ) i would love some better contact shadows though for readabilitys sake can this effect be hooked up to any transform or does it HAVE to be a directional light ?
     
    RB_lashman likes this.
  50. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    246
    This effect simply adds shadows to the directional light where there should be that aren't caught by shadow maps alone. It's important to remember that, while tuning your scene lighting, if your directional light isn't substantially brighter than the rest of the lights in your scene, you won't get very deep or noticeable shadows. Applying shadows to other light sources that are cast by a different light would cause more problems than it would solve, I'm afraid.

    I'll definitely look into this!

    Sadly, no. There is only an "entry point" for multiplying arbitrary render textures (in this case, the screen-space shadows) with the shadow map result of a directional light when deferred rendering is used. Without this entry point, the only other way to blend the screen-space shadows would be to multiply them directly to the final rendered scene color, which would look quite bad.

    Directional lights are the only light type that offer an "entry point" for modifying the final shadow mask in screen-space, unfortunately. The entire deferred rendering and light rendering pipeline would have to be modified quite heavily to get this to work with other light types. Sadly, those are the limitations we have to work with.
     
    SteveB, punk and RB_lashman like this.