In the computer graph, z-buffering , also known as buffering depth , is the coordinate depth management of images in 3D graphics, usually done in hardware, sometimes in software. This is one solution to the problem of visibility, which is a matter of deciding which elements of the displayed scene are visible, and which ones are hidden. Z-buffering was first described in 1974 by Wolfgang StraÃÆ'Ã
¸er in Chapter 6 (page 6-1) of his PhD thesis. The painter's algorithm is another common solution which, although less efficient, can also deal with non-opaque scene elements. The depth buffer uses the Picture space method for the detection of hidden surfaces.
When viewing images that contain objects and non-transparent surfaces, it is not possible to see them from a view that is at the back of an object closer to the eye. To get a realistic display image, the removal of this hidden surface should be. The identification and removal of these surfaces is referred to as the Hidden surface problem.
When an object is rendered, the depth of the resulting pixel (z coordinate) is stored in the buffer (the z-buffer or depth buffer ). These buffers are usually arranged as two-dimensional (x-y) arrays with one element for each screen pixel. If another object of the scene should be displayed in the same pixel, the method compares the two depths and overrides the current pixel if the object is closer to the observer. The selected depth is then saved to z-buffer, replacing the old one. In the end, z-buffer will allow the method to reproduce the perception of depth that it usually is: close objects hide that further away. This is called z-culling .
The granularity of the z-buffer has a major effect on the quality of the scene: a 16-bit z buffer can produce artifacts (called "z-fighting" or sutures ) when two objects are very close. one another. 24-bit or 32-bit Z-buffers behave much better, although the problem can not be completely eliminated without additional algorithms. 8-bit Z-buffers are almost never used because of too little precision.
Video Z-buffering
Usage
Z-buffer is a technology used in almost all contemporary computers, laptops and mobile phones to display 3D graphics, for example for computer games. Z-buffer is implemented as hardware in silicon IC (integrated circuit) inside this computer. Z-buffer is also used (implemented as software as opposed to hardware) to produce special effects the computer generates for the movie.
Furthermore, the Z-buffer data obtained from surface rendering from the light-point of view allows for the creation of shadows by the technique of shadow mapping.
Maps Z-buffering
Developments
Even with fairly small granularity, quality problems can arise when the precision in the z-buffer distance value is not spread evenly over the distance. Closer values ââare much more precise (and hence can display closer objects better) than further values. Generally, this is desirable, but sometimes it will cause the artifact to appear as the object becomes further away. The variation in z-buffering that produces more evenly distributed precision is called w-buffering (see below).
At the beginning of a new scene, the z-buffer must be cleared to a specified value, usually, 1.0, since this value is the upper limit (on a scale of 0 to 1) depth, meaning that no object is present at this point through the frustum view.
The discovery of the z-buffer concept is most often associated with Edwin Catmull, although Wolfgang StraÃÆ'Ã
¸er describes this idea in his Ph.D. 1974. months of thesis before the invention of Catmull 1 .
On the latest PC graphics card (1999-2005), the z-buffer management uses a significant portion of the available memory bandwidth. Various methods have been used to reduce the cost of z-buffering performance, such as lossless compression (computer resources to compress/decompress less than bandwidth) and z-clear ultra-fast hardware that obsolescence "one positive frame, one frame" Negative tricks (skip clear inter-frames at all using signed numbers to cleverly check the depth).
src: i.ytimg.com
Z-culling
In rendering, z-culling is the initial pixel removal based on depth, a method that provides improved performance when hidden surface rendering is expensive. This is a direct consequence of z-buffering, in which the depth of each pixel candidate is compared to the depth of the geometry behind it which may be hidden.
When using a z-buffer, a pixel can be destroyed (discarded) as soon as its depth is known, allowing it to pass through all lighting and texturing processes of pixels that will not be visible anyway. Also, the time-consuming pixel shaders will generally not be executed for the pixels captured. This makes z-culling a good optimization candidate in situations where fillrate, lighting, texturing or pixel shaders are the main congestion.
While z-buffering allows geometry to be sorted, sorting polygons by adding depth (so using an inverted painter algorithm) allows each pixel of the screen to render less. This can improve performance in scenes with limited content with large overdraws, but if not combined with z-buffering, it suffers from severe problems such as:
- The polygons may confine each other in one cycle (eg: triangle A closes B, B clogs C, C clogs A), and
- there is no "nearest" canonical point on the triangle (eg: no matter whether one of the triangle types by the center or the nearest point or their furthest point, one can always find two triangles A and B so that A is "closer" but in fact B must be withdrawn first).
Thus, the reversed painter's algorithm can not be used as an alternative to Z-culling (without heavy reengineering), except as a Z-culling optimization. For example, the optimization might be to keep the polygons sorted by x/y-location and z-depth to provide a limit, in an attempt to determine quickly whether two polygons might have an occlusion interaction.
src: i.ytimg.com
Math
Kisaran nilai kedalaman dalam ruang kamera yang akan dirender sering didefinisikan antara dan nilai . Setelah transformasi perspektif, nilai baru , atau , ditentukan oleh:
Setelah proyeksi ortografi, nilai baru , atau , ditentukan oleh:
di mana adalah nilai lama dalam ruang kamera, dan kadang-kadang disebut atau .
Nilai yang dihasilkan dari dinormalisasi antara nilai -1 dan 1, di mana plane berada pada -1 dan plane berada pada 1. Nilai di luar rentang ini sesuai dengan titik-titik yang tidak dalam tampilan frustum, dan tidak boleh ditampilkan.
Representasi titik-tetap
di mana
Ini menunjukkan bahwa nilai dikelompokkan jauh lebih padat di dekat bidang, dan jauh lebih jarang menjauh, menghasilkan presisi yang lebih baik lebih dekat ke kamera. Semakin kecil
Source of the article : Wikipedia