Visible Surface Algorithms




CS216

Chris Pollett

Apr 15, 2010

Outline

Introduction

Visible Surface Algorithms

High-Level Object Precision

for each object O in the world do
  begin
    Find the part A of O that is visible
    Display A appropriately
  end;

High-Level Image Precision

for each pixel on the screen do
  begin
    Determine the visible object O that is pierced
      by the ray from the viewer determined by the pixel
    if there is such an O
      then display the pixel appropriately
      else display the pixel in the background color
  end;

High-Level List Priority Algorithms

Precompute for each object a visibility ordering
Scan convert objects to image space in a back-to-front order

Back Face Elimination

Schumacker List Priority Algorithm (1969 - used in Flight Simulators)

A nonconvex polygon with priorities on its edges

Newell-Newell-Sancha Depth Sorting (1972)

More on Newell-Newell-Sancha Depth Sorting

Three pictures from the depth sorting checks

The BSP Algorithm

Constructing the BSP Tree

The steps to construct the BSP tree are as follows:

  1. Select any polygon `P` from the current list and place it at the root of the tree.
  2. Each remaining polygon in the list is then tested to see which side of `P` it lies. This is done by comparing signs of the dot products of the normal of `P` with the normals with the plane of defined given by the vector between a vertex of the other polygon and the plane given by `P`. If a polygon lies on the same side as `P` we put it in the left subtree list, otherwise, we put it in the right subtree list. If a polygon straddles `P`s plane, divide it along that plane and put each the pieces in the appropriate subtree list.
  3. We then repeat this procedure recursively on the two subtrees.

To make this algorithm faster one often takes in Step (1) the polygon that cuts the fewest other polygons. In fact, it often suffices for efficiency just to pick five polygons at random and choose amongst these the one that cuts the fewest polygons.

BSP Traversal