# CS 447/547: Computer Graphics Homework 4 solved

\$35.00

## Description

5/5 - (1 vote)

Question 1: Consider a one pixel wide line from (1, 1.33) to (6, 1.33), with square endcaps. The
outline of the line is shown on the figure below. Integer locations are at the center of each pixel.
a. Assume we are doing area-weighted sampling, with the alpha of each pixel set in
proportion to the amount of the pixel covered by the line. Give the alpha values of all the
pixels. (Hint: the value for (1,1) is 1/3). ( 8 points)
b. Now assume we are doing super-sampling. Below is the same line, drawn at twice the
resolution using some version of point sampling which fills whole pixels.
Halve the size of this image by averaging 2×2 blocks of pixels. Please fill the numbers in the
grids below. Assume the intensity for black is 0 and white is 1. (Hint: the value for (0, 0) is 1,
and (2, 2) is 0.5 ). (8 points)
Question 2: Below are shown the illumination graphs for the diffuse and specular components
of a flat surface lit by a light as shown with a viewer in the position indicated.
a. Draw two more graphs, one for the diffuse and one for the specular component of the
same flat surface. However, now make the distant light assumption, using a directional
light source coming from vertically above. (6 points)
b. Draw two more graphs, but now make the distant viewer assumption, assuming that the
viewer is looking from a constant direction vertically down to the surface. Use the point
light from the original example, NOT a directional light. (6 points)
c. Draw two more graphs, showing the effect of both a directional light coming from above
and a distant viewer looking from above. (6 points)
Question 3: On the left is a polygon with both its world coordinates and texture coordinates
marked. For example, the world coordinate for the bottom-left is (0, 0, 0) and its texture
coordinate is (0, 0). On the right is a 16×16 texture map that will be used with the polygon.
a. Draw the mipmap level L1, L2 and L3 for the texture. Indicate the intensity of each pixel
in each mipmap, and assume the mipmaps are generated by averaging pixels. Assume the
intensity for black is 0 and the intensity for white is 1. ( 12 points)
b. The polygon is rendered with a perspective view looking toward the negative z axis with
the positive y axis pointing up. The viewing and window parameters are such that, for the
polygon, each unit of distance in world space appears as 3 pixel lengths on the screen.
Which mipmap should be used for texturing the polygon? Show your working, and
assume nearest mipmap nearest as the texture interpolation mode. (8 points)
(Hint: you need to calculate the 𝜆 values for both x and y direction. You can calculate the
𝜆 value for x as follows: 𝜆𝑥 = log2
𝑡𝑒𝑥𝑒𝑙𝑠 𝑖𝑛 𝑥 𝑑𝑖𝑟𝑒𝑐𝑡𝑖𝑜𝑛
𝑝𝑖𝑥𝑒𝑙𝑠 𝑖𝑛 𝑥 𝑑𝑖𝑟𝑒𝑐𝑡𝑖𝑜𝑛 = log2
48
3×3
= 2.4 )