1. Definition
Hidden Surface Removal (HSR) is the process of determining which surfaces (or parts of surfaces) of 3D objects are visible from a viewpoint and which are hidden behind other objects.
- Ensures that only the visible surfaces are rendered.
- Improves realism and avoids unnecessary computation.
The Z-buffer (Depth Buffer) technique is one of the most widely used methods for HSR.
2. Z-Buffer Method
Z-buffering stores depth information for each pixel on the screen to determine which surfaces are visible.
2.1 Concept
3. Steps of Z-Buffer Algorithm
-
Initialize Buffers
- Framebuffer: stores the color of each pixel.
- Z-buffer: stores the depth (z-value) of each pixel. Initialize all values to far plane depth.
-
Scan Each Polygon
- For every pixel covered by the polygon:
a. Compute interpolated z-value for that pixel.
b. Compare with Z-buffer value.
-
Update Buffers
-
Result
- After processing all polygons, the framebuffer contains only the visible surfaces.
4. Advantages
- Simple and general: Works for any 3D scene with overlapping objects.
- Handles arbitrary polygons.
- Compatible with hardware acceleration, making it fast for real-time graphics.
5. Disadvantages
- Memory-intensive: Requires a Z-buffer the same size as the framebuffer.
- No automatic transparency handling: Transparent surfaces need special handling.
- Precision issues: Limited depth precision may cause Z-fighting when surfaces are very close.
6. Summary Table
| Aspect |
Description |
| Purpose |
Remove hidden surfaces in 3D rendering |
| Technique |
Z-buffer (depth buffer) |
| How it works |
Stores depth per pixel; updates color only if new depth is closer |
| Pros |
Simple, general, hardware-friendly |
| Cons |
Memory usage, limited depth precision, transparency handling |
Key Points:
- Z-buffering is a per-pixel technique for hidden surface removal.
- It compares depth values of surfaces to determine visibility.
- Essential for realistic 3D rendering in games, CAD, and simulations.