CS 184: COMPUTER GRAPHICS


PREVIOUS < - - - - > CS 184 HOME < - - - - > CURRENT < - - - - > NEXT
MIDTERM EXAM will be on Tuesday, November 9, in class.

Lecture #18 -- Th: 10/28, 2004.

Review: Polygon Filling, Rasterization

Warm-up Exercises:

  • What is inside of a polygon ?
  • Who owns which pixels ?
  • Details of the Sweep-line Algorithm

    Processing one polygon at a time: Datastructures:
        -- Scene Graph -- Display List -- Edge Table -- Active Edge List.
    Preprocessing:
        -- Bucket-sort all polygon edges into the Edge Table.
        -- Inserting edges into scan-line buckets (details)
    Scan-line Processing:
        -- Details of scan-line processing on active edge list

    Still to do:

  • Deal with features that may obscure one another ...
  • Deal with smoothly varying shading/color on objects ...
  •  

    Visibility Determination, Hidden Feature Elimination

    The Problem:
        -- Some front faces can hide other front faces;
        -- need to determine what should be drawn on display.
    Concept of "Depth Complexity": How many things are stacked behind each other on average ?

    Solution #1: Ray Casting:
        -- Cast a ray from the eye through each pixel into the scene,
        -- determine what surface gets hit first (display that color).

    Solution #2: Painter's Algorithm:
    This is one of several "List-priority Algorithms"
        -- Depth-sort all front-facing polygons;
        -- (over-) paint them back-to-front.
        -- Complete depth sorting is not be possible when there are cyclic overlaps;
        -- then we need to break polygons into smaller parts.
    (There are many other algorithms that break up polygons into smaller parts --> later).

    Solution #3: Horizon-Line Algorithm:
    Suited primarily for height functions and for terrains.
        -- Paint slices through the function from front-to-back.
        -- keep an up-to-date upper (and lower) horizon = silhoutette edge Max-y(x) and perhaps Min-y(x).
        -- The area between these two horizons is shadowed out;
        -- Only draw new elements above and below.

    Solution #4: Z-Buffer
    The z-buffer is a 2D array of storage elements that stores for each pixel (R,G,B)color and a z-depth.
        -- Paint all triangles (one at a time) into the z-buffer (using scan-line-based raster filling;
        -- the front-most pixel and its depth and color will be retained -- and finally displayed.
        -- The z-depth of each pixel can be efficiently calculated by linear interpolation,
            i.e., by fixed incrementation in y and in x (since we assume all polyhedron faces to be planar).
    Extra Notes on Scan-Line Algorithms
     

    Alternative Scan-line Approach: Processing all polygons simultaneously:

    Differences to basic approach above.
    Extra Notes on Sweep-Line-Based Hidden Feature Elimination
     
     


    Reading Assignment:

    Study: 2ndEd:  Ch 7.8 - 7.10; Ch 6.1-6.5;
    Study: 3rdEd:  Ch 8.9 - 8.11;  Ch 6.1-6.5;

    Current Homework Assignment:

    ASG#7  "Scan Conversion and Z-Buffering"
    This assignment can be done with ANY PARTNER
    -- possibly the one with whom you might do the final project.
    PREVIOUS < - - - - > CS 184 HOME < - - - - > CURRENT < - - - - > NEXT
    Page Editor: Carlo H. Séquin