"He who knows not, and knows not that he knows not, is a fool...shun him.
He who knows not, and knows that he knows not, is willing...teach him.
He who knows, and knows not that he knows, is asleep...awaken him.
He who knows, and knows that he knows, is wise...follow him."
- Chinese Probverb
This demo renders a depth of field effect by rendering 8 different views on a spherical cap around a focus point and averaging the results. The focus point is computed by shooting a ray in the middle of the screen and intersecting it with the geometry. As you look around, the focus point changes smoothly as you're either looking at closeup details or in the distance.
The good thing about this way of implementing the effect is that the results are very good, at least if you render enough views. The bad thing is that it's very expensive. For this reason this demo uses a simple lightmapped scene and fairly small render target resolution. For depth of field situations you can get away with using low resolution render targets though as most of the scene is a bit blurry anyway.
This demo should run on Radeon 9500 and up and Geforce FX 5200 and up.