Hidden Surface Removal
Visible surface detection methods are of 2 types: Object Space method and Image Space method.
Object Space Algorithms - compares objects as a whole to determine which object / surface should be visible. Eg: line - display algorithms.
Image Space Algorithms - Visibility is decided point by point at each pixel position at projection plane.
Sorting and coherence methods
Sorting : to facilitate depth comparison by ordering according to depth
Coherence : to take advantage of regularities in a surface.
Algorithms
Back face detection
based on inside - outside tests. Point (x,y) is inside a polygon surface if Ax + By + Cz + D < 0 , or V.N > 0 , where N is the normal vector of the surface, and V is the vector in eye's viewing direction.
Z - Buffer / Depth Buffer Method
compare surface depth at each pixel. Easy, quick - for polygon surfaces. 2 buffer areas - 1) depth buffer : to store depth values for each position(x,y) while processing, 2) refresh buffer : to store intensity values for each position.
Depth buffer initialized with 0, refresh buffer initialized with background intensity. As surfaces listed in polygon tables are processed, depth for each pixel is calculated and compared with current value. Smaller depth is stored, and corresponding surface intensity is stored in refresh buffer.
'A' Buffer Algorithm
Anti-aliased, area averaged, accumulation buffer method. Accommodates z-buffer for transparency. 'A' Buffer method expands depth buffer so that each pixel can reference a set of surfaces (linked list), so more than 1 surface intensity can be considered, and object edges can be antialiased. 'A' buffer method has 2 fields: depth field and intensity field. If depth field is positive, it implies single surface at pixel area, otherwise multiple surfaces (negative depth field value), in which case intensity buffer/refresh buffer stores linked list of surface data, such as rgb intensity components (a parameter which is used in all cases), opacity, depth, percentage of area coverage, surface identifier, pointer to next surface, and other parameters.
Scan Line Method
At each scan line, all polygon surfaces intersecting at that point are determined and depths are calculated to find the visible surface. It is similar to depth buffer, but instead of checking each pixel, we check line-wise, so scan line methods are good for geometrical objects.
Depth Sort / Painter's Algorithm
Sort surfaces in decreasing order of depth, scan convert surfaces in order. This is analogous to a painter's style - first the lowest layers are painted, then the layer above it, and so on. The objects at lowest depth are painted last, and those that are most depth, which may even not be visible eventually are painted first.
BSP Tree Method
Binary Space Partitioning: Efficient. Applying BSP tree to visibility testing involves identifying surfaces that are inside and outside partitioning plane at each step of space subdivision. In BSP tree, objects are terminal nodes, front objects as left branches, back objects as right branches.
Area Subdivision Method
takes advantage of area coherence by locating view areas that represent part of single surface. Divide total area into smaller and smaller areas such that each small area is the projection of part of single surface, or it contains no surface at all (empty).