A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by jimmikaelkael, Feb 21, 2016.
Yes it's normal.But now after changing setup a bit it looks better now
Hi, we are currently adding this to our game Imagine Earth using the latest URP. Looks great so far!
Just one question: How can I access the HBAO renderer settings from script to enable/disable it from within the game?
Glad you like it, upcoming v3.0 will be even better, lots of bugfixes and improvements!
To toggle HBAO from script, you need a reference to the settings file being used, for example you can do:
public class HBAOSettingsManager : MonoBehaviour
public HBAORendererSettings hbaoSettings;
public void ToggleHBAO()
if (hbaoSettings != null)
var generalSettings = hbaoSettings.general;
generalSettings.enable = !generalSettings.enable;
hbaoSettings.general = generalSettings;
EDIT: I will add a few helper methods to the HBAORendererSettings class in v3.0
Hi there, v3.0 has been submitted for review:
Rewritten scripts/shaders code for Unity 2019.1+
Added scene view effect
Added temporal filtering
Added interleaved gradient and spatial distribution noises
Added possibility to stack AO components (both Standard and Universal Render Pipeline)
Added UI for Universal Render Pipeline AO setting assets
Fixed wrong RenderTextureFormat for color bleeding
Fixed memory leaks
Improved number of compiled shader variants
Please note that due to the fact that package installer does not keep track on deleted files or folder structures, you will need to delete older HBAO package content from your project before importing it.
the issue regarding VR + URP was already reported. Is there a new ETA on this fix? I noticed that new version introduced some changes. Previosly nothing was rendered for right eye (black screen). Now, the left eye is rendered correctly with HBAO, but AO on the right eye is shifted to the left side.
I haven't yet looked at fixing it, but the code rewrite was motivated too by VR problems. Let's say on June we should get VR support.
We're using 2019.3's camera stacking feature with the URP, and the 2nd camera seems to render after the AO. So not only does the 2nd camera not have AO, but the AO from the first camera renders on top of it. Is this a supported configuration? If so, is there additional configuration required to get it to work?
Thank you for report, this is something I will need to check.
I’ve been loving hbao in URP but v3 seems to have broken the effect in the latest 2020.1 beta. Now my game looks dull again! Help!
Works here, please make sure you deleted older package content before installing v3.0.
Also, there's currently an issue in URP 8.0.1 that still exist in unreleased 9.0.0-preview, the problem is that an intermediate color texture is no longer created as it was the case with Universal Render Pipeline <8.0.1 when there was at least one renderer feature. The consequence is that the final blit pass does not happen wether it should.
The method RequiresIntermediateColorTexture in ForwardRenderer.cs should return true if there's at least 1 renderer feature as it used to do before, or better, let a way for a ScriptableRendererFeature to notify that it requires intermediate color texture:
In the meantime, a workaround if you have this problem is to tick Post Processing checkbox on the camera. I have filed a bug report with reproduce case project.
Was excited to see that with the update you can now see the effect in the scene view. I updated my project and it doesn't work because I'm using 2018.4 LTS, and HBAO now only supports 2019.1+
I still have a backup of the old version that works, but is there some reason why the new version can't be compatible with 2018 LTS?
I'm sorry if this has already been answered I'm getting an error when trying to use the demo scene in URP.
Solid magenta screen (In Scene and Game window with HBAO enabled) with the error: Shader error in 'Hidden/Universal Render Pipeline/HBAO': failed to open source file: 'Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl' at Assets/Horizon Based Ambient Occlusion/SRP/URP/Shaders/HBAO_Common.hlsl(6) (on d3d11)
Any help with this?
Yes, there was some good reasons to move on 2019, local shader keywords was one of them.
I've made a 2018.4 LTS backport a few days ago, please check the store it is already available.
It seems your URP setup has a problem, or you don't use the minimal supported version, not sure...
Please check your pipeline setup and if you updated the asset recently try to delete and reimport it, then follow URP installation instructions from the documentation.
Thank you for doing this and for all of your work and support with HBAO over the years.
Is it possible to have AO only on specified shader/materials ? (and not on everything else)
Excellent, I must have updated just before this came out. I've tested this version now and everything is working well and being able to see the effect in scene view is great.
HBAO is a screen space image effect and so it is geometry agnostic. This is unfortunately impossible...
EDIT: There are tricks to play with render queue in order to exclude objects from HBAO but I won't recommend doing this anymore.
@jimmikaelkael I'm on 8.01 and do have postprocessing ticked on my camera. The effect actually suddenly came on at some point (not sure what I did) but now I can't change it through the render feature settings. So it's stuck on the default setting.
Have you tried to wipe older HBAO package content and reinstall ?
Try to delete your custom HBAO settings files too if you have any.
EDIT: Just tried once again on 2020.1.0.b3, Universal RP 8.0.1 and it works fine here.
Which platform are you using ?
I'm now on 2020.1.0b4. Also 8.0.1 Twice tried uninstalling and reinstalling HBAO but still no luck. On a mac using Metal. Haven't tried in a new project yet.
EDIT: Upon investigation this was likely due to some random bug or change in the 2020 beta. Now FIXED after messing around with the forward renderers.
HBAO version 3.1 is pending review, here's the changelog:
Added HDRP support
Added more settings helper methods
Added namespaces for each render pipelines variants
Use 16bit floating point texture format for noise when platform supports it
Fixed wrong albedoMultipier setter method
Sincerest condolences for your recent loss.
Just had to stop by to say how impressive the new v3.0 release has been. Not only does this look far better on mobile than all the other AO packages we were experimenting with, but it has much faster performance despite this (Wow). We are very excited for the early URP + forward rendering support.
Also, looking hugely forward to the upcoming VR support for the new SinglePass/MultiView rendering! (As we turn our attention to mobile VR as our next target platform, we've discovered that graphics quality on the Oculus Quest has been depressing to work with, without any (truly) viable AO options to date.)
Thanks again for everything you are doing. Your work is an amazing benefit to Unity developers everywhere.
So, 3.1 has been published. Version 3.2 will pop out very soon.
After investigating with the help of @transat on latest Unity beta and bleeding edge URP, some things will change in HBAO for Universal pipeline.
The effect will be integrated as a Post Process, like it is in HDRP. It will make use of Volume component and overrides, so a few things will change in URP setup steps. Everything will be shown in the documentation.
v3.2 will also fix an issue of whitish color bleeding problem after Max Distance, in all render pipelines.
There is a HUGE memory leak:
I have been trying to find it for days and finally found the cause. Even when standing in an empty scene, not in playmode, material and objects increase by several every second. HBAO is the cause. Are you aware of this? Makes my entire project un-usable.
See the v3.0 changelog it is fixed already.
Haven't you've been notified it was updated ?
I have the latest version and I still have this issue..
I even deleted the entire asset and re-imported. But still there.
You need to remove older render feature from your pipeline asset, then add it again
After 10000 frames:
HBAO version 3.2 is currently pending review, changelog:
Fixed colorbleeding white color bleed beyond max distance
Switched HBAO for URP to Post Process VolumeComponent
Note: please read documentation for new URP installation steps
I just bought this asset, I'm very glad that there is a working version of post processing AO for URP. I was excited to get it running in my game, however I found a situation where it doesn't work, and I'm wondering if it is fixable at all.
My game requires that players are visible behind objects, and I opted to use the silhouette technique which is very easy to implement with URP, as such:
However, players are not rendered during the opaque pass, this makes it so players are not present in the depth texture, so AO doesnt contemplate them, and they get AO drawn on top of them form the objects behind them, while they don't get AO at all.
Do you think there is a solution for this problem? Maybe forcing the "render objects" feature that unity made to write to the depth texture or the opaque texture?
Funny I have the exact same problem (using the same tutorial u linked above), didnt know it was caused by this AO though. My units are a tiny bit seethru when in-front of objects, and look a bit weird. Behind objects it works as intended.
To be clear: this is not caused by this AO. This is other way round, this problem is caused by the render object feature which override depth for the characters.
True, but they both work without each other. So the AO is just as much a reason as the render object feature. However I have solved it using a custom shader, so you can still get this effect while using HBAO So dont worry!
Also, this AO looks way better than what you get from Unity's own, and support from the creator is great. I warmly recommend it!
Exactly, this is a problem due to the render objects feature not writing properly to the necessary textures. Any hints on how to solve it? Maybe this needs to go on a forum for that feature itself.
Ok, so I've found the problem, it is due to the depth pre-pass that is triggered when MSAA is enabled. If MSAA is disabled, the pre-pass is disabled with it, and then everything works!
I'm so happy I can now use this effect!
Somehow I get strange anomalies when using URP and HBAO on iOS or Android, see screenshot.
In the editor all looks fine and I just use default URP shaders and simple one color skybox
Also with the demo scene.
Looks like depth precision issue, I will need to investigate.
Could you please try to set blur to Disabled and see if the issue persists ?
Still the same
Some scene depth banding also noticeable on Oculus Quest (Android, Snapdragon 835).
Some related threads. It appears others may be encountering this as well:
Old posts, but maybe insightful:
 Do not know if this last one is helpful, but noticed several commented lines regarding shader quality being set to 'medium' on all mobile platforms besides GLES 2, seemingly as an internal Unity decision due to 'shader quality' setting being currently unexposed in scriptable render pipeline - but I do not know if shader quality is capable of affecting scene depth precision: https://webcache.googleusercontent....erLibrary/Core.hlsl+&cd=5&hl=en&ct=clnk&gl=us
Sorry I am not familiar with HBAO.
Did it have an effect on the animated and transparent objects,too?
Are you ticking "Depth Texture" in your render pipeline asset like mentionned in the documentation ?
Thank you very much for report, I will have a closer look to this.
HBAO is a screen space image effect, like post process effect the occlusion is computed every frame, not baked. However transparent materials should never receive occlusion, and HBAO renders before transparent queue. Animated objects are supported provided they are not tranparent.
Sure, alll is set up like in the docu, but I get these strange artifacts. On iOS the artifacts are not that big as on Android. See screenshot. Mostly noticable on flat surfaces like planes and such.
Yes, I have been able to reproduce it, I'm investigating.
Thanks for explanation.
I think this is definitely what I am looking for!
Just wondering, what is the current issue with VR? Does it not work at all or only with specific settings/devices?
I have redevelopped the project in v3.0 and I haven't tested it yet with VR. Most likely single pass instancing will have problems.
So, for the depth precision issues on iOS and Android, you will have to wait something is fixed in URP.
There's a PR awaiting to be merged: https://github.com/Unity-Technologies/Graphics/pull/26
I see so is that the issue that you mentioned would presumably be fixed around June or so?