ello: The trick is to render to depthmap to the alpha channel and not the rgb channel. The alpha channel is 24Bit whereas the rgb channels are 8 bit each. You might want to have a look at this paper:
http://ati.amd.com/developer/gdc/Scheuermann_DepthOfField.pdf
I didn't get their depthmap shader to work, so i wrote my own. As for the DoF shader example: 0.5 values in the depthmap are sharp, anything above or below 0.5 will be blurred. Just thought i should tell you, as it gave me some headaches until i realized it.
However this shader isn't perfect from what i can tell. A good improvement would be to dynamically blur the depthmap if the values are above or below a certain value. That way focused objects would stay sharp and unfocused objects would be even more blurry and won't have hard edges (They don't have hard edges all the time, but for some depthalues they have).

the others: thanks, i'm glad you like it However don't expect this shader to be released before christmas. There's still some things i want to improve. I also have another project I'm working on which is more important right now, so I wont be working on DoF 24/7

Oh yeah: Got autofocus to work. You look at an object and it becomes sharp. I think this shader would be great for machinima projects once it's finished.


Shade-C EVO Lite-C Shader Framework