0
\$\begingroup\$

I've tried both the built-in unity ambient occlusion that comes with the post-processing stack, as well as another one ported from the Microsoft MiniEngine by someone: https://github.com/keijiro/MiniEngineAO.
Both of them have the same issue pictured below with these dark lines and the occlusion on the faces around the lines seem to flicker as the camera moves.

image

I've been trying to solve this issue by using the Microsoft MiniEngine AO and changing the compute shader. In one of my attempts, I changed the output of the shader from the calculated occlusion:
Occlusion[OutPixel] = lerp(1, ao, gIntensity);
to the depth texture UV to be sampled:
Occlusion[OutPixel] = QuadCenterUV.x;

(QuadCenterUV probably being the center of the UV to sample for the 4 depth texture samples:)

// Fetch four depths and store them in LDS #ifdef INTERLEAVE_RESULT float4 depths = DepthTex.Gather(samplerDepthTex, float3(QuadCenterUV, DTid.z)); #else float4 depths = DepthTex.Gather(samplerDepthTex, QuadCenterUV); 


and this was the output: enter image description here

With a similar effect on the Y axis. I think that may be the cause, as the distortion of the UVs matches the distortion of the effect.
I don't know how to fix this, because I don't have enough knowledge about RWBuffers or compute shaders.
My terrain is generated by a noise function as a 2D array, constructed into a mesh, the mesh runs Mesh.RecalculateNormals(), and then is sent to the Mesh Filter.

What is the issue here, and how can I fix it, or can anyone fix it for me?

\$\endgroup\$
3
  • \$\begingroup\$ I have exactly the same issue, did you eventually find a solution ? \$\endgroup\$ Commented May 11, 2020 at 15:56
  • \$\begingroup\$ Unfortunately not. I have no clue what could be causing this, even simple linear coordinates of the UV get distorted. I can only assume it is some sort of bug somewhere further up the line. \$\endgroup\$ Commented May 14, 2020 at 3:42
  • \$\begingroup\$ Actually, I did find a solution. github.com/keijiro/KinoObscurance seems to work for me. \$\endgroup\$ Commented May 14, 2020 at 3:50

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.