Real time depth of field effect.

Blitz3D Forums/Blitz3D Programming/Real time depth of field effect.

Zombie Apocalypse alpha 1 had depth of field using the above method...copycat...;p
but as rob said without pixel shaders it's next to impossible to achieve a smooth transistion.
(Pats vividGL on back and makes love to it's pixel shader skins)

But as for the above shot, I'd say fred is making each 'blur' frame bigger or smaller than the last. This isn't the optimal way(because it creats a radial shilloute(sp?))
What you want to do is shift the 'frame buffer' around on it's x,y plane but always keep it at the same distance from the camera.

i.e for 10 frames,

for j=1 to 10
moveEntity depthLayer(j),centreX+cos(j*36),centreY+sin(j*36),centreZ
next

This cretes a very convincing and easily adjustable blur. because,

centreX+cos(j*36) cna be altered to, centreX+cos(j*36)*blurFactor...
bigger blur factor = more out of focus.

Reason for moveEntity is you parent the depth layers to the camera. So you can move it on it's x,y while still being perfectly aligned to the camera.(I.e to prevent any radial leakage.)