Hidden Surface Removal Flashcards
Hidden-surface-removal algorithms can be divided into two broad classes
Object-space algorithms
Image-space algorithms
Object-space algorithms
attempt to order the surfaces of the objects in the scene such that rendering surfaces in a particular order provides the correct image. This class of algorithms does not work well with pipeline architectures in which objects are passed down the pipeline in an arbitrary order. The graphics system must have all the objects available so it can sort them into the correct back-to-front order
Image-space algorithms
work as part of the projection process and seek to determine the relationship among object points on each projector
z-buffer algorithm
is an image-space algorithm that fits in well with the rendering pipeline. As primitives are rasterized, we keep track of the distance from the COP or the projection plane to the closest point on each projector that has already been rendered
Z-buffer: Information stored in the buffer
- A depth buffer
- distance from the COP or the projection plane to the closest point on each projector that has already been rendered. We update this information as successive primitives are projected and filled.
Z-buffer: How is the information used for hidden surface removal
display only the closest point on each projector
Z-buffer: Advantages
- its complexity is proportional to the number of fragments generated by the rasterizer
- it can be implemented with a small number of additional calculations over what we have to do to project and display polygons without hidden-surface removal
- compatible with pipeline architectures, where it can execute at the speed at which fragments are passing through the pipeline
- easy to implement on a hardware and software level
What is hidden-surface removal
Algorithms that remove those surfaces that should not be visible to the viewer are called hidden-surface-removal algorithms, and algorithms that determine which surfaces are visible to the viewer are called visible-surface algorithms
Z-buffer: Why can’t it handle scenes with opaque and translucent objects?
If all polygons are rendered with the standard z-buffer algorithm, compositing will not be performed correctly, particularly if a translucent polygon is rendered first, and an opaque behind it is rendered later
Z-buffer: How can you modify the algorithm to deal with opaque and translucent objects?
make the z-buffer read-only when rendering translucent polygons, we can prevent the depth information from being updated when rendering translucent objects
If the pixel is part of an opaque polygon, the depth data is updated, but if it is a translucent pixel, the depth data is not updated.
Depth Sort
order all the polygons by how far away from the viewer their maximum z-value is. If no two polygons’ z-extents overlap, we can paint the polygons back to front and we are done
Depth Sort vs Z-buffer: Rasterization
- Rasterization is done polygon by polygon using some rasterization algorithm. For each fragment on the polygon corresponding to the intersection of the polygon with a ray through a pixel, we compute the depth from the centre of projection. The method compares this depth to the value in the z-buffer corresponding to this fragment. If this depth is greater than the depth in the z-buffer, this fragment is discarded
- order all the polygons by how far away from the viewer their maximum z-value is. If no two polygons’ z-extents overlap, we can paint the polygons back to front and we are done
Depth Sort vs Z-buffer: Type of algorithm
-
-
Depth Sort Scenes that are difficult to render
- Cyclic overlap
Back-face Culling
- A polygon is facing forward if and only if 𝑛∙𝑣≥0, where 𝑣 is in the direction of the viewer and 𝑛 is the normal to the front face of the polygon
- Reduce the work required for hidden-surface removal by eliminating all back-facing polygons before we apply any other hidden-surface-removal algorithms