Raskar and Cohen's Two-Pass Algorithm for Silhouette Rendering
© Ruzi Che Mat, James Ward and Mahes Visvalingam, 2002

Croplogo.jpg (11317 bytes)

2.   Raskar and Cohen's Two Pass Algorithms

This investigation was undertaken by Ruzi Che Mat as a part of his 4-month Dissertation project in part fulfilment for a Taught MSc in Computer Graphics and Virtual Environments at the University of Hull.  The project was co-supervised by Mahes Visvalingam and James Ward, who undertook further investigations.

The approach

Graphics card : nVidia GeForce MX2
Software : Sil2 demo available from same address as paper.
Paper : Raskar R., Cohen M., 1999, "Image Precision Silhouette Edges". In Spencer S. N., editor,
Proceedings of the Conference on the 1999 Symposium on interactive 3D Graphics,
New York, April 1999. ACM Press., pp. 135 - 140
.  Available online: http://www.cs.unc.edu/~raskar/NPR/sil.html
Status : More recent algorithms on web.  Check out http://www.cs.unc.edu/~raskar/HWWS/

Evaluation
For an abstract of Ruzi's thesis, please see his web page at: http://staf.uum.edu.my/ruzinoor/dissertation.htm
This illustrated report on this evaluation is provided by Ruzi Che Mat, James Ward and Mahes Visvalingam

Evaluation
The suitability of the following variants of the two pass algorithm were evaluated through the Sil2 demo program:

  1. Wireframe Method
  2. Z-scaled Translation
  3. Fattened Polygons
  4. Charcoal Effect

Conclusion
Adopt: 
The Wireframe Method could be useful for real time rendering of silhouettes of terrain even if is not ideal for static frames or printed maps.
Reject : Both the methods using a) z-scaling with differing ranges of the depth buffer and b) polygon fattening were less useful for scientific visualisation of terrain. 

Acknowledgements

Our thanks to: The Ordnance of Great Britain for permission to use their sample data set in our research programme.
Jarek Rossignac for a copy of their original paper.

   REPORT

Contents Raskar and Cohen's approach

With polyhedral models, silhouettes are normally assumed to lie along the boundaries between adjacent front facing and back-facing surfaces; i.e. they are equated with occluding contours.  Owing to the limited precision of the depth buffer and pixel sampling, the rendered edges tend to leave gaps in the outline.  For example, the silhouette of Venus's back in the wireframe model has a dotted appearance.  Rossignac and van Emmerick (1992) proposed a Two Pass Algorithm based on the z (depth) buffer for image precision rendering of these boundaries.  It avoids the use of polyhedral topology and processes the scene as consisting of oriented polygons.  As the name suggests, it involves two passes through the entire model.   In the first pass, the front-facing polygons are shaded.   In the second pass, the scene is translated back towards the camera, to minimise gaps in silhouettes, before the backfaces are rendered in wireframe mode.  The translation vector and the range of the depth buffer have to be finely tuned.

The basic method is very easy to implement and the graphic attributes of the silhouette edges can be varied to reflect depth, occlusion and other properties.  In their version of the two pass algorithm,   Raskar and Cohen set the depth function to Less than or Equal  in the second pass, instead of translating the scene backwards, before rendering the backfaces in wireframe mode.  The method works well when dihedral angles between front facing and backfacing polygons are not large. As line width increases, there are visible gaps between silhouette edges made up of neighbouring polygons.   The use of two different types of primitives, namely polygons and polylines, poses some restrictions.  So, Raskar and Cohen filled backfacing polygons with the depth function set to Less than or Equal, as in their wireframe model, to make them visible.  They noted three methods for pulling backfacing slopes towards the camera to increase their visibility,  namely 1) a simple translation forward by a fixed amount, 2) z-scaling the translation by the average z-value of the polygon (by scaling down the model or by moving the near and far planes of the view frustum), or c) use of glPolygonOffset which also offers z- and orientation dependent scaling.  Their Sil2 demo program shifts the near to far plane range of the depth buffer and enables user-control over z-scaling.

