About#
Wax DOF Box changes the focus distance of an image after it has been rendered. It needs two images: the colour image and its depth map, usually written by a raytracer, but a depth map can also be painted by hand.
This version from February 2010 runs on the GPU with GLSL shaders, 20 to 30 times faster than the first CPU version. What remained slow was the transfer between GPU and CPU memory, and writing the images to disk.
The program itself has not been kept: only the screenshots and videos below remain.
How it works#
The depth of field is computed the way a raytracer does it. For each pixel, the depth read in the depth map, minus the chosen focus distance, gives a deviance: the larger the deviance, the stronger the blur. A larger deviance multiplier needs more samples.
Two shaders do the sampling: method_1 takes the samples on a regular pattern, method_2 at random, which adds a light noise. The samples are read around the pixel, summed and averaged.
The window sets the focus distance, the deviance, the number of samples, the shape of the diaphragm and the method.
Videos#
Two videos from February 2010, made with a modified version that works in real time. It reads a sequence of 150 colour and depth images (400x300) found on the DOF PRO website. They were captured with FRAPS, so the frame rate is low.
ScreenShots#
The same image at two focus distances.





