Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Horizon Based Ambient Occlusion - HBAO image effect

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

  1. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Yes.
     
  2. yaboo

    yaboo

    Joined:
    Mar 23, 2016
    Posts:
    38
    VR Single Pass support in Unity 2017.3.7
    20200418141631.png
     
  3. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,030
    I wasn't aware of HBAO_Integrated! such a useful asset :)

    Also I need to increase distance of effected area but Max Distance parameter doesn't work at all.
     
  4. ash4640

    ash4640

    Joined:
    Jan 19, 2018
    Posts:
    59
    Hi I recently purchased HBAO, is there a way it can be made to work with HDRP 6.9.1 and Unity 2019.2.15. I want to integrate it with my old project. I get the following errors, pls see the screenshot.
     

    Attached Files:

  5. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Nope, it's not possible, I'm sorry for the inconvenience. The minimal SRP targets are clearly mentionned in asset description. These minimal targets were choosen for some good reasons.
     
    ash4640 likes this.
  6. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,030
    Also I need to increase distance of effected area but Max Distance parameter doesn't work at all.
     
  7. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    You did not mentionned which pipeline so I guess it is Standard pipeline. Just trie dit again, it works fine here.
    there is no integrated component anymore, the asset has been fully redevelopped and now there is only one component to prevent user confusion, it is now always "integrated" (using command buffer).

    So, I don't now how you can even get it working... Seems you updated recently after some time without update, and a lot has changed. Please delete your older camera components, wipe older package content completely then reinstall it.
     
  8. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,030
    I setup and used HBAO on camera mode only for characters faces and integrated with Gbuffer mode for outdoor environments that was great for me. Now I doubt if I upgrade and achieve same result :(
     
  9. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Why doubt ? I've told you, it's now always integrated, exactly as HBAO_Integrated was doing. I stopped to provide the older version because it was obsolete. Integrated version was the newest and that's what I kept.

    Full redevelopment doesn't necessarily means change the core algorithm...
     
  10. SufferinPup

    SufferinPup

    Joined:
    Jul 7, 2012
    Posts:
    10
    I haven't been following this thread, but in case you haven't looked into this yet the problem seems to specifically be if you set the AA setting on the camera to FXAA.
     
  11. RPowers

    RPowers

    Joined:
    May 14, 2015
    Posts:
    114
    Hi. It appears that VR single pass/single pass instanced isn't working. I'm using Unity 2019.3.9f1.
     
  12. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Thank you for report.

    You will need to wait I add VR Support. Planned for end of June.
     
    jeromeWork and GridWanderer like this.
  13. EduardDraude

    EduardDraude

    Joined:
    Mar 8, 2019
    Posts:
    36
    Hey, I really like HBAO!
    I have a shader, which just renders shadows on a otherwise completely transparent plane. Its an AR App, which renders the camera stream in the background, the reason of such strange thing. Is there a way to reiceive AO also with this plane, when an object touches it? I use URP 7.3.1 and the shadow proposed in this thread: https://forum.unity.com/threads/wat...al-render-pipeline-order.748142/#post-5518747
    @jimmikaelkael Do you have an idea or a hint?
    Thax and keep up the good work!
     
  14. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    157
    Hello, is the URP version a native version (Render feature) or does it requires the post processing stack v2?
     
  15. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Yes in URP this is a Renderer Feature, and you use it as a builtin post process volume component.
    Specific setup steps for URP are quite basic but required and everything is explained in documentation.
     
  16. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    157
    That perfect, I'll buy it! Can you use it on mobile/Quest? Other AO effect are very intensive (That's AO), how many drawcalls does it require with low quality settings? Also have you plans to support VR?
     
  17. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    The drawcalls count is fairly low, something like 8 dc. but that's not what will give you a clue of prformances, 10 drawcalls can be faster than 1, it all depends what's being done.
    The main bottleneck is how much samples you do and as you understood lowest quality does fewer samples.
    Actually I don't recommend it on Quest, URP has currently a depth precision issue on this platform that should be adressed soon.
    Single pass instanced VR will be supported end of june.
     
    joedanimation likes this.
  18. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    157
    Ok thanks for the explanations. I just integrated the asset on my project, it looks great. I've few image effects on the Quest but I can understand that's it's not recommanded. However it can be great on PC VR. Anyway thanks for your hard work!
     
  19. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,394
    How can I enable/disable color bleed at runtime?

    Im trying this but I get an error:

    public void SetColorBleeding(bool b)
    {
    hbao.colorBleedingSettings.enabled = true;
    }

    Cannot modify the return value of 'HBAO_Core.colorBleedingSettings' because it is not a variable

    I didn't put it in code wrap here because its not correct and I don't want anyone to copy/paste it thinking it is.

    Thank you:)
     
  20. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Hi,

    HBAO_Core is old and no longer provided in recent releases. I suggest you completely delete the package, remove the component from your camera, and install latest release. That one has scene view and settings method helpers.

    After update you'll just have to call:
    Code (CSharp):
    1. var hbao = ...
    2. hbao.EnableColorBleeding(true);
     
    protopop likes this.
  21. alto971

    alto971

    Joined:
    Jun 1, 2014
    Posts:
    17
    Hello, i've just bought this asset (HBAO 3.2), and it's not working ... i can't see any effects in my scenes (playing mode or not). Even i've followed the documentation. The project is under Unity 2019.3.13f1 (windows build targeted on a mac with Radeon Pro 575 4 Go), with URP 7.3.1. even the demo scene does not work. Is there a bug with Unity version or URP version ?
     
    Last edited: May 16, 2020
  22. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,394
    It worked :) thank you for the update
     
    jimmikaelkael likes this.
  23. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    No problem here with same Unity and URP version, but on Windows. I don't think targeted build is related here since you seem to have problem in the editor.
    Which graphics API ?

    Anyone else having problem in editor on mac, for HBAO on URP ?
     
  24. DragonmoN

    DragonmoN

    Joined:
    Nov 27, 2016
    Posts:
    14
    Doesnt Work for me either on 2019.3.13f1 with WebGL target
     
  25. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Ok so it looks like OpenGLES2.0 graphics API has problem as well as metal. It's the whole Post Process that doesn't execute and not just HBAO.
    I'll be investigating.
     
    DragonmoN and camta005 like this.
  26. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    So not sure what hapened and when... but whole PP is disabled on GLES2.
    I was enable to enable it with 2 comments in Packages/Universal RP/Runtime/UniversalRenderPipeline.cs file. You can try to comment out line 333 and 697 and PP should show, just make sure it is ticked also on your camera.
     
  27. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    379
    Hello. I bought this asset back in 2016 but I just started using it to be able to add AO to my URP project. Amazing product! Thank you.

    I have a feature request thou. Well it's actually a bug fix.

    You have assembly definitions for your runtime scripts but you don't have assembly definitions for your editor scripts. That causes many compiler errors in my setup when I move "Horizon Based Ambient Occlusion" folder to my 3rdParty folder which also includes an assembly definition itself.

    You need to create assembly definitions for your editor script folders and add references to relevant editor assemblies from the packages folder for URP assemblies.

    Currently I have to create those editor assembly definitions by myself but that would make it harder for me to upgrade to the new versions of HBAO in the future.

    Can you please do that?

    Thank you very much.
     
  28. Xtro

    Xtro

    Joined:
    Apr 17, 2013
    Posts:
    379
    Here is the assembly definition I created for your editor folder. I just created it for URP because I deleted the non-SRP folders.

    As you can see, my 3rdParty folder has an assembly definition named "Assembly" and as expected, it's not an editor assembly so, your editor scripts can't be compiled without creating an editor assembly definition just for them.

    Please see the screenshot I attached.
     

    Attached Files:

    jimmikaelkael likes this.
  29. sturgical

    sturgical

    Joined:
    Jul 2, 2017
    Posts:
    3
    Hey folks,

    I just downloaded this to a brand new URP project for testing, unpacked the URP assets and the demo scene doesn't seem to work for me. No SSAO. Even the AO only button doesn't do anything. Any advice?
     
  30. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Please read documentation and do setup steps properly.
     
  31. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Of course I will do. Thank you for reporting it, and thank you for your review.
     
  32. sturgical

    sturgical

    Joined:
    Jul 2, 2017
    Posts:
    3
    Ah, got it. Neeeeevvvvermind. Thanks!
     
    jimmikaelkael likes this.
  33. alto971

    alto971

    Joined:
    Jun 1, 2014
    Posts:
    17
    as i said earlier , GPU is Radeon Pro 575 4 Go (iMac).
    and for me, the built-in post process for 2019.3 is working. But HBAO not !
     
  34. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Please go to HBAO URP shaders folder, select HBAO.shader file and see if it reports compile error in the inspector.
    Which graphics API I asked ?
     
  35. alto971

    alto971

    Joined:
    Jun 1, 2014
    Posts:
    17
    No error with the shader ... and for the Graphics API, since this imac is under Catalina version, it seems it's Metal 'API, but i'm not really sure for that point because the specs for the Graphics card say that API supported are OpenGL and DirectX
     
    Last edited: May 18, 2020
  36. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    You could maybe try to untick auto graphics API for mac under Player settings and try another API, to see if it makes a difference.
    Current used API is generally displayed in window title between pointy brackets, this is the case on windows editor at least.
     
  37. alto971

    alto971

    Joined:
    Jun 1, 2014
    Posts:
    17
    yep, it's Metal ! I've tried to unset and erase Metal from Player settings, so only OpenGL Core is selected...it's still not working with HBAO, but PostProcess built-in for Unity 2019.3 working.
     
  38. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    That's strange because here OpenGL Core API works fine...
    Just to make sure, have you raised AO intensity ?

    EDIT: after checking that, please try to take screen shots from frame debugger. Normally you should see HBAO in there, a screenshot of the 2 frames I highlighted below could be useful.
     
    Last edited: May 18, 2020
  39. alto971

    alto971

    Joined:
    Jun 1, 2014
    Posts:
    17
    all my settings seems to be good (according the HBAO documentation)






    and if i use the Frame debugger in the HBAO's demo scene ... i can't find it ...


    AO intensity is at maximum value : 4
     
  40. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Doesn't execute at all, screenshots of unfolded AO settings please ?
     
  41. alto971

    alto971

    Joined:
    Jun 1, 2014
    Posts:
    17
    here it is


    OpenGL used and not Metal ! Unity 2019.3.13f1
     
    Last edited: May 18, 2020
  42. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    What you are showing me is not HBAO for URP... So definitely it won't work like that...
    Are you sure you have read documentation properly ?

    You seem to have understood setup steps correctly but not usage part, documentation says "Finally, you can then add a component override to your volume profiles" (with a screenshot, look it closely). So you simply use HBAO as a override to the PPv3 stack.

     
  43. alto971

    alto971

    Joined:
    Jun 1, 2014
    Posts:
    17
    oh yes ... i've read it, but i didn't notice than I need to use THE postProcessProfile included int the asset. Now all it's working on my project for OpenGL API and for Metal too ... awesome ! Thanks a lot
     
  44. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    You don't need to use the included profile, it is just an example... just use your own.
    The problem was not only make use of ANY profile, the problem was that you used the HBAO component for Standard pipeline.
     
  45. alto971

    alto971

    Joined:
    Jun 1, 2014
    Posts:
    17
    yes, i've understood that too
     
  46. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    Glad you got it working, thank you very much for thr review!
     
  47. CmartinezSaltoki

    CmartinezSaltoki

    Joined:
    May 21, 2020
    Posts:
    6
    Hi!
    I recently bought this HBAO asset and implemented it in my URP project. Everything works fine but I wanted to ask something anyway, just in case you can help me.
    In my scene I have some furniture I want to move around as well as some other that wont move at all (floor, ceiling and walls wont move either) so I was thinking about baking the AO of these "static" objects only and then apply HBAO just to the furniture which will move. Working this way I would avoid the "static" furniture to have 2 AO (the baked one and the HBAO) but for this I'd need to exclude the "static" furniture from the list of objects that would be affected by the HBAO.
    Is it possible?
     
  48. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    I'm really sorry but it is pointless to do that... I mean you won't save any performances doing that. HBAO is like any SSAO a screen space effect hence it is not aware of your objects. To calculate AO it purely relies on depth buffer and view normals.
     
  49. CmartinezSaltoki

    CmartinezSaltoki

    Joined:
    May 21, 2020
    Posts:
    6
    Thanks for replying that fast!
    I didn't mean to save any performances by doing that, just wanted to know if it is possible to apply HBAO to certain objects while the rest remain unaffected. (Preferably without using neither layers nor more than one camera).
    Thanks again for your help and sorry if I sound like a beginner once again :p
     
  50. jimmikaelkael

    jimmikaelkael

    Joined:
    Apr 27, 2015
    Posts:
    604
    No problem man, I'm here for that.
     
unityunity