Depth Buffer Method / ZBuffer Method
Depth Buffer Method is the important topic of the Computer Graphics. Moreover, It is the Important subject of the Computer Science & Technological field.
Algorithm forÂ Depth Buffer Method
1) Initialize the depth buffer and refresh buffer so that for all buffer positions(x, y),
 đđđđĄâ(đ„, đŠ) = 0, đđđđđđ â(đ„, đŠ) = đŒđđđđđđđ
2) For each position on each polygon surface, compare depth values to previously stored values inÂ the depth buffer to determine visibility.
3) Calculate the depth z for each (x, y) position on the polygon.
4) If z > depth(x, y), then set
 đđđđĄâ(đ„, đŠ) = đ§, đđđđđđ â(đ„, đŠ) = đŒđ đąđđ (đ„, đŠ)
5) Where đŒđđđđđđđ is the value for the background intensity, and đŒđ đąđđ (đ„, đŠ) is the projectedÂ intensity value for the surface at pixel position (x,y). After all, surfaces have been processed, theÂ depth buffer contains depth values for the visible surfaces and the refresh buffer contains theÂ corresponding intensity values for those surfaces.
End of Algorithm
It is image space approach.
Moreover, It compares surface depth at each pixel position on the projection plane.
It also referred to as zbuffer method since generally depth is measured in the zdirection.
Each surface of the scene processed separately one point at a time across the surface.
 Fig for Depth Buffer Method, A view plane position (x, y), surface s_{1} has the smallest depth from the view plane and so is visible at that position.
 We are starting with the pixel position of view plane and for a particular surface of an object.
 If we take the orthographic projection of any point (x,y,z) of the surface on the view plane we get twodimension coordinate (x,y) for that point to display.
 Here we are taking (x.y) position on plan and find particular surface is how much depth.
 We can implement depth buffer algorithm in normalized coordinates so that z values range from 0 at the back clipping plane to zmax at the front clipping plane.

Zmax value can be 1 for unit cube or the largest value. [ Depth Buffer Method ]
 Here two buffers required. A depth buffer to store depth value of each (x,y) position and refresh buffer to store corresponding intensity values.
 Initially, depth buffer value 0 and refresh buffer value is an intensity of the background.
 Each surface of the polygon then processed one by one scanline at a time.
 Calculate the z values at each (x,y) pixel position.
 If calculated depth value is greater than the value stored in depth buffer it replaced with newly calculated values and store intensity of that point into refresh buffer at (x,y) position.
 Also, Depth values calculated from plane equation đŽđ„ + đ”đŠ + đ¶đ§ + đ· = 0 as: Z = (AxByD)/C
Related Terms
Computer Graphics, General Projection Transformations, VisibleSurface Detection Algorithms, Perspective Projection
Leave a Reply