12 - Object Visibility, Occlusions & Clipping Flashcards
View-Frustrum culling
culling that takes place at the clipping stage (discarding the parts of the scene that are not contained within the near-far-left-right-top-bottom defined space)
Back-face culling
improve rendering performance by not rendering the polygons that are facing away from the camera
Occlusion culling
Determining which polygons are rendered when they have the same screen coordinates (xs,ys) by identifying which is closest to the camera (depth)
Two types of occlusion culling
Painters algorithm (object-level)
Z-buffer algorithm (image-level)
Painter’s Algorithm
is to draw the objects in the scene from the furthest to the nearest. This means that objects that are closer to the camera are drawn on top of objects that are further way, as they should appear in the final image.
Painters algorithm flaw
its inability to cope with objects that cannot be ordered from back to front (for example, overlapping objects – see right).
This limitation is addressed by the Z-buffer algorithm.
Z-Buffer algorithm
The Z-buffer algorithm involves using a depth buffer (the Z-buffer) with an entry for every pixel on the screen.
The contents of the (xs, ys) element in the framebuffer is the transformed surface that is closest to the screen at (xs, ys).
z-buffer algorithm
initialising each value of the depth buffer to infinity.
each object in the scene is rendered, one-by-one,
and if its z value is less than what is in the buffer,
the value in the buffer is replaced.
At each point, if the z-value is replaced the contents in the framebuffer are updated
Z - Buffer issue
The Z-buffer algorithm is also unable to cope with transparent/partially transparent polygons,
because if the transparent polygon is at the front, a list of those behind it must be kept