University of Bergen | Faculty of Mathematics and Natural Sciences | Department of Informatics | Visualization Group
Visualization
You are here: Department of Informatics > Visualization Group > Teaching > INF359 (VISUAL2): Selected Topics in Visualization
 Visualization
 > about
 > team & contact info
 > research
 > teaching
 --- > INF359: vis-special
 > seminars
 > resources
 > network
 > events
 > links
Course INF359 (VISUAL2): Selected Topics in Visualization (utvalde emner i visualisering)

INF359 Lab Report

By Yngve Devik Hammersland

Assignment

In this lab exercise the goal was to implement several non-photorealistic visualization techniques for volume rendering. We were given the VolumeShop framework as a starting point and extended/hacked this to suit our needs.

Approach

The first thing done is to make a new plugin in which to do the work without messing with the original components. This is a shameless copy of the SimpleRenderer plugin already in volumeshop, modified to suit the needs of this assignment.

Plugin coding

The original plugin contains a number of properties. The properties that controls the rendering is removed as the rendering shader is to be replaced. Thus, the Technique property of the plugin is replaced by the Shading and Contour properties. This also allows us to change the rendering style on-the-fly without needing to recompile the project. The new properties has the following choices. For Shading:
Normal
the normal shading originally found in the SimpleRenderer
Cartoony
the cartoon look with stepwise diffuse shading.
Cool To Warm
the cool to warm technique.
And for Contour:
None
No contours whatsoever.
Simple
Contours based on |N·V|.
Smart
Contours based on |N·V| and the curvature. Yields even width for all contours.
The rest of the work is done in the volume renderer shader program.

Shader coding

Based on the properties, different logic is used in the shader to determine the color of the ray/pixel. Basically the color computation of the GetColor method has been extracted to ComputeColor. ComputeColor in turn checks whether or not the current point is a countour or not by calling IsContour. If it is a contour, black is returned, otherwise a color is returned based on the current shading mode. IsCountour also checks for contours based on the current Contour property.

This enables us to select contour type and shading type independently.

Result

Here is a screen capture of cartoon shading and smart contours. Click on it to download a short video which showcases the different modes. Screen Capture of Plugin




 Last change: Jean-Paul Balabanian