Depth Buffer Method
Depth Buffer Method
Z= (-Ax-By-D)/C
Depth Values across the edge are calculated by:
Z’= (-A(x+1)-By-D)/C
Depth Values down the edge are recursively calculated by:
Z’= Z + [(A/m)+B]/C
Depth buffer is used to store depth values for (x,y) position, as surfaces
are processed (0 < depth < 1).
The frame buffer is used to store the intensity value of colour value at
each position (x,y). The z-coordinates
are usually normalized to the range [0,1]
The 0 value for z-coordinate indicates
back clipping pane and 1 value for
z-coordinates indicates front clipping
pane.
ALGORITHM: -
Step 1: - Set the buffer values –
Depthbuffer (x,y) = 0
Framebuffer (x,y) = background colour
Step 2: - Process each polygon (One at a time) For each projected (x,y)
pixel position of a polygon, calculate depth z.
If Z > depthbuffer (x,y)
Compute surface color,
set depthbuffer (x,y) = z,
framebuffer (x,y) = surfacecolor (x,y)
Advantages: -
It is easy to implement.
Accurate performance.
Disadvantages: -
It requires large memory.