Help with SSAO shader.
Posted: 18 Sep 2017, 00:03
For whatever reason, nobody has been working on an SSAO shader I'm very nooby to glsl, but I decided to take matters into my own hands. I noticed in the obj frag and terrain frag that there's a depth float. I used this and ported over the opengl example ssao shader to OSG. (https://github.com/McNopper/OpenGL/blob ... .frag.glsl)
I added this ssao to both my terrain and obj frag. No errors, but when debugging the output, it's empty: https://i.imgur.com/faSFVZL.png (should show AO). One thing I did notice is that there seems to be no projection matrix available in either the terrain frag or obj frag...
EDIT: Nope, I'm just stupid... the matrices are in the vertex shaders...
Changed a couple of things in the code: https://pastebin.com/raw/MnCzxCr7
Please and thank you.
I added this ssao to both my terrain and obj frag. No errors, but when debugging the output, it's empty: https://i.imgur.com/faSFVZL.png (should show AO). One thing I did notice is that there seems to be no projection matrix available in either the terrain frag or obj frag...
EDIT: Nope, I'm just stupid... the matrices are in the vertex shaders...
Changed a couple of things in the code: https://pastebin.com/raw/MnCzxCr7
Please and thank you.