Semester
Subject
Year
Tribhuwan University
2081
Bachelor Level / Third Year / Fifth Semester / Science
(Computer Graphics)
Full Marks: 60
Pass Marks: 24
Time: 3 Hours
Candidates are required to give their answers in their own words as for as practicable.
The figures in the margin indicate full marks.
Long Answers Questions
Z-Buffer (Depth Buffer) method is an image-space approach for visible surface detection that compares surface depths at each pixel position on the projection plane to determine which surface is closest to the viewer and should be displayed.
The Z-Buffer method uses two buffers:
For every pixel, the algorithm checks whether the current polygon's depth is less than (closer to viewer) the value stored in the depth buffer. If yes, it updates both buffers.
a. Initialize the depth buffer to the maximum depth value (farthest distance, typically 1 or ∞)
b. Initialize the frame buffer to the background color
c. For each polygon in the scene:
d. Display the frame buffer
For a plane with equation , the depth at any point is:
For the next pixel along a scan line :
This incremental calculation makes the method efficient.
| Limitation | Solution |
|---|---|
| Large memory | Use scanline Z-buffer which processes one scan line at a time, reducing buffer to one row |
| Aliasing | Apply anti-aliasing techniques (super-sampling, area averaging) |
| Transparency | Use A-buffer (Accumulation buffer) which stores a list of surfaces at each pixel with opacity values |
| Z-fighting | Increase depth buffer precision (use 32-bit instead of 16-bit), or offset overlapping polygons slightly |
| Overdraw | Use front-to-back rendering with early depth testing, or apply spatial subdivision (BSP trees, octrees) to cull hidden objects before rasterization |
| Shadows | Combine with shadow mapping techniques using a secondary depth buffer from light's viewpoint |
The Z-Buffer method is the most widely used visible surface detection algorithm due to its simplicity and hardware compatibility. Its limitations regarding memory and aliasing are effectively overcome using modern techniques like the A-buffer, anti-aliasing, and hierarchical depth testing, making it the standard in real-time graphics and GPU architectures.
Short Answers Questions