It would appear the standard Obscurance effect doesn’t work with an Orthographic camera. Its basic SSAO script works perfectly fine for me though. I’ve gone through the setup script for Obscurance and I can’t see anything that would making it unsupported. There are no errors or warnings… I very much suspect the culprit is bad matrices/vectors that are assumed to be projection.
Maybe it’s a little bit late, but i just faced the same problem, here is how to solve:
(Change ScreenSpaceAmbientObscurance.shader)
float LinearEyeDepthOrth(float z)
{
// uniform float4 _ProjectionParams;
// x = 1 or -1 (-1 if porject is flipped)
// y = near plane
// z = far plane
// w = 1/far plane
// http://www.derschmale.com/2014/03/19/reconstructing-positions-from-the-depth-buffer-pt-2-perspective-and-orthographic-general-case/
// Z_view = Z_near + Z_ndc(Z_far - Z_near)
return _ProjectionParams.y + z * (_ProjectionParams.z - _ProjectionParams.y);
}
float3 ReconstructCSPosition(float2 S, float z)
{
float linEyeZ = LinearEyeDepthOrth(z);
//return float3(( ( S.xy * _MainTex_TexelSize.zw) * _ProjInfo.xy + _ProjInfo.zw) * linEyeZ, linEyeZ);
return float3(( ( S.xy * _MainTex_TexelSize.zw) * _ProjInfo.xy + _ProjInfo.zw), linEyeZ);
...
}
1 Like
We need to do some fixes for this to make sure our effects construct properly in ortho. I’ve notified the team.
1 Like
It looks like nobody ever fixed it yet, or am I missing something?
Any update from the team @Tim-C ? the issue seems to be still there
It’s not that simple to ‘fix’ SSAO with orthographic rendering, most SSAO depends on a smooth transition of values for depth and normals, and orthographic rendering by its very nature, does not render depth that way.