CSCI 360

Fall 2015, Final Exam.


  1. Lighting
      Wikipedia gives the following lighting equation:
       
       And the accompanying diagram 
       
      	 
    1. [6 points] Define all elements of this equation.
    2. [4 points] Give the type/dimensions of all elements of this equation.
    3. [4 points] An element representing attenuation due to distance is missing from this equation, add this element and define the associated parameters.
  2. Raster Algorithms.
      Assume p1 = (x1, y1) and p2 = (x2, y2). Further assume x1 ≤ x2.
      Line1(p1, p2)
      
      1. m = (y2-y1)/(x2-x1)
      2. x = x1
      3. y = y1
      4. while x ≤ x2 do
      5. plot(x,y)
      6. x += 1
      7. y += m
    1. [4 points] Describe at least two different problems with this algorithm. If appropriate, give an example of values for p1 and p2 where these problems will be encountered.

      Over Please

      DDA(p1, p2) 
      
      1. dx = x2-x1
      2. dy = y2-y1
      3. x = x1
      4. y = y1
      5. if |dx| < |dy|
      6. while y ≤ y2
      7. plot(x,y)
      8. x += dx/dy
      9. y = y + 1
      10. else
      11. while x ≤ x2
      12. plot(x,y)
      13. x += 1
      14. y += dy/dx
    2. [3 points] Describe how DDA is an improvement over Line1.
    3. [3 points] What further improvements are accomplished by Bressenham's Line Algorithm?
  3. Shaders
    1. [3 points] What is the relationship between a VBO and a shader attribute?
    2. [3 points] What is the purpose of a uniform variable? What information might be involved with a uniform variable.
    3. [2 points] What data is consumed and produced by a vertex shader? A fragment shader?
    4. [2 points] Give an example of a task that traditionally is accomplished in a vertex shader, in a fragment shader.
    5. [2 points] None of the vertex shaders produced for this class involved a loop. How are all vertices in a scene processed without such a loop?
  4. Textures
    1. [3 points] What is a texture?
    2. [4 points] What is minification? Give a diagram mapping from texture space to screen space demonstrating minification.
    3. [3 points] What are mipmaps and what problem do mipmaps solve?
    4. [4 points] List one advantage and one disadvantage of procedurally generating textures in a fragment shader.