Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Hidden-surface determination
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Algorithms == A [[rendering pipeline]] typically entails the following steps: [[Graphical projection|projection]], [[Clipping (computer graphics)|clipping]], and [[rasterization|rasterization.]] Some algorithms used in rendering include: ; [[Z-buffering]]: 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]]). ; Coverage buffers ({{visible anchor|C-buffer}}) 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]] (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]]). 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]]: This algorithm sorts polygons by their [[Centroid|barycenter]] 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]] 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]] (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 (graphics)|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]]: 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)