Visualisierung 2 - Sommersemester 2018 This application has been reimplemented after "Adaptive Cutaways for Comprehensible Rendering of Polygonal Scenes" by Burns et. al. [1].
Download the binaires and the source code for testing.
Introduction
In 3D renderings, an often occurring problem is the occlusion of objects of interest by other secondary objects. Burns et al. [1] address this problem by introducing cutaway renderings that expose hidden objects of interest while preserving contextual information of the scene at interactive frame rates. Their method is made for the rendering of polygonal scenes and not for volumentric data.
While Burns et. al. used illustrative and non-photorealistic rendering, this implementation uses (partially) textured scenes in combination with blinn-phong shading.
The graphical user interface has been designed with Qt 5.10.1 [4] and for the loading of the polygonal scenes the Open-Asset-Import-Library [3] has been used.
Implementation
The basic workflow for generating cutaway renderings is as follows (, the computation is done entirely in respective shaders):
- Rear hulls of objects of interest are rendered into a depth buffer. The jump flooding algorithm, adapted from Rong and Tan [2], is a GPU-based version of a parallelizable algorithm for calculating 2D distance transforms. This algorithm maximizes a cutaway function which defines a cutaway surface. Cutaway surfaces are regions of 3D space that occlude objects of interest and are represented by depth images.
- Then, secondary objects are rendered and clipped against the cutaway depth image. Only objects of interest are rendered completely.
- Since the secondary objects are simply clipped against the cutaway depth image, they appear hollow along the cut surface. The cut surface is the surface that is created by clipping the secondary objects. Especially, when using textures, a view inside the models along the cut surface is noticable. This has been corrected with shading the exposed interior fragments with apropriate colors using normals that have been derived from the cutaway shape.
Apart from the main algorithm there have been added some improvements regarding the cutaways (as has been done by Burns et. al. as well):
- Perspective Compensation: A fixed slope of the z-aligned cone causes problems with perspective projection. It can lead to cutaways of very different widths (angles), depending on the depth of the pixel. Therefore, perspective compensation is performed. It uses a scale factor to change the slope according to the zoom factor.
- Local Angles: Local control of cutaway angles allows object specific angles, which results in a more effective illustration where less secondary objects are discarded.
- Edge Compression: When the scene is dynamically changing, object of interest which are suddenly on or off screen can create discontinuity in the cutaways. This effect was reduced by the adjustment of the cutaway angles such that for pixels near the edge of the screen a narrower angle is used and for pixels sufficiently away from the edge of the screen the normal angle is used.
- Directional Constrains: Any large and flat surface that enters the cutaway interior nearly parallel to the edge of the cutaway exhibits a distractingly large cut surface (e.g. floors). To avoid this, an angle function is defined which adjusts the cutaway angle accordingly.
- Additionally to the implementations in the paper, the alpha value of the frontmonst secondary object can be adjusted, which can lead to a more understandable view of the scene from some points of view.
It has to be mentioned, that these improvements are not perfect solutions, they just reduce the occurence of the problems for a majority of cases.
Guide
- After starting the AdaptiveCutaways.exe, an explorer window opens with two scene folders that can be selected. Once a folder has been selected, the scene objects in the folder are loaded into the application. This may take a some seconds, depending on the scene. After loading the scene, the GUI is visible, with a rendering widget on the right and a list of selectable objects of interest on the left.
- Different scenes can be loaded by pressing the load button and loading a scene folder with object files.
- With the scroll wheel it is possible to zoom in an out of the scene.
- With the LMB and the RMB the scene can be rotated.
- Checking objects in the left list makes them to objects of interest and they are rendered with the cutaway surface described above. Several objects of interest can be selected.
- The angle of the cutaway surfaces can be adjusted manually above the rendering screen.
- The directional constraints can be turned on and off above the render widget to see the difference this improvement makes.
- The edge compressen can be turned on and off above the render widget zo see the difference this improvement makes when coming close to the border of the rendering widget.
- The alpha value can be regulated with the sliders above the rendering widget.
References
[1] Michael Burns and Adam Finkelstein. 2008. Adaptive cutaways for comprehensible rendering of polygonal scenes. ACM Trans. Graph. 27, 5, Article 154 (December 2008), see PDF
[2] Guodong Rong and Tiow-Seng Tan. 2006. Jump flooding in GPU with applications to Voronoi diagram and distance transform. In Proceedings of the 2006 symposium on Interactive 3D graphics and games (I3D '06). ACM, New York, NY, USA, 109-116 see PDF
[3] Loading of polygonal scenes with ASSIMP
[4] GUI implemented with Qt 5.10.1
[5] Assimp model loader inspired by Eric Stone's implementation