Depth Buffering
Algorithm:
Cast a ray from the viewpoint through each pixel to find the closest surface
Rendering Loop:
set depth of all pixels to ZMAX
foreach primitive in scene
determine pixels touched
foreach pixel in primitive
compute z at pixel
if (z < depth) then
pixel = object color
depth = z
endif
endfor
endfor
|
|