Search Unity

SESSAO (High-Quality SSAO w/ Color-Bleed)

Discussion in 'Assets and Asset Store' started by sonicether, May 4, 2015.

  1. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Thanks for pointing out the problem. Sad to see I didn't catch it before release. I'll be working on this asap. I'm glad you're enjoying the effect otherwise!

    Duh... I feel pretty dumb for not putting a background panel or changing font color for indie (lighter) GUI. That should be a quick and easy fix.

    Hmm, I haven't noticed that myself in my testing. I see a warning at the bottom of your window, I assume that's from SESSAOEditor.cs? What version of Unity are you using? Could you please attach a screenshot of the warnings in the console related to SESSAOEditor.cs? That'll really help me find and fix the bug. :)
     
    potatojin and RB_lashman like this.
  2. smelchers

    smelchers

    Joined:
    Feb 22, 2015
    Posts:
    22
    What is the difference to the SSAO that Unity 5 delivers out of the box, please?
     
  3. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    Aside from the quality and performance advantage that is patent in SE_SSAO.... color bleed
     
    Pulov and RB_lashman like this.
  4. 6789077

    6789077

    Joined:
    May 27, 2014
    Posts:
    4
    Is this compatible with Oculus SDK Camera ?
     
  5. 8Infinite8

    8Infinite8

    Joined:
    Jul 27, 2013
    Posts:
    112
    Hi, I just bought this and tried to import the asset but I get an error:

    Error while importing package: Package has unknown format
    UnityEditor.AssetStoreContext:OpenPackage(String)


    Untiy 4. Running 4.6.3.f1
     
  6. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    As I understand it, the asset is only compatible with Unity 4 (pro) and Unity 5 versions
     
    RB_lashman likes this.
  7. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    that is correct - it needs the full functionality
     
  8. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    On the asset store page it says 5.0.1 is required. I always thought this prevented people from buying assets not working with their version? :eek:
     
  9. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    well - it IS compatible with 4.6.x ... although, like it's already been mentioned - it does need the Pro version (for anything below Unity5, that is)

    also - taken straight from the asset description:

    "Sonic Ether's Screen-Space Ambient Occlusion (SESSAO) is an image effect for Unity 5 and Unity 4 Pro (4.6 and higher)"
     
  10. 8Infinite8

    8Infinite8

    Joined:
    Jul 27, 2013
    Posts:
    112


    Yes. Which I have. It still does not import.
     
  11. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    223
    Hi there,

    This looks great - but the package on the store requires Unity 5.0.1 to import (we're still stuck on 4.6 for the time being, so it'd be great to get that in)
     
  12. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    Unity 4 can't open packages exported from unity 5. You could try to use unity 5 to extract the package and then import the individual files in your project, no idea if that works.
     
  13. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Should work fine - just download 5 personal, extract and copy over manually.

    Regarding inspector UI - does this version have the hideous reskin with large child like digit numbers featured in the video? Because I really don't want my assets gamified or anything, I like it very much Unity's native style - just makes it harder to work with.

    Have the beta but plan to pick up the full version later this week (we prefer buy our assets all in one go).

    If the ui is different like in the alloy video, please offer an option to disable it so it looks like Unity native UI. This is because we generally have a lot of components and it's nice to just be consistent.
     
    Last edited: May 16, 2015
    spraycanmansam likes this.
  14. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Hi, I read the "Sonic Ether's Screen-Space Ambient Occlusion (SESSAO) is an image effect for Unity 5 and Unity 4 Pro (4.6 and higher)" part and think it's a bit misleading.

    I've got Unity4 Pro and still can't use it out of the box, it allows me to download it, yet I receive the aforementioned
    "Error while importing package: Package has unknown format
    UnityEditor.AssetStoreContext:OpenPackage(String)"


    I expected it to work on Unity 4.6 as per description, are you going to upload a 4.6 Pro version anytime soon? " just download 5 personal, extract and copy over manually." isn't a solution for me, forcing customers to install a whole new version just to get 1MB from it is, well... "not so practical". How do you plan to solve this issue, or are you going to fix the description?

    Thanks for your time.
     
  15. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I'm sure he will but if you want to not wait, that's your answer.
     
    ZJP and RB_lashman like this.
  16. montyfi

    montyfi

    Joined:
    Aug 3, 2012
    Posts:
    548
    You wrote that it works with any shaders. Have you tested it with SpeedTree?
    Currently I don't know any SSAO solution that works correctly with it. If SESSAO works I will buy it immediately.
    Here is a picture with well known SSAO package from asset store, the same with standard Unity SSAO
     
  17. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    well, he did post this some time ago ... dunno if that answers your question
     
    blueivy likes this.
  18. 8Infinite8

    8Infinite8

    Joined:
    Jul 27, 2013
    Posts:
    112
    Agreed. It's a little misleading. Surely Unity should proof check submissions before allowing them on the store?
     
    NeatWolf likes this.
  19. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    This problem must be a result of how the Asset Store Tools handles packages when they're uploaded. In my own local testing, I could export a package from Unity 5 and import it into Unity 4 just fine. I assure you that I did not foresee this problem and would not claim compatibility with Unity 4 if it indeed wasn't compatible in all of my local tests. Sounds like if I simply upload the next version through Unity 4.6 instead, it should fix this issue.

    As for UI related problems, a custom UI is something that I was trying out with this asset, but I've gotten mixed feedback about it (aside from the few bugs that would take a few minutes to fix) so I think I'll just remove it.

    About the problem with AO rendering on top of some alpha test shaders, I'll see what I can do, since this is really an unacceptable problem.

    I'll be working as hard as I possibly can on these bugs and likely upload a fix in 12-16 hours. I apologize for the shaky launch, but I'm here to ensure that everything gets sorted out as soon as possible. Thank you for understanding. :)
     
  20. Golesy

    Golesy

    Joined:
    Apr 10, 2013
    Posts:
    35
    When's a launch ever gone smoothly haha! Here's the error you wanted, just the one! Still working great for me btw!
     

    Attached Files:

  21. 8Infinite8

    8Infinite8

    Joined:
    Jul 27, 2013
    Posts:
    112
    I have U5 here and I was able to import then add to a U4 project no problem. If you could mention this process on the asset store page, it might be useful to others.

    I thought the UI was very cool.

    This is the fastest, cleanest SSAO technique I've tested. VERY cool. Thank you.
     
    blueivy likes this.
  22. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    I've tried reproducing this particular visual bug and I can't seem to be able to. I downloaded the shader you attached and tried with various rendering paths. Unity 5.0.1 and 5.0.2. DX9 and DX11. It looks like, in your screenshot, the grass is not being rendered to the depth buffer.

    I was, however, experiencing slightly different artifacts. All of the artifacts that I've encountered are related to problems with the camera normals texture. Unity's Ambient Obscurance shader doesn't show this problem because it reconstructs normals from the depth texture instead of directly accessing the normals texture. I'm convinced that the problems you and I are experiencing with alpha cutout shaders are a result of a Unity bug. Check @xenius posts about this: here and here

    The oddest thing happened to me while testing, however. I had a material setup with the shader that you attached and was seeing visual artifacts. However, oddly, if I switch the material's shader to the Standard shader, set its rendering mode to "Transparent", and then switched back to the shader you attached, the visual bugs were gone. This was all done with Deferred rendering. This procedure didn't fix issues in Forward rendering. If you could try out this procedure and let me know if it fixes the visual bugs you're experiencing, that'd be great. Again, this seems like a Unity bug to me (as it's a problem with the camera normals texture itself and not my SSAO).
     
  23. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Just wanted to let everyone know that I've submitted version 1.01 and it is currently pending review. I've fixed Unity 4 importing errors, and removed the custom skin for the inspector GUI.

    Since the transparency issues (forward shader or forward rendering mode + transparency materials) are a rendering bug with Unity itself, I'm unable to fix that for now. I'll be submitting a bug report to Unity. Let's hope the issue is fixed soon.

    To ensure that your foliage/cutout transparency objects look correct, for now you'll have to use the Standard shader with Deferred rendering.
     
    hippocoder likes this.
  24. Sprak

    Sprak

    Joined:
    May 20, 2008
    Posts:
    28
    Hm, current version crashes on GT750M Macbook Pro in Unity 5.0.1f1. I can add the component to the main camera, but whenever I switch to Game view everything just freezes and I have to force quit Unity. I'm using a completely clean and empty 5.0.1 project, with color space set to linear. No error or warning message on import.
     
  25. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    AAAAAAAaaa it requires U5? duuude I thought it would run under 4.6 as I thought i did not rely in deferred rendering.... this killled me.
     
  26. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    No, it does not require Unity 5. Read a few posts above you, please. There's just a few issues with cutout shaders in forward rendering, but that's a Unity problem and not something I can fix on my end.
     
    RB_lashman likes this.
  27. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Hmm... Strange. Try updating your graphics drivers. I am unfortunately unable to personally test behavior on OSX (since I don't own any Apple products). I did just force Unity to run with OpenGL and didn't encounter any problems.
     
    RB_lashman likes this.
  28. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Ah dude, I got missleaded by the first line and came here to cry. I should have read all teh text. sorry.
    upload_2015-5-16_23-17-38.png
     
  29. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    I bought the package but I can not import. Downloaded a couple of times.

    Error while importing package: Package has unknown format
    UnityEditor.AssetStoreContext:OpenPackage(String)

    Using u 4.6.5
     
  30. uexilon

    uexilon

    Joined:
    Nov 27, 2013
    Posts:
    11
    He submitted a patch that should solve this.. It just needs to be approved by Unity.

    Read the last few posts above yours.. He actually wrote that already there ;)
     
  31. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    Hi guys,
    Good News and Bad News for you:

    Basically, some of the draw-issues you might be experiencing in regards to foliage/alpha cutout/etc. shaders is due to a Camera-DepthNormals-Shader-Replacement issue (that's also been effecting a few of our Alloy shaders). This bug appears to be fixed for a few things in 5.1RC1 (though it also required a code fix on our end for our shader bugs). I'm going to lay out a couple things really quickly for reference: (note these are applicable once you start using 5.1)

    FOR PEOPLE USING SHADERFORGE: If you are using ANY shaderforge shaders, be aware that the only thing passed onto the shader-replacement system for camera depth normals is "_Color", "_Maintex" and "_Cutoff". If you are doing alpha-cutoff based ANYTHING, if the visibility of a pixel is being determined by anything other than the three params above, you will get unusual discontinuities with SSAO and any other DepthNormals based effect.

    EDIT - ignore this section, in 5.1 even alpha-blended foliage draws correctly.
    FOR PEOPLE USING FOLIAGE: Right now, due to the way Camera DepthNormals works, you are going to want to use ALPHA CUTOUT SHADERS ONLY on your foliage. This is so the SSAO actually sees the foliage in the depth buffer. Otherwise the SSAO will just draw over it from things behind it. This is likely unavoidable (unless @sonicether has some miraculous notion how to draw inbetween opaque and trans objects). Makes more sense now why all foliage in the Crysis games is 100% opaque (albeit using an alpha-to-coverage technique).

    FOR PEOPLE USING ALLOY: We'll have a fix for this before 5.1 comes out, so you shouldn't see any weird discontinuities, though we don't have any way to fix the dissolve property group unless Unity chooses to adopt a custom pass for the DepthNormals texture (instead of the unnecessarily hacky shader replacement setup that currently exists).

    phew.. well this has been an exhausting day.
     
    Last edited: May 17, 2015
    Ghosthowl, hippocoder, Seith and 2 others like this.
  32. spraycanmansam

    spraycanmansam

    Joined:
    Nov 22, 2012
    Posts:
    254
    There's always something. It's still a great product and worth the investment :)
     
    blueivy and RB_lashman like this.
  33. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,348
    Hi,

    Does the SSAO have a distance cutoff feature ? I dont want for example to be active in my distant fog, at least Unity's SSAO creates some very bad artifacts in fog, so it would be fine if the system did not create fog artifacts or have a cut off to avoid them.

    Thanks
     
    Pulov likes this.
  34. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hah! That's odd. I tried the same steps you mentioned and it indeed fixed the issue with the SSAO... except now the grass is not affected by shadows anymore! There is something really wrong here. I had to undo to go back to the previous behavior (as vegetation unaffected by shadows is a no-no).

    Thank you for investigating. So that looks like a Unity bug then. That's not good...
     
  35. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thank you for all that info! I'm a Shader Forge user. Do you think it IS a Unity bug (since you say it works in 5.1)? In 5.0.1 I tried replacing "_Diffuse" from my SF shader by "_Maintex" (the other two params are the same already) but it didn't seem to fix anything with regard to SSAO.

    In other words, are the SF params changes mandatory for SF vegetation shaders to work in 5.1, or did 5.1 simply fix the issue?
     
  36. Sprak

    Sprak

    Joined:
    May 20, 2008
    Posts:
    28
    It seems that this line is the cause of the problem:
    Code (CSharp):
    1. int numSamples = (8 + PreserveDetails * 4) - HalfSampling * (4 + PreserveDetails * 2);
    Ok, so what I've found is pretty weird, but might be clues that suggest a solution... Here's what I'm guessing:
    PreserveDetails and HalfSampling are not initialized with default value in the code, and it seems like they don't get set ahead of the shader running, making numSamples NaN on at least one render frame, and somehow totally freezing Unity because of that. If I initialize the variables with a value (PreserveDetails = 1; HalfSampling = 1; for example) before numSamples is set, everything works just fine. Like this:
    Code (CSharp):
    1. HalfSampling = 1;
    2. PreserveDetails = 1;
    3. int numSamples = (8 + PreserveDetails * 4) - HalfSampling * (4 + PreserveDetails * 2);
    (I do this at every place in the shader where numSamples is calculated)
     
  37. DennG

    DennG

    Joined:
    Dec 5, 2013
    Posts:
    158
    Well.. looks like something is missing there


    Unity 5.0.2p1. Tested in two different projects.
     
  38. Hikiko66

    Hikiko66

    Joined:
    May 5, 2013
    Posts:
    1,304
    This has already been covered in this thread.
     
    RB_lashman and DennG like this.
  39. xenius

    xenius

    Joined:
    Sep 30, 2010
    Posts:
    523
    @Seith: In Unity 5.0-5.02 the camera depth normals texture rendering is just busted, regardless of shader. Its drawing trans/cutout shaders as solid regardless of shader.

    In 5.1 RC1, it works but ONLY for shaders using the 3 param-names I listed above.
     
    RB_lashman likes this.
  40. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Ah I see, thanks! I didn't know 5.1 was in RC stage already. I hope it comes out soon!
     
    RB_lashman likes this.
  41. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    They announced a release for the 9th next month :D
     
    Seith and RB_lashman like this.
  42. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    Ah, thank you for that! Man, that's the strange thing about shader programming. Some GPUs are very picky about the way you do things, while others will let you get away with almost anything. May I ask you to test one little thing for me? Could you possibly remove the lines of code that you added to fix the problem, and then for every occurrence of
    Code (CSharp):
    1. int PreserveDetails
    replace that with
    Code (CSharp):
    1. int PreserveDetails = 0;
    and the same with
    Code (CSharp):
    1. int HalfSampling;
    replaced by
    Code (CSharp):
    1. int HalfSampling = 0;
    If you could do that for me and see if that fixes the problem as well, that'd be tremendously helpful :)
     
    RB_lashman likes this.
  43. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    hey guys ... the update is up in the store!!! :D go, go, go :D
     
    buttmatrix, Pulov and blueivy like this.
  44. Sprak

    Sprak

    Joined:
    May 20, 2008
    Posts:
    28
    I forgot to mention, that's what I tried first. But it's really weird... The numSamples variable is calculated (and used) in passes 1, 2, 3 and 7. To make things work I need to:
    - Explicitly set the PreserveDetails variable within the frag method of passes 1 and 3. (i.e. PreserveDetails = 0; )
    - Explicitly set the HalfSampling variable within the frag method on pass 1. (i.e. HalfSampling = 0; )

    And this is with the code modified as you asked (initialize PreserveDetails + HalfSampling with 0 when they're defined)
     
  45. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    It works pretty nicely in 4.6.5 now.

    I expected the color bleed to be based on texture average color or so instead of mateiral color. Not a big issue as an SSAO works great with the fallof feature.

    With camera global fog works perfect, with exp fog hmmm there are some artifacts, wil try to tune or simply play with teh fallof.

    overall I'm pretty happy.
     
    RB_lashman likes this.
  46. kebrus

    kebrus

    Joined:
    Oct 10, 2011
    Posts:
    415
    Hi sonic, you are probably too busy for my request but would please update your example to include a long distance scene with the parameters to test it out? That probably the only thing stopping me to get this now.

    Also, does the effect works on direct light? or do I have an option to have it on shadows only?

    Pulov said the color bleed is based on the material color, does this means if all my objects in the scene are using the default white the color bleed doesn't happen?
     
  47. sonicether

    sonicether

    Joined:
    Jan 12, 2013
    Posts:
    265
    It may take me a while to setup a large-scale scene demo but I'll definitely start working on that as I'm sure many others are wondering how it looks in such a scene.

    To apply AO only to ambient lighting would be a much more complex and ambitious endeavor that would likely require a serious modification to the internal rendering system and thus hinder compatibility and flexibility. Right now there's a simple work-around parameter that removes ambient light from brighter areas in the scene based on its value.

    Color-bleed is based on the final combined resulting color of a surface after rendering (light color, material color, texture color, etc.). Basically, the color that you see on a surface is the color that it'll bleed onto nearby objects.
     
    kebrus, xenius and RB_lashman like this.
  48. iamsam

    iamsam

    Joined:
    Dec 22, 2013
    Posts:
    233
    I just wanted to put in my two cents as I purchased this plugin when it was released a few days back and put it in an extremely large scene in the project I am currently working on. I usually don't do this with my projects as a small change can break months of hard work, but I was really surprised by the performance it gave (Unity 5.0.1f), and actually ended up shipping it in my end product. So please keep up the good work and hope to see this evolve into an excellent product.
     
    RB_lashman likes this.
  49. RB_lashman

    RB_lashman

    Joined:
    Aug 15, 2013
    Posts:
    92
    could you maybe share some screenshots (if possible)? :)
     
    buttmatrix likes this.
  50. iamsam

    iamsam

    Joined:
    Dec 22, 2013
    Posts:
    233
    @RB_lashman Sorry I unfortunately cannot share screenshots as it is a large project releasing beginning of next year and we are completing a few phases at a time. I just wanted to share what I found since I have only seen such quick and amazing results in a selected few assets and I thought I should mention it here.
     
    kebrus and RB_lashman like this.