Hidden-surface Determination
   HOME

TheInfoList



OR:

In
3D computer graphics 3D computer graphics, sometimes called Computer-generated imagery, CGI, 3D-CGI or three-dimensional Computer-generated imagery, computer graphics, are graphics that use a three-dimensional representation of geometric data (often Cartesian coor ...
, hidden-surface determination (also known as shown-surface determination, hidden-surface removal (HSR), occlusion culling (OC) or visible-surface determination (VSD)) is the process of identifying what
surfaces A surface, as the term is most generally used, is the outermost or uppermost layer of a physical object or space. Surface or surfaces may also refer to: Mathematics *Surface (mathematics), a generalization of a plane which needs not be flat * Sur ...
and parts of surfaces can be seen from a particular viewing angle. A hidden-surface determination
algorithm In mathematics and computer science, an algorithm () is a finite sequence of Rigour#Mathematics, mathematically rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algo ...
is a solution to the
visibility problem In geometry, visibility is a mathematical abstraction of the real-life notion of visibility. Given a set of obstacles in the Euclidean space, two points in the space are said to be visible to each other, if the line segment that joins them does n ...
, which was one of the first major problems in the field of 3D computer graphics. The process of hidden-surface determination is sometimes called hiding, and such an algorithm is sometimes called a hider. When referring to line rendering it is known as
hidden-line removal In 3D computer graphics, solid objects are usually modeled by polyhedra. A face of a polyhedron is a planar polygon bounded by straight line segments, called edges. Curved surfaces are usually approximated by a polygon mesh. Computer programs ...
. Hidden-surface determination is necessary to render a scene correctly, so that one may not view features hidden behind the model itself, allowing only the naturally viewable portion of the graphic to be visible.


Background

Hidden-surface determination is a process that identifies which surfaces are not visible to the user (for example, because they lie behind opaque objects such as walls). Despite advances in hardware capability,
rendering algorithm Rendering is the process of generating a photorealistic or non-photorealistic image from input data such as 3D models. The word "rendering" (in one of its senses) originally meant the task performed by an artist when depicting a real or imag ...
s require substantial computational resources. By deciding that certain surfaces do not need to be rendered because they are not visible, rendering engines can improve efficiency, allowing the rendering of large world spaces. There are many techniques for hidden-surface determination, but they generally rely on
sorting Sorting refers to ordering data in an increasing or decreasing manner according to some linear relationship among the data items. # ordering: arranging items in a sequence ordered by some criterion; # categorizing: grouping items with similar p ...
the surfaces based on their distance from the viewer. Sorting large quantities of graphics primitives can be computationally-expensive and is usually done by
divide and conquer The term divide and conquer in politics refers to an entity gaining and maintaining political power by using divisive measures. This includes the exploitation of existing divisions within a political group by its political opponents, and also ...
. The different hidden-surface determination techniques differ, in part, through the way in which the space is partitioned prior to sorting.


Algorithms

A
rendering pipeline The computer graphics pipeline, also known as the rendering pipeline, or graphics pipeline, is a framework within computer graphics that outlines the necessary procedures for transforming a 3D computer graphics, three-dimensional (3D) scene into ...
typically entails the following steps:
projection Projection or projections may refer to: Physics * Projection (physics), the action/process of light, heat, or sound reflecting from a surface to another in a different direction * The display of images by a projector Optics, graphics, and carto ...
,
clipping Clipping may refer to: Words * Clipping (morphology), the formation of a new word by shortening it, e.g. "ad" from "advertisement" * Clipping (phonetics), shortening the articulation of a speech sound, usually a vowel * Clipping (publications ...
, and rasterization. Some algorithms used in rendering include: ;
Z-buffering A z-buffer, also known as a depth buffer, is a type of data buffer used in computer graphics to store the depth information of fragments. The values stored represent the distance to the camera, with 0 being the closest. The encoding scheme may ...
: During rasterization, the depth (Z value) of each pixel (or ''sample'' in the case of anti-aliasing, but without loss of generality the term ''pixel'' is used) is checked against an existing depth value. If the current pixel is behind the pixel in the Z-buffer, the pixel is rejected, otherwise, it is shaded and its depth value replaces the one in the Z-buffer. Z-buffering supports dynamic scenes easily and is currently implemented efficiently in graphics hardware. This approach is the current standard. Z-buffering requires up to 4 bytes per pixel, and can have a substantial computational cost since the rasterization algorithm needs to check each rasterized sample against the Z-buffer. The Z-buffer algorithm can suffer from artifacts due to precision errors (also known as
Z-fighting Demonstration of z-fighting with multiple colors and textures over a grey background Z-fighting, also called stitching or planefighting, is a phenomenon in 3D rendering that occurs when two or more primitives have very similar distances to the ...
). ; Coverage buffers () and surface buffer ( S-buffer): Faster than Z-buffering and commonly used in games such as Quake I, these approaches store information about already displayed segments for each line of the screen (in contrast of storing each pixel as is the case for Z-buffering). New polygons are then cut against already displayed segments that would hide them. An S-buffer can display unsorted polygons, while a C-buffer requires polygons to be displayed from the nearest to the furthest. Because the C-buffer technique does not require a pixel to be drawn more than once, the process is slightly faster. This approach was commonly used with
binary space partitioning In computer science, binary space partitioning (BSP) is a method for space partitioning which recursively subdivides a Euclidean space into two convex sets by using hyperplanes as partitions. This process of subdividing gives rise to a representa ...
(BSP) trees. ; Sorted active edge list: Used in Quake I, this technique stores a list of the edges of already displayed polygons (see
scanline rendering Scanline rendering (also scan line rendering and scan-line rendering) is an algorithm for visible surface determination, in 3D computer graphics, that works on a row-by-row basis rather than a polygon-by-polygon or pixel-by-pixel basis. All of ...
). Polygons are displayed from the nearest to the furthest. New polygons are clipped against already displayed polygons' edges, creating new polygons to display, then storing the additional edges. Such an approach is harder to implement than S/C/Z-buffers, but it scales much better with increased image resolution. ;
Painter's algorithm The painter's algorithm (also depth-sort algorithm and priority fill) is an algorithm for Hidden-surface determination#Visible surface determination, visible surface determination in 3D computer graphics that works on a polygon, polygon-by-polyg ...
: This algorithm sorts polygons by their
barycenter In astronomy, the barycenter (or barycentre; ) is the center of mass of two or more bodies that orbit one another and is the point about which the bodies orbit. A barycenter is a dynamical point, not a physical object. It is an important con ...
and draws them back to front. This approach produces few artifacts when applied to scenes with polygons of similar size forming smooth meshes and
back-face culling In computer graphics, back-face culling determines whether a polygon that is part of a solid needs to be drawn. Polygons that face away from the viewer do not need to be drawn, as they will be obscured by other polygons facing the viewer. This pr ...
turned on. The drawbacks are the computational cost of the sorting step and the fact that visual artifacts can occur. This algorithm can fail for general scenes, as it cannot handle polygons in various common configurations, such as surfaces that intersect each other. ;
Binary space partitioning In computer science, binary space partitioning (BSP) is a method for space partitioning which recursively subdivides a Euclidean space into two convex sets by using hyperplanes as partitions. This process of subdividing gives rise to a representa ...
(BSP): This technique divides a scene along planes corresponding to polygon boundaries. The subdivision is constructed in such a way as to provide an unambiguous depth ordering from any point in the scene when the BSP tree is traversed. The main disadvantage of the technique is the high computational cost of the construction of the BSP tree. As a result, this approach is less suitable for scenes consisting of dynamic geometry. The advantage of BSP is that the data is pre-sorted and error-free, and can be used as input for the previously mentioned algorithms. Note that the BSP is not a solution to hidden-surface removal, only an aid. ; Ray tracing: Ray tracing attempts to model the path of light rays to a viewpoint by tracing rays from the viewpoint into the scene. Although not a hidden-surface removal algorithm as such, it implicitly solves the hidden-surface removal problem by finding the nearest surface along each view-ray. Effectively this approach is equivalent to sorting all the geometry on a per-pixel basis. ; The
Warnock algorithm The Warnock algorithm is a hidden surface algorithm invented by John Warnock that is typically used in the field of computer graphics. It solves the problem of rendering a complicated image by recursive subdivision of a scene until areas are ob ...
: This algorithm divides the screen into smaller areas and sorts triangles within these. If there is ambiguity (i.e., polygons overlap in-depth extent within these areas), then further subdivision occurs. At the limit, the subdivision may occur down to the pixel level.


Culling and visible-surface determination

A related area to visible-surface determination is ''culling'', which usually happens before visible-surface determination in a rendering pipeline. Primitives or batches of primitives can be rejected in their entirety, which ''usually'' reduces the computational load in a rendering system.Types of culling algorithms include:


Viewing-frustum culling

The
viewing frustum In 3D computer graphics, a viewing frustum or view frustum is the region of space in the modeled world that may appear on the screen; it is the field of view of a perspective virtual camera system. The view frustum is typically obtained by t ...
is a geometric representation of the volume visible to the
virtual camera In 3D computer graphics, 3D video games, a virtual camera system aims at controlling a camera or a set of cameras to display a view of a 3D virtual world. Camera systems are used in video games where their purpose is to show the action at the b ...
. Naturally, objects outside this volume will not be visible in the final image, so they are discarded. Often, objects lie on the boundary of the viewing frustum. These objects are cut into pieces along this boundary in a process called
clipping Clipping may refer to: Words * Clipping (morphology), the formation of a new word by shortening it, e.g. "ad" from "advertisement" * Clipping (phonetics), shortening the articulation of a speech sound, usually a vowel * Clipping (publications ...
, and the pieces that lie outside the frustum are discarded as there is no place to draw them.


Back-face culling

With 3D objects, some of the object's surface is facing the camera, and the rest is facing away from the camera, i.e. is on the backside of the object, hindered by the front side. If the object is completely opaque, those surfaces never need to be drawn. These surfaces are determined by the vertex winding order: if the triangle drawn has its vertices in clockwise order on the projection plane when facing the camera, they switch into counter-clockwise order when the surface turns away from the camera. Incidentally, this approach also makes the objects completely transparent when the viewpoint camera is located inside them, because then all the surfaces of the object are facing away from the camera and are culled by the renderer. To prevent this artifact, the object must be set as double-sided (i.e. no back-face culling is done) or have separate inside surfaces.


Contribution culling

Often, objects are so far away that they do not contribute significantly to the final image. These objects are thrown away if their screen
projection Projection or projections may refer to: Physics * Projection (physics), the action/process of light, heat, or sound reflecting from a surface to another in a different direction * The display of images by a projector Optics, graphics, and carto ...
is too small. See
Clipping Clipping may refer to: Words * Clipping (morphology), the formation of a new word by shortening it, e.g. "ad" from "advertisement" * Clipping (phonetics), shortening the articulation of a speech sound, usually a vowel * Clipping (publications ...
.


Occlusion culling

Objects that are entirely behind other opaque objects may be culled. This is a very popular mechanism to speed up the rendering of large scenes that have a moderate to high
depth complexity Depth(s) may refer to: Science and mathematics * Depth (ring theory), an important invariant of rings and modules in commutative and homological algebra * Depth in a well, the measurement between two points in an oil well * Color depth (or "n ...
. There are several types of occlusion culling approaches: *
Potentially visible set In 3D computer graphics, Potentially Visible Sets are used to accelerate the rendering of 3D environments. They are a form of occlusion culling, whereby a candidate set of ''potentially visible'' polygons are pre-computed, then indexed at run- ...
(''PVS'') rendering divides a scene into regions and pre-computes visibility for them. These visibility sets are then indexed at run-time to obtain high-quality visibility sets (accounting for complex occluder interactions) quickly. *
Portal rendering In computer-generated imagery and real-time 3D computer graphics, portal rendering is an algorithm for visibility determination. For example, consider a 3D computer game environment, which may contain many polygons, only a few of which may be v ...
divides a scene into cells/sectors (rooms) and portals (doors), and computes which sectors are visible by clipping them against portals. Hansong Zhang's dissertation "Effective Occlusion Culling for the Interactive Display of Arbitrary Models" describes an occlusion culling approach.


Divide and conquer

A popular theme in the visible surface determination literature is
divide and conquer The term divide and conquer in politics refers to an entity gaining and maintaining political power by using divisive measures. This includes the exploitation of existing divisions within a political group by its political opponents, and also ...
. The
Warnock algorithm The Warnock algorithm is a hidden surface algorithm invented by John Warnock that is typically used in the field of computer graphics. It solves the problem of rendering a complicated image by recursive subdivision of a scene until areas are ob ...
pioneered dividing the screen.
Beam tracing Beam tracing is an algorithm to simulate wave propagation. It was developed in the context of computer graphics to render 3D scenes, but it has been also used in other similar areas such as acoustics and electromagnetism simulations. Beam tracin ...
is a ray-tracing approach that divides the visible volumes into beams. Various screen-space subdivision approaches reduce the number of primitives considered per region, e.g. tiling, or screen-space BSP clipping. Tiling may be used as a preprocess to other techniques. Z-buffer hardware may typically include a coarse "hi-Z", against which primitives can be rejected early without rasterization. Such an approach is a form of occlusion culling. Bounding volume hierarchies (BVHs) are often used to subdivide the scene's space (examples are the
BSP tree In computer science, binary space partitioning (BSP) is a method for space partitioning which recursively subdivides a Euclidean space into two convex sets by using hyperplanes as partitions. This process of subdividing gives rise to a represent ...
, the
octree An octree is a tree data structure in which each internal node has exactly eight child node, children. Octrees are most often used to partition a three-dimensional space by recursive subdivision, recursively subdividing it into eight Octant (geo ...
and the kd-tree). This approach allows visibility determination to be performed hierarchically: if a node in the tree is considered to be ''invisible'', then all of its child nodes are also invisible, and no further processing is necessary (they can all be rejected by the renderer). If a node is considered ''visible'', then each of its children needs to be evaluated. This traversal is effectively a tree walk, where invisibility/occlusion or reaching a leaf node determines whether to stop or whether to recurse, respectively.


See also

*
Clipping Clipping may refer to: Words * Clipping (morphology), the formation of a new word by shortening it, e.g. "ad" from "advertisement" * Clipping (phonetics), shortening the articulation of a speech sound, usually a vowel * Clipping (publications ...


Sources


Hidden Surface DeterminationA Characterization of Ten Hidden-Surface Algorithms
(
Wayback Machine The Wayback Machine is a digital archive of the World Wide Web founded by Internet Archive, an American nonprofit organization based in San Francisco, California. Launched for public access in 2001, the service allows users to go "back in ...
copy) {{Computer graphics 3D rendering Computer graphics algorithms fr:Détermination des surfaces cachées