Home / Computer Graphics / Z buffer algorithm Advantages and Disadvantages

Z buffer algorithm Advantages and Disadvantages

Z (depth) Buffer Algorithm
For each polygon {
for each pixel (x, y) inside the polygon projection area { if
(z_polygon_pixel(x,y) < depth_buffer(x,y)){
depth_buffer(x,y) = z_polygon_pixel(x,y);
color_buffer(x,y) = polygon color at (x,y) }
}
}

}

Z (depth) Buffer Algorithm –

 
Advantages:

• Simple to use
• Can be implemented easily in object or image space
• Can be executed quickly, even with many polygons.

Disadvantages:
• Takes up a lot of memory
• Can’t do transparent surfaces without additional code.