0
4.7kviews
Explain any one Hidden surface removal algorithm in detail.

Mumbai University > Mechanical Engineering > Sem 7 > CAD/CAM/CAE

Marks: 10M

Year: May 2013, Dec 2013

1 Answer
1
84views
  • Z-buffering is an image space algorithm.
  • Algorithm:

    for each polygon P
    
    {for each pixel (x, y) in P 
    
    {compute z_depth at x, y
    
    if z_depth < z_buffer (x, y) then
    
    set_pixel (x, y,color) 
    
    z_buffer (x, y) <= z_depth}}
    

enter image description here

  • The algorithm is usually applied to scenes containing polygon surface, because depth values can be computed very quickly and the method is easy to implement.
  • Each surface of a screen is processed separately, one point at a time across the surface.
  • With object description converted to projection coordinates, each (x,y,z) position on a polygon surface corresponds to the orthographic projection point (x,y) on the view plane. Therefore for each pixel position on the view plane, object depths can be compared by comparing z values.
  • Z-buffer method requires two buffer areas namely depth buffer and refresh buffer. Depth buffer stores the z value of the pixel and the refresh buffer stores the intensity values for each position.
  • If the determined z-value of the pixel position is smaller, which means its closer to the view point, then the depth buffer value at that point is changed to the pixel's value, and that pixel's intensity is saved in the refresh buffer.
  • Advantages:

    • Easy to implement
    • Simple hardware implementation
    • Online algorithm (i.e., we don’t need to load all polygons at once in order to run algorithm)
  • Disadvantages

    • Doubles memory requirements (at least)
    • Scale/device dependent
    • Can't do transparent surfaces without additional code
Please log in to add an answer.