Hidden Surface Removal
CS-116A: Introduction to Computer Graphics
Instructor: Rob Bruce
Fall 2016

SLIDE 1: Hidden surface removal: Occlusion example

Image of a toroid, icosahedron, and a tetrahedron at different depths in 3-dimensional space. These shapes are stacked on top of each other. Some of the surfaces are hidden by other surfaces. This demonstrates occlusion.

SLIDE 2: Visibility detection: Methods

  • Z-buffer method
  • A-buffer method
  • Scan-line method
  • Depth-sorting method
  • Binary Space-Partitioning (BSP) tree method
  • Area-subdivision method
  • Octree method
  • Ray-Casting method

Source: Computer Graphics with OpenGL, pp. 481-495

SLIDE 3: Visibility detection method: Z-buffer

  • Z-buffer method:
  • Object depth computed one pixel at a time to determine visible surfaces.
  • Depth buffer used to store information about each pixel’s depth for a given object.
  • Disadvantage: can’t average pixel colors when pixels have transparency (opacity). In other words, this algorithm only works with solid surfaces!

Source: Computer Graphics with OpenGL, pp. 481-482, 485.

SLIDE 4: Visibility detection method: A-buffer

  • A-buffer method.
  • Similar to Z-buffer method.
  • "antialiasing, area-averaging, visibility detection method..."
  • Transparent pixel color influenced by other pixels behind the transparent pixel. In other words, transparent surfaces in the foreground allow visibility of objects behind them.

Source: Computer Graphics with OpenGL, pp. 484-485.

SLIDE 5: Visibility detection method: Scan-line

  • Scan-line method.
  • Horizontally scan left to right, top to bottom to determine depth values for various objects on the screen.
  • Depth values evaluated only for surfaces which overlap.

Source: Computer Graphics with OpenGL, pp. 486-487.

SLIDE 6: Visibility detection method: Depth-sorting

  • Depth-sorting method.
  • Also referred to as the “painter’s algorithm”. Think about painting a picture. You layer one color of paint on top of other layers. The layers underneath are effectively covered by the top layer.
  • Procedure:
  • "Surfaces are sorted in order of decreasing depth."
  • "Surfaces are scan-converted in order, starting with the surface of greatest depth."
  • Surfaces are effectively stacked on top of other surfaces on the canvas (visible screen) from smallest Z-axis value to largest Z-axis value.

Source: Computer Graphics with OpenGL, pp. 487-490.

SLIDE 7: Visibility detection method: BSP-tree

  • BSP-tree (Binary Space-Partitioning) method.
  • Binary tree with left and right branches: left branch = object is in front (visible), right branch = object is in back (object is occluded).
  • "...useful when the view reference point changes, but the objects in a scene are at fixed positions."
  • Tree is traversed in order of objects appearing from back to front.

Source: Computer Graphics with OpenGL, pp. 490-491.

SLIDE 8: Visibility detection method: Area-subdivision

  • Area-Subdivision method
  • "...successively dividing the total view-plane area into smaller and smaller rectangles until each rectangular area contains the projection of part of a single visible surface, contains no surface projections, or the area has been reduced to the size of a pixel."
  • Surface subdivision stops when one of the following conditions is satisfied:
    "Condition 1: An area has no inside, overlapping, or surrounding surfaces (all surfaces are outside the area)."
    "Condition 2: An area has only one inside, overlapping, or surrounding surface."
    "Condition 3: An area has one surrounding surface that obscures all other surfaces with the area boundaries."

Source: Computer Graphics with OpenGL, pp. 491-493.

SLIDE 9: Area-subdivision: surface cases

Four image cases demonstrating different situations for hidden surfaces: one object encapsulated by another object, one object overlapping with another object, one object inside of another object, and two objects completely separate with no overlapping surfaces.

Source: Computer Graphics with OpenGL, p. 492.

SLIDE 10: Visibility detection method: Ray-casting

  • Ray-casting method.
  • Cast a ray of light from each pixel position to the nearest object to determine visible surfaces.
  • An effective method for curved surfaces such as spheres.

Source: Computer Graphics with OpenGL, pp. 494-495.