![]() Raskar and Cohen's Two-Pass Algorithm for Silhouette Rendering © Ruzi Che Mat, James Ward and Mahes Visvalingam, 2002 |
|
| 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
Evaluation Evaluation
Conclusion Acknowledgements
|
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:
|
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:
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. |
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.
![]()
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.
| 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. |
| 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. |
| 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
|
Cartographic Information Systems Research Group, University of Hull