SSAO - artifacts appearing
Offset.xy is definatelly off because it just return XY coordinates from screenspace:


Clamping solved 'small copies of model' on the model itself, thanks!

sampleDepth actually looks like this and indeed is not in viewspace and it may really explain those little models now:


Using viewspace (offset = mul(projection, offset) ---> offset = mul(view, offset)) solves depth problem but final buffer is clear white. No effects are actually visible. What next step do you suggest? If depth comparing is correct now, what might be off?


UPDATE:
Comparision is working but in a wrong way. Below line results in just fully white buffer screen:

occlusion += (sampleDepth &gt;= sample.z + bias ? 1.0 : 0.0);


Changing it to:

occlusion += (sampleDepth &gt;= sample.z - bias ? 1.0 : 0.0);


Actually gives us comparision but it is really bold and doesn't include only holes and creases but whole model. Changing bias to small values like 0.001f doesn't help:


Update #2:
Directly comparing gives result presented below. However it doesn't seem satisfying enough to use as it seems to present rather edges than creases and holes:

occlusion += (sampleDepth == sample.z ? 1.0 : 0.0);