3. Z-BUFFER METHOD
• Also known as depth-buffer method
• Proposed by Catmull in 1974
• Easy to implement
• Z-buffer is like frame buffer , contain depths
• Two buffers are used –
-Frame Buffer
-Depth Buffer
4. Z-BUFFER ALGO
• Initialize all d[I,j]=1.0(max depth),c[I,j]=background color
For(each polygon)
For(each pixel in polygon projection)
{
Find depth-z of polygon at (x,y) corresponding to pixel (I,j)
If z<d[I,j]
C[I,j]=color;
End
}
5. IMP POINTS
• Z buffer method does not require pre-sorting of
polygons.
• This method can be executed quickly even with
many polygons.
• This can be implemented in hardware to
overcome the speed problem.
• No object to object comparison is required.
• This method can be applied to non-polygonal
objects.
• Hardware implementation of this algorithm are
available in some graphics workstations.
• The z-value of a polygon can be calculated
incrementally.
6. Uses:
The Z-buffer is a technology used in almost all
contemporary computers, laptops, and mobile phones for
performing 3D computer graphics.
The primary use now is for video games, which require fast
and accurate processing of 3D scenes
The Z-buffer is implemented in hardware within consumer
graphics cards.
The Z-buffer is also used (implemented as software as
opposed to hardware) for producing computer-generated
special effects for films.
7. Advantages:
A. It is simple to use.
B. Any kind of opaque surface
can be handled/removed.
C. It displays complex surface
intersections easily.
D. No depth storing of
objects is needed and
hence computational
complexity is linear.
8. Disadvantages:
A. Storage requirements are higher.
B. Since depth storing is not done, a location
in the z-buffer may have to be changed
many times depending on the number of
surfaces representing the scene.
C. It is a time-consuming process as it
needs to scan and convert every
polygon.
D. The space involved is very large. At
least it requires X*Y size of the
buffers.