They stated that, with smooth curved objects, this created smooth and continuous silhouettes of varying thickness in an artistic style.  However, they noted that the width of the rendered silhouette can become large at sharp edges.  Moreover, this method does not yield silhouettes with near uniform width.  Raskar and Cohen then proceeded to fatten or enlarge the backfacing polygons out from their respective midpoints by a distance proportional to the z-value and polygon orientation.  This fattening is performed for each view and involves the insertion of additional vertices to cast n-sided polygons into 2n polygon fans.  They were very pleased with this method stating that this produces no gaps between edges of neighbouring polygons and offers all the benefits of the traditional graphics pipeline for polygon rendering, e.g. textures, lights and blending. 

They went on to suggest that  finely tessellated models could be rendered in a charcoal-like style by fattening front facing polygons with normal almost perpendicular to the view direction.  The degree of fattening of backfacing and near perpendicular polygons can be interactively controlled through a view dependent scaling factor.


Reasons for Evaluation

Raskar and Cohen's  methods, based on Rossignac and van Emmerick's two-pass algorithm for dynamic rendering of silhouettes, were investigated in the summer of 2001 for the following reasons:

  1. Assumption          
    The two-pass algorithm defines silhouettes as formed by the set of edges between front and back facing polygons, i.e. as occluding contours. Visvalingam and Whelan (1998) noted that occluding contours were insufficient for sketching the silhouettes of terrain.  However, the final modification for rendering charcoal-like sketches offers scope for including what Visvalingam and Whelan termed near occlusion.  Whelan (2001) and Whelan and Visvalingam (2002) used a 2.5D prototype system to demonstrate that Formulated Silhouettes provided better descriptions of landforms.  The current investigation  is one of a number being undertaken to evaluate whether existing algorithms for 3D rendering at interactive rates could reproduce similar form depiction.  Raskar and Cohen's ideas were considered because all three of their basic methods address the partial visibility problem; more importantly, charcoal rendering has the additional capacity to extend existing silhouettes and insert other lines. 
  2. Results             
    Raskar and Cohen's output for the auxiliary machine room and for the Venus model were impressive and prompted the need for independent verification.
  3. Ease of Evaluation
    Source code for a demo program was available.
  4. Speed                  
    Although the computational and data overheads of polygon fattening can be a problem when rendering large terrain models at interactive rates, this study was more concerned with evaluating the perceptual impact of the rendered silhouettes than with speed at this stage.

   Results

Results for the Venus model
The output for the Venus model is sufficient to illustrate our observations.  The first set of figures presented for the three methods do not feature the charcoal effect.  Then, the impact of using the charcoal effect is considered. 

Results without charcoal effect

At first sight, all three methods seemed to produce quite good results.  However, we noted the following:

  • The wireframe method seems to produce the best results if we ignore the stitched and feathered strokes in places, e.g. at arm.  The line width can be adjusted.  The 'lines' do not sketch the forms fully, e.g. around the navel and lower torso, because the method equates silhouettes with occluding contours.  However, the method is of value for dynamic navigation of terrain since the overall depiction of form is clear and true to form.

  • In comparison, z-scaling by adjustments to the depth buffer range produces less appealing results.  As Raskar and Cohen pointed out this method generates uneven 'strokes'; and it is not possible to control the variations in width.  The default values produce even shorter 'lines' at the bust, navel and lower torso and instead emphasise the neck and legs.  There is shape distortion - Venus looks sleeker and more flat chested since the thicker 'lines' come across as background, setting off the figure in white.  The z-scaling is difficult to tune.

  • The fattened polygons do pick out near occlusion in places (e.g. navel and bust).  However, it produces some variation in 'line' width.  Unless such variation is intelligently placed, the fattened areas can be perceived as background, e.g. around neck.  Despite some excessive fattening in places, some forms are inadequately portrayed, e.g. lower torso.  Polygon fattening also produces very uneven strokes with rough edges, e.g. around bust, and contrary to Raskar and Cohen's evaluation it has gaps at sharp edge, e.g. see angular gap below bum and blotchy line outlining the bust. 

