urp-ssao
urp-ssao copied to clipboard
It doesnt work on play mode :/
Unity Version: 2019.3.0b12 URP: 7.1.5
The second one is in playing mode. Issue is SSAOmaterial is null in Execute method in playing mode.
Yeah i get this issue as well, it works in scene view, but not in play mode, I also have HDR turned off.
+1, also does not appear in Standalone build. I had a play around with changing the Render Pass Event but no luck. Really nice and easy to set up though, and the results look nice + good options
Doesn't really matter if it only works in the editor hahaha, was digging, playing around with the script and shader, and I can't see where it goes wrong :/
During play mode (assuming the same with the build), I'm seeing that ssaoMaterial is null, causing the Execute method to exit early
https://github.com/sebastianhein/urp-ssao/blob/4958115f46d11e781af478ae78732c55f2bed446/Scripts/SSAO.cs#L71-L73
Going to have a look around as to why that may be
Ok so I have found something
#if UNITY_EDITOR
if (!Application.isPlaying)
{
ResourceReloader.TryReloadAllNullIn(this, "Packages/com.sbstn_hn.rendererfeatures.urp-ssao");
}
#endif
If you remove the #if directive #if UNITY_EDITOR
and the !Application.isPlaying
check, it should run in the editor paused and play mode and should also run in a build.
I'm not too familiar with custom render passes and SRP in general, so I don't know about the performance implications of this. It seems to be working for now
Ahhhh, i see, i took that entire section out thinking it was specifically saying only show it in editor, kinda dumb shouldve looked at it closer, also use Unity's profiler if you wanna look at how performant it is
Thank you!
Hi, I have done that, can confirm it solves it, maybe this should be corrected in the repo ?