Jump to content
Posted 07 August 2011 - 04:02 PM
Posted 08 August 2011 - 08:26 AM
Posted 09 August 2011 - 05:01 PM
Looking at the screenshot i'd say it's a combination of a large sample kernel radius with a low number of samples; does decreasing the kernel radius/increasing the number of samples improve the problem?
The black "edges" are a result of sampling beyond the edges of the depth texture. The result of this will change depending on the texture wrap mode (repeat, clamp to edge, etc.) or you could try clamping your texture coordinated in [0, 1].
As a side note, you might be interested in a tutorial I wrote a while back that extends the SSAO technique you're implementing: http://www.john-chap...ontent.php?id=8
Posted 09 August 2011 - 07:30 PM
Posted 10 August 2011 - 03:18 PM
How are you actually generating the sample kernel? As maxest says if there's any regularity to it that is what will be causing the interference pattern (and why increasing the number samples doesn't seem to reduce the effect).
float2 rotationTC = pIn.pos.xy/4; float3 vRotation = gNoiseVecMap.Sample(gPointSam, rotationTC);
float h = 1/(1+vRotation.z); float3x3 rotMat = float3x3( h*vRotation.y*vRotation.y + vRotation.z, -h*vRotation.y*vRotation.x, vRotation.x, -h*vRotation.y*vRotation.x, h*vRotation.x*vRotation.x + vRotation.z, vRotation.y, -vRotation.x, -vRotation.y, vRotation.z);
float3 vOffset = xyz[i%8]*(offsetScale*=offsetScaleStep); float3 vRotatedOffset = mul(vOffset, rotMat); float3 vRandVector = float3(vRotatedOffset.xy*gProjParams.screenDimension, vRotatedOffset.z*fSceneDepthP*2);
Posted 11 August 2011 - 12:30 AM