It was difficult to achieve satisfactory results by tweaking either the z-scaling factor for translating backfacing polygons or the view dependent scaling for the charcoal effect.  So, this method was not considered further.

small-vF.jpg (59860 bytes)  
Click on image for larger version

Results for charcoal effect

The following table shows the application of the charcoal effect with the wireframe method and with fattened backfacing polygons. The results for the wireframe method are slightly better with the fattening of nearly occluding polygons.   When the charcoal effect was used with the fattened polygons shown above, over-extended and extraneous multiple 'lines produced a rough and clumsy output.  This may be ideal for emulation of some artistic styles.  However, as pointed out by Lesage and Visvalingam (2002) cartographic visualisation aims for clarity, legibility and lack of clutter.  The lineweight can be adjusted by tuning an orientation dependent  scaling factor to produce more pleasing results, as shown below.  However, the extraneous and over extended lines are still there, e.g. under the neck.

small-VC.jpg (49694 bytes)  
Click on  image for larger version

The following results for the default pose also favours the simple wireframe method for the reasons stated above.  The  'line' of the bum is distinctly uneven on fattened polygons.  Moreover, polygon fattening has the propensity to merge form lines (e.g. at the legs).  Where there is a succession of mountain ranges, it is quite common for ridges to peep out over others and they need to be clearly demarcated.  Down scaling the fattening helps to some extent but extraneous lines (e.g. under the neck) cannot be removed without losing some of the outline which has already become dotted in places, e.g. on back.    In comparison, the wireframe depiction is clear, legible and elegant.   However, the results  (not shown here) for the two other datasets in the demo suggest that the relative performance of methods can be form dependent.  So, the wireframe and fattened polygon methods were assessed using terrain data.

   small-sideF.jpg (30942 bytes)  small-sideW.jpg (21421 bytes) 
Click on images for larger versions

Results for terrain

The results for the fattened polygons were disappointing and are discussed first.   In comparison, the wireframe method, considered next, produces very good results.   Readers should be aware that these methods produce results which are graphics card dependent as noted by Che Mat (2001). 

Results for fattened polygons

Fattening of only the backfacing polygons (Figure a below)  outputs much more than silhouettes and is not very pleasing or useful for mapping in 3D, where as pointed out by Visvalingam (1990) the terrain is merely background for other foreground information, such as land use. Even view-dependent scaling down (Figure b) did not resolve the clutter, lack of clarity or the illegibility.  Further scaling down leads to the disappearance of thin occluding contours, such as at the front of the plateau.  The charcoal effect was much worse and the view dependent scaling could not be fine tuned satisfactorily.  Better, more balanced results were obtained by Lesage (1999) who used the Sobel and Canny edge operators on luminance maps to generate sketches for 3D animations. However, as identified by Lesage and Visvalingam (2002) edge detection has limitations, necessitating the current on-going research. 

small-WF.jpg (52971 bytes) 
Click on image for larger version

Results for Wireframe Method

Rossignac and van Emmerick's wireframe method, with the Less than or Equal To depth function, produced very good results when used on our Port Talbot test data.  The linewidth can be varied (figures a and b below) to give very crisp and clear outlines (figs a, b and d).   Raskar and Cohen hoped that the choarcoal effect would introduce some variation in silhouette width, making the figure more pleasing at some cost.  However, the charcoal effect has a propensity to output extraneous and untidy lines and was scaled down.  Even this leaves a blotch, for exmaple, at A in fig c.  Further down scaling will merely output results equivalent to those of the basic wireframe method.  It would be interesting to see if the same effect could be achieved through other methods.

Although this study is not unduly concerned with speed, it was difficult to control the orientation of this 250 x 250 model during evaluation. This is of some concern since it is normal to work with 500 x 500 (and larger) heightfields.

small-WW.jpg (61278 bytes) 
Click on images for larger versions


