I'm currently trying to implement SSAO. But my current outcome seems more or like an edge highlighting than real ssao. Note that I haven't blurred the result yet. But i Think if I blur this tiny line it will nearly dissappear. I played with different radius etc, but nothing changed. :(
Here is my linear depth texture (note far is 1000, that's why is so dark) and my normal texture.
And finally here is my ssao shader: http://jsfiddle.net/Peters_Stuff/Bqx8X/
And this is how i generate my sample kernel:
this.kernel = [];
this.kernelSize = size;
var max = 1;
var min = -1;
//kernel
for (var i = 0; i < this.kernelSize; i++){
this.kernel.push(Math.random() * (max - min) + min);
this.kernel.push(Math.random() * (max - min) + min);
this.kernel.push(Math.random());
}
var a = Math.random();
for (var i = 0; i < this.kernel.length; i++){
this.kernel[i] *= a;
}