So, it's been a while since my last update and while there has been progress, it has been slower than I would have hoped.
One thing that hampered the work flow was the flu, which resulted in me having to go home for week 4 to recover. Incidently, week 4 was supposed to be a technical supervisor meeting week, but that had to be delayed to week 5 instead.
However, the main thing that slowed progress, was the many problems that I encountered trying to implement SSAO in my d3d9 application. The shader I was using came from an article on Blizzard's implemention of SSAO in StarCraft 2 in the book Game Programming Gems 8 - there were a lot of variables that weren't really explained in the shader and I had to guess at a lot of the values I plugged into them. When I did get the shader to actually produce a result, the graphical effects it produced were obviously not ambient occlusion:
Some problems were easily solved (though easy to overlook as well), such as the effect of being able to see the SSAO effect of the room through the walls - this was caused by the Alpha Blending being turned on in the main file, so easily fixed. But even after fixing that, the scene still looked wrong. I am reasonably sure no that the main problem lay in the way the shader converted screen space positions to view space positions using the depth values, but at the time I could not work out why it was not working.
Suffice it to say, I spent a few weeks trying to get that shader to work, but ultimately I decided that it would be better to start a new SSAO shader from scratch and test each element step by step - which is really what I should have done in the first place. After spending weeks trying to get the GPGems8 shader to work and failing, it took me far less time than that to produce a new shader from scratch and get it working. However, I probably wouldn't have been able to get it to work so quickly if I hadn't been learning from those early failures.
I will detail the steps I took in implementing the new shader in another post, but for now here are some screens of the working depth texture and SSAO texture.
Depth and Normals (normals in rgb, depth in a):
SSAO without blur:
Unfortunately, there are some weird artifacts in the SSAO, that occur when the camera is at a certain angle to that back wall of the scene - I have yet to determine the cause:



No comments:
Post a Comment