I'm working on baking Ambient Occlusion for my static objects. I have them unwrapped to a light map texture with no shared overlapping UV's.
For each of those pixels I compute the occlusion only, no shadows, light color, emission. Just occlusion. And this includes self-occlusion as well as occlusion from any other objects in the scene.
I'm wondering what peoples techniques are and how fast they are. My current technique can generate a 512x512 occlusion map in 2.9 mins. I'm still working to speed this up and think I may potentially be able to get this to about 1 minute. 512 is relatively high resolution I would think for an occlusion map for an object since it will just get blurred, in my opinion. The results are fine in terms of texture quality, I just want to know how fast other algorithms are because I have to bake a ton of objects and want to know if I should maybe go to a CPU ray caster. Anyone else have specs that they have or can run on baking a 512 size texture?
Current algorithm on GPU:
Render objects world position and world normals into the ambient occlusion texture.
Read the normals and positions to the CPU.
For each pixel in the occlusion texture that has a normal (IE a triangle mapped to it and wrote a normal)
--->Set a camera in the world at position from texture
--->Set camera orientation based off of the normal
--->Cull the scene against camera, and render the scene. This is the depth buffer from the pixels point of view on the object.
--->Take all pixels in the depth buffer, compare them to generate an occlusion value for this pixel
I render the depth buffer to a 4x4 texture (so 16 depth samples per pixel). Could do 8x8 but it really doesn't matter after the blur is applied.