I'm trying to get SSAO working in xna 4. The simplest implementation I've found is given in this article: http://www.theorangeduck.com/page/pure-depth-ssao
as it works purely from a depthmap. (the hlsl code I'm using is identical to that in the article)
I'm getting this kind of banding (see attachment).
Based on the directions of the bands, I assume the problem is with my depth map?
Here's the shader I'm using to render it:
float MaxDepth=200;
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
VertexShaderOutput output;
output.Position=mul(input.Position,WorldViewProjectionMatrix);
output.Depth=output.Position.z;
return output;
}
float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
return float4(input.Depth/MaxDepth,input.Depth/MaxDepth,input.Depth/MaxDepth,1);
}
Can anyone help?
Thanks in advance!