Home
ContactAbout
An isle like environment with focus on two hills, while background and foreground are blurred.

DDepth-of-field Shader

C++OpenGLGLSLQt

In this project, a post processing shader was developed that simulates a depth of field effect. This project is part of the computer graphics course 'Realtime Rendering'.

To achieve the effect, the depth information calculated by the camera are utilized. A window consisting of multiple points serves as focus field, the blur level is calculated based on the distance to the focus area. Additional strategies such as jittering are experimented with.

The world that is used for the presentation is the result of a prior exersise and consists of textures and shaders only (no geometry was used).

This project represents the first contact with C++ and GLSL.

Focus on a mountain, further mountains and skybox are blurred.
Focus on sky and isles in the distance, foreground is blurred.
Focus on foreground, sky and far away objects are blurred.
Foreground and sky are blurred, in the center of the image a blue box is shown that represents the focus area.
Foreground and sky are blurred, in the center of the image a blue box is shown with colored dots that are used for testing depth at different points.
Foreground and sky are blurred, in the center of the image a blue box is shown with dots inside. All dots above the horizontal dots are marked as one area and the lower dots are marked as one.
Focus on sky and far away isles. Foreground is blurred.
Screenshot with most of the image being in focus. Slight blur in foreground and sky.
Red mountains in the foreground are blurred.
Focus in a valley between mountains.
Focus on three hills with depth around them.