Discussion and Conclusion
Most researchers in NPAR tend to equate silhouettes with occluding contours.  They ascribe the problem of drawing silhouette lines to pixel sampling and the limited precision of the depth buffer within the traditional graphics pipeline for polygon rendering.  Raskar and Cohen attempted to counteract this problem using three methods, namely by a minor but elegant and effective modification to the wireframe method; by differential z-scaling the depth buffer before rendering backfaces; and, by polygon fattening.  They favoured polygon fattening over the wireframe method mainly because it exploited the traditional polygon rendering pipeline and offered a range of rendering possibilities.  Their conclusions are valid for some applications of non-photorealistic animation rendering, such as engineering-models, art and game development, particularly for curved closed forms.   While a polygon based scheme is attractive, their specific proposals are not   useful for scientific visualisation of terrain data.  The varying width of fattened polygons produce uneven lines.  Fat darkened areas may be perceived as background, rather than silhouettes.  Worse still, they produce extensive and unbalanced shading of terrain data.  Polygon fattening is also rather slow.

Visvalingam and Whelan (1988) and Whelan and Visvalingam (2002) amongst others have noted that silhouettes extend beyond occluding contours.  However, the global filtering of polygons with normals close to zero to produce a charcoal-effect is not a solution for terrain.  Everitt's (2000) One Pass algorithm (see Che Mat and Visvalingam, 2002), designed to render faces with normal almost perpendicular to view direction, produces better results on automatic scaling of alpha input by 4.  The polygon fatteneing method requires view dependent fattening.  Neither Everitt nor Raskar and Cohen render silhouettes as such. Rossignac and van Emmerick's wireframe approach modified to use the Less than or Equal to depth function produced the best results so far for silhouetting 3D data at interactive rates.  Although generally pleasing, the addition of the charcoal effect to the wireframe method can generate extraneous lines which were difficult to suppress by scaling, and which produced unusable results for some views.  The simplicity of Rossignac and van Emmerick's basic algorithm is itself appealing and it would be interesting to see if aesthetically more pleasing results could be obtained by some simpler modification to the basic Wireframe Method.

 


References
  • Che Mat R., 2001, "Evaluation of Silhouette Rendering Algorithms in Terrain Evaluation", MSc Dissertation, Department of Computer Science, The University of Hull
  • Che Mat R, Visvalingam M, 2002, "Everitt's One Pass Silhouette Rendering with Cube Maps", http://www2.dcs.hull.ac.uk/CISRG/projects/Silhouettes/Everitt.html [ONLINE}
  • Everitt, C. 2000, "One Pass Silhouette Rendering with GeForce and GeForce2" http://developer.nvidia.com/docs/IO/1246/ATT/silhouette_demo.doc
  • Lesage, P_L (1999) "Towards real-time sketch-based exploration of terrain data : an investigation of image processing operators", MSc Thesis, The University of Hull
  • Lesage, P_L., Visvalingam, M., 2002, "Towards sketch-based exploration of terrain", Computers & Graphics 26 (2), 309 - 328.
  • Pearson D. E., Robinson J. A., 1985, "Visual Communication at Very Low Data Rates", Proceedings of the IEEE, 73 (4), pp. 795 - 812
  • Raskar R., Cohen M., 1999, "Image Precision Silhouette Edges". In Spencer S. N., editor, Proceedings of the Conference on the 1999 Symposium on interactive 3D Graphics, New York, April 1999. ACM Press., pp. 135 - 140.  Available online: http://www.cs.unc.edu/~raskar/NPR/sil.html
  • Rossignac J., van Emmerick, M., 1992, "Hidden Contours on a Framebuffer",  Proceedings o the 7th Eurographics Workshop on Computer Graphics Hardware, Cambridge, UK, Sept. 1992.
  • Visvalingam M., Whelan J. C., 1998, "Occluding Contours within Artistic Sketches of Surfaces", Proceedings of Eurographics UK ‘98, pp. 281 - 289
  • Whelan, J. C., 2001, "Beyond Factual to Formulated Silhouettes", PhD Thesis, The University of Hull
  • Whelan J. C, visvalingam M. 2002, "Formulated Silhouettes for Sketching Terrain" http://www2.dcs.hull.ac.uk/CISRG/projects/whelan-1/paper.htm [ONLINE]

Page maintained by: Mahes Visvalingam
Last updated on 31 Jul 2002

Cartographic Information Systems Research Group, University of Hull