Depth | Z- Buffer method for visible surface detection | Computer graphics
In this post we are going to discuss one of the most important techniques for visible surface detection. This technique is used after the back-facing technique is used to further reduce the computation time. This method is related to computation of depth of various objects at each and every polygon and hence finding out which objects are going to make it into the final list of the picture.
Depth-Bufferis the variable used to save the depth while
Frame Bufferis the variable used to save the color. In this algorithm we take two 2-dimensional matrix(
n * n) in which each point is represented as
(i, j)is represented as
jthpixel while on the other two-dimensional matrix it represents the position while the value represents the color.
- First, set depth buffer to zero and frame buffer to background color.
- Now for each point in the
n * nmatrix we are going to calculate the depth buffer for each and every polygon.
- The polygon having the least depth buffer at is final and shown in the result. Also, the color of that polygon is given to that frame buffer.
- Easy to use
- Less computation time
- Can be implemented easily even with a lot of polygons
- Lot of space is used due to saving in 2-D matrices * Can’t do transparent rendering.
Did you enjoy reading or think it can be improved? Don’t forget to leave your thoughts in the comments section below! If you liked this article, please share it with your friends, and read a few more!