Another SSAO thread.

Started by
39 comments, last by Cineska 15 years, 10 months ago
Hi there!

I'm working on SSAO right now and I wanted to code it myself. But right now I'm at the point that I don't understand the basics anymore.

So to split it up:
I need a depth map. First I thought I need a depth map like the one Riemer used in his HLSL tutorial. (http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series3/Shadow_map.php)

Then I found out that I need a depth map that is normal based. So I had 2 options. One of them was a view dependant normal map and a world dependant. I tried both, the results were awful with SSAO.

Then the SSAO texture:

I understand the theory how it is done. But looking at the code from Inigo Quilez which is written in GLSL doesn't really help me.

I don't know what he's doing in these lines.
 vec4 zbu = texture2D( tex0, gl_Color.xy );    vec3 ep = zbu.x*gl_TexCoord[0].xyz/gl_TexCoord[0].z;    vec4 pl = texture2D( tex1, gl_Color.xy*fres.xy );


From what I read, tex0 is the depth map and tex1 is a random normal texture.

Guess I have to stop now, my brain is spinning in circles.
I appreciate every tip you can give.

Regards

This topic is closed to new replies.

Advertisement