Search Unity

Horizon Based Ambient Occlusion - HBAO image effect

Discussion in 'Assets and Asset Store' started by jimmikaelkael, Feb 21, 2016.

  1. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    355
    I'm interested in purchasing HBAO and have a few questions. I'm new to screen space AO solutions and more of a programmer than artist....so excuse the basic questions :).

    1. Does it use AO textures to in Unity Materials to create AO? Or does it ignore them?
    2. If I use this product, can I remove all AO textures from my project to save GPU memory and still get its benefits?
    2. How does it work with shaders that store AO in the Alpha channel?

    Thanks
     
  2. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Thank you very much for reporting this problem. I will do the appropriate changes in the next release.
     
  3. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    1. As every SSAO solution, HBAO is an screen space effect and is geometry agnostic. It will ignore your materials.
    2. I don't think so, generally AO texture on materials brings higher frequency AO. It is not mutually exclusive.
    3. AO in alpha channel ? If you meant in vertex color alpha, same as point 1, HBAO will just ignore it but your other shader will handle it (but you'll get double AO...).
     
  4. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    355
    Thanks for the quick reply... I’ll go ahead and purchase it.
     
  5. Candac59

    Candac59

    Joined:
    Sep 18, 2015
    Posts:
    102
    Hi,

    Reconstruct mode work perfectly :) thanks you !
     
  6. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Glad it fixed your problem, but this also means your foliage causing this artifacts is forward rendered which is sub-optimal...

    What shader is used for this foliage ? builtin or VS shader ?
     
  7. Candac59

    Candac59

    Joined:
    Sep 18, 2015
    Posts:
    102
    Oh defered renderer is better ?

    Yes, i use only VS shader
     
  8. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Deferred is smarter with lighting.
     
  9. candycat

    candycat

    Joined:
    Jun 5, 2014
    Posts:
    29
    Hi, any plan to support HD SRP in Unity 2018?
     
  10. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
  11. candycat

    candycat

    Joined:
    Jun 5, 2014
    Posts:
    29
    I see... Is it possible to port HBAO as a standalone component that can work in HD SRP (not custom effect in Post Processing stack)?
     
  12. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    That's my best hope. I haven't yet looked at it in details but of course I'll do my best to support it!
    Since first release I always took care that my asset can work from Unity 5.0 to the latest release and latest innovations, it isn't going to change ;)
     
    Aniow, rizu, candycat and 1 other person like this.
  13. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    838
    Hi, I am using your asset, it is really nice. One question I'd like to ask is how can I exclude certain objects from HBAO? I have a heathaze particle system and need to exclude it from AO, is that possible?
     
  14. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    134
    Compilation error in HBO_Core.cs when VR package is removed in Unity 2018.2
     
  15. rizu

    rizu

    Joined:
    Oct 8, 2013
    Posts:
    1,156
  16. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    203
    Hey there, how can I modify HBAO settings via script?

    This:
    Code (CSharp):
    1. AO._resolution = HBAO_Core.Resolution.Quarter;
    Doesn't seem to work, for example.

    EDIT: Got it to work:
    Code (CSharp):
    1. HBAO_Core.GeneralSettings testSettings = AO.generalSettings;
    2. testSettings.resolution = HBAO_Core.Resolution.Quarter;
    3. AO.generalSettings = testSettings;
     
    Last edited: Jun 24, 2018
    jimmikaelkael likes this.
  17. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    As with every SSAO solution HBAO is a screen space image effect and is geometry agnostic. One way to workaround this is to set a higher custom render queue to the material you need to exclude.
     
    khos likes this.
  18. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Thank you very much for reporting this issue, I'll investigate it.
     
  19. Aniow

    Aniow

    Joined:
    Apr 8, 2014
    Posts:
    7
    Hello. Your asset is amazing!
    I'm very surprised at how well HBAO works with small details! Really Best AO!

    HBAO works fine. However, I'm curious, will there be an update? :)
     
  20. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Thank you for your kind words :)
    I've planned an update for minor fixes late summer.
    After that, I'll start to think about a temporal approach if it's feasible.
     
    antoripa and Aniow like this.
  21. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    408
    Please ... please ... make HBAO for HD. Heck, I would buy this again if you needed to cover the cost. The AO built into the post processing stack vs this one is the largest drop in quality for my project when switching from 2017 to HDRP. Things are just a bit ... ungrounded and off ... and I know I wouldn't have that problem if I could just use this.
     
    Last edited: Aug 24, 2018
    jimmikaelkael and Thrawn75 like this.
  22. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    I'd clearly like to have it done already. However it seems Unity is letting us devs down the road...
    My main grip against Unity is that they clearly lack bringing documentation about HDRP.

    Let me explain in details. HBAO is not a "custom post effect", it is a standalone effect. Using what's explained at https://github.com/Unity-Technologies/PostProcessing/wiki/Writing-Custom-Effects is pointless in my case: HBAO needs to have control on where it is executed in the pipeline.
    Using what's explained at https://blogs.unity3d.com/2018/01/31/srp-overview/ is pointless as I don't want to create my rendering pipeline but rather plug on existing one.

    Some times ago, a thread was started regarding image effects in HDRP (https://forum.unity.com/threads/how-to-add-image-effects-within-unity-2018-hdrp.531178/) but was soon closed by a moderator, not letting me a chance to get more info. Yes it is author responsability to port an asset but in my case it will certainly not take only 10 minutes, please be serious! It's sad as that thread could have been interesting.

    In fact I just need a simple example of how you get a rendering entry point in HDRP not using PostProcess render context, but I can't find it anywhere...
     
    DGordon likes this.
  23. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    408
    Have you posted in the beta forums for graphics asking how to do that with hdrp? This sounds like something that unity tech should be addressing.
     
  24. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
  25. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    408
    That would be great. I'll be honest ... if you can't, complain like heck to Unity. We should not be losing out on higher quality custom post processing effects because HDRP isn't supporting it. That's ... a horrible place for HDRP to be going if that were the case (you guys are going to be the ones pushing HDRP past the defaults in the coming years, and UT knows it), and UT would need to know about that ASAP.
     
  26. syscrusher

    syscrusher

    Joined:
    Jul 4, 2015
    Posts:
    973
    I share your pain, because I also have an asset with a custom shader, and porting to SRP is proving to be a large challenge.

    On a different thread, I had some correspondence with one of the Unity developers of the HDRP, and he very openly acknowledged that documentation is lagging for the new LWRP and HDRP. They are still finalizing some of the APIs, and this developer assured me that they are taking documentation -- and open-source example code -- very seriously. They don't want to waste effort documenting and exemplifying APIs that may change before release, only to have to redo the documentation afterward. Also, if people build to docs that turn out to be incorrect later, that's almost worse than no docs at all.

    The general tone I've gathered from the SRP threads is that SRP is a pre-release feature right now. The advice they gave me as an asset publisher is not to be in too big a hurry to port, because HDRP isn't going to be ready for production-status projects for months. People are experimenting with it, and I'm doing the same, but basically Unity themselves are saying it's not fully production-ready yet.

    One of the devs recently posted a status update on HDRP which shows just how many features are still in flux.
     
    jimmikaelkael likes this.
  27. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    408
    If these problems will be solved when HDRP is stable, yep, that makes sense. If these are problems with an underlying system that isn't changing ... it needs to be flagged. I'm not writing any custom shader stuff, so I really don't know. I don't care if HBAO comes out today, or when things settle down ... so long as we get something like this in the end.
     
  28. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    I know you've seen Unity's reply concerning HDRP but I'm writing here for others, seems we need to wait for viable rendering entry point...
     
  29. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Thank you for sharing what you know about it. At least I know I'm not alone ;)
     
  30. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    is this integrated with unity's new post processing system?
     
    jazznazz likes this.
  31. jazznazz

    jazznazz

    Joined:
    Apr 27, 2012
    Posts:
    5
    jimmikaelkael likes this.
  32. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    shkar-noori likes this.
  33. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Thank you for linking this interesting paper! I'll look at it however I can't promise I will integrate it, but sure the method looks great.
     
    Aniow, jazznazz and turboscalpeur like this.
  34. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    HBAO v2.7 has been submitted for review, changelog is the following:
    • Added multibounce approximation feature to replace older luminance influence setting
    • Improved AO intensity response
    • Improved blur
    • Fixed RGB colormask on composite passes
    I'm now trying to consider a temporal approach. I think maybe HBAO sample directions can be splitted and accumulated over time.
     
  35. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    225
    @jimmikaelkael On 2018.3f1 and using the latest HBAO the effect is no longer showing for me. I'm using a Mac. The "Display Mode" option seems out of whack. "Normal" gives me a split screen with only the AO on the right and the no-AO landscape on the left.
     
  36. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Works fine here on 2018.3.0f1. Please delete completely older package folder and reimport it.
     
    transat likes this.
  37. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    225
    Works now. Cheers.
     
  38. _kooow_

    _kooow_

    Joined:
    Sep 6, 2013
    Posts:
    1
    I downloaded the trial and used in my Unity and version is 2018.2.19f1. But when I click on Game tab I see this error: Method not found 'UnityEngine.Texture2D.LoadImage'.
    I would like to use your tool because I need ssao when my camera is orthographic and currently your tool is best for me.
     
  39. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,420
    Is this supported on WebGL and mobile? How is the performance?
     
  40. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Sorry for the late reply...
    I generally do not recommend it for mobile where it will be too slow to get proper realtime performances.
     
  41. ehsan_wwe1

    ehsan_wwe1

    Joined:
    Apr 16, 2011
    Posts:
    16
    i have a problem with the doubleside materials


    do you have any way for me
    the wall is dynamically so i cant use single side material
    i try to dupicate walls with fliped normal at the same postion ( its looklike the doubleside material ) but your Effect fo flicker any my walls )
     
  42. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Not much I can do... Ensure the shader is doing proper depth culling and testing.
    EDIT: Not sure I understood what your doing but seems It's really bad. You seem to get zfighting in depth buffer and/or view normals.
     
  43. SURVIVR

    SURVIVR

    Joined:
    Mar 2, 2018
    Posts:
    1
    Not sure if I missed this earlier in the thread or on the description, but I cannot get AO to work on LWRP for VR. Is there any I can do to get this working properly?
     
  44. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    HBAO doesn't work with LWRP or HDRP yet. I have no ETA but it will be done once proper stable API is there so that we can implement our own PostFX in SRP without loosing important basic functionalities.
     
  45. DawgVinci

    DawgVinci

    Joined:
    Feb 11, 2019
    Posts:
    8
    Hey, great product you have there. I wanted to ask if it's possible to attach the Script at runtime?
    I've tried this

    private Camera mainCamera = Camera.main;

    void Awake()
    {
    Camera.main.gameObject.AddComponent<HBAO>();
    }

    It gets the script on the camera but the effect won't work/start. Sorry, i'm not really a coding/scripting guy and the reason why i need it like this is that i only use (atm) Unity for modding a game. (kinda as a training before i start my own real project)
     
  46. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,416
    Lwrp is officially out of preview or experimental, so it should be able to support that at least ? There are no ssao soultion for lwrp yet so it is pretty blue ocean in my opinion.
     
  47. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    513
    Ocean is quite muddy here... Wife has been diagnosed with lung cancer somewhere in april, and on saturday we were said she has brain metastases.

    SRP is not my priority, I just hope you can understand. Maybe you can find something good on competitors.
     
  48. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    838
    I hope you don't mind if I say, I am very sorry to hear this, wish you and wife my deepest sympathies and only the very best, I hope it can go as well as possible!
     
    jimmikaelkael likes this.
  49. camta005

    camta005

    Joined:
    Dec 16, 2016
    Posts:
    211
    Is it possible to view the effect in the scene window?