IBM Research Report Efficient Conservative Visibility Culling
Total Page:16
File Type:pdf, Size:1020Kb
RC 21973 (98761) 26 February 2001 Computer Science IBM Research Report Efficient Conservative Visibility Culling Using the Prioritized-Layered Projection Algorithm James T. Klosowski IBM Research Division Thomas J. Watson Research Center P.O. Box 704 Yorktown Heights, NY 10598 Claudio T. Silva AT&T Labs-Research 180 Park Ave. P.O. Box 971 Florham Park, NJ 07932 Research Division Almaden - Austin - Beijing - Haifa - T. J. Watson - Tokyo - Zurich LIMITED DISTRIBUTION NOTICE: This report has been submitted for publication outside of IBM and will probably be copyrighted if accepted for publication. It has been issued as a Research Report for early dissemination of its contents. In view of the transfer of copyright to the outside publisher, its distribution outside of IBM prior to publication should be limited to peer communications and specific requests. After outside publication, requests should be filled only by reprints or legally obtained copies of the article (e.g. , payment of royalties). Copies may be requested from IBM T. J. Watson Research Center , P. O. Box 218, Yorktown Heights, NY 10598 USA (email: [email protected]). Some reports are available on the internet at http://domino.watson.ibm.com/library/CyberDig.nsf/home . Efficient Conservative Visibility Culling Using The Prioritized-Layered Projection Algorithm James T. Klosowski £ Cl´audio T. Silva† Abstract We propose a novel conservative visibility culling technique based on the Prioritized-Layered Projection (PLP) algorithm. PLP is a time-critical rendering technique that computes, for a given viewpoint, a partially correct image by rendering only a subset of the geometric primitives, those that PLP deter- mines to be most likely visible. Our new algorithm builds on PLP and provides an efficient way of finding the remain- ing visible primitives. We do this by adding a second phase to PLP which uses image-space techniques for determining the visibility status of the remaining geometry. Another contri- (a) (b) bution of our work is to show how to efficiently implement such image-space visibility queries using currently available OpenGL hardware and extensions. We report on the imple- mentation of our techniques on several graphics architectures, analyze their complexity, and discuss a possible hardware ex- tension that has the potential to further increase performance. Index Terms Conservative visibility, occlusion culling, in- teractive rendering 1Introduction Interactive rendering of very large data sets is a fundamental (c) (d) problem in computer graphics. Although graphics processing power is increasing every day, its performance has not been Figure 1: Office model: (a) This image was computed using able to keep up with the rapid increase in data set complexity. PLP and is missing several triangles. (b) The correct image To address this shortcoming, techniques are being developed showing all the visible triangles rendered with cPLP. (c) The to reduce the amount of geometry that is required to be ren- current z-buffer, rendered as luminance, for the image in (a). dered, while still preserving image accuracy. Black/white represents near/far objects. (d) Final z-buffer for Occlusion culling is one such technique whose goal is to the correct image in (b). determine which geometry is hidden from the viewer by other geometry. Such occluded geometry need not be processed by the graphics hardware since it will not contribute to the techniques that produce images that are mostly correct, in ex- final image produced on the screen. Occlusion culling, also 1 change for even greater levels of interactivity. The approxi- known as visibility culling , is especially effective for scenes mate approaches are more effective when only a few pixels are with high depth complexity, due to the large amount of oc- rendered incorrectly, limiting any artifacts that are perceivable clusion that occurs. In such situations, much geometry can to the viewer. often be eliminated from the rendering process. Occlusion culling techniques are usually conservative, producing images The Prioritized-Layered Projection (PLP) algorithm, intro- that are identical to those that would result from rendering duced by Klosowski and Silva [16, 17], is one such example all of the geometry. However, they can also be approximate of an approximate occlusion culling technique. Rather than performing (expensive) conservative visibility determinations, £ IBM T. J. Watson Research Center, PO Box 704, Yorktown PLP is an aggressive culling algorithm that estimates the vis- Heights, NY 10598; [email protected]. ible primitives for a given viewpoint, and only renders those †AT&T Labs-Research, 180 Park Ave., PO Box 971, Florham primitives that it determines to be most likely visible, up to a Park, NJ 07932; [email protected]. user-specified budget. Consequently, PLP is suitable for gen- 1Visibility culling is also used in a more general context to refer to erating partially correct images for use in a time-critical ren- all algorithms that cull geometry based on visibility, such as back-face dering system. To illustrate this approach, consider the images culling, view frustum culling, and occlusion culling. of the office model shown in Fig. 1. The image generated by PLP for this viewpoint is shown in Fig. 1(a), while the cor- rectly rendered image is in Fig. 1(b). We can see that the im- age rendered by PLP is fairly accurate, although portions of the model are missing, including the plant stand, clock, door jam, and parts of the desk lamp. PLP works by initially creating a partition of the space oc- cupied by the geometric primitives. Each cell in the partition is then assigned, during the rendering loop, a probabilistic value indicating how likely it is that the cell is visible, given the current viewpoint, view direction, and geometry in the neigh- boring cells. The intuitive idea behind the algorithm is that a cell containing much geometry is likely to occlude the cells behind it. At each point of the algorithm, PLP maintains a priority queue, also called the front, which determines which cell is most likely to be visible and therefore projected next by the algorithm. As cells are projected, the geometry asso- ciated with those cells is rendered, until the algorithm runs out of time or reaches its limit of rendered primitives. At the Figure 2: Illustration of the accuracy of PLP: For the same same time, the neighboring cells of the rendered cell are in- viewpoint and model as shown in Fig. 1, the visible geometry serted into the front with appropriate probabilistic values. It is that PLP rendered is shown in white, and the visible geometry by scheduling the projection of cells as they are inserted in the that PLP did not render is shown in red. front that PLP is able to perform effective visibility estimation. In [16, 17], PLP was shown to be effective at finding visi- ble primitives for reasonably small budgets. For example, for a city model containing 500K triangles, PLP was able to find chical Z-Buffer technique of Greene et al. [14] is probably the (on average) 90% of the visible triangles while rendering only best known example of a technique that effectively uses such 10% of the total geometry. This number alone does not guar- information. However, even before this seminal paper, Kubota antee the quality of the resulting images, since the missing Pacific already had hardware support on their graphics sub- 10% of the visible triangles could occupy a very large per- system for visibility queries based on the current status of the centage of the screen or may be centrally located so that the depth buffer. In Section 5, we will put our new techniques into incorrect pixels are very evident to the viewer. To address this context with respect to the relevant related work. concern, the authors reported the number of incorrect pixels The main contributions of our work are: generated by the PLP algorithm. In the worst case, for the same model and viewpoints discussed above, PLP only gener- ated 4% of the pixels incorrectly. These two statistics support ¯ We propose cPLP, an efficient interactive rendering algo- the claim that PLP is effective in finding visible geometry. rithm that works as an extension to the PLP algorithm by As mentioned previously, approximate occlusion culling adding a second phase which uses image-space visibility techniques will sacrifice image accuracy for greater rendering queries. interactivity. While this tradeoff may be acceptable in some applications (especially those that demand time-critical ren- dering), there are many others (such as manufacturing, medi- ¯ We show how to efficiently implement such image-space cal, and scientific visualization applications) that cannot toler- visibility queries using available OpenGL hardware and ate such artifacts. The users of these applications require that extensions. Our implementation techniques can poten- all of the images generated to be completely accurate. To ad- tially be used in conjunction with other algorithms. dress the requirements of these applications, we describe an efficient conservative occlusion culling algorithm based upon ¯ We discuss the performance and limitations of current PLP. Essentially, our new algorithm works by filling in the graphics hardware, and we propose a simple hardware holes in the image where PLP made the mistake of not ren- extension that could provide further performance im- dering the complete set of visible geometry. provements. An interesting fact is that after rendering PLP’s estimation of the visible set, as shown in Fig. 1(a), most of the z-buffer gets initialized to some non-default value, as illustrated by The remainder of our paper has been organized as follows. Fig. 1(c). This figure corresponds to the z-buffer rendered as In Section 2, after a brief overview of PLP and some aspects luminance, where black represents near objects, and white rep- of its implementation, we detail our new cPLP algorithm.