Good point, easy to test this stuff by just writing up a track & car that use a shader which passes normal maps.
(still using world coordinates in this picture, need to find the right matrix rotation.)
I found a pretty straightforward tutorial for SSAO with normal+depth maps so I'll give it a shot. (
http://www.gamedev.net/page/resourc...a-simple-and-practical-approach-to-ssao-r2753 - I implemented it without the random texture lookup)
I think these are the correct screenspace normals:
(blue faces the camera, red's left/right, green's up/down - for display purposes I'm using absolute value)
EDIT: This is the result I've got from this.
Since this is straight up using the main render texture to pass normals, some artifacts are to be expected - for example, the car's shadow is doing funny things to the normals.
Also, this is without a random map - I'm using relatively large primes to maximize randomness, but it could probably be better. I'm not sure what's causing the interspersed dark pixels, but that's probably going to be a problem.
I also did a fake-composite by taking 2 screenshots using the same camera, the effects are mostly pretty subtle (except the headlight, which is transparent and screws things up)
Bottom is with the AO multiplied with the output result.
This one has the AO's effect multiplied up 2.5x to make it more prominent. It does, I think, add to the effect of the door opening. But the artifacts are also fairly prominent.
Difference in framerate is 52 -> 37 (16 samples) -> 29 (32 samples)
Tweaking the constants helped out with the artifacts. Still does a black line around the sky (it's due to depth I suppose)
Definitely at least partially losing its impact because the main things it hits are already dark (shadows, the wheels have a baked AO map on them too)
EDIT #5 or so
Added bumpmap shader, which is really just adding the tread pattern.