CSE 386: Foundations of Computer Graphics and Games

Catalog Description:

This course is an introduction to techniques used to create images on the computer. The course covers the algorithms and mathematical theory behind three dimensional image generation with an emphasis on 3D geometry, 3D transformations, and the graphics pipeline. Programming required.


(CSE 274 or CSE 278) and MTH 151

Required topics (approximate weeks allocated):

  • Course introduction (0.5)
    • Image-order vs object-order rendering
    • Low-level graphics APIs vs software rendering
  • Mathematics for computer graphics (2.5)
    • Trigonometry review
    • Vectors and vector operations
    • Matrices and matrix operations
  • Colors (0.5)
    • RGB color model
    • Alpha blending
    • Raster displays vs vector displays
  • Lighting and shading (2.0)
    • Vectors used in lighting equations
    • Equations for ambient, diffuse, and specular color
    • Positional lights and spotlights
    • Shadows
  • Textures (0.5)
    • Applying 2D textures to 3D surfaces
    • Texture mapping
  • Image order rendering (4.0)
    • Raytracing overview
    • Orthographic and perspective projection
    • Computing a camera’s coordinate frame
    • Generating viewing rays
    • Ray object intersections
    • Optional ray tracing features such as: viewports, reflections, and shadows
  • Object order rendering (3.0)
    • 2D and 3D geometric transformations
    • Graphics pipeline:
      • Modeling transformation
      • Viewing transformation
      • Projection
      • Perspective division
      • Viewport transformation
    • Generating geometric shapes procedurally
    • Image space algorithms:
      • Z buffer algorithm
      • Decaling
  • Exams (1.0)

Learning Outcomes:

  1. Utilize vector arithmetic to solve geometry problems related to computer graphics
    • Express a vector as the sum of a set of linearly independent basis vectors
    • Use vector subtraction to find a vector that points from one point to another or find the distance between two points
    • Manipulate vectors to produce vectors that are normalized to unit length, have a specified length, or point in a direction that is opposite the original vector
    • Use the dot product to compare the directions of vectors or find the component of one vector that is parallel or perpendicular to another
    • Use the cross product to find a vector that is normal to the "front" side of a surface, calculate the area of a parallelogram or triangle, and generate an orthonormal basis
  2. Describe and implement basic image order algorithms such as ray tracing
    • Generate a parametric representation a line or ray given two points
    • Generate viewing rays associated with pixel positions for both perspective and orthographic projections
    • Represent surfaces implicitly using quadratic equations
    • Solve for intersections between rays and surfaces using the quadratic formula
    • Calculate reflection vectors and use them to model inter-object reflections
    • Generate shadow feelers and use them to simulate shadows associated with both positional and directional light sources
  3. Explain and implement shading models such as Lambertian, Gouraud, and Blinn-Phong
    • Correctly calculate the ambient, diffuse, and specular reflection given the properties of a light source and the properties of a surface
    • Simulate light attenuation based on constant, linear, and quadratic attenuation factors and the distance to a light source
    • Correctly combine the diffuse and specular reflections for multiple light sources, to calculate the local illumination
    • Specify and utilize material properties and textures to increase surface detail
    • Use the dot product to determine whether or not a fragment is within the "beam" of a spotlight
    • Describe advantages, disadvantages, and differences between Gouraud and Blinn-Phong Shading
  4. Specify and utilize linear transformations to express relationships between coordinate frames, transform vertex positions and normals, and map coordinates and rotations from one coordinate frame to another
    • Represent positions and directions using homogenous coordinates
    • Create a homogenous transformation matrix that will produce a specified translation, rotation, or scale
    • Use a homogenous transformation matrix to generate transformed vertex coordinates
    • Correctly order a set of transformations to create specified composite transformations containing one or more individual translation, rotation, and scale transformations
  5. Describe the purposes of graphics pipeline transformations and operations and correctly specify each to perform object order rendering
    • List and correctly order the transformations that must be carried out to produce object coordinates, world coordinates, eye coordinates, clip coordinates, normalized device coordinates, and window coordinates
    • Correctly specify and order matrices to create a composite modeling or viewing transformations
    • Apply a projection transformation and perspective division to transform a vertex to clip coordinates
    • Describe and implement an algorithm that will clip a triangle against a normalized view volume
    • Determine whether or not the triangle faces the viewpoint given three vertices that describe a triangle and a vector that describes the viewing direction
    • Write a code fragment that correctly implements the depth test and describe how it is used to perform hidden surface elimination
    • Use the areas of triangles to perform Barycentric interpolation of vertex attributes for a point in the interior of the triangle