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.
That's great to hear! Until then, rz_0lento's suggested changes worked. HBAO is now rendering!
Just to clarify how to make HBAO work in urp 12:
1.) Comment out line 34 from Assets\Horizon Based Ambient Occlusion\SRP\URP\Editor\HBAOEditor.cs that contains hasAdvancedMode override.
2.) On line 375 from Assets\Horizon Based Ambient Occlusion\SRP\URP\Runtime\HBAORendererFeature.cs
source = new RenderTargetIdentifier("_CameraColorTexture"); // <----Original
source = renderingData.cameraData.renderer.cameraColorTarget;
3. At this point, HBAO will render, but it won't render correctly. In the HBAO override for the Post Process Volume, make sure to change the Per-Pixel Normals option to one of the Construct variants.
Thank you again rz_0lento for pointing me in the right direction!
As extra note, those Per-Pixel Normals from Camera didn't really work proper on URP 10 either, have to use reconstruct versions. In addition if now using URP 12 deferred they have extra option on URP Renderer Data asset called "Accurate G-buffer normals" which now totally break HBAO if it is still getting normals from camera Reconstruct -variants work fine still.
Would be nice if this option was in URP too now that it has deferred mode (URP 12+).
This method was strongly tied to how standard render pipeline worked.
For SRP I'm expecting Unity to allow access to a global ambient occlusion texture so that we can write ourselves in it instead of the builtin AO (this should be done at early stage, before opaque, so we need the correct injection points in the pipelines). Then like it is actually done in HDRP the materials can access the occlusion term.
The benefits are that it is a lit AO and it can also be disabled per material.
EDIT: please also take a look at this thread https://forum.unity.com/threads/mis...nt-in-hd-render-pipeline.979803/#post-7376441
HDRP does not currently have before opaque injection point, nor before atmospheric scattering
This is now available on URP10+ in HBAO v3.4. There's a new field at the top of general settings which allow for LitAO mode.
Nice work! SSAO is now dead to me
Hell can you please talk more on what is the LITAO and should I use it over the normal HBAO you have? Does it look better, does it cost the same, what other benefits?
With this mode the AO is applied to lighting at material level. It is more physically correct and won't cost more perfs. Another benefit is that you can exlude AO in your custom shaders.
To support AO in your custom shaders, this is done the exact same way as for Unity's SSAO, please refer to this page:
EDIT: it seems there's a missing bit of information in the doc about the required passes in your custom shaders; The Depth pass is required in any case and the DepthNormal pass is required only if you intend to use per pixel normals "Camera".
I have the same error in HDRP (unity 2021.2.0b8) :
Assets\Horizon Based Ambient Occlusion\SRP\URP\Editor\HBAOEditor.cs
that contains "hasAdvancedMode override" not working.
How to fix this in HDRP pipeline?
In Unity 2021.2.0b10 I think at certain camera angles the results is backwards with camera normals?
Compared to reconstruct
looks fine at this angle
Compared to reconstruct it looks the same
No idea whats happening :O
This is in forward mode
@jimmikaelkael any news on this?
Camera view normals on URP were added not so long ago. I added the option for the future but it is not reliable actually (I have let reconstruct mode as the default option). It's what unity outputs... And generally I do not support betas: I can not even launch the version you mentionned without it crashing instantly on my system.
I'm really sorry for the inconvenience.
Ah fair enough, hopefully it comes out of beta soon XD
The new features in URP 12 are simply too good to pass up for me so I figured I'd just jump on it.
Reconstruction works fine for now so I'll just do that. I hope you get 2021.2 to work soon!
I'm having issues with URP in 2020.3.3f1. I created a new project, installed URP 10.5.1, installed the current version of HBAO, created a new URP pipeline asset, added HBAO to the Renderer features, and enabled the depth texture but it doesn't work in the demo scene. Did I miss anything?
If I remove the pipeline asset from the graphics setting (basically going back to built in), it works but as soon as I assign the pipeline asset to the SRP field, it stops. The scene renders fine, it's just like the asset is not doing anything. I do have Post Processing checked on the scene camera.
@reggie_sgs Make sure you apply the HBAO to the right URP data asset (the one in use atm).
Yes, it's a new project and there's only one so that's not it.
I tried on these specific versions and had no issue.
- you did not mention you unpacked HBAO's embedded URP package, so I hope you're not adding Unity's builtin SSAO renderer feature
- please consider that the demo scenes for URP and Standard pipeline are not the same, you seem to be looking into the same demo scene when you switch the pipeline: it doesn't work like that
- try removing renderer feature, removing HBAO package and reinstall
Just to make sure, can you add SSAO renderer feature to the same URP data asset you've put HBAO and see if the SSAO applies? If you can't see that one either, it's probably still the wrong asset. Also if it's the right asset, make sure HBAO is actually enabled by upping the intensity above 0 (or whatever naming convention it uses for this).
Thanks, I didn't realize the SRP package added a different demo scene, I just missed that. After switching to the correct demo scene, I was able to get it to work. Thanks!
Hi, I am using HDRP13 with HBAO and all works very good (Good job!). But is there a way to render AO before Fog? The old method doesn't seem to be working (I can't find the lines anymore).
Also, I hear that they added injection points for custom postprocess.
Is this relevant for HBAO and if so, how do I use it to render HBAO before fog? Thanks!
Hey another thing, in HDRP13, (I am not sure if it also happens in HDRP12) but with DLSS on, optimal settings turned off for DLSS, and Dynamic res set down to below 1, the screen renders wrong.
Check this thread out that I posted, I initially thought it was HDRP, but it looks like it is HBAO +HDRP13.
Would really appreciate it if you can provide a workaround, or update to the code.
Hi, sadly I can not run recent unity editor versions on my computer, it crashes instantly. And honestly, I generally never support betas because it is too much broken.
Yeah, the document you are showing are the available injection points. I know them all and if you look closely there's no custom post process injection point available just before fog, I'm so sorry for the inconvenience.
Thank you very much for the feedback! Now I know that HBAO doesn't actually get proper render size for DLSS, but, as stated above I have no ETA for a fix.
NP mate, honestly you have one of the best support for your product so I am not worried about this getting fixed in the future. Just wanted to relay the message so that you are aware.
Also, it breaks in HDRP12 with DLSS, so, so far all available versions of DLSS + HBAO is broken at the moment.
I am guessing this is related to the newly introduced upscaled TAA but I haven't looked into the code so your guess is as good as mine
I understand it is probably not ideal for mobile but I do have a question regaurding this package. I have the same application running on a few Android devices and a few iOS devices. I get about 18fps on Android but getting 60 fps on iOS with it. Just curious what the difference is or does SSAO on Android just suck compared to iOS?
I'm not used to mobile but let me guess.
Behind the platforms you mentionned there is hardware and SSAO computation heavily rely on GPU. Old graphics benchmarks https://www.anandtech.com/show/10685/the-iphone-7-and-iphone-7-plus-review/4