Volume Renderer DoF

Introduction

The Volume Renderer DoF is an application that was implemented for the course Visualisierung 2 in SS2017 by Heraldo Sifuentes Caccire and Xi Wang

Depth of field (DoF) is an optical effect which consists of focusing on a certain region and emphasizing it, by sharpening this in-focus region and blurring less important out-of-focus regions. DoF is achieved by attuning the focal length and aperture of a lens, thus focusing the light rays onto the projection plane in two different ways. Regions in-focus are projected onto a single point and are sharp, while all the other out-of-focus regions are mapped to a circle-like area, also known as the circle of confusion, and become blurry. For a region to be in focus, it has to be at a certain distance from the camera. Regions with distance values below or above this given distance are out of focus, hence they are mapped to the circle of confusion. The diameter of the circle of confusion stands in relation to the blur effect: the higher the diameter, the blurrier the projection. This relationship implies that sharp projections are the result of low diameter values. The diameter value does not need to be exact zero for a region to be in focus, it suffices if this value is below a certain threshold (e.g. the size of a pixel). Many rendering techniques implement this effect to increase the level of realism. In visualization, DoF is an effective method to emphasize certain regions such as an organ. The paper presented by Schott et al. suggests a DoF algorithm for slice-based direct volume rendering techniques.

DoF in a Volume Renderer

The suggested method in the paper can easily be integrated into a sliced-based direct volume rendering system. To add the DoF effect two stacks of framebuffers (each with two framebuffers - previous and next buffers) are needed instead of one. The two stacks separate the slices into two regions, one before the focal plane and one behind the focal plane. The slices before the focal plane are traversed in front-to-back order, the slices behind the focal plane are traversed in back-to-front order respectively. During the traversal each slice is projected into the next-framebuffer and then gets blurred. The DoF is approximated by sampling the previous-framebuffer and averaging the samples. Then the next-framebuffer and previous-framebuffer are swapped and the process is repeated till the slice in-focus is reached. Finally, the front-buffer is blended on top of the back-buffer to get the desired result.

Implementation

The application was implemented using C++, OpenGL and QT5. The first step was to implement a slice based volume renderer. The slices are obtained by intersecting a view-aligned plane against the bounding box of the volume. Then the slices are blended as described in the paper.

Downloads and Documentation

Binary

Source

Documentation