1

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.

linear depth and normal

Current Outcome

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;
}
Kromster
  • 7,181
  • 7
  • 63
  • 111
Pris0n
  • 350
  • 1
  • 5
  • 24
  • It looks okay, I would say, a bit blurring, playing with bias. Take a look at this: http://devmaster.net/posts/3095/shader-effects-screen-space-ambient-occlusion – Dragan Okanovic Jun 18 '13 at 10:29
  • hmm I added some blur, but it doesnt seem right at all. Have a lookt for yourself. Left is ssao blur and right blur combined with standard rendering http://www.imgbox.de/users/public/images/HuIN3sCLVN.jpg – Pris0n Jun 18 '13 at 21:01
  • Because it's too thin I would say that you need to play with min and max values, it won't all be fine in first try. It looks well shaped and colored, but just spreading should be adjusted. Quick look at shader tells me that everything is doing alright. – Dragan Okanovic Jun 18 '13 at 21:09
  • you were right. i played with the values and it looks much better know. thinks i noticed, - in 80% my floor in my ssao is gray and not white, the saturation is varying - my range check doesn't work --> my whole model is surrounded with ssao – Pris0n Jun 20 '13 at 14:34

0 Answers0