I’ve found ana rticle by Alex Evans of Lionehead studios about blurring scenes to make a Depth of Field effect.
I found it really interesting anda want to try an implementation.
If I understood he uses the depth buffer and a combination of textures with different sizes (smaller = far = more filtering = more blur).
He takes a small textures for the far objects, so when it render it in the original size it comes “blurred” by the filtering.
The method is reading back the depth buffer, render far objects to texture (more far, more small) and then render a billboard quad at the normal size, so far objects are rendered with hardware “blurring” and near object with few blurring.
It looks a good method, but how to implement it in OGl ?
I tought two way of doing it :
1)Z sort all the objects and polys , render them to TextureSize/Z texture. and billboard 'em in distance order.
- Read back the depth buffer in some way and do the same but without sorting “by hand”
any ideas ??
The article is at http://www.gamasutra.com/features/20010209/evans_01.htm