---
title: "Z-buffer method with limitation"
subject: "Computer Graphics"
chapter: 7
key: "semester_5/computer_graphics:z-buffer-with-limitation"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/z-buffer-with-limitation
site: BCT Engineering
---

# Z-buffer method with limitation

Computer Graphics · Chapter 7: Visible Surface Determination

- Asked in: 2071 Chaitra, 10 marks; 2081 Chaitra (new course), 4 marks; 2070 Chaitra, 7+3 marks (asked 3 times)
- Video: [Z Buffer | Method | CG | Computer Graphics | Lec-53 | Bhanu Priya](https://www.youtube.com/watch?v=FqDNXXgS5dw) — Education 4u
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/z-buffer-with-limitation
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-7

## Question

Explain the Z-buffer algorithm for visible surface detection in detail with its limitation (drawback), along with the steps needed to calculate the depth.

## Short answer

Z-buffer stores nearest depth per pixel; depth is computed incrementally from plane equation: along scan line, z' = z − A/C; along edge, z' = z + (A/m + B)/C. Update pixel if z < stored depth. Limitations: no transparency, aliasing from single sample, memory cost, depth precision issues.

## Answer

#### Z-buffer algorithm
The **Z-buffer (depth-buffer) method** is an image-space method that keeps the nearest surface at every pixel using two arrays:
- zbuf(x, y): depth of the nearest surface so far (initialised to the maximum depth, 1).
- frame(x, y): colour of that surface (initialised to the background).

```text
for each polygon P:
    for each pixel (x,y) in the projection of P:
        z = depth of P at (x,y)
        if z < zbuf(x,y):
            zbuf(x,y) = z
            frame(x,y) = colour of P at (x,y)
```

At the end the frame buffer holds the visible surfaces. Polygons may be processed in any order.

#### Calculating the depth
The plane is Ax + By + Cz + D = 0, so z = (−Ax − By − D)/C.
1. Moving along a scan line, x increases by 1: z' = z − A/C (a constant increment).
2. Moving from a scan line to the next along a left edge with slope m: x' = x − 1/m, y' = y − 1, giving z' = z + (A/m + B)/C.
3. The depth at the top vertex is computed from the plane equation; the other values are found incrementally by addition only.

#### Limitations
1. **No transparency:** only one surface (the nearest) is stored per pixel, so transparent and translucent surfaces cannot be rendered correctly.
2. **Aliasing:** only one sample per pixel, so jagged edges appear and anti-aliasing is difficult.
3. **Extra memory** is needed for the depth buffer (same size as the frame buffer).
4. **Limited depth precision:** two nearby surfaces can have the same quantised depth (z-fighting).
5. Time is spent on surfaces that are finally hidden (overdraw).

The A-buffer method overcomes limitations 1 and 2.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why can the Z-buffer not render transparent surfaces correctly?
   A. It cannot compute depth
   B. Only the nearest surface per pixel is stored, so surfaces behind are discarded
   C. It requires sorting of polygons
   D. It only works on convex objects
   Answer: B. With one value per pixel, nothing behind a transparent surface is kept to blend. (Key point: Main limitation)

2. Moving down to the next scan line along an edge with slope m, what is the new depth?
   A. z' = z + (A/m + B)/C
   B. z' = z - A/C
   C. z' = z + B/C only for all edges
   D. z' = z - (A/m + B)/C
   Answer: A. With x' = x - 1/m and y' = y - 1 substituted in the plane equation this results. (Key point: Edge depth change)

3. What causes z-fighting?
   A. Polygons processed out of order
   B. Missing frame buffer
   C. Limited depth precision gives two nearby surfaces the same quantised depth
   D. Too many scan lines
   Answer: C. Quantised depth values cannot separate very close surfaces. (Key point: Z-fighting)

4. Which method overcomes the transparency and aliasing limitations of the Z-buffer?
   A. Back-face detection
   B. Painter's algorithm
   C. Flat shading
   D. A-buffer
   Answer: D. The A-buffer keeps several surfaces per pixel with area coverage. (Key point: Overcoming limits)

## Related in Computer Graphics

- [Z-buffer (depth buffer) method](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Az-buffer-method-explain) — Computer Graphics, chapter 7, asked 7×
- [Z-buffer limitation and A-buffer](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Az-buffer-limitation-a-buffer) — Computer Graphics, chapter 7
- [VSD factors, classes, Z/A-buffer](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Avisible-surface-factors-classes) — Computer Graphics, chapter 7
- [Back-face detection algorithm](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aback-face-detection-method) — Computer Graphics, chapter 7, asked 8×
- [Scan-line method of visible surface](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Ascan-line-visible-surface) — Computer Graphics, chapter 7, asked 3×
- [A-buffer method](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aa-buffer-method) — Computer Graphics, chapter 7, asked 2×

## Related in other subjects

- [Design steps of surface drainage](https://www.bctengineer.com/question.md?key=semester_6%2Ftransportation_engineering_i%3Asurface-drainage-design-steps) — Transportation Engineering I, chapter 4, asked 3×
- [Square law detector limitation; envelope detector](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Asquare-law-detector-limitation-envelope) — Communication Systems, chapter 2
- [Big-Oh significance and limitation](https://www.bctengineer.com/question.md?key=semester_4%2Fdata_structure_and_algorithm%3Abig-oh-significance-limitation) — Data Structure and Algorithm, chapter 9
- [Buffer criteria; NH₄Cl weight calculation](https://www.bctengineer.com/question.md?key=semester_2%2Fengineering_chemistry%3Abuffer-nh4cl) — Engineering Chemistry, chapter 1
