Week 11 Solution
Question 1
a) (0,1,0) (green). Even though the red polgon is drwn on top, this has no effect because the centre of the pixel is on the bottom edge of the polygon.
b) (0.5,0.5,0) (brown or dark yellow).
c) (0.5,0.25,0) After drawing B, the colour is (0,0.5,0) because B covers 50% of the pixel, we just average (0,1,0) (B’s colour) with (0,0,0) (background). Then when drawing B we average (1,0,0) and (0,0.5,0). The reason why it’s not the same as the answer to b, is that we just work out the fraction of the pixle covered, and the result in b depends on exactly which part of the pixel is covered.
d) (0.33, 0.67, 0) All the sample in the middle row count as being part of polygon B.
e) (0.44,0.56, 0)
f) e (jittered post filtering) gives the closest to correct.
Question 2
For a mipmap, the half size version takes 1/4 the memory, the next 1/16 and so on. So need the sum 1/4 + 1/16 + 1/64 + This is approximately the sum of an infinite geometric progression with a = 1/4 and r = 1/4. Sum = a/(1-r) = 1/4 /(3/4) = 1/3. So a mipmap takes 33% more space.
For a ripmap, first count the space where we keep the width constant. Half the height takes half the memory, so the sum is 1/2 + 1/4 + 1/8 + … = 1, ie 100% more memory. Similarly all the versions that keep the height constant take another 100% extra. In total we get 300% of the original memory. But this doesn’t count versions which shrink both dimensions. We get all these by shrinking all of the images to half size in both directions, adding another 1/4 to to memory requirements, and shrinking the results again to add another 1/16 and so on. We already worked out 1/4 + 1/16 + …, it’s 1/3. So doing all this adds another 300% * 1/3 = 100%. The grand total is that we need 300% more space for a ripmap.
The bad news is that textures can be stretched diagonally as well, and the ripmap doesn’t help here unlesss we add another 300% with one rotated 45 degrees. Graphics cards often use a different technique which uses less space but requires many more samples. Trilinear mipmapping looks up eight texture samples to work out the texture for a pixel — anisotropic filtering can take 8 or 16 times as many to get a nice result.