Real time Depth of Field by simulated Heat Diffusion on the GPU

A project for TSBK03 - Techniques for Advanced Computer Games given in the fall of 2012 at Linköping University. We created an interactive depth of field using simulated heat diffusion for real time computer graphics applications. Using an original RGB rendering along with the depth buffer, we calculate a focus map from user defined camera parameters (aperture, focal depth and focus plane distance). This focus map is then treated as a heat insulator map, allowing RGB fragments to transfer values according to the heat equation. This eliminations the problem previous implementations have of colors bleeding between in-focus objects and out-of-focus objects.

To solve the tri-diagonal equation system resulting from using the heat equation on every fragment, we use an iterative solver which iterates toward the analytically correct solution. All calculations are done in parallel on the graphics card's GPU using GLSL shaders.

The project was written in C++ and uses the OpenGL API. GLSL shaders was used for post-processing and for GPGPU calculations on the graphics card's GPU.

Full paper, in English, is available here